weboptimizer 2.0.1466 → 2.0.1468

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 CHANGED
@@ -1,17 +1,32 @@
1
- import globals from 'globals';
1
+ import clientnode from 'clientnode';
2
2
  import google from 'eslint-config-google';
3
3
  import jsdoc from 'eslint-plugin-jsdoc';
4
- import js from '@eslint/js';
4
+ import { readFile } from 'fs/promises';
5
+ import globals from 'globals';
6
+ import { resolve } from 'path';
7
+ import { cwd } from 'process';
5
8
  import typescript from 'typescript-eslint';
9
+ import js from '@eslint/js';
6
10
  import typescriptPlugin from '@typescript-eslint/eslint-plugin';
7
11
  import typescriptParser from '@typescript-eslint/parser';
8
12
 
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ const Tools = clientnode.Tools;
15
+
9
16
  // Remove unsupported rules.
10
17
  const unsuportedRules = ['require-jsdoc', 'valid-jsdoc'];
11
18
  const googleRules = Object.keys(google.rules).filter(key => !unsuportedRules.includes(key)).reduce((object, key) => ({
12
19
  ...object,
13
20
  [key]: google.rules[key]
14
21
  }), {});
22
+ const isLibrary = JSON.parse(await readFile(resolve(cwd(), './package.json'), {
23
+ encoding: 'utf-8'
24
+ })).default?.webOptimizer?.library ?? false;
25
+ let tsConfigFilePath = '';
26
+ for (const filePath of ['./tsconfig.json', './node_modules/weboptimizer/tsconfig.' + `${isLibrary ? 'library' : 'application'}.json`]) if (await Tools.isFile(filePath)) {
27
+ tsConfigFilePath = filePath;
28
+ break;
29
+ }
15
30
  export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc.configs['flat/recommended'], {
16
31
  languageOptions: {
17
32
  ecmaVersion: 'latest',
@@ -26,14 +41,13 @@ export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc
26
41
  jsx: true
27
42
  },
28
43
  impliedStrict: true,
29
- project: './tsconfig.json'
44
+ project: tsConfigFilePath
30
45
  },
31
46
  sourceType: 'module'
32
47
  },
33
48
  ignores: ['**/exclude/*', '*.compiled.*', '*.d.ts', '**/*.d.ts', '*.js', '**/*.js'],
34
49
  plugins: {
35
- jsdoc,
36
- '@typescript-eslint': typescriptPlugin
50
+ jsdoc
37
51
  },
38
52
  rules: {
39
53
  ...googleRules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1466",
3
+ "version": "2.0.1468",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
package/tsconfig.json CHANGED
@@ -7,6 +7,7 @@
7
7
  "checkJs": true,
8
8
  "esModuleInterop": true,
9
9
  "experimentalDecorators": true,
10
+ "forceConsistentCasingInFileNames": true,
10
11
  "isolatedModules": true,
11
12
  "jsx": "react-jsx",
12
13
  "lib": ["DOM", "ESNext"],