@st1ggy/linter-config 1.0.67 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/eslint/eslint.config.common.js +6 -6
- package/src/eslint/eslint.config.next.js +3 -16
- package/src/eslint/eslint.config.react.js +3 -3
- package/src/eslint/eslint.config.typescript.js +3 -10
- package/src/eslint/rules/rules.common.js +84 -85
- package/src/eslint/rules/rules.import.js +39 -40
- package/src/eslint/rules/rules.next.js +13 -0
- package/src/eslint/rules/rules.prettier.js +7 -8
- package/src/eslint/rules/rules.react.js +46 -48
- package/src/eslint/rules/rules.sonarjs.js +5 -1
- package/src/eslint/rules/rules.typescript.js +26 -25
- package/src/eslint/rules/rules.unicorn.js +21 -22
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import commonConfig from './rules/rules.common.js'
|
|
2
|
+
import importConfig from './rules/rules.import.js'
|
|
3
|
+
import prettierConfig from './rules/rules.prettier.js'
|
|
4
|
+
import sonarjsConfig from './rules/rules.sonarjs.js'
|
|
5
|
+
import unicornConfig from './rules/rules.unicorn.js'
|
|
6
6
|
|
|
7
|
-
export default [...
|
|
7
|
+
export default [...prettierConfig, ...commonConfig, ...importConfig, ...unicornConfig, ...sonarjsConfig]
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import nextConfig from './eslint.config.next.js'
|
|
2
|
+
import reactConfig from './eslint.config.react.js'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
...react,
|
|
7
|
-
{
|
|
8
|
-
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
9
|
-
plugins: {
|
|
10
|
-
'@next/next': nextPlugin,
|
|
11
|
-
},
|
|
12
|
-
rules: {
|
|
13
|
-
...nextPlugin.configs.recommended.rules,
|
|
14
|
-
...nextPlugin.configs['core-web-vitals'].rules,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
]
|
|
4
|
+
export default [...reactConfig, ...nextConfig]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import typescriptConfig from './eslint.config.typescript.js'
|
|
2
|
+
import reactConfig from './rules/rules.react.js'
|
|
3
3
|
|
|
4
|
-
export default [...
|
|
4
|
+
export default [...typescriptConfig, ...reactConfig]
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import commonConfig from './eslint.config.common.js'
|
|
2
|
+
import typescriptConfig from './rules/rules.typescript.js'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
import typescriptRules from './rules/rules.typescript.js'
|
|
5
|
-
|
|
6
|
-
export default tseslint.config(
|
|
7
|
-
...common,
|
|
8
|
-
...tseslint.configs.recommended,
|
|
9
|
-
...tseslint.configs.stylistic,
|
|
10
|
-
...typescriptRules,
|
|
11
|
-
)
|
|
4
|
+
export default [...commonConfig, ...typescriptConfig]
|
|
@@ -1,88 +1,87 @@
|
|
|
1
1
|
import eslint from '@eslint/js'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
2
3
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
'
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
],
|
|
86
|
-
},
|
|
4
|
+
export default tseslint.config({
|
|
5
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
6
|
+
extends: [eslint.configs.recommended],
|
|
7
|
+
rules: {
|
|
8
|
+
'no-console': 'warn',
|
|
9
|
+
'no-debugger': 'warn',
|
|
10
|
+
'object-curly-newline': 'off',
|
|
11
|
+
'operator-linebreak': 'off',
|
|
12
|
+
'function-paren-newline': 'off',
|
|
13
|
+
'no-confusing-arrow': 'off',
|
|
14
|
+
'newline-per-chained-call': 'off',
|
|
15
|
+
indent: 'off',
|
|
16
|
+
'implicit-arrow-linebreak': 'off',
|
|
17
|
+
'no-undef': 'off',
|
|
18
|
+
'lines-between-class-members': [
|
|
19
|
+
'error',
|
|
20
|
+
'always',
|
|
21
|
+
{
|
|
22
|
+
exceptAfterSingleLine: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
'prefer-template': 'error',
|
|
26
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
27
|
+
'no-return-assign': 'off',
|
|
28
|
+
'newline-before-return': ['error'],
|
|
29
|
+
radix: 'off',
|
|
30
|
+
'no-mixed-operators': 'off',
|
|
31
|
+
'max-len': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
code: 120,
|
|
35
|
+
tabWidth: 2,
|
|
36
|
+
ignoreComments: true,
|
|
37
|
+
ignoreRegExpLiterals: true,
|
|
38
|
+
ignoreStrings: true,
|
|
39
|
+
ignoreTrailingComments: true,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
camelcase: [
|
|
43
|
+
'error',
|
|
44
|
+
{
|
|
45
|
+
allow: ['Open_Sans'],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
'no-shadow': 'off',
|
|
49
|
+
'no-unused-vars': 'off',
|
|
50
|
+
'no-use-before-define': 'off',
|
|
51
|
+
'sort-imports': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
ignoreDeclarationSort: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
quotes: ['error', 'single', { avoidEscape: true }],
|
|
58
|
+
'object-shorthand': 'error',
|
|
59
|
+
'prefer-const': 'error',
|
|
60
|
+
'class-methods-use-this': 'off',
|
|
61
|
+
'spaced-comment': ['error', 'always'],
|
|
62
|
+
'no-restricted-syntax': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
selector: 'WithStatement',
|
|
66
|
+
message: '`with` statement are not allowed.',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
selector: 'ForInStatement',
|
|
70
|
+
message: 'Use for..of instead.',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
selector: 'TSEnumDeclaration',
|
|
74
|
+
message: "Don't declare enums, use type union of literal strings or constants.",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
selector: 'MemberExpression[object.name="React"]',
|
|
78
|
+
message: 'Use named imports from react.',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
selector:
|
|
82
|
+
'CallExpression[callee.property.name="replaceAll"] > Literal[regex.flags=/^[^g]*$/].arguments:first-child',
|
|
83
|
+
message: 'Missing "g" flag in regular expression.',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
87
86
|
},
|
|
88
|
-
|
|
87
|
+
})
|
|
@@ -1,45 +1,44 @@
|
|
|
1
1
|
import importPlugin from 'eslint-plugin-import'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
2
3
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
position: 'after',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
alphabetize: {
|
|
22
|
-
order: 'asc',
|
|
23
|
-
caseInsensitive: false,
|
|
4
|
+
export default tseslint.config({
|
|
5
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
6
|
+
plugins: { import: importPlugin },
|
|
7
|
+
rules: {
|
|
8
|
+
'import/newline-after-import': 'error',
|
|
9
|
+
'import/order': [
|
|
10
|
+
'error',
|
|
11
|
+
{
|
|
12
|
+
'newlines-between': 'always',
|
|
13
|
+
groups: [['builtin', 'external'], ['internal'], ['sibling', 'parent', 'index', 'object'], ['type']],
|
|
14
|
+
pathGroups: [
|
|
15
|
+
{
|
|
16
|
+
pattern: '@/**',
|
|
17
|
+
group: 'external',
|
|
18
|
+
position: 'after',
|
|
24
19
|
},
|
|
20
|
+
],
|
|
21
|
+
alphabetize: {
|
|
22
|
+
order: 'asc',
|
|
23
|
+
caseInsensitive: false,
|
|
25
24
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
'import/no-duplicates': [
|
|
28
|
+
'error',
|
|
29
|
+
{
|
|
30
|
+
considerQueryString: true,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
'import/prefer-default-export': 'off',
|
|
34
|
+
'import/extensions': [
|
|
35
|
+
'error',
|
|
36
|
+
'never',
|
|
37
|
+
{
|
|
38
|
+
js: 'never',
|
|
39
|
+
json: 'ignorePackages',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'import/no-unresolved': ['error', {}],
|
|
44
43
|
},
|
|
45
|
-
|
|
44
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import nextPlugin from '@next/eslint-plugin-next'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
3
|
+
|
|
4
|
+
export default tseslint.config({
|
|
5
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
6
|
+
plugins: {
|
|
7
|
+
'@next/next': nextPlugin,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
...nextPlugin.configs.recommended.rules,
|
|
11
|
+
...nextPlugin.configs['core-web-vitals'].rules,
|
|
12
|
+
},
|
|
13
|
+
})
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import prettierConfig from 'eslint-config-prettier'
|
|
2
2
|
import prettierPlugin from 'eslint-plugin-prettier'
|
|
3
|
+
import tseslint from 'typescript-eslint'
|
|
3
4
|
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
]
|
|
5
|
+
export default tseslint.config({
|
|
6
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
7
|
+
extends: [prettierConfig],
|
|
8
|
+
plugins: { prettier: prettierPlugin },
|
|
9
|
+
rules: { 'prettier/prettier': 'error' },
|
|
10
|
+
})
|
|
@@ -1,53 +1,51 @@
|
|
|
1
1
|
import reactJsxRuntime from 'eslint-plugin-react/configs/jsx-runtime.js'
|
|
2
2
|
import reactRecommended from 'eslint-plugin-react/configs/recommended.js'
|
|
3
3
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
4
|
+
import tseslint from 'typescript-eslint'
|
|
4
5
|
|
|
5
|
-
export default
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
50
|
-
...reactHooksPlugin.configs.recommended.rules,
|
|
51
|
-
},
|
|
6
|
+
export default tseslint.config({
|
|
7
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
8
|
+
plugins: { 'react-hooks': reactHooksPlugin },
|
|
9
|
+
extends: [reactRecommended, reactJsxRuntime],
|
|
10
|
+
rules: {
|
|
11
|
+
'react/boolean-prop-naming': 'error',
|
|
12
|
+
'react/button-has-type': 'error',
|
|
13
|
+
'react/checked-requires-onchange-or-readonly': 'error',
|
|
14
|
+
'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
|
|
15
|
+
'react/destructuring-assignment': 'error',
|
|
16
|
+
'react/function-component-definition': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
namedComponents: 'arrow-function',
|
|
20
|
+
unnamedComponents: 'arrow-function',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
'react/hook-use-state': 'error',
|
|
24
|
+
'react/jsx-boolean-value': 'error',
|
|
25
|
+
'react/jsx-closing-bracket-location': 'error',
|
|
26
|
+
'react/jsx-closing-tag-location': 'error',
|
|
27
|
+
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
|
28
|
+
'react/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
|
|
29
|
+
'react/jsx-curly-spacing': [
|
|
30
|
+
'error',
|
|
31
|
+
{
|
|
32
|
+
when: 'never',
|
|
33
|
+
attributes: { allowMultiline: false },
|
|
34
|
+
children: false,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'react/jsx-equals-spacing': ['error', 'never'],
|
|
38
|
+
'react/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
39
|
+
'react/jsx-fragments': 'error',
|
|
40
|
+
'react/jsx-handler-names': 'error',
|
|
41
|
+
'react/jsx-max-props-per-line': ['error', { when: 'multiline' }],
|
|
42
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
43
|
+
'react/jsx-no-leaked-render': 'error',
|
|
44
|
+
'react/jsx-no-useless-fragment': 'error',
|
|
45
|
+
'react/jsx-props-no-multi-spaces': 'error',
|
|
46
|
+
'react/jsx-tag-spacing': 'error',
|
|
47
|
+
'react/no-multi-comp': 'error',
|
|
48
|
+
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
49
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
52
50
|
},
|
|
53
|
-
|
|
51
|
+
})
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import sonarjs from 'eslint-plugin-sonarjs'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
2
3
|
|
|
3
|
-
export default
|
|
4
|
+
export default tseslint.config({
|
|
5
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
6
|
+
extends: [sonarjs.configs.recommended],
|
|
7
|
+
})
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
settings: {
|
|
10
|
-
'import/resolver': {
|
|
11
|
-
typescript: {},
|
|
12
|
-
},
|
|
1
|
+
import tseslint from 'typescript-eslint'
|
|
2
|
+
|
|
3
|
+
export default tseslint.config({
|
|
4
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
5
|
+
extends: [...tseslint.configs.recommended, ...tseslint.configs.stylistic],
|
|
6
|
+
languageOptions: {
|
|
7
|
+
parserOptions: {
|
|
8
|
+
project: ['tsconfig.json'],
|
|
13
9
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'error',
|
|
19
|
-
{
|
|
20
|
-
'ts-expect-error': 'allow-with-description',
|
|
21
|
-
'ts-ignore': 'allow-with-description',
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
25
|
-
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
|
|
10
|
+
},
|
|
11
|
+
settings: {
|
|
12
|
+
'import/resolver': {
|
|
13
|
+
typescript: {},
|
|
26
14
|
},
|
|
27
15
|
},
|
|
28
|
-
|
|
16
|
+
rules: {
|
|
17
|
+
'@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
|
|
18
|
+
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
19
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
20
|
+
'error',
|
|
21
|
+
{
|
|
22
|
+
'ts-expect-error': 'allow-with-description',
|
|
23
|
+
'ts-ignore': 'allow-with-description',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
27
|
+
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
|
|
28
|
+
},
|
|
29
|
+
})
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
2
|
+
import tseslint from 'typescript-eslint'
|
|
2
3
|
|
|
3
|
-
export default
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
refs: false,
|
|
21
|
-
},
|
|
4
|
+
export default tseslint.config({
|
|
5
|
+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
6
|
+
extends: [unicornPlugin.configs['flat/recommended']],
|
|
7
|
+
rules: {
|
|
8
|
+
'unicorn/consistent-destructuring': 'error',
|
|
9
|
+
'unicorn/custom-error-definition': 'error',
|
|
10
|
+
'unicorn/no-unused-properties': 'error',
|
|
11
|
+
'unicorn/prevent-abbreviations': [
|
|
12
|
+
'error',
|
|
13
|
+
{
|
|
14
|
+
checkShorthandImports: false,
|
|
15
|
+
replacements: {
|
|
16
|
+
dev: false,
|
|
17
|
+
prod: false,
|
|
18
|
+
props: false,
|
|
19
|
+
ref: false,
|
|
20
|
+
refs: false,
|
|
22
21
|
},
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
},
|
|
23
|
+
],
|
|
25
24
|
},
|
|
26
|
-
|
|
25
|
+
})
|