|
1 | 1 | /* eslint-disable */ |
2 | 2 | module.exports = { |
3 | | - env: { |
4 | | - browser: true, |
5 | | - es6: true, |
6 | | - es2021: true, |
7 | | - node: true, |
8 | | - cypress: true, |
9 | | - }, |
10 | | - extends: [ |
11 | | - "eslint:recommended", |
12 | | - "plugin:react/recommended", |
13 | | - "plugin:@typescript-eslint/recommended", |
14 | | - "plugin:import/recommended", |
15 | | - "plugin:import/errors", |
16 | | - "plugin:import/warnings", |
17 | | - "plugin:import/typescript", |
18 | | - ], |
19 | | - parser: "@typescript-eslint/parser", |
20 | | - parserOptions: { |
21 | | - ecmaFeatures: { |
22 | | - jsx: true, |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + es6: true, |
| 6 | + es2021: true, |
| 7 | + node: true, |
23 | 8 | }, |
24 | | - ecmaVersion: "latest", |
25 | | - sourceType: "module", |
26 | | - }, |
27 | | - plugins: ["react", "@typescript-eslint"], |
28 | | - rules: { |
29 | | - "react/react-in-jsx-scope": "off", |
30 | | - camelcase: 0, |
31 | | - // semi : ["error", "always"], |
32 | | - "array-callback-return": 0, |
33 | | - "arrow-body-style": 0, |
34 | | - "brace-style": ["error", "1tbs", { allowSingleLine: true }], |
35 | | - curly: 0, |
36 | | - // "comma-dangle" : ["error", "always-multiline"], |
37 | | - "eol-last": ["error", "always"], |
38 | | - "func-names": ["error", "never"], |
39 | | - "key-spacing": 0, |
40 | | - "max-classes-per-file": ["warn", 2], |
41 | | - // "keyword-spacing" : ["error", { after: true }], |
42 | | - "lines-between-class-members": 0, |
43 | | - indent: 0, |
44 | | - // "max-len": ["error", { code: 120, "ignoreComments": true }], |
45 | | - "no-extra-semi": "error", |
46 | | - "no-console": "error", |
47 | | - "no-else-return": ["error", { allowElseIf: true }], |
48 | | - "no-multi-assign": 0, |
49 | | - "no-multi-spaces": [ |
50 | | - 2, |
51 | | - { |
52 | | - exceptions: { |
53 | | - BinaryExpression: true, |
54 | | - VariableDeclarator: true, |
55 | | - ImportDeclaration: true, |
56 | | - }, |
57 | | - }, |
58 | | - ], |
59 | | - "no-param-reassign": ["error", { props: false }], |
60 | | - "no-restricted-globals": 0, |
61 | | - "no-script-url": 0, |
62 | | - // "no-trailing-spaces" : ["error", { skipBlankLines: true }], |
63 | | - "object-curly-spacing": [ |
64 | | - "error", |
65 | | - "always", |
66 | | - { arraysInObjects: true, objectsInObjects: true }, |
| 9 | + extends: [ |
| 10 | + 'eslint:recommended', |
| 11 | + 'plugin:react/recommended', |
| 12 | + 'plugin:@typescript-eslint/recommended', |
| 13 | + 'plugin:import/recommended', |
| 14 | + 'plugin:import/errors', |
| 15 | + 'plugin:import/warnings', |
| 16 | + 'plugin:import/typescript', |
67 | 17 | ], |
68 | | - "one-var": ["error", { initialized: "never", uninitialized: "always" }], |
69 | | - "prefer-destructuring": 0, |
70 | | - quotes: 0, |
71 | | - // "space-in-parens" : ["error", "never"], |
72 | | - "space-infix-ops": "error", |
73 | | - // "space-unary-ops" : "error", |
74 | | - "no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }], |
| 18 | + parser: '@typescript-eslint/parser', |
| 19 | + parserOptions: { |
| 20 | + ecmaFeatures: { |
| 21 | + jsx: true, |
| 22 | + }, |
| 23 | + ecmaVersion: 'latest', |
| 24 | + sourceType: 'module', |
| 25 | + }, |
| 26 | + plugins: ['react', '@typescript-eslint'], |
| 27 | + rules: { |
| 28 | + 'react/react-in-jsx-scope': 'off', |
| 29 | + camelcase: 0, |
| 30 | + // semi : ["error", "always"], |
| 31 | + 'array-callback-return': 0, |
| 32 | + 'arrow-body-style': 0, |
| 33 | + 'brace-style': ['error', '1tbs', { allowSingleLine: true }], |
| 34 | + curly: 0, |
| 35 | + // "comma-dangle" : ["error", "always-multiline"], |
| 36 | + 'eol-last': ['error', 'always'], |
| 37 | + 'func-names': ['error', 'never'], |
| 38 | + 'key-spacing': 0, |
| 39 | + 'max-classes-per-file': ['warn', 2], |
| 40 | + // "keyword-spacing" : ["error", { after: true }], |
| 41 | + 'lines-between-class-members': 0, |
| 42 | + indent: 0, |
| 43 | + // "max-len": ["error", { code: 120, "ignoreComments": true }], |
| 44 | + 'no-extra-semi': 'error', |
| 45 | + 'no-console': 'error', |
| 46 | + 'no-else-return': ['error', { allowElseIf: true }], |
| 47 | + 'no-multi-assign': 0, |
| 48 | + 'no-multi-spaces': [ |
| 49 | + 2, |
| 50 | + { |
| 51 | + exceptions: { |
| 52 | + BinaryExpression: true, |
| 53 | + VariableDeclarator: true, |
| 54 | + ImportDeclaration: true, |
| 55 | + }, |
| 56 | + }, |
| 57 | + ], |
| 58 | + 'no-param-reassign': ['error', { props: false }], |
| 59 | + 'no-restricted-globals': 0, |
| 60 | + 'no-script-url': 0, |
| 61 | + // "no-trailing-spaces" : ["error", { skipBlankLines: true }], |
| 62 | + 'object-curly-spacing': ['error', 'always', { arraysInObjects: true, objectsInObjects: true }], |
| 63 | + 'one-var': ['error', { initialized: 'never', uninitialized: 'always' }], |
| 64 | + 'prefer-destructuring': 0, |
| 65 | + quotes: 0, |
| 66 | + // "space-in-parens" : ["error", "never"], |
| 67 | + 'space-infix-ops': 'error', |
| 68 | + // "space-unary-ops" : "error", |
| 69 | + 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }], |
75 | 70 |
|
76 | | - // import rules |
77 | | - "import/no-extraneous-dependencies": [ |
78 | | - "error", |
79 | | - { |
80 | | - devDependencies: [ |
81 | | - "**/__tests__/**/*.js", |
82 | | - "**/test*.js", |
83 | | - "**/*.test.js*", |
84 | | - "**/*.spec.js", |
85 | | - "**/*.spec.jsx", |
| 71 | + // import rules |
| 72 | + 'import/no-extraneous-dependencies': [ |
| 73 | + 'error', |
| 74 | + { |
| 75 | + devDependencies: [ |
| 76 | + '**/__tests__/**/*.js', |
| 77 | + '**/test*.js', |
| 78 | + '**/*.test.js*', |
| 79 | + '**/*.spec.js', |
| 80 | + '**/*.spec.jsx', |
| 81 | + ], |
| 82 | + }, |
86 | 83 | ], |
87 | | - }, |
88 | | - ], |
89 | 84 |
|
90 | | - "import/no-useless-path-segments": "error", |
91 | | - "import/order": [ |
92 | | - 0, // TODO: we should turn this to error after we sorted our import orders. |
93 | | - { |
94 | | - groups: [["builtin", "external"], "internal", "sibling", "parent"], |
95 | | - "newlines-between": "ignore", |
96 | | - }, |
97 | | - ], |
98 | | - "import/prefer-default-export": 0, |
99 | | - "import/extensions": ["warn", "never", { jsx: "never", json: "always" }], |
100 | | - "no-sequences": ["warn"], |
| 85 | + 'import/no-useless-path-segments': 'error', |
| 86 | + 'import/order': [ |
| 87 | + 0, // TODO: we should turn this to error after we sorted our import orders. |
| 88 | + { |
| 89 | + groups: [['builtin', 'external'], 'internal', 'sibling', 'parent'], |
| 90 | + 'newlines-between': 'ignore', |
| 91 | + }, |
| 92 | + ], |
| 93 | + 'import/prefer-default-export': 0, |
| 94 | + 'import/extensions': ['warn', 'never', { jsx: 'never', json: 'always' }], |
| 95 | + 'no-sequences': ['warn'], |
101 | 96 |
|
102 | | - // react rules |
103 | | - // "jsx-quotes" : ["error", "prefer-single"], |
104 | | - // "react/jsx-closing-bracket-location": ["error", { selfClosing: "line-aligned", nonEmpty: "line-aligned" }], |
105 | | - // "react/jsx-closing-tag-location" : "error", |
106 | | - // "react/jsx-first-prop-new-line" : ["error", "multiline-multiprop"], |
107 | | - // "react/jsx-indent" : ["error", 4], |
108 | | - // "react/jsx-indent-props" : ["error", 4], |
109 | | - // "react/jsx-max-props-per-line" : ["error", { when: "multiline" }], |
110 | | - // "react/jsx-tag-spacing" : ["error", { closingSlash: "never", beforeSelfClosing: "always" }], |
111 | | - "react/prop-types": 0, |
112 | | - "react/self-closing-comp": "error", |
113 | | - "react/no-unescaped-entities": 0, |
114 | | - // "react/sort-prop-types" : ["error", { ignoreCase: true, sortShapeProp: true }], |
115 | | - }, |
| 97 | + // react rules |
| 98 | + // "jsx-quotes" : ["error", "prefer-single"], |
| 99 | + // "react/jsx-closing-bracket-location": ["error", { selfClosing: "line-aligned", nonEmpty: "line-aligned" }], |
| 100 | + // "react/jsx-closing-tag-location" : "error", |
| 101 | + // "react/jsx-first-prop-new-line" : ["error", "multiline-multiprop"], |
| 102 | + // "react/jsx-indent" : ["error", 4], |
| 103 | + // "react/jsx-indent-props" : ["error", 4], |
| 104 | + // "react/jsx-max-props-per-line" : ["error", { when: "multiline" }], |
| 105 | + // "react/jsx-tag-spacing" : ["error", { closingSlash: "never", beforeSelfClosing: "always" }], |
| 106 | + 'react/prop-types': 0, |
| 107 | + 'react/self-closing-comp': 'error', |
| 108 | + 'react/no-unescaped-entities': 0, |
| 109 | + // "react/sort-prop-types" : ["error", { ignoreCase: true, sortShapeProp: true }], |
| 110 | + }, |
116 | 111 | }; |
0 commit comments