Skip to content

Commit

Permalink
fix(eslint-config): new versions of react plugin need whitelisting of…
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonC committed Oct 3, 2022
1 parent 14ee555 commit 07e8ce9
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions packages/eslint-config/rules/react.js
@@ -1,47 +1,49 @@
module.exports = {
'react/jsx-wrap-multilines': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
"react/jsx-wrap-multilines": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
// handled by @emotion/babel-preset-css-prop
'react/react-in-jsx-scope': 'off',
"react/react-in-jsx-scope": "off",
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
'react/jsx-filename-extension': 'off',
"react/jsx-filename-extension": "off",
// irritating, TS handles this better
'react/static-property-placement': 'off',
'react/prop-types': 'off',
"react/static-property-placement": "off",
"react/prop-types": "off",
// see https://github.com/jsx-eslint/eslint-plugin-react/issues/3384#issuecomment-1236371796
"react/no-unknown-property": ["error", { ignore: ["css"] }],

// These cause typing conflicts
'react/require-default-props': ['off'],
'react/default-props-match-prop-types': [
'error',
{ allowRequiredDefaults: true }
"react/require-default-props": ["off"],
"react/default-props-match-prop-types": [
"error",
{ allowRequiredDefaults: true },
],

'react/sort-comp': [
'error',
"react/sort-comp": [
"error",
{
order: [
'static-methods',
'instance-variables',
'lifecycle',
'/^on.+$/',
'/^handle.+$/',
'getters',
'setters',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else',
'/^render.+$/',
'render'
]
}
"static-methods",
"instance-variables",
"lifecycle",
"/^on.+$/",
"/^handle.+$/",
"getters",
"setters",
"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
"everything-else",
"/^render.+$/",
"render",
],
},
],
'react/destructuring-assignment': [
'error',
'always',
{ ignoreClassFields: true }
"react/destructuring-assignment": [
"error",
"always",
{ ignoreClassFields: true },
],
'react/no-find-dom-node': 'error',
'react/jsx-fragments': 'error',
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
'@tablecheck/consistent-react-import': 'error'
"react/no-find-dom-node": "error",
"react/jsx-fragments": "error",
"react/jsx-no-useless-fragment": ["error", { allowExpressions: true }],
"@tablecheck/consistent-react-import": "error",
};

0 comments on commit 07e8ce9

Please sign in to comment.