@dword-design/eslint-config 6.0.7 → 6.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/dist/create/index.js +11 -9
- package/package.json +4 -3
package/dist/create/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import globals from 'globals';
|
|
|
20
20
|
import loadPkg from 'load-pkg';
|
|
21
21
|
import { compact, omit, without } from 'lodash-es';
|
|
22
22
|
import { sortOrder as packageJsonSortOrder } from 'sort-package-json';
|
|
23
|
+
import tseslint from 'typescript-eslint';
|
|
23
24
|
import restrictedImports from "./restricted-imports.js";
|
|
24
25
|
export default () => {
|
|
25
26
|
const packageConfig = loadPkg.sync() || {};
|
|
@@ -48,14 +49,14 @@ export default () => {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
}, js.configs.recommended, importPlugin.flatConfigs.recommended, pluginPromise.configs['flat/recommended'], ...pluginVue.configs['flat/recommended'].map(plugin => ({
|
|
52
|
-
files: ['**/*.js', '**/*.vue'],
|
|
52
|
+
}, js.configs.recommended, tseslint.configs.recommended, importPlugin.flatConfigs.recommended, pluginPromise.configs['flat/recommended'], ...pluginVue.configs['flat/recommended'].map(plugin => ({
|
|
53
|
+
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
|
53
54
|
...plugin
|
|
54
55
|
})), ...compat.extends(`plugin:${packageName`@dword-design/eslint-plugin-import-alias`}/recommended`), {
|
|
55
|
-
files: ['**/*.js', '**/*.vue'],
|
|
56
|
+
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
|
56
57
|
...eslintPluginPrettierRecommended
|
|
57
58
|
}, ...(baseConfig.testRunner === 'playwright' ? [pluginPlaywright.configs['flat/recommended']] : []), ...compat.plugins(packageName`eslint-plugin-prefer-arrow`), ...compat.plugins(packageName`eslint-plugin-simple-import-sort`), ...compat.plugins(packageName`eslint-plugin-sort-keys-fix`), {
|
|
58
|
-
files: ['**/*.js', '**/*.vue'],
|
|
59
|
+
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
|
59
60
|
...eslintPluginUnicorn.configs.recommended
|
|
60
61
|
}, ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'], {
|
|
61
62
|
files: ['**/*.vue'],
|
|
@@ -82,7 +83,7 @@ export default () => {
|
|
|
82
83
|
}]
|
|
83
84
|
}
|
|
84
85
|
}, {
|
|
85
|
-
files: ['**/*.js', '**/*.vue'],
|
|
86
|
+
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
|
86
87
|
languageOptions: {
|
|
87
88
|
globals: {
|
|
88
89
|
...globals.node,
|
|
@@ -138,13 +139,13 @@ export default () => {
|
|
|
138
139
|
'no-template-curly-in-string': 'off',
|
|
139
140
|
'no-underscore-dangle': 'off',
|
|
140
141
|
'no-var': 'error',
|
|
142
|
+
'object-shorthand': ['error', 'always'],
|
|
141
143
|
[`${packageName`prettier`}/prettier`]: ['error', {
|
|
142
144
|
arrowParens: 'avoid',
|
|
143
145
|
objectWrap: 'collapse',
|
|
144
146
|
singleQuote: true,
|
|
145
147
|
trailingComma: 'all'
|
|
146
148
|
}],
|
|
147
|
-
'object-shorthand': ['error', 'always'],
|
|
148
149
|
'padding-line-between-statements': ['error', {
|
|
149
150
|
blankLine: 'never',
|
|
150
151
|
next: '*',
|
|
@@ -181,6 +182,7 @@ export default () => {
|
|
|
181
182
|
'simple-import-sort/imports': 'error',
|
|
182
183
|
'sort-keys-fix/sort-keys-fix': 'error',
|
|
183
184
|
'unicorn/catch-error-name': 'off',
|
|
185
|
+
'unicorn/consistent-function-scoping': 'off',
|
|
184
186
|
'unicorn/no-anonymous-default-export': 'off',
|
|
185
187
|
'unicorn/no-negated-condition': 'off',
|
|
186
188
|
'unicorn/no-nested-ternary': 'off',
|
|
@@ -189,7 +191,7 @@ export default () => {
|
|
|
189
191
|
'unicorn/template-indent': ['error', {
|
|
190
192
|
tags: Object.keys({
|
|
191
193
|
css: true,
|
|
192
|
-
|
|
194
|
+
dedent: true,
|
|
193
195
|
html: true,
|
|
194
196
|
javascript: true,
|
|
195
197
|
sql: true,
|
|
@@ -221,7 +223,7 @@ export default () => {
|
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
}, {
|
|
224
|
-
files: ['**/*.spec.js'],
|
|
226
|
+
files: ['**/*.spec.js', '**/*.spec.ts'],
|
|
225
227
|
...(baseConfig.testRunner === 'mocha' && {
|
|
226
228
|
languageOptions: {
|
|
227
229
|
globals: {
|
|
@@ -238,7 +240,7 @@ export default () => {
|
|
|
238
240
|
}]
|
|
239
241
|
}
|
|
240
242
|
}, {
|
|
241
|
-
files: [...(baseConfig.testRunner === 'playwright' ? ['fixtures/**'] : []), '**/*.spec.js'],
|
|
243
|
+
files: [...(baseConfig.testRunner === 'playwright' ? ['fixtures/**'] : []), '**/*.spec.js', '**/*.spec.ts'],
|
|
242
244
|
rules: {
|
|
243
245
|
...(baseConfig.testRunner === 'playwright' && {
|
|
244
246
|
'no-empty-pattern': 'off'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/eslint-config",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"repository": "dword-design/eslint-config",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,11 +49,12 @@
|
|
|
49
49
|
"load-pkg": "^4.0.0",
|
|
50
50
|
"lodash-es": "^4.17.21",
|
|
51
51
|
"prettier": "^3.5.3",
|
|
52
|
-
"sort-package-json": "^3.2.1"
|
|
52
|
+
"sort-package-json": "^3.2.1",
|
|
53
|
+
"typescript-eslint": "^8.33.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@dword-design/functions": "^6.0.2",
|
|
56
56
|
"@playwright/test": "^1.52.0",
|
|
57
|
+
"dedent": "^1.6.0",
|
|
57
58
|
"execa": "^9.5.3",
|
|
58
59
|
"in-folder": "^1.0.3",
|
|
59
60
|
"output-files": "^2.0.32",
|