@st1ggy/linter-config 1.0.80 → 2.1.0
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 +31 -23
- package/src/eslint/configs/config.common.js +105 -84
- package/src/eslint/configs/config.import.js +49 -38
- package/src/eslint/configs/config.next.js +14 -10
- package/src/eslint/configs/config.prettier.js +11 -7
- package/src/eslint/configs/config.react.js +56 -48
- package/src/eslint/configs/config.sonarjs.js +13 -6
- package/src/eslint/configs/config.typescript.js +25 -25
- package/src/eslint/configs/config.unicorn.js +25 -21
- package/src/eslint/configs/constants.js +1 -0
- package/src/eslint/eslint.config.common.js +9 -1
- package/src/eslint/eslint.config.react.js +2 -2
- package/src/examples/example.ts +1 -0
- package/src/index.js +0 -1
- package/bun.lockb +0 -0
- package/eslint.config.js +0 -11
- package/prettier.config.js +0 -5
- package/src/eslint/configs/config.angular.js +0 -18
- package/src/eslint/eslint.config.angular.js +0 -4
- package/src/eslint/eslint.config.typescript.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@st1ggy/linter-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "ESLint, Stylelint and Prettier configs for React, Vue [WIP] and Svelte [WIP]",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -19,32 +19,33 @@
|
|
|
19
19
|
"url": "https://github.com/St1ggy/linter-config/issues"
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/St1ggy/linter-config#readme",
|
|
22
|
-
"
|
|
23
|
-
"@eslint/js": "^
|
|
24
|
-
"
|
|
25
|
-
"eslint": "^
|
|
26
|
-
"eslint-
|
|
27
|
-
"eslint-
|
|
28
|
-
"eslint
|
|
29
|
-
"eslint-
|
|
30
|
-
"eslint-
|
|
31
|
-
"eslint-
|
|
32
|
-
"eslint-plugin-
|
|
33
|
-
"eslint-plugin-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"stylelint
|
|
40
|
-
"stylelint-config-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@eslint/js": "^9.22.0",
|
|
24
|
+
"@stylistic/eslint-plugin-js": "^4.2.0",
|
|
25
|
+
"@stylistic/eslint-plugin-jsx": "^4.2.0",
|
|
26
|
+
"@stylistic/eslint-plugin-migrate": "^4.2.0",
|
|
27
|
+
"@stylistic/eslint-plugin-ts": "^4.2.0",
|
|
28
|
+
"eslint": "^9.22.0",
|
|
29
|
+
"eslint-config-next": "^15.2.2",
|
|
30
|
+
"eslint-config-prettier": "^10.1.1",
|
|
31
|
+
"eslint-import-resolver-typescript": "^3.8.5",
|
|
32
|
+
"eslint-plugin-import": "^2.31.0",
|
|
33
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
34
|
+
"eslint-plugin-react": "^7.37.4",
|
|
35
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
36
|
+
"eslint-plugin-sonarjs": "^3.0.2",
|
|
37
|
+
"eslint-plugin-unicorn": "^57.0.0",
|
|
38
|
+
"prettier": "^3.5.3",
|
|
39
|
+
"stylelint": "^16.15.0",
|
|
40
|
+
"stylelint-config-recommended": "^15.0.0",
|
|
41
|
+
"stylelint-config-sass-guidelines": "^12.1.0",
|
|
42
|
+
"stylelint-config-tailwindcss": "^1.0.0",
|
|
43
|
+
"typescript": "^5.8.2",
|
|
44
|
+
"typescript-eslint": "^8.26.1"
|
|
43
45
|
},
|
|
44
46
|
"type": "module",
|
|
45
47
|
"exports": {
|
|
46
48
|
".": "./src/index.js",
|
|
47
|
-
"./eslint-angular": "./src/eslint/eslint.config.angular.js",
|
|
48
49
|
"./eslint-next": "./src/eslint/eslint.config.next.js",
|
|
49
50
|
"./eslint-react": "./src/eslint/eslint.config.react.js",
|
|
50
51
|
"./eslint-typescript": "./src/eslint/eslint.config.typescript.js",
|
|
@@ -52,5 +53,12 @@
|
|
|
52
53
|
"./prettier-common": "./src/prettier/prettier.config.common.js",
|
|
53
54
|
"./stylelint-common": "./src/stylelint/stylelint.config.common.js",
|
|
54
55
|
"./stylelint-scss": "./src/stylelint/stylelint.config.scss.js"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"src"
|
|
59
|
+
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"lint:fix": "eslint . --fix"
|
|
55
63
|
}
|
|
56
64
|
}
|
|
@@ -1,87 +1,108 @@
|
|
|
1
1
|
import eslint from '@eslint/js'
|
|
2
|
-
import
|
|
2
|
+
import stylisticJs from '@stylistic/eslint-plugin-js'
|
|
3
|
+
import { config } from 'typescript-eslint'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'error',
|
|
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
|
-
'error',
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
5
|
+
import { files } from './constants.js'
|
|
6
|
+
|
|
7
|
+
export default config([
|
|
8
|
+
eslint.configs.recommended,
|
|
9
|
+
stylisticJs.configs.all,
|
|
10
|
+
{
|
|
11
|
+
files,
|
|
12
|
+
plugins: { '@stylistic/js': stylisticJs },
|
|
13
|
+
rules: {
|
|
14
|
+
'no-console': 'warn',
|
|
15
|
+
'no-debugger': 'warn',
|
|
16
|
+
'no-undef': 'off',
|
|
17
|
+
'prefer-template': 'error',
|
|
18
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
19
|
+
'no-return-assign': 'off',
|
|
20
|
+
'newline-before-return': ['error'],
|
|
21
|
+
radix: 'off',
|
|
22
|
+
camelcase: [
|
|
23
|
+
'error',
|
|
24
|
+
{
|
|
25
|
+
allow: [],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
'no-shadow': 'off',
|
|
29
|
+
'no-unused-vars': 'off',
|
|
30
|
+
'no-use-before-define': 'off',
|
|
31
|
+
'sort-imports': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
ignoreDeclarationSort: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'object-shorthand': 'error',
|
|
38
|
+
'prefer-const': 'error',
|
|
39
|
+
'class-methods-use-this': 'off',
|
|
40
|
+
'no-restricted-syntax': [
|
|
41
|
+
'error',
|
|
42
|
+
{
|
|
43
|
+
selector: 'WithStatement',
|
|
44
|
+
message: '`with` statement are not allowed.',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
selector: 'ForInStatement',
|
|
48
|
+
message: 'Use for..of instead.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
selector: 'TSEnumDeclaration',
|
|
52
|
+
message: "Don't declare enums, use type union of literal strings or constants.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
selector: 'MemberExpression[object.name="React"]',
|
|
56
|
+
message: 'Use named imports from react.',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
selector:
|
|
60
|
+
'CallExpression[callee.property.name="replaceAll"] > Literal[regex.flags=/^[^g]*$/].arguments:first-child',
|
|
61
|
+
message: 'Missing "g" flag in regular expression.',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
curly: ['error', 'all'],
|
|
65
|
+
// @stylistic
|
|
66
|
+
'@stylistic/js/object-curly-newline': 'off',
|
|
67
|
+
'@stylistic/js/operator-linebreak': 'off',
|
|
68
|
+
'@stylistic/js/function-paren-newline': 'off',
|
|
69
|
+
'@stylistic/js/no-confusing-arrow': 'off',
|
|
70
|
+
'@stylistic/js/newline-per-chained-call': 'off',
|
|
71
|
+
'@stylistic/js/indent': 'off',
|
|
72
|
+
'@stylistic/js/implicit-arrow-linebreak': 'off',
|
|
73
|
+
'@stylistic/js/lines-between-class-members': [
|
|
74
|
+
'error',
|
|
75
|
+
'always',
|
|
76
|
+
{
|
|
77
|
+
exceptAfterSingleLine: true,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
'@stylistic/js/no-mixed-operators': 'off',
|
|
81
|
+
'@stylistic/js/max-len': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
code: 120,
|
|
85
|
+
tabWidth: 2,
|
|
86
|
+
ignoreComments: true,
|
|
87
|
+
ignoreRegExpLiterals: true,
|
|
88
|
+
ignoreStrings: true,
|
|
89
|
+
ignoreTrailingComments: true,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
'@stylistic/js/quotes': ['error', 'single', { avoidEscape: true }],
|
|
93
|
+
'@stylistic/js/spaced-comment': ['error', 'always'],
|
|
94
|
+
'@stylistic/js/object-curly-spacing': ['error', 'always', { objectsInObjects: true }],
|
|
95
|
+
'@stylistic/js/padding-line-between-statements': [
|
|
96
|
+
'error',
|
|
97
|
+
{ blankLine: 'always', prev: '*', next: 'if' },
|
|
98
|
+
{ blankLine: 'always', prev: 'if', next: 'if' },
|
|
99
|
+
{ blankLine: 'always', prev: ['const', 'let'], next: '*' },
|
|
100
|
+
{ blankLine: 'any', prev: ['const', 'let'], next: ['const', 'let'] },
|
|
101
|
+
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
102
|
+
{ blankLine: 'always', prev: '*', next: 'case' },
|
|
103
|
+
{ blankLine: 'always', prev: 'if', next: '*' },
|
|
104
|
+
],
|
|
105
|
+
'@stylistic/js/multiline-comment-style': ['error', 'separate-lines', { checkJSDoc: true }],
|
|
106
|
+
},
|
|
86
107
|
},
|
|
87
|
-
|
|
108
|
+
])
|
|
@@ -1,44 +1,55 @@
|
|
|
1
1
|
import importPlugin from 'eslint-plugin-import'
|
|
2
|
-
import
|
|
2
|
+
import { config } from 'typescript-eslint'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
import { files } from './constants.js'
|
|
5
|
+
|
|
6
|
+
export default config([
|
|
7
|
+
importPlugin.flatConfigs.recommended,
|
|
8
|
+
importPlugin.flatConfigs.typescript,
|
|
9
|
+
{
|
|
10
|
+
files,
|
|
11
|
+
rules: {
|
|
12
|
+
'import/newline-after-import': 'error',
|
|
13
|
+
'import/order': [
|
|
14
|
+
'error',
|
|
15
|
+
{
|
|
16
|
+
'newlines-between': 'always',
|
|
17
|
+
groups: [['builtin', 'external'], ['internal'], ['parent'], ['sibling', 'index', 'object'], ['type']],
|
|
18
|
+
pathGroups: [
|
|
19
|
+
{
|
|
20
|
+
pattern: '@/**',
|
|
21
|
+
group: 'external',
|
|
22
|
+
position: 'after',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
alphabetize: {
|
|
26
|
+
order: 'asc',
|
|
27
|
+
caseInsensitive: false,
|
|
19
28
|
},
|
|
20
|
-
],
|
|
21
|
-
alphabetize: {
|
|
22
|
-
order: 'asc',
|
|
23
|
-
caseInsensitive: false,
|
|
24
29
|
},
|
|
30
|
+
],
|
|
31
|
+
'import/no-duplicates': [
|
|
32
|
+
'error',
|
|
33
|
+
{
|
|
34
|
+
considerQueryString: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
'import/prefer-default-export': 'off',
|
|
38
|
+
'import/extensions': [
|
|
39
|
+
'error',
|
|
40
|
+
'never',
|
|
41
|
+
{
|
|
42
|
+
js: 'never',
|
|
43
|
+
json: 'ignorePackages',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
'import/no-unresolved': ['error', {}],
|
|
47
|
+
},
|
|
48
|
+
settings: {
|
|
49
|
+
'import/resolver': {
|
|
50
|
+
typescript: true,
|
|
51
|
+
node: true,
|
|
25
52
|
},
|
|
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', {}],
|
|
53
|
+
},
|
|
43
54
|
},
|
|
44
|
-
|
|
55
|
+
])
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import nextPlugin from '@next/eslint-plugin-next'
|
|
2
|
-
import
|
|
2
|
+
import { config } from 'typescript-eslint'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { files } from './constants.js'
|
|
5
|
+
|
|
6
|
+
export default config([
|
|
7
|
+
{
|
|
8
|
+
files,
|
|
9
|
+
plugins: {
|
|
10
|
+
'@next/next': nextPlugin,
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
...nextPlugin.configs.recommended.rules,
|
|
14
|
+
...nextPlugin.configs['core-web-vitals'].rules,
|
|
15
|
+
},
|
|
12
16
|
},
|
|
13
|
-
|
|
17
|
+
])
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import prettierConfig from 'eslint-config-prettier'
|
|
2
2
|
import prettierPlugin from 'eslint-plugin-prettier'
|
|
3
|
-
import
|
|
3
|
+
import { config } from 'typescript-eslint'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { files } from './constants.js'
|
|
6
|
+
|
|
7
|
+
export default config([
|
|
8
|
+
prettierConfig,
|
|
9
|
+
{
|
|
10
|
+
files,
|
|
11
|
+
plugins: { prettier: prettierPlugin },
|
|
12
|
+
rules: { 'prettier/prettier': 'error' },
|
|
13
|
+
},
|
|
14
|
+
])
|
|
@@ -1,51 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import stylisticJsx from '@stylistic/eslint-plugin-jsx'
|
|
2
|
+
import reactPlugin from 'eslint-plugin-react'
|
|
3
3
|
import reactHooksPlugin from 'eslint-plugin-react-hooks'
|
|
4
|
-
import
|
|
4
|
+
import { config } from 'typescript-eslint'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'react
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'error',
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'error',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
import { files } from './constants.js'
|
|
7
|
+
|
|
8
|
+
export default config([
|
|
9
|
+
reactPlugin.configs.flat.recommended,
|
|
10
|
+
reactPlugin.configs.flat['jsx-runtime'],
|
|
11
|
+
stylisticJsx.configs.recommended,
|
|
12
|
+
{
|
|
13
|
+
files,
|
|
14
|
+
plugins: { 'react-hooks': reactHooksPlugin },
|
|
15
|
+
rules: {
|
|
16
|
+
'react/boolean-prop-naming': 'error',
|
|
17
|
+
'react/button-has-type': 'error',
|
|
18
|
+
'react/checked-requires-onchange-or-readonly': 'error',
|
|
19
|
+
'react/default-props-match-prop-types': ['error', { allowRequiredDefaults: true }],
|
|
20
|
+
'react/destructuring-assignment': 'error',
|
|
21
|
+
'react/function-component-definition': [
|
|
22
|
+
'error',
|
|
23
|
+
{
|
|
24
|
+
namedComponents: 'arrow-function',
|
|
25
|
+
unnamedComponents: 'arrow-function',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
'react/hook-use-state': 'error',
|
|
29
|
+
'react/jsx-boolean-value': 'error',
|
|
30
|
+
'react/jsx-fragments': 'error',
|
|
31
|
+
'react/jsx-handler-names': 'error',
|
|
32
|
+
'react/jsx-no-constructed-context-values': 'error',
|
|
33
|
+
'react/jsx-no-leaked-render': 'error',
|
|
34
|
+
'react/jsx-no-useless-fragment': 'error',
|
|
35
|
+
'react/no-multi-comp': 'error',
|
|
36
|
+
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
37
|
+
|
|
38
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
39
|
+
// @stylistic
|
|
40
|
+
'@stylistic/jsx/jsx-closing-bracket-location': 'error',
|
|
41
|
+
'@stylistic/jsx/jsx-closing-tag-location': 'error',
|
|
42
|
+
'@stylistic/jsx/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never' }],
|
|
43
|
+
'@stylistic/jsx/jsx-curly-newline': ['error', { multiline: 'consistent', singleline: 'forbid' }],
|
|
44
|
+
'@stylistic/jsx/jsx-curly-spacing': [
|
|
45
|
+
'error',
|
|
46
|
+
{
|
|
47
|
+
when: 'never',
|
|
48
|
+
attributes: { allowMultiline: false },
|
|
49
|
+
children: false,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'@stylistic/jsx/jsx-equals-spacing': ['error', 'never'],
|
|
53
|
+
'@stylistic/jsx/jsx-first-prop-new-line': ['error', 'multiline'],
|
|
54
|
+
'@stylistic/jsx/jsx-max-props-per-line': ['error', { when: 'multiline' }],
|
|
55
|
+
'@stylistic/jsx/jsx-props-no-multi-spaces': 'error',
|
|
56
|
+
'@stylistic/jsx/jsx-tag-spacing': 'error',
|
|
57
|
+
},
|
|
50
58
|
},
|
|
51
|
-
|
|
59
|
+
])
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { configs } from 'eslint-plugin-sonarjs'
|
|
2
|
+
import { config } from 'typescript-eslint'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { files } from './constants.js'
|
|
5
|
+
|
|
6
|
+
export default config([
|
|
7
|
+
configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
files,
|
|
10
|
+
rules: {
|
|
11
|
+
'sonarjs/todo-tag': 'warn',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
])
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { config, configs } from 'typescript-eslint'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { files } from './constants.js'
|
|
4
|
+
|
|
5
|
+
export default config([
|
|
6
|
+
...configs.recommended,
|
|
7
|
+
...configs.stylistic,
|
|
8
|
+
{
|
|
9
|
+
files,
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parserOptions: {
|
|
12
|
+
project: ['tsconfig.json'],
|
|
13
|
+
},
|
|
9
14
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
typescript:
|
|
15
|
+
rules: {
|
|
16
|
+
'@typescript-eslint/no-shadow': ['error', { ignoreTypeValueShadow: true }],
|
|
17
|
+
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
|
|
18
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
19
|
+
'error',
|
|
20
|
+
{
|
|
21
|
+
'ts-expect-error': 'allow-with-description',
|
|
22
|
+
'ts-ignore': 'allow-with-description',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
26
|
+
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
|
|
14
27
|
},
|
|
15
28
|
},
|
|
16
|
-
|
|
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
|
-
})
|
|
29
|
+
])
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
2
|
-
import
|
|
2
|
+
import { config } from 'typescript-eslint'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'error',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
import { files } from './constants.js'
|
|
5
|
+
|
|
6
|
+
export default config([
|
|
7
|
+
unicornPlugin.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
files,
|
|
10
|
+
rules: {
|
|
11
|
+
'unicorn/consistent-destructuring': 'error',
|
|
12
|
+
'unicorn/custom-error-definition': 'error',
|
|
13
|
+
'unicorn/no-unused-properties': 'error',
|
|
14
|
+
'unicorn/prevent-abbreviations': [
|
|
15
|
+
'error',
|
|
16
|
+
{
|
|
17
|
+
checkShorthandImports: false,
|
|
18
|
+
replacements: {
|
|
19
|
+
dev: false,
|
|
20
|
+
prod: false,
|
|
21
|
+
props: false,
|
|
22
|
+
ref: false,
|
|
23
|
+
refs: false,
|
|
24
|
+
},
|
|
21
25
|
},
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
],
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
|
-
|
|
29
|
+
])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const files = ['**/*.{js,jsx,ts,tsx,mts,cts,mjs,cjs,vue,svelte}']
|
|
@@ -2,6 +2,14 @@ import commonConfig from './configs/config.common.js'
|
|
|
2
2
|
import importConfig from './configs/config.import.js'
|
|
3
3
|
import prettierConfig from './configs/config.prettier.js'
|
|
4
4
|
import sonarjsConfig from './configs/config.sonarjs.js'
|
|
5
|
+
import typescriptConfig from './configs/config.typescript.js'
|
|
5
6
|
import unicornConfig from './configs/config.unicorn.js'
|
|
6
7
|
|
|
7
|
-
export default [
|
|
8
|
+
export default [
|
|
9
|
+
...commonConfig,
|
|
10
|
+
...importConfig,
|
|
11
|
+
...typescriptConfig,
|
|
12
|
+
...prettierConfig,
|
|
13
|
+
...unicornConfig,
|
|
14
|
+
...sonarjsConfig,
|
|
15
|
+
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import reactConfig from './configs/config.react.js'
|
|
2
|
-
import
|
|
2
|
+
import commonConfig from './eslint.config.common.js'
|
|
3
3
|
|
|
4
|
-
export default [...
|
|
4
|
+
export default [...commonConfig, ...reactConfig]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as eslintCommon } from './eslint/eslint.config.common.js'
|
|
2
|
-
export { default as eslintTypescript } from './eslint/eslint.config.typescript.js'
|
|
3
2
|
export { default as eslintReact } from './eslint/eslint.config.react.js'
|
|
4
3
|
export { default as eslintNext } from './eslint/eslint.config.next.js'
|
|
5
4
|
|
package/bun.lockb
DELETED
|
Binary file
|
package/eslint.config.js
DELETED
package/prettier.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import angular from 'angular-eslint'
|
|
2
|
-
import tseslint from 'typescript-eslint'
|
|
3
|
-
|
|
4
|
-
export default tseslint.config(
|
|
5
|
-
{
|
|
6
|
-
files: ['**/*.ts'],
|
|
7
|
-
extends: [...angular.configs.tsAll],
|
|
8
|
-
processor: angular.processInlineTemplates,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.html'],
|
|
12
|
-
extends: [...angular.configs.templateAll],
|
|
13
|
-
rules: {
|
|
14
|
-
'@angular-eslint/template/i18n': 'off',
|
|
15
|
-
'@angular-eslint/template/no-call-expression': ['error', { allowPrefix: '$' }],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
)
|