@dword-design/eslint-config 6.1.3 → 7.0.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/README.md +43 -43
- package/dist/create/index.js +194 -243
- package/dist/create/restricted-imports.js +79 -68
- package/dist/index.js +2 -2
- package/package.json +11 -16
package/README.md
CHANGED
|
@@ -3,49 +3,49 @@
|
|
|
3
3
|
<!-- /TITLE -->
|
|
4
4
|
|
|
5
5
|
<!-- BADGES/ -->
|
|
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
|
-
|
|
6
|
+
<p>
|
|
7
|
+
<a href="https://npmjs.org/package/@dword-design/eslint-config">
|
|
8
|
+
<img
|
|
9
|
+
src="https://img.shields.io/npm/v/@dword-design/eslint-config.svg"
|
|
10
|
+
alt="npm version"
|
|
11
|
+
>
|
|
12
|
+
</a><img src="https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue" alt="Linux macOS Windows compatible"><a href="https://github.com/dword-design/eslint-config/actions">
|
|
13
|
+
<img
|
|
14
|
+
src="https://github.com/dword-design/eslint-config/workflows/build/badge.svg"
|
|
15
|
+
alt="Build status"
|
|
16
|
+
>
|
|
17
|
+
</a><a href="https://codecov.io/gh/dword-design/eslint-config">
|
|
18
|
+
<img
|
|
19
|
+
src="https://codecov.io/gh/dword-design/eslint-config/branch/master/graph/badge.svg"
|
|
20
|
+
alt="Coverage status"
|
|
21
|
+
>
|
|
22
|
+
</a><a href="https://david-dm.org/dword-design/eslint-config">
|
|
23
|
+
<img src="https://img.shields.io/david/dword-design/eslint-config" alt="Dependency status">
|
|
24
|
+
</a><img src="https://img.shields.io/badge/renovate-enabled-brightgreen" alt="Renovate enabled"><br/><a href="https://gitpod.io/#https://github.com/dword-design/eslint-config">
|
|
25
|
+
<img
|
|
26
|
+
src="https://gitpod.io/button/open-in-gitpod.svg"
|
|
27
|
+
alt="Open in Gitpod"
|
|
28
|
+
width="114"
|
|
29
|
+
>
|
|
30
|
+
</a><a href="https://www.buymeacoffee.com/dword">
|
|
31
|
+
<img
|
|
32
|
+
src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg"
|
|
33
|
+
alt="Buy Me a Coffee"
|
|
34
|
+
width="114"
|
|
35
|
+
>
|
|
36
|
+
</a><a href="https://paypal.me/SebastianLandwehr">
|
|
37
|
+
<img
|
|
38
|
+
src="https://sebastianlandwehr.com/images/paypal.svg"
|
|
39
|
+
alt="PayPal"
|
|
40
|
+
width="163"
|
|
41
|
+
>
|
|
42
|
+
</a><a href="https://www.patreon.com/dworddesign">
|
|
43
|
+
<img
|
|
44
|
+
src="https://sebastianlandwehr.com/images/patreon.svg"
|
|
45
|
+
alt="Patreon"
|
|
46
|
+
width="163"
|
|
47
|
+
>
|
|
48
|
+
</a>
|
|
49
49
|
</p>
|
|
50
50
|
<!-- /BADGES -->
|
|
51
51
|
|
package/dist/create/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import pathLib from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import
|
|
4
|
-
import { loadConfigSync } from '@dword-design/base';
|
|
5
|
-
import defu from '@dword-design/defu';
|
|
3
|
+
import importAlias from '@dword-design/eslint-plugin-import-alias';
|
|
6
4
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
7
5
|
import js from '@eslint/js';
|
|
8
6
|
import confusingBrowserGlobals from 'confusing-browser-globals';
|
|
9
7
|
import packageName from 'depcheck-package-name';
|
|
10
8
|
import { defineConfig } from 'eslint/config';
|
|
11
9
|
import gitignore from 'eslint-config-flat-gitignore';
|
|
12
|
-
import
|
|
10
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
11
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
13
12
|
import eslintPluginJsonc from 'eslint-plugin-jsonc';
|
|
14
13
|
import pluginPlaywright from 'eslint-plugin-playwright';
|
|
15
14
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
@@ -21,244 +20,196 @@ import loadPkg from 'load-pkg';
|
|
|
21
20
|
import { compact, omit, without } from 'lodash-es';
|
|
22
21
|
import { sortOrder as packageJsonSortOrder } from 'sort-package-json';
|
|
23
22
|
import tseslint from 'typescript-eslint';
|
|
24
|
-
import restrictedImports from
|
|
25
|
-
export default () => {
|
|
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
|
-
}, ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'], {
|
|
62
|
-
files: ['**/*.vue'],
|
|
63
|
-
languageOptions: {
|
|
64
|
-
parserOptions: {
|
|
65
|
-
babelOptions: {
|
|
66
|
-
rootMode: 'upward-optional'
|
|
23
|
+
import restrictedImports from './restricted-imports.js';
|
|
24
|
+
export default ({ cwd = '.' } = {}) => {
|
|
25
|
+
const packageConfig = loadPkg.sync(cwd) || {};
|
|
26
|
+
const eslintRestrictedImports = restrictedImports
|
|
27
|
+
.filter(importDef => importDef.alternative === undefined ||
|
|
28
|
+
importDef.alternative !== packageConfig.name)
|
|
29
|
+
.map(importDef => ({
|
|
30
|
+
...omit(importDef, ['alternative']),
|
|
31
|
+
message: compact([
|
|
32
|
+
importDef.message,
|
|
33
|
+
importDef.alternative ? `Use '${importDef.alternative}' instead` : '',
|
|
34
|
+
]).join(' '),
|
|
35
|
+
}));
|
|
36
|
+
// mimic CommonJS variables -- not needed if using CommonJS
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
38
|
+
const __dirname = pathLib.dirname(__filename);
|
|
39
|
+
const compat = new FlatCompat({ baseDirectory: __dirname });
|
|
40
|
+
return defineConfig([
|
|
41
|
+
gitignore({ strict: false }),
|
|
42
|
+
js.configs.recommended,
|
|
43
|
+
tseslint.configs.recommended,
|
|
44
|
+
importX.flatConfigs.recommended,
|
|
45
|
+
importX.flatConfigs.typescript,
|
|
46
|
+
pluginPromise.configs['flat/recommended'],
|
|
47
|
+
...pluginVue.configs['flat/recommended'].map(plugin => ({
|
|
48
|
+
files: ['**/*.ts', '**/*.vue'],
|
|
49
|
+
...plugin,
|
|
50
|
+
})),
|
|
51
|
+
importAlias.configs.recommended,
|
|
52
|
+
{ files: ['**/*.ts', '**/*.vue'], ...eslintPluginPrettierRecommended },
|
|
53
|
+
pluginPlaywright.configs['flat/recommended'],
|
|
54
|
+
...compat.plugins(packageName `eslint-plugin-prefer-arrow`),
|
|
55
|
+
...compat.plugins(packageName `eslint-plugin-simple-import-sort`),
|
|
56
|
+
...compat.plugins(packageName `eslint-plugin-sort-keys-fix`),
|
|
57
|
+
{
|
|
58
|
+
files: ['**/*.ts', '**/*.vue'],
|
|
59
|
+
...eslintPluginUnicorn.configs.recommended,
|
|
67
60
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
files: ['**/*.json'],
|
|
73
|
-
rules: {
|
|
74
|
-
'jsonc/indent': ['error', 2],
|
|
75
|
-
'jsonc/sort-keys': 'error'
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
files: ['**/package.json'],
|
|
79
|
-
rules: {
|
|
80
|
-
'jsonc/sort-keys': ['error', {
|
|
81
|
-
order: packageJsonSortOrder,
|
|
82
|
-
pathPattern: '^$'
|
|
83
|
-
}]
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
files: ['**/*.js', '**/*.ts', '**/*.vue'],
|
|
87
|
-
languageOptions: {
|
|
88
|
-
globals: {
|
|
89
|
-
...globals.node,
|
|
90
|
-
...globals.browser
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
rules: {
|
|
94
|
-
...(baseConfig.testRunner === 'playwright' && {
|
|
95
|
-
'playwright/expect-expect': 'off'
|
|
96
|
-
}),
|
|
97
|
-
'arrow-body-style': ['error', 'as-needed'],
|
|
98
|
-
'func-names': ['error', 'never'],
|
|
99
|
-
'global-require': 'off',
|
|
100
|
-
'import/extensions': ['error', 'ignorePackages'],
|
|
101
|
-
'import/no-commonjs': 'error',
|
|
102
|
-
'import/no-dynamic-require': 'off',
|
|
103
|
-
'import/no-extraneous-dependencies': ['error', {
|
|
104
|
-
devDependencies: ['base.config.js', '**/*.spec.js', '**/*.spec.ts', ...(baseConfig.testRunner === 'playwright' ? ['fixtures/**', 'global-setup.js', 'global-teardown.js', 'playwright.config.js'] : ['global-test-hooks.js'])]
|
|
105
|
-
}],
|
|
106
|
-
'import/no-named-as-default': 'off',
|
|
107
|
-
'import/order': 'off',
|
|
108
|
-
'import/prefer-default-export': 'off',
|
|
109
|
-
'linebreak-style': ['error', 'unix'],
|
|
110
|
-
'new-cap': 'off',
|
|
111
|
-
'no-await-in-loop': 'off',
|
|
112
|
-
'no-console': 'off',
|
|
113
|
-
'no-constant-condition': ['error', {
|
|
114
|
-
checkLoops: false
|
|
115
|
-
}],
|
|
116
|
-
'no-continue': 'off',
|
|
117
|
-
'no-empty-pattern': 'error',
|
|
118
|
-
'no-lonely-if': 'off',
|
|
119
|
-
'no-negated-condition': 'error',
|
|
120
|
-
'no-nested-ternary': 'off',
|
|
121
|
-
'no-param-reassign': 'off',
|
|
122
|
-
'no-promise-executor-return': 'off',
|
|
123
|
-
'no-regex-spaces': 'off',
|
|
124
|
-
// https://github.com/facebook/create-react-app/issues/12847
|
|
125
|
-
'no-restricted-globals': ['error', {
|
|
126
|
-
message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
|
|
127
|
-
name: 'isFinite'
|
|
128
|
-
}, {
|
|
129
|
-
message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
|
|
130
|
-
name: 'isNaN'
|
|
131
|
-
}, ...without(confusingBrowserGlobals, 'self').map(g => ({
|
|
132
|
-
message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
|
|
133
|
-
name: g
|
|
134
|
-
}))],
|
|
135
|
-
'no-restricted-imports': ['error', {
|
|
136
|
-
paths: eslintRestrictedImports
|
|
137
|
-
}],
|
|
138
|
-
'no-return-assign': 'off',
|
|
139
|
-
'no-template-curly-in-string': 'off',
|
|
140
|
-
'no-underscore-dangle': 'off',
|
|
141
|
-
'no-var': 'error',
|
|
142
|
-
'object-shorthand': ['error', 'always'],
|
|
143
|
-
[`${packageName`prettier`}/prettier`]: ['error', {
|
|
144
|
-
arrowParens: 'avoid',
|
|
145
|
-
objectWrap: 'collapse',
|
|
146
|
-
singleQuote: true,
|
|
147
|
-
trailingComma: 'all'
|
|
148
|
-
}],
|
|
149
|
-
'padding-line-between-statements': ['error', {
|
|
150
|
-
blankLine: 'never',
|
|
151
|
-
next: '*',
|
|
152
|
-
prev: '*'
|
|
153
|
-
}, {
|
|
154
|
-
blankLine: 'always',
|
|
155
|
-
next: '*',
|
|
156
|
-
prev: 'import'
|
|
157
|
-
}, {
|
|
158
|
-
blankLine: 'any',
|
|
159
|
-
next: 'import',
|
|
160
|
-
prev: 'import'
|
|
161
|
-
}, ...Object.keys({
|
|
162
|
-
'block-like': true,
|
|
163
|
-
const: true,
|
|
164
|
-
expression: true,
|
|
165
|
-
let: true
|
|
166
|
-
}).flatMap(name => [{
|
|
167
|
-
blankLine: 'always',
|
|
168
|
-
next: `multiline-${name}`,
|
|
169
|
-
prev: '*'
|
|
170
|
-
}, {
|
|
171
|
-
blankLine: 'always',
|
|
172
|
-
next: '*',
|
|
173
|
-
prev: `multiline-${name}`
|
|
174
|
-
}]), {
|
|
175
|
-
blankLine: 'always',
|
|
176
|
-
next: 'export',
|
|
177
|
-
prev: '*'
|
|
178
|
-
}],
|
|
179
|
-
'prefer-arrow/prefer-arrow-functions': ['error'],
|
|
180
|
-
'prefer-destructuring': 'off',
|
|
181
|
-
'require-await': 'error',
|
|
182
|
-
'simple-import-sort/imports': 'error',
|
|
183
|
-
'sort-keys-fix/sort-keys-fix': 'error',
|
|
184
|
-
'unicorn/catch-error-name': 'off',
|
|
185
|
-
'unicorn/consistent-function-scoping': 'off',
|
|
186
|
-
'unicorn/no-anonymous-default-export': 'off',
|
|
187
|
-
'unicorn/no-negated-condition': 'off',
|
|
188
|
-
'unicorn/no-nested-ternary': 'off',
|
|
189
|
-
'unicorn/no-null': 'off',
|
|
190
|
-
'unicorn/prevent-abbreviations': 'off',
|
|
191
|
-
'unicorn/template-indent': ['error', {
|
|
192
|
-
tags: Object.keys({
|
|
193
|
-
css: true,
|
|
194
|
-
dedent: true,
|
|
195
|
-
html: true,
|
|
196
|
-
javascript: true,
|
|
197
|
-
sql: true,
|
|
198
|
-
svg: true,
|
|
199
|
-
xml: true
|
|
200
|
-
})
|
|
201
|
-
}],
|
|
202
|
-
'vue/attributes-order': ['error', {
|
|
203
|
-
alphabetical: true
|
|
204
|
-
}],
|
|
205
|
-
'vue/no-deprecated-functional-template': 'error',
|
|
206
|
-
'vue/order-in-components': 'off',
|
|
207
|
-
'vue/prefer-true-attribute-shorthand': 'error',
|
|
208
|
-
'vue/require-default-prop': 'off',
|
|
209
|
-
'vue/require-prop-types': 'off',
|
|
210
|
-
// Complains about title not being a string if variable is passed
|
|
211
|
-
...(baseConfig.testRunner === 'playwright' && {
|
|
212
|
-
'playwright/valid-title': ['error', {
|
|
213
|
-
ignoreTypeOfTestName: true
|
|
214
|
-
}]
|
|
215
|
-
})
|
|
216
|
-
},
|
|
217
|
-
settings: {
|
|
218
|
-
'import/resolver': {
|
|
219
|
-
[packageName`eslint-import-resolver-babel-module`]: {
|
|
220
|
-
allowExistingDirectories: true
|
|
61
|
+
...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
|
|
62
|
+
{
|
|
63
|
+
files: ['**/*.json'],
|
|
64
|
+
rules: { 'jsonc/indent': ['error', 2], 'jsonc/sort-keys': 'error' },
|
|
221
65
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
66
|
+
{
|
|
67
|
+
files: ['**/package.json'],
|
|
68
|
+
rules: {
|
|
69
|
+
'jsonc/sort-keys': [
|
|
70
|
+
'error',
|
|
71
|
+
{ order: packageJsonSortOrder, pathPattern: '^$' },
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
files: ['**/*.ts', '**/*.vue'],
|
|
77
|
+
languageOptions: { globals: { ...globals.node, ...globals.browser } },
|
|
78
|
+
rules: {
|
|
79
|
+
'@dword-design/import-alias/prefer-alias': [
|
|
80
|
+
'error',
|
|
81
|
+
{ alias: { '@': '.' } },
|
|
82
|
+
],
|
|
83
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
84
|
+
'func-names': ['error', 'never'],
|
|
85
|
+
'global-require': 'off',
|
|
86
|
+
'import-x/extensions': ['error', 'ignorePackages', { ts: 'never' }],
|
|
87
|
+
'import-x/no-extraneous-dependencies': [
|
|
88
|
+
'error',
|
|
89
|
+
{
|
|
90
|
+
devDependencies: [
|
|
91
|
+
'**/*.spec.ts',
|
|
92
|
+
'fixtures/**',
|
|
93
|
+
'global-setup.ts',
|
|
94
|
+
'global-teardown.ts',
|
|
95
|
+
'playwright.config.ts',
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
'import-x/no-named-as-default': 'off',
|
|
100
|
+
'import-x/no-named-as-default-member': 'off',
|
|
101
|
+
'linebreak-style': ['error', 'unix'],
|
|
102
|
+
'new-cap': 'off',
|
|
103
|
+
'no-await-in-loop': 'off',
|
|
104
|
+
'no-console': 'off',
|
|
105
|
+
'no-constant-condition': ['error', { checkLoops: false }],
|
|
106
|
+
'no-continue': 'off',
|
|
107
|
+
'no-empty-pattern': 'error',
|
|
108
|
+
'no-lonely-if': 'off',
|
|
109
|
+
'no-negated-condition': 'error',
|
|
110
|
+
'no-nested-ternary': 'off',
|
|
111
|
+
'no-param-reassign': 'off',
|
|
112
|
+
'no-promise-executor-return': 'off',
|
|
113
|
+
'no-regex-spaces': 'off',
|
|
114
|
+
// https://github.com/facebook/create-react-app/issues/12847
|
|
115
|
+
'no-restricted-globals': [
|
|
116
|
+
'error',
|
|
117
|
+
{
|
|
118
|
+
message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
|
|
119
|
+
name: 'isFinite',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
|
|
123
|
+
name: 'isNaN',
|
|
124
|
+
},
|
|
125
|
+
...without(confusingBrowserGlobals, 'self').map(g => ({
|
|
126
|
+
message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
|
|
127
|
+
name: g,
|
|
128
|
+
})),
|
|
129
|
+
],
|
|
130
|
+
'no-restricted-imports': ['error', { paths: eslintRestrictedImports }],
|
|
131
|
+
'no-return-assign': 'off',
|
|
132
|
+
'no-template-curly-in-string': 'off',
|
|
133
|
+
'no-underscore-dangle': 'off',
|
|
134
|
+
'no-var': 'error',
|
|
135
|
+
[`${packageName `prettier`}/prettier`]: [
|
|
136
|
+
'error',
|
|
137
|
+
{
|
|
138
|
+
arrowParens: 'avoid',
|
|
139
|
+
objectWrap: 'collapse',
|
|
140
|
+
singleQuote: true,
|
|
141
|
+
trailingComma: 'all',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
'object-shorthand': ['error', 'always'],
|
|
145
|
+
'padding-line-between-statements': [
|
|
146
|
+
'error',
|
|
147
|
+
{ blankLine: 'never', next: '*', prev: '*' },
|
|
148
|
+
{ blankLine: 'always', next: '*', prev: 'import' },
|
|
149
|
+
{ blankLine: 'any', next: 'import', prev: 'import' },
|
|
150
|
+
...Object.keys({
|
|
151
|
+
'block-like': true,
|
|
152
|
+
const: true,
|
|
153
|
+
expression: true,
|
|
154
|
+
let: true,
|
|
155
|
+
}).flatMap(name => [
|
|
156
|
+
{ blankLine: 'always', next: `multiline-${name}`, prev: '*' },
|
|
157
|
+
{ blankLine: 'always', next: '*', prev: `multiline-${name}` },
|
|
158
|
+
]),
|
|
159
|
+
{ blankLine: 'always', next: 'export', prev: '*' },
|
|
160
|
+
],
|
|
161
|
+
'prefer-arrow/prefer-arrow-functions': ['error'],
|
|
162
|
+
'prefer-destructuring': 'off',
|
|
163
|
+
'require-await': 'error',
|
|
164
|
+
'simple-import-sort/imports': 'error',
|
|
165
|
+
'sort-keys-fix/sort-keys-fix': 'error',
|
|
166
|
+
'unicorn/catch-error-name': 'off',
|
|
167
|
+
'unicorn/consistent-function-scoping': 'off',
|
|
168
|
+
'unicorn/no-anonymous-default-export': 'off',
|
|
169
|
+
'unicorn/no-negated-condition': 'off',
|
|
170
|
+
'unicorn/no-nested-ternary': 'off',
|
|
171
|
+
'unicorn/no-null': 'off',
|
|
172
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
173
|
+
'unicorn/template-indent': [
|
|
174
|
+
'error',
|
|
175
|
+
{
|
|
176
|
+
tags: Object.keys({
|
|
177
|
+
css: true,
|
|
178
|
+
endent: true,
|
|
179
|
+
html: true,
|
|
180
|
+
javascript: true,
|
|
181
|
+
sql: true,
|
|
182
|
+
svg: true,
|
|
183
|
+
xml: true,
|
|
184
|
+
}),
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
'vue/attributes-order': ['error', { alphabetical: true }],
|
|
188
|
+
'vue/no-deprecated-functional-template': 'error',
|
|
189
|
+
'vue/order-in-components': 'off',
|
|
190
|
+
'vue/prefer-true-attribute-shorthand': 'error',
|
|
191
|
+
'vue/require-default-prop': 'off',
|
|
192
|
+
'vue/require-prop-types': 'off', // Complains about title not being a string if variable is passed
|
|
193
|
+
},
|
|
194
|
+
settings: {
|
|
195
|
+
'import-x/resolver-next': [
|
|
196
|
+
createTypeScriptImportResolver({
|
|
197
|
+
project: pathLib.join(cwd, 'tsconfig.json'),
|
|
198
|
+
}),
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
files: ['**/*.spec.ts'],
|
|
204
|
+
rules: {
|
|
205
|
+
'playwright/expect-expect': 'off',
|
|
206
|
+
'playwright/valid-title': ['error', { ignoreTypeOfTestName: true }],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
files: ['fixtures/**', '**/*.spec.ts'],
|
|
211
|
+
rules: { 'no-empty-pattern': 'off' },
|
|
212
|
+
},
|
|
213
|
+
{ files: ['**/*.vue'], rules: { 'vue/multi-word-component-names': 'off' } },
|
|
214
|
+
]);
|
|
215
|
+
};
|
|
@@ -1,68 +1,79 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
}
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
alternative: 'parse-packagejson-name',
|
|
4
|
+
message: 'Does not work in the browser due to fs dependency in ow.',
|
|
5
|
+
name: 'parse-pkg-name',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
alternative: '@dword-design/nuxt-auth',
|
|
9
|
+
message: 'Does not auto-rewrite redirects.',
|
|
10
|
+
name: '@nuxtjs/auth',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
alternative: '@dword-design/chdir',
|
|
14
|
+
message: 'It is not maintained anymore.',
|
|
15
|
+
name: 'chdir',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
alternative: 'execa',
|
|
19
|
+
message: "'execa' provides more features and syntactic sugar.",
|
|
20
|
+
name: 'child-process-promise',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
alternative: 'execa',
|
|
24
|
+
message: 'It does not support promises.',
|
|
25
|
+
name: 'child_process',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
alternative: 'fs-extra',
|
|
29
|
+
message: 'Does not support promises.',
|
|
30
|
+
name: 'fs',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
alternative: 'globby',
|
|
34
|
+
message: 'Does not support promises.',
|
|
35
|
+
name: 'glob',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
alternative: 'globby',
|
|
39
|
+
message: 'Does not support pattern arrays.',
|
|
40
|
+
name: 'glob-promise',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
alternative: 'globby',
|
|
44
|
+
message: 'Only works for Node.js >= 12.',
|
|
45
|
+
name: 'matched',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
alternative: 'node-sass-package-importer',
|
|
49
|
+
message: 'Does not support inline importing CSS files.',
|
|
50
|
+
name: 'node-sass-tilde-importer',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
alternative: '@dword-design/proxyquire',
|
|
54
|
+
message: 'Does not set some important default values.',
|
|
55
|
+
name: 'proxyquire',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
alternative: 'stealthy-require-no-leak',
|
|
59
|
+
message: 'Has a memory leak when requiring the same module multiple times.',
|
|
60
|
+
name: 'stealthy-require',
|
|
61
|
+
},
|
|
62
|
+
{ alternative: 'matchdep', name: 'resolve-dep' },
|
|
63
|
+
{ alternative: '@dword-design/endent', name: 'dedent' },
|
|
64
|
+
{
|
|
65
|
+
alternative: 'sort-keys',
|
|
66
|
+
message: 'Does not support recursive sorting.',
|
|
67
|
+
name: 'sort-object-keys',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
alternative: 'tree-kill-promise',
|
|
71
|
+
message: 'Does not support promises.',
|
|
72
|
+
name: 'tree-kill',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
importNames: ['zipObject'],
|
|
76
|
+
message: 'Use map and fromPairs instead',
|
|
77
|
+
name: '@dword-design/functions',
|
|
78
|
+
},
|
|
79
|
+
];
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import create from
|
|
2
|
-
export default create();
|
|
1
|
+
import create from './create/index.js';
|
|
2
|
+
export default create();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"repository": "dword-design/eslint-config",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,30 +22,26 @@
|
|
|
22
22
|
"test": "base test"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@dword-design/base": "^12.0.5",
|
|
27
|
-
"@dword-design/defu": "^1.0.0",
|
|
28
|
-
"@dword-design/eslint-plugin-import-alias": "^5.1.2",
|
|
25
|
+
"@dword-design/eslint-plugin-import-alias": "^6.0.2",
|
|
29
26
|
"@eslint/eslintrc": "^3.3.1",
|
|
30
|
-
"@eslint/js": "^9.
|
|
27
|
+
"@eslint/js": "^9.28.0",
|
|
31
28
|
"confusing-browser-globals": "^1.0.11",
|
|
32
29
|
"depcheck-package-name": "^3.0.1",
|
|
33
|
-
"eslint": "^9.
|
|
30
|
+
"eslint": "^9.28.0",
|
|
34
31
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
35
32
|
"eslint-config-prettier": "^10.1.5",
|
|
36
|
-
"eslint-import-resolver-
|
|
37
|
-
"eslint-import-
|
|
38
|
-
"eslint-plugin-import": "npm:@dword-design/eslint-plugin-import@^0.1.0",
|
|
33
|
+
"eslint-import-resolver-typescript": "^4.4.2",
|
|
34
|
+
"eslint-plugin-import-x": "npm:@dword-design/eslint-plugin-import-x-fork@^0.0.1",
|
|
39
35
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
40
36
|
"eslint-plugin-playwright": "^2.2.0",
|
|
41
37
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
42
|
-
"eslint-plugin-prettier": "^5.4.
|
|
38
|
+
"eslint-plugin-prettier": "^5.4.1",
|
|
43
39
|
"eslint-plugin-promise": "^7.2.1",
|
|
44
40
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
45
41
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
46
42
|
"eslint-plugin-unicorn": "npm:@dword-design/eslint-plugin-unicorn@^0.0.1",
|
|
47
43
|
"eslint-plugin-vue": "^10.1.0",
|
|
48
|
-
"globals": "^16.
|
|
44
|
+
"globals": "^16.2.0",
|
|
49
45
|
"load-pkg": "^4.0.0",
|
|
50
46
|
"lodash-es": "^4.17.21",
|
|
51
47
|
"prettier": "^3.5.3",
|
|
@@ -53,12 +49,11 @@
|
|
|
53
49
|
"typescript-eslint": "^8.33.1"
|
|
54
50
|
},
|
|
55
51
|
"devDependencies": {
|
|
52
|
+
"@dword-design/base": "^13.0.1",
|
|
56
53
|
"@playwright/test": "^1.52.0",
|
|
57
|
-
"
|
|
58
|
-
"execa": "^9.5.3",
|
|
59
|
-
"in-folder": "^1.0.3",
|
|
54
|
+
"endent": "npm:@dword-design/endent@^1.4.1",
|
|
60
55
|
"output-files": "^2.0.32",
|
|
61
|
-
"
|
|
56
|
+
"playwright": "^1.52.0"
|
|
62
57
|
},
|
|
63
58
|
"packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
|
|
64
59
|
"engines": {
|