|
1 | | -module.exports = { |
2 | | - extends: ['eslint:recommended'], |
3 | | - plugins: ['import'], |
4 | | - parserOptions: { |
5 | | - ecmaVersion: 2018, |
6 | | - sourceType: 'module', |
7 | | - }, |
8 | | - env: { |
9 | | - browser: true, |
10 | | - es6: true, |
11 | | - commonjs: true, |
12 | | - }, |
13 | | - globals: { |
14 | | - process: 'readonly', |
15 | | - }, |
16 | | - rules: { |
17 | | - 'array-callback-return': 'warn', |
18 | | - 'arrow-body-style': ['error', 'as-needed'], |
19 | | - 'block-scoped-var': 'warn', |
20 | | - curly: ['warn', 'multi-line'], |
21 | | - 'default-param-last': 'error', |
22 | | - 'dot-notation': 'error', |
23 | | - eqeqeq: 'error', |
24 | | - 'import/no-duplicates': 'error', |
25 | | - 'import/no-useless-path-segments': 'error', |
26 | | - 'import/order': [ |
27 | | - 'error', |
28 | | - { |
29 | | - groups: ['builtin', 'external', 'parent', 'sibling', 'index', 'object', 'type'], |
30 | | - pathGroups: [ |
31 | | - { |
32 | | - pattern: '@/**', |
33 | | - group: 'parent', |
34 | | - position: 'before', |
| 1 | +import js from '@eslint/js' |
| 2 | +import * as importPlugin from 'eslint-plugin-import' |
| 3 | + |
| 4 | +/** |
| 5 | + * @type {import('eslint').Linter.Config} |
| 6 | + */ |
| 7 | +export default [ |
| 8 | + { |
| 9 | + name: 'eslint-config-smarthr/eslint', |
| 10 | + plugins: { |
| 11 | + 'import': importPlugin, |
| 12 | + }, |
| 13 | + languageOptions: { |
| 14 | + parserOptions: { |
| 15 | + ecmaVersion: 2018, |
| 16 | + sourceType: 'module', |
| 17 | + } |
| 18 | + }, |
| 19 | + rules: { |
| 20 | + ...js.configs.recommended.rules, |
| 21 | + 'array-callback-return': 'warn', |
| 22 | + 'arrow-body-style': ['error', 'as-needed'], |
| 23 | + 'block-scoped-var': 'warn', |
| 24 | + curly: ['warn', 'multi-line'], |
| 25 | + 'default-param-last': 'error', |
| 26 | + 'dot-notation': 'error', |
| 27 | + eqeqeq: 'error', |
| 28 | + 'import/no-duplicates': 'error', |
| 29 | + 'import/no-useless-path-segments': 'error', |
| 30 | + 'import/order': [ |
| 31 | + 'error', |
| 32 | + { |
| 33 | + groups: ['builtin', 'external', 'parent', 'sibling', 'index', 'object', 'type'], |
| 34 | + pathGroups: [ |
| 35 | + { |
| 36 | + pattern: '@/**', |
| 37 | + group: 'parent', |
| 38 | + position: 'before', |
| 39 | + }, |
| 40 | + ], |
| 41 | + alphabetize: { |
| 42 | + order: 'asc', |
35 | 43 | }, |
36 | | - ], |
37 | | - alphabetize: { |
38 | | - order: 'asc', |
| 44 | + 'newlines-between': 'always', |
| 45 | + }, |
| 46 | + ], |
| 47 | + 'no-async-promise-executor': 'error', |
| 48 | + 'no-caller': 'error', |
| 49 | + 'no-catch-shadow': 'error', |
| 50 | + 'no-confusing-arrow': [ |
| 51 | + 'error', |
| 52 | + { |
| 53 | + allowParens: true, |
| 54 | + }, |
| 55 | + ], |
| 56 | + 'no-div-regex': 'warn', |
| 57 | + 'no-eval': 'error', |
| 58 | + 'no-extend-native': 'error', |
| 59 | + 'no-extra-parens': ['error', 'functions'], |
| 60 | + 'no-floating-decimal': 'error', |
| 61 | + 'no-implicit-globals': 'error', |
| 62 | + 'no-implied-eval': 'error', |
| 63 | + 'no-import-assign': 'error', |
| 64 | + 'no-inner-declarations': 'warn', |
| 65 | + 'no-iterator': 'error', |
| 66 | + 'no-label-var': 'error', |
| 67 | + 'no-lone-blocks': 'error', |
| 68 | + 'no-loop-func': 'warn', |
| 69 | + 'no-new-func': 'error', |
| 70 | + 'no-new-wrappers': 'error', |
| 71 | + 'no-octal-escape': 'error', |
| 72 | + 'no-proto': 'error', |
| 73 | + 'no-return-assign': 'error', |
| 74 | + 'no-return-await': 'error', |
| 75 | + 'no-script-url': 'warn', |
| 76 | + 'no-self-compare': 'error', |
| 77 | + 'no-sequences': 'error', |
| 78 | + 'no-shadow': 'error', |
| 79 | + 'no-shadow-restricted-names': 'error', |
| 80 | + 'no-throw-literal': 'error', |
| 81 | + 'no-unmodified-loop-condition': 'warn', |
| 82 | + 'no-unused-expressions': [ |
| 83 | + 'error', |
| 84 | + { |
| 85 | + allowShortCircuit: true, |
| 86 | + allowTernary: true, |
| 87 | + }, |
| 88 | + ], |
| 89 | + 'no-unused-vars': [ |
| 90 | + 'error', |
| 91 | + { |
| 92 | + vars: 'local', |
| 93 | + args: 'none', |
| 94 | + }, |
| 95 | + ], |
| 96 | + 'no-useless-call': 'warn', |
| 97 | + 'no-useless-computed-key': 'error', |
| 98 | + 'no-useless-concat': 'error', |
| 99 | + 'no-useless-rename': 'error', |
| 100 | + 'no-var': 'error', |
| 101 | + 'no-void': 'error', |
| 102 | + 'no-with': 'error', |
| 103 | + 'object-shorthand': ['error', 'properties'], |
| 104 | + 'prefer-arrow-callback': 'warn', |
| 105 | + 'prefer-const': [ |
| 106 | + 'warn', |
| 107 | + { |
| 108 | + destructuring: 'all', |
| 109 | + ignoreReadBeforeAssign: true, |
| 110 | + }, |
| 111 | + ], |
| 112 | + 'prefer-numeric-literals': 'error', |
| 113 | + 'prefer-regex-literals': 'error', |
| 114 | + 'prefer-rest-params': 'error', |
| 115 | + 'prefer-spread': 'warn', |
| 116 | + radix: 'error', |
| 117 | + 'sort-imports': [ |
| 118 | + 'error', |
| 119 | + { |
| 120 | + ignoreDeclarationSort: true, |
| 121 | + }, |
| 122 | + ], |
| 123 | + 'symbol-description': 'error', |
| 124 | + 'template-curly-spacing': 'error', |
| 125 | + 'valid-typeof': [ |
| 126 | + 'error', |
| 127 | + { |
| 128 | + requireStringLiterals: true, |
39 | 129 | }, |
40 | | - 'newlines-between': 'always', |
41 | | - }, |
42 | | - ], |
43 | | - 'no-async-promise-executor': 'error', |
44 | | - 'no-caller': 'error', |
45 | | - 'no-catch-shadow': 'error', |
46 | | - 'no-confusing-arrow': [ |
47 | | - 'error', |
48 | | - { |
49 | | - allowParens: true, |
50 | | - }, |
51 | | - ], |
52 | | - 'no-div-regex': 'warn', |
53 | | - 'no-eval': 'error', |
54 | | - 'no-extend-native': 'error', |
55 | | - 'no-extra-parens': ['error', 'functions'], |
56 | | - 'no-floating-decimal': 'error', |
57 | | - 'no-implicit-globals': 'error', |
58 | | - 'no-implied-eval': 'error', |
59 | | - 'no-import-assign': 'error', |
60 | | - 'no-inner-declarations': 'warn', |
61 | | - 'no-iterator': 'error', |
62 | | - 'no-label-var': 'error', |
63 | | - 'no-lone-blocks': 'error', |
64 | | - 'no-loop-func': 'warn', |
65 | | - 'no-new-func': 'error', |
66 | | - 'no-new-wrappers': 'error', |
67 | | - 'no-octal-escape': 'error', |
68 | | - 'no-proto': 'error', |
69 | | - 'no-return-assign': 'error', |
70 | | - 'no-return-await': 'error', |
71 | | - 'no-script-url': 'warn', |
72 | | - 'no-self-compare': 'error', |
73 | | - 'no-sequences': 'error', |
74 | | - 'no-shadow': 'error', |
75 | | - 'no-shadow-restricted-names': 'error', |
76 | | - 'no-throw-literal': 'error', |
77 | | - 'no-unmodified-loop-condition': 'warn', |
78 | | - 'no-unused-expressions': [ |
79 | | - 'error', |
80 | | - { |
81 | | - allowShortCircuit: true, |
82 | | - allowTernary: true, |
83 | | - }, |
84 | | - ], |
85 | | - 'no-unused-vars': [ |
86 | | - 'error', |
87 | | - { |
88 | | - vars: 'local', |
89 | | - args: 'none', |
90 | | - }, |
91 | | - ], |
92 | | - 'no-useless-call': 'warn', |
93 | | - 'no-useless-computed-key': 'error', |
94 | | - 'no-useless-concat': 'error', |
95 | | - 'no-useless-rename': 'error', |
96 | | - 'no-var': 'error', |
97 | | - 'no-void': 'error', |
98 | | - 'no-with': 'error', |
99 | | - 'object-shorthand': ['error', 'properties'], |
100 | | - 'prefer-arrow-callback': 'warn', |
101 | | - 'prefer-const': [ |
102 | | - 'warn', |
103 | | - { |
104 | | - destructuring: 'all', |
105 | | - ignoreReadBeforeAssign: true, |
106 | | - }, |
107 | | - ], |
108 | | - 'prefer-numeric-literals': 'error', |
109 | | - 'prefer-regex-literals': 'error', |
110 | | - 'prefer-rest-params': 'error', |
111 | | - 'prefer-spread': 'warn', |
112 | | - radix: 'error', |
113 | | - 'sort-imports': [ |
114 | | - 'error', |
115 | | - { |
116 | | - ignoreDeclarationSort: true, |
117 | | - }, |
118 | | - ], |
119 | | - 'symbol-description': 'error', |
120 | | - 'template-curly-spacing': 'error', |
121 | | - 'valid-typeof': [ |
122 | | - 'error', |
123 | | - { |
124 | | - requireStringLiterals: true, |
125 | | - }, |
126 | | - ], |
127 | | - 'vars-on-top': 'warn', |
128 | | - 'wrap-iife': ['error', 'any'], |
129 | | - 'yield-star-spacing': ['error', 'after'], |
130 | | - }, |
131 | | - overrides: [ |
132 | | - { |
133 | | - files: ['*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'], |
134 | | - env: { |
135 | | - jest: true, |
136 | | - }, |
| 130 | + ], |
| 131 | + 'vars-on-top': 'warn', |
| 132 | + 'wrap-iife': ['error', 'any'], |
| 133 | + 'yield-star-spacing': ['error', 'after'], |
137 | 134 | }, |
138 | | - ], |
139 | | -} |
| 135 | + } |
| 136 | +] |
0 commit comments