eslint-config-ct
Version:
ESLint config used in Charlie Tango
59 lines (55 loc) • 1.69 kB
JavaScript
module.exports = {
plugins: ['react', 'react-hooks'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
rules: {
// https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules
'react/jsx-handler-names': ['warn', {
'eventHandlerPrefix': 'handle',
'eventHandlerPropPrefix': 'on'
}],
'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
'react/jsx-no-comment-textnodes': 'warn',
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
'react/jsx-no-target-blank': 'warn',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': [
'warn',
{
allowAllCaps: true,
ignore: [],
},
],
'react/jsx-uses-react': 'warn',
'react/jsx-uses-vars': 'warn',
'react/no-danger-with-children': 'warn',
'react/no-deprecated': 'warn',
'react/no-direct-mutation-state': 'warn',
'react/no-is-mounted': 'warn',
'react/react-in-jsx-scope': 'error',
'react/require-render-return': 'error',
'react/style-prop-object': 'warn',
'react/sort-comp': ['warn', {
order: [
'static-methods',
'instance-variables',
'lifecycle',
'everything-else',
'render',
]
}],
'react/void-dom-elements-no-children': 'off', // Causes issues with funky structure,
'react/no-did-update-set-state': 'warn',
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
'react/jsx-no-bind': ['error', {
ignoreRefs: true,
allowArrowFunctions: true,
allowBind: false,
}],
// Hooks
"react-hooks/rules-of-hooks": "error",
},
}