@naturalcycles/dev-lib 20.0.3 → 20.0.4
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 +10 -6
- package/dist/lint.util.js +1 -2
- package/package.json +1 -1
package/cfg/eslint.config.js
CHANGED
|
@@ -28,6 +28,10 @@ const e2eFiles = ['e2e/**/*.ts', 'e2e/**/*.tsx', 'e2e/**/*.cts', 'e2e/**/*.mts']
|
|
|
28
28
|
const testFiles = ['**/*.test.ts', '**/*.test.tsx', '**/*.test.cts', '**/*.test.mts']
|
|
29
29
|
|
|
30
30
|
const cwd = process.cwd()
|
|
31
|
+
const tsconfigSrcPath = `${cwd}/tsconfig.json`
|
|
32
|
+
const tsconfigScriptsPath = `${cwd}/tsconfig.scripts.json`
|
|
33
|
+
const tsconfigE2ePath = `${cwd}/tsconfig.e2e.json`
|
|
34
|
+
|
|
31
35
|
const config = getEslintConfigForDir()
|
|
32
36
|
export default config
|
|
33
37
|
|
|
@@ -76,17 +80,17 @@ function getEslintConfigForDir() {
|
|
|
76
80
|
...eslintVitestRules.rules,
|
|
77
81
|
},
|
|
78
82
|
},
|
|
79
|
-
{
|
|
83
|
+
fs.existsSync(tsconfigSrcPath) && {
|
|
80
84
|
files: srcFiles,
|
|
81
|
-
...getConfig(
|
|
85
|
+
...getConfig(tsconfigSrcPath),
|
|
82
86
|
},
|
|
83
|
-
{
|
|
87
|
+
fs.existsSync(tsconfigScriptsPath) && {
|
|
84
88
|
files: scriptsFiles,
|
|
85
|
-
...getConfig(
|
|
89
|
+
...getConfig(tsconfigScriptsPath),
|
|
86
90
|
},
|
|
87
|
-
{
|
|
91
|
+
fs.existsSync(tsconfigE2ePath) && {
|
|
88
92
|
files: e2eFiles,
|
|
89
|
-
...getConfig(
|
|
93
|
+
...getConfig(tsconfigE2ePath),
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
96
|
ignores: ['**/__exclude/**', '**/*.scss', '**/*.js'],
|
package/dist/lint.util.js
CHANGED
|
@@ -98,8 +98,7 @@ export async function eslintAll(opt) {
|
|
|
98
98
|
}
|
|
99
99
|
async function runESLint(extensions = eslintExtensions.split(','), fix = true) {
|
|
100
100
|
const eslintConfigPath = `eslint.config.js`;
|
|
101
|
-
|
|
102
|
-
if (!existsSync(eslintConfigPath) || !existsSync(tsconfigPath)) {
|
|
101
|
+
if (!existsSync(eslintConfigPath)) {
|
|
103
102
|
// faster to bail-out like this
|
|
104
103
|
return;
|
|
105
104
|
}
|