ESLint rules for Primer React
-
Assuming you already have ESLint and Primer React installed, run:
npm install --save-dev eslint-plugin-primer-react # or yarn add --dev eslint-plugin-primer-react -
In your ESLint configuration file, extend the recommended Primer React ESLint config:
{ "extends": [ // ... "plugin:primer-react/recommended" ] }
- a11y-explicit-heading
- a11y-link-in-text-block
- a11y-no-duplicate-form-labels
- a11y-no-title-usage
- a11y-remove-disable-tooltip
- a11y-tooltip-interactive-trigger
- a11y-use-accessible-tooltip
- direct-slot-children
- enforce-button-for-link-with-no-href
- enforce-css-module-default-import
- enforce-css-module-identifier-casing
- new-color-css-vars
- no-deprecated-entrypoints
- no-deprecated-experimental-components
- no-deprecated-props
- no-system-props
- no-unnecessary-components
- no-use-responsive-value
- no-wildcard-imports
- prefer-action-list-item-onselect
- spread-props-first
- use-deprecated-from-deprecated
- use-styled-react-import