@scayle/eslint-config-storefront 4.5.0 → 4.5.1
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/CHANGELOG.md +6 -0
- package/config/flat/index.mjs +51 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
package/config/flat/index.mjs
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
yaml,
|
|
16
16
|
} from '@antfu/eslint-config'
|
|
17
17
|
import gitignore from 'eslint-config-flat-gitignore'
|
|
18
|
+
import tseslint from 'typescript-eslint'
|
|
18
19
|
import { sonarjs } from './sonarjs.mjs'
|
|
19
20
|
import { promise } from './promise.mjs'
|
|
20
21
|
import { sanitized } from './sanitized.mjs'
|
|
@@ -51,6 +52,27 @@ export const eslintConfigStorefront = function(config = {
|
|
|
51
52
|
javascript(),
|
|
52
53
|
typescript(config.typescript),
|
|
53
54
|
jsdoc(),
|
|
55
|
+
tseslint.configs.recommended,
|
|
56
|
+
[{
|
|
57
|
+
rules: {
|
|
58
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
59
|
+
'@typescript-eslint/no-empty-object-type': ['error', {
|
|
60
|
+
'allowInterfaces': 'always',
|
|
61
|
+
}],
|
|
62
|
+
'@typescript-eslint/no-unused-vars': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
'args': 'all',
|
|
66
|
+
'argsIgnorePattern': '^_',
|
|
67
|
+
'caughtErrors': 'all',
|
|
68
|
+
'caughtErrorsIgnorePattern': '^_',
|
|
69
|
+
'destructuredArrayIgnorePattern': '^_',
|
|
70
|
+
'varsIgnorePattern': '^_',
|
|
71
|
+
'ignoreRestSiblings': true,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
}],
|
|
54
76
|
)
|
|
55
77
|
: {}
|
|
56
78
|
|
|
@@ -83,6 +105,32 @@ export const eslintConfigStorefront = function(config = {
|
|
|
83
105
|
},
|
|
84
106
|
ignores: ['**/fixtures/**/*'],
|
|
85
107
|
},
|
|
108
|
+
// Disable TypeScript ESLint rules for JSON files
|
|
109
|
+
{
|
|
110
|
+
files: ['**/*.json'],
|
|
111
|
+
rules: {
|
|
112
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
113
|
+
'@typescript-eslint/no-array-constructor': 'off',
|
|
114
|
+
'@typescript-eslint/no-duplicate-enum-values': 'off',
|
|
115
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
116
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
117
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'off',
|
|
118
|
+
'@typescript-eslint/no-misused-new': 'off',
|
|
119
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
120
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
|
|
121
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
122
|
+
'@typescript-eslint/no-this-alias': 'off',
|
|
123
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
|
|
124
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
125
|
+
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
126
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
127
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
128
|
+
'@typescript-eslint/no-wrapper-object-types': 'off',
|
|
129
|
+
'@typescript-eslint/prefer-as-const': 'off',
|
|
130
|
+
'@typescript-eslint/prefer-namespace-keyword': 'off',
|
|
131
|
+
'@typescript-eslint/triple-slash-reference': 'off',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
86
134
|
// Specific rules handling for test files
|
|
87
135
|
{
|
|
88
136
|
// See https://github.com/antfu/eslint-config/blob/main/src/globs.ts#L34
|
|
@@ -91,6 +139,9 @@ export const eslintConfigStorefront = function(config = {
|
|
|
91
139
|
'no-console': 'off',
|
|
92
140
|
},
|
|
93
141
|
},
|
|
142
|
+
{
|
|
143
|
+
ignores: ['**/*.jsonc'],
|
|
144
|
+
},
|
|
94
145
|
]
|
|
95
146
|
|
|
96
147
|
return flatConfigComposer.append(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/eslint-config-storefront",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "SCAYLE Commerce Engine specific eslint configuration",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"format": "dprint check",
|
|
34
34
|
"format:fix": "dprint fmt",
|
|
35
|
-
"lint": "eslint .
|
|
35
|
+
"lint": "eslint .",
|
|
36
|
+
"lint:ci": "eslint . --format gitlab",
|
|
36
37
|
"lint:fix": "eslint . --fix",
|
|
37
38
|
"package:lint": "publint"
|
|
38
39
|
},
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"dprint": "0.49.1",
|
|
55
|
-
"eslint": "9.
|
|
56
|
-
"eslint-formatter-gitlab": "
|
|
56
|
+
"eslint": "9.26.0",
|
|
57
|
+
"eslint-formatter-gitlab": "6.0.0",
|
|
57
58
|
"publint": "0.2.12"
|
|
58
59
|
}
|
|
59
60
|
}
|