weboptimizer 2.0.1466 → 2.0.1467
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/eslint.config.mjs +12 -4
- package/package.json +1 -1
package/eslint.config.mjs
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import clientnode from 'clientnode';
|
|
2
2
|
import google from 'eslint-config-google';
|
|
3
3
|
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
|
+
import globals from 'globals';
|
|
4
5
|
import js from '@eslint/js';
|
|
5
6
|
import typescript from 'typescript-eslint';
|
|
6
7
|
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
|
|
7
8
|
import typescriptParser from '@typescript-eslint/parser';
|
|
9
|
+
const {
|
|
10
|
+
Tools
|
|
11
|
+
} = clientnode;
|
|
8
12
|
|
|
9
13
|
// Remove unsupported rules.
|
|
10
14
|
const unsuportedRules = ['require-jsdoc', 'valid-jsdoc'];
|
|
@@ -12,6 +16,11 @@ const googleRules = Object.keys(google.rules).filter(key => !unsuportedRules.inc
|
|
|
12
16
|
...object,
|
|
13
17
|
[key]: google.rules[key]
|
|
14
18
|
}), {});
|
|
19
|
+
let tsConfigFilePath = '';
|
|
20
|
+
for (const filePath of ['./tsconfig.json', './node_modules/weboptimizer/tsconfig.json']) if (Tools.isFileSync(filePath)) {
|
|
21
|
+
tsConfigFilePath = filePath;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
15
24
|
export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc.configs['flat/recommended'], {
|
|
16
25
|
languageOptions: {
|
|
17
26
|
ecmaVersion: 'latest',
|
|
@@ -26,14 +35,13 @@ export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc
|
|
|
26
35
|
jsx: true
|
|
27
36
|
},
|
|
28
37
|
impliedStrict: true,
|
|
29
|
-
project:
|
|
38
|
+
project: tsConfigFilePath
|
|
30
39
|
},
|
|
31
40
|
sourceType: 'module'
|
|
32
41
|
},
|
|
33
42
|
ignores: ['**/exclude/*', '*.compiled.*', '*.d.ts', '**/*.d.ts', '*.js', '**/*.js'],
|
|
34
43
|
plugins: {
|
|
35
|
-
jsdoc
|
|
36
|
-
'@typescript-eslint': typescriptPlugin
|
|
44
|
+
jsdoc
|
|
37
45
|
},
|
|
38
46
|
rules: {
|
|
39
47
|
...googleRules,
|