Skip to content

Commit

Permalink
chore: Alphabetize rules (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Nov 10, 2020
1 parent 0cc600f commit b9f6da0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 26 deletions.
10 changes: 7 additions & 3 deletions jsx-a11y.js
@@ -1,3 +1,5 @@
const {mapDeprecatedRules} = require('./utils')

module.exports = {
env: {
browser: true,
Expand All @@ -9,6 +11,9 @@ module.exports = {
},
plugins: ['jsx-a11y'],
rules: {
...mapDeprecatedRules([
'jsx-a11y/label-has-for', // see label-has-associated-control
]),
'jsx-a11y/accessible-emoji': 'error',
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/anchor-has-content': 'error',
Expand All @@ -20,12 +25,13 @@ module.exports = {
'jsx-a11y/aria-unsupported-elements': 'error',
'jsx-a11y/autocomplete-valid': 'error',
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/control-has-associated-label': 'off',
'jsx-a11y/heading-has-content': 'error',
'jsx-a11y/html-has-lang': 'error',
'jsx-a11y/iframe-has-title': 'error',
'jsx-a11y/img-redundant-alt': 'error',
'jsx-a11y/interactive-supports-focus': 'warn',
'jsx-a11y/label-has-for': 'off', // deprecated -> label-has-associated-control
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/lang': 'error',
'jsx-a11y/media-has-caption': 'warn',
'jsx-a11y/mouse-events-have-key-events': 'error',
Expand All @@ -43,7 +49,5 @@ module.exports = {
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'warn',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/control-has-associated-label': 'off',
},
}
42 changes: 21 additions & 21 deletions react.js
Expand Up @@ -39,31 +39,44 @@ module.exports = {
},
},
rules: {
'react/boolean-prop-naming': 'off',
'react/button-has-type': 'off',
'react/default-props-match-prop-types': 'error',
'react/destructuring-assignment': 'off',
'react/display-name': ['error', {ignoreTranspilerName: false}],
'react/forbid-component-props': 'off',
'react/forbid-dom-props': 'off',
'react/forbid-elements': 'off',
'react/forbid-foreign-prop-types': 'error',
'react/forbid-prop-types': 'off',
'react/function-component-definition': 'off',
'react/jsx-boolean-value': 'off',
'react/jsx-curly-brace-presence': [
'warn',
{props: 'never', children: 'ignore'},
],
'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-fragments': 'off',
'react/jsx-handler-names': 'off',
'react/jsx-key': 'error',
'react/jsx-max-depth': 'off',
'react/jsx-no-bind': 'off',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-no-literals': 'off',
'react/jsx-no-script-url': 'error',
'react/jsx-no-target-blank': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-props-no-spreading': 'off',
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-pascal-case': 'error',
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-default-props': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-array-index-key': 'off', // sometimes you don't care about the issues or they don't apply
'react/no-access-state-in-setstate': 'error',
'react/no-adjacent-inline-elements': 'warn',
'react/no-array-index-key': 'off', // sometimes you don't care about the issues or they don't apply
'react/no-children-prop': 'off',
'react/no-danger': 'off',
'react/no-danger-with-children': 'error',
Expand All @@ -74,16 +87,21 @@ module.exports = {
'react/no-find-dom-node': 'error',
'react/no-is-mounted': 'error',
'react/no-multi-comp': 'off',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-set-state': 'off',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
'react/no-typos': 'error',
'react/no-unescaped-entities': 'warn',
'react/no-unknown-property': 'error',
'react/no-unsafe': 'warn', // if you need it there should be a comment explaining why
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/no-will-update-set-state': 'error',
'react/prefer-es6-class': 'off',
'react/prefer-stateless-function': 'off',
'react/prefer-read-only-props': 'off',
'react/prefer-stateless-function': 'off',
'react/prop-types': 'error',
'react/react-in-jsx-scope': 'error',
'react/require-default-props': 'off', // sometimes the default value is undefined so that's fine...
Expand All @@ -96,24 +114,6 @@ module.exports = {
'react/static-property-placement': 'off',
'react/style-prop-object': 'error',
'react/void-dom-elements-no-children': 'error',
'react/default-props-match-prop-types': 'error',
'react/jsx-curly-brace-presence': [
'warn',
{props: 'never', children: 'ignore'},
],
'react/no-access-state-in-setstate': 'error',
'react/no-redundant-should-component-update': 'error',
'react/no-this-in-sfc': 'error',
'react/no-typos': 'error',
'react/no-unsafe': 'warn', // if you need it there should be a comment explaining why
'react/no-unused-state': 'error',
'react/boolean-prop-naming': 'off',
'react/button-has-type': 'off',
'react/destructuring-assignment': 'off',
'react/forbid-dom-props': 'off',
'react/jsx-max-depth': 'off',
'react/jsx-sort-default-props': 'off',
'react/jsx-no-useless-fragment': 'warn',

'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
Expand Down
3 changes: 1 addition & 2 deletions stylistic.js
Expand Up @@ -66,7 +66,6 @@ module.exports = {
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',

// variables
'init-declarations': 'off',
'@typescript-eslint/init-declarations': 'off',

Expand All @@ -80,6 +79,7 @@ module.exports = {
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-confusing-non-null-assertion': 'off', // prettier reformats their "correct" example anyway 🤷‍♂️
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
Expand All @@ -88,7 +88,6 @@ module.exports = {
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/prefer-for-of': 'off', // I prefer for of, but I don't want to lint for it
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/naming-convention': 'off',
},
},
],
Expand Down

0 comments on commit b9f6da0

Please sign in to comment.