@gincat/eslint-react
Version:
ESLint configuration package for React projects at Gincat Digital, enforcing coding standards and best practices for JavaScript and TypeScript.
79 lines (78 loc) • 3.52 kB
JavaScript
export const reactRules = {
'react/button-has-type': ['error'],
'react/checked-requires-onchange-or-readonly': ['error'],
'react/destructuring-assignment': ['error', 'never'],
'react/display-name': ['off'],
'react/forward-ref-uses-ref': ['error'],
'react/function-component-definition': ['error', {
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
}],
'react/hook-use-state': ['error'],
'react/jsx-boolean-value': ['error', 'never'],
'react/jsx-closing-bracket-location': ['error'],
'react/jsx-closing-tag-location': ['error'],
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
'react/jsx-curly-newline': ['error', {
multiline: 'consistent',
singleline: 'consistent',
}],
'react/jsx-curly-spacing': ['error', { when: 'never' }],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-filename-extension': ['error', { allow: 'as-needed', extensions: ['.jsx', '.tsx'] }],
'react/jsx-first-prop-new-line': ['error', 'multiline'],
'react/jsx-fragments': ['error', 'element'],
'react/jsx-handler-names': ['error'],
'react/jsx-indent-props': ['error', 'tab'],
'react/jsx-indent': ['error', 'tab'],
'react/jsx-key': ['error', {
warnOnDuplicates: true,
}],
'react/jsx-max-props-per-line': ['error', { maximum: 1 }],
'react/jsx-no-comment-textnodes': ['error'],
'react/jsx-no-duplicate-props': ['error'],
'react/jsx-no-leaked-render': ['error'],
'react/jsx-no-script-url': ['error'],
'react/jsx-no-target-blank': ['error'],
'react/jsx-no-undef': ['error'],
'react/jsx-no-useless-fragment': ['error'],
'react/jsx-one-expression-per-line': ['error', { allow: 'non-jsx' }],
'react/jsx-pascal-case': ['error'],
'react/jsx-props-no-multi-spaces': ['error'],
'react/jsx-props-no-spread-multi': ['error'],
'react/jsx-tag-spacing': ['error'],
'react/jsx-uses-react': ['error'],
'react/jsx-wrap-multilines': ['error'],
'react/no-access-state-in-setstate': ['error'],
'react/no-array-index-key': ['error'],
'react/no-arrow-function-lifecycle': ['error'],
'react/no-children-prop': ['error'],
'react/no-danger-with-children': ['error'],
'react/no-deprecated': ['error'],
'react/no-did-mount-set-state': ['error'],
'react/no-did-update-set-state': ['error'],
'react/no-direct-mutation-state': ['error'],
'react/no-find-dom-node': ['error'],
'react/no-invalid-html-attribute': ['error'],
'react/no-is-mounted': ['error'],
'react/no-multi-comp': ['error'],
'react/no-namespace': ['error'],
'react/no-redundant-should-component-update': ['error'],
'react/no-render-return-value': ['error'],
'react/no-string-refs': ['error'],
'react/no-this-in-sfc': ['error'],
'react/no-unescaped-entities': ['error'],
'react/no-unknown-property': ['error'],
'react/no-unsafe': ['error'],
'react/no-unused-class-component-methods': ['error'],
'react/no-unused-prop-types': ['error'],
'react/no-unused-state': ['error'],
'react/no-will-update-set-state': ['error'],
'react/prefer-stateless-function': ['error'],
'react/prop-types': ['error'],
'react/require-default-props': ['error'],
'react/require-render-return': ['error'],
'react/self-closing-comp': ['error'],
'react/sort-comp': ['error'],
'react/void-dom-elements-no-children': ['error'],
};