UNPKG

1.85 kBJavaScriptView Raw
1module.exports = {
2 extends: [
3 "@dtrussia/eslint-config-dtrussia"
4 ],
5 plugins: [
6 "react"
7 ],
8 ecmaFeatures: {
9 jsx: true
10 },
11 rules: {
12 "react/jsx-uses-react": 2,
13 "react/jsx-uses-vars": 2,
14 "react/react-in-jsx-scope": 2,
15 "react/prop-types": 0,
16 "react/jsx-quotes": 0,
17 // Enforce component methods order
18 "react/sort-comp": [2, {
19 "order": [
20 "lifecycle",
21 "/^on.+$/",
22 "everything-else",
23 "/^render.+$/",
24 "render"
25 ]
26 }],
27 // Prevent missing displayName in a React component definition
28 "react/display-name": 0,
29 // Enforce boolean attributes notation in JSX
30 "react/jsx-boolean-value": 2,
31 // Enforce or disallow spaces inside of curly braces in JSX attributes
32 "react/jsx-curly-spacing": 0,
33 // Prevent duplicate props in JSX
34 "react/jsx-no-duplicate-props": 0,
35 // Disallow undeclared variables in JSX
36 "react/jsx-no-undef": 2,
37 // Enforce propTypes declarations alphabetical sorting
38 "react/jsx-sort-prop-types": 0,
39 // Enforce props alphabetical sorting
40 "react/jsx-sort-props": 0,
41 // Prevent usage of dangerous JSX properties
42 "react/no-danger": 0,
43 // Prevent usage of setState in componentDidMount
44 "react/no-did-mount-set-state": [2, "allow-in-func"],
45 // Prevent usage of setState in componentDidUpdate
46 "react/no-did-update-set-state": 2,
47 // Prevent multiple component definition per file
48 "react/no-multi-comp": 2,
49 // Prevent usage of unknown DOM property
50 "react/no-unknown-property": 2,
51 // Restrict file extensions that may be required
52 "react/require-extension": 0,
53 // Prevent extra closing tags for components without children
54 "react/self-closing-comp": 2,
55 // Prevent missing parentheses around multilines JSX
56 "react/wrap-multilines": 2
57 }
58}