@naturalcycles/dev-lib 19.33.3 → 19.34.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/cfg/eslint.config.js +57 -48
- package/cfg/tsconfig.e2e.json +6 -0
- package/package.json +1 -1
package/cfg/eslint.config.js
CHANGED
|
@@ -23,57 +23,66 @@ import eslintBiomeRules from './eslint-biome-rules.js'
|
|
|
23
23
|
const defaultFiles = ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts']
|
|
24
24
|
const testFiles = ['**/*.test.ts', '**/*.test.tsx', '**/*.test.cts', '**/*.test.mts']
|
|
25
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
|
-
files: testFiles,
|
|
54
|
-
plugins: {
|
|
55
|
-
vitest: eslintPluginVitest,
|
|
26
|
+
const config = getEslintConfigForDir(process.cwd())
|
|
27
|
+
export default config
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This function only exists, because typescript-eslint started to have an issue with auto-detecting tsconfigRootDir.
|
|
31
|
+
* If the issue is fixed - we can remove this and come back to having just a single config.
|
|
32
|
+
*/
|
|
33
|
+
export function getEslintConfigForDir(dir) {
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
...eslint.configs.recommended,
|
|
37
|
+
files: defaultFiles,
|
|
38
|
+
},
|
|
39
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-type-checked.ts
|
|
40
|
+
...tseslint.configs.recommendedTypeChecked.map(c => ({
|
|
41
|
+
...c,
|
|
42
|
+
files: defaultFiles,
|
|
43
|
+
})),
|
|
44
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic-type-checked.ts
|
|
45
|
+
...tseslint.configs.stylisticTypeChecked.map(c => ({
|
|
46
|
+
...c,
|
|
47
|
+
files: defaultFiles,
|
|
48
|
+
})),
|
|
49
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/configs/recommended.js
|
|
50
|
+
{
|
|
51
|
+
...eslintPluginUnicorn.configs.recommended,
|
|
52
|
+
files: defaultFiles,
|
|
56
53
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
// https://eslint.vuejs.org/user-guide/#user-guide
|
|
55
|
+
// ...require('eslint-plugin-vue').configs['flat/recommended'],
|
|
56
|
+
...eslintPluginVue.configs['flat/recommended'].map(c => ({
|
|
57
|
+
...c,
|
|
58
|
+
files: defaultFiles,
|
|
59
|
+
})),
|
|
60
|
+
{
|
|
61
|
+
files: testFiles,
|
|
62
|
+
plugins: {
|
|
63
|
+
vitest: eslintPluginVitest,
|
|
64
|
+
},
|
|
65
|
+
settings: {
|
|
66
|
+
vitest: {
|
|
67
|
+
typecheck: true,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
rules: {
|
|
71
|
+
...eslintPluginVitest.configs.recommended.rules,
|
|
72
|
+
...eslintVitestRules.rules,
|
|
60
73
|
},
|
|
61
74
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
...
|
|
75
|
+
{
|
|
76
|
+
files: defaultFiles,
|
|
77
|
+
...getConfig(dir),
|
|
65
78
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
ignores: ['**/__exclude/**', '**/*.scss', '**/*.js'],
|
|
73
|
-
},
|
|
74
|
-
].filter(Boolean)
|
|
79
|
+
{
|
|
80
|
+
ignores: ['**/__exclude/**', '**/*.scss', '**/*.js'],
|
|
81
|
+
},
|
|
82
|
+
].filter(Boolean)
|
|
83
|
+
}
|
|
75
84
|
|
|
76
|
-
function getConfig() {
|
|
85
|
+
function getConfig(dir) {
|
|
77
86
|
return {
|
|
78
87
|
plugins: {
|
|
79
88
|
'@typescript-eslint': tseslint.plugin,
|
|
@@ -88,13 +97,13 @@ function getConfig() {
|
|
|
88
97
|
globals: {
|
|
89
98
|
...globals.browser,
|
|
90
99
|
...globals.node,
|
|
91
|
-
// ...globals.jest,
|
|
92
100
|
...globals.vitest,
|
|
93
101
|
NodeJS: 'readonly',
|
|
94
102
|
},
|
|
95
103
|
// parser: tseslint.parser,
|
|
96
104
|
parserOptions: {
|
|
97
|
-
project:
|
|
105
|
+
project: `${dir}/tsconfig.json`,
|
|
106
|
+
// tsconfigRootDir: cwd,
|
|
98
107
|
parser: tseslint.parser,
|
|
99
108
|
extraFileExtensions: ['.vue', '.html'],
|
|
100
109
|
},
|
package/cfg/tsconfig.e2e.json
CHANGED
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
"module": "esnext",
|
|
15
15
|
"moduleResolution": "bundler",
|
|
16
16
|
"lib": ["esnext", "dom", "dom.iterable"]
|
|
17
|
+
// copy-paste the paths below,
|
|
18
|
+
// it's needed, because playwright doesn't support ${configDir} properly
|
|
19
|
+
// "baseUrl": ".",
|
|
20
|
+
// "paths": {
|
|
21
|
+
// "@src/*": ["../src/*"],
|
|
22
|
+
// },
|
|
17
23
|
},
|
|
18
24
|
"exclude": ["**/__exclude"]
|
|
19
25
|
}
|