weboptimizer 2.0.1462 → 2.0.1464
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 +107 -0
- package/package.json +25 -27
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import google from 'eslint-config-google';
|
|
3
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
|
+
import js from '@eslint/js';
|
|
5
|
+
import typescript from 'typescript-eslint';
|
|
6
|
+
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
|
|
7
|
+
import typescriptParser from '@typescript-eslint/parser';
|
|
8
|
+
|
|
9
|
+
// Remove unsported rules.
|
|
10
|
+
const unsuportedRules = ['require-jsdoc', 'valid-jsdoc'];
|
|
11
|
+
const googleRules = Object.keys(google.rules).filter(key => !unsuportedRules.includes(key)).reduce((object, key) => ({
|
|
12
|
+
...object,
|
|
13
|
+
[key]: google.rules[key]
|
|
14
|
+
}), {});
|
|
15
|
+
export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc.configs['flat/recommended'], {
|
|
16
|
+
languageOptions: {
|
|
17
|
+
ecmaVersion: 'latest',
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.browser,
|
|
20
|
+
...globals.node,
|
|
21
|
+
...globals.jest
|
|
22
|
+
},
|
|
23
|
+
parser: typescriptParser,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true
|
|
27
|
+
},
|
|
28
|
+
impliedStrict: true,
|
|
29
|
+
project: './tsconfig.json'
|
|
30
|
+
},
|
|
31
|
+
sourceType: 'module'
|
|
32
|
+
},
|
|
33
|
+
ignores: ['**/exclude/*', '*.compiled.*', '*.d.ts', '**/*.d.ts', '*.js', '**/*.js'],
|
|
34
|
+
plugins: {
|
|
35
|
+
jsdoc,
|
|
36
|
+
'@typescript-eslint': typescriptPlugin
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
...googleRules,
|
|
40
|
+
...typescriptPlugin.configs.recommended.rules,
|
|
41
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
42
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
43
|
+
'@typescript-eslint/no-this-alias': ['error', {
|
|
44
|
+
allowedNames: ['self']
|
|
45
|
+
}],
|
|
46
|
+
'@typescript-eslint/no-unused-vars': ['error', {
|
|
47
|
+
argsIgnorePattern: '^_',
|
|
48
|
+
varsIgnorePattern: '^_'
|
|
49
|
+
}],
|
|
50
|
+
'@typescript-eslint/type-annotation-spacing': ['error', {
|
|
51
|
+
after: false,
|
|
52
|
+
before: false,
|
|
53
|
+
overrides: {
|
|
54
|
+
arrow: {
|
|
55
|
+
after: true,
|
|
56
|
+
before: true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}],
|
|
60
|
+
'jsdoc/check-param-names': 'error',
|
|
61
|
+
'jsdoc/check-tag-names': 'error',
|
|
62
|
+
'jsdoc/require-description-complete-sentence': 'error',
|
|
63
|
+
'jsdoc/require-hyphen-before-param-description': 'error',
|
|
64
|
+
'jsdoc/require-param': 'error',
|
|
65
|
+
'jsdoc/require-param-description': 'error',
|
|
66
|
+
'jsdoc/require-param-type': 'off',
|
|
67
|
+
'jsdoc/require-returns-description': 'error',
|
|
68
|
+
'jsdoc/require-returns-type': 'off',
|
|
69
|
+
'jsdoc/tag-lines': ['error', 'never'],
|
|
70
|
+
'arrow-parens': ['error', 'always'],
|
|
71
|
+
'block-scoped-var': 'off',
|
|
72
|
+
camelcase: ['error', {
|
|
73
|
+
properties: 'always'
|
|
74
|
+
}],
|
|
75
|
+
'comma-dangle': ['error', 'never'],
|
|
76
|
+
curly: ['error', 'multi'],
|
|
77
|
+
indent: ['error', 4, {
|
|
78
|
+
ignoreComments: true
|
|
79
|
+
}],
|
|
80
|
+
'max-nested-callbacks': ['error', 10],
|
|
81
|
+
'new-cap': 'off',
|
|
82
|
+
'no-invalid-this': 'off',
|
|
83
|
+
'no-unused-vars': ['off', {
|
|
84
|
+
argsIgnorePattern: '^_',
|
|
85
|
+
varsIgnorePattern: '^_'
|
|
86
|
+
}],
|
|
87
|
+
'no-constant-condition': 'off',
|
|
88
|
+
'no-new-func': 'off',
|
|
89
|
+
'no-new-wrappers': 'off',
|
|
90
|
+
'quote-props': ['error', 'as-needed', {
|
|
91
|
+
numbers: true
|
|
92
|
+
}],
|
|
93
|
+
semi: ['error', 'never'],
|
|
94
|
+
'space-before-function-paren': ['error', {
|
|
95
|
+
anonymous: 'never',
|
|
96
|
+
asyncArrow: 'always',
|
|
97
|
+
named: 'never'
|
|
98
|
+
}],
|
|
99
|
+
'spaced-comment': ['error', 'always', {
|
|
100
|
+
line: {
|
|
101
|
+
exceptions: ['/usr/bin/env node']
|
|
102
|
+
},
|
|
103
|
+
markers: ['/', '//', '///']
|
|
104
|
+
}],
|
|
105
|
+
'space-infix-ops': 'off'
|
|
106
|
+
}
|
|
107
|
+
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1464",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ejsLoader.d.ts",
|
|
34
34
|
"ejsLoader.js",
|
|
35
35
|
"eslint.config.d.ts",
|
|
36
|
-
"eslint.config.
|
|
36
|
+
"eslint.config.mjs",
|
|
37
37
|
"helper.d.ts",
|
|
38
38
|
"helper.js",
|
|
39
39
|
"index.d.ts",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"url": "https://github.com/thaibault/weboptimizer.git"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"build": "yarn build:types; yarn build:plain",
|
|
68
|
-
"build:lint": "babel --extensions '.ts' --plugins @babel/plugin-syntax-top-level-await,babel-plugin-transform-modern-regexp --presets
|
|
67
|
+
"build": "yarn build:types; yarn build:lint; yarn build:plain",
|
|
68
|
+
"build:lint": " babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,babel-plugin-transform-modern-regexp --presets @babel/preset-typescript --out-file eslint.config.mjs eslint.config.ts",
|
|
69
69
|
"build:plain": "command=\"babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime,babel-plugin-transform-modern-regexp --presets @babel/preset-env,@babel/preset-typescript --out-file\" && $command browser.js browser.ts && $command configurator.js configurator.ts && $command ejsLoader.js ejsLoader.ts && $command helper.js helper.ts && $command index.js index.ts && $command jestEnvironmentBrowser.js jestEnvironmentBrowser.ts && $command jestSetup.js jestSetup.ts && $command plugins/HTMLTransformation.js plugins/HTMLTransformation.ts && $command plugins/InPlaceAssetsIntoHTML.js plugins/InPlaceAssetsIntoHTML.ts && $command stylelintConfigurator.js stylelintConfigurator.ts && $command type.js type.ts && $command webpackConfigurator.js webpackConfigurator.ts && shx chmod +x index.js && shx sed -i 's/(#!\\\\/usr\\\\/bin\\\\/env )babel-(node)/$1$2/' index.js 1>/dev/null",
|
|
70
|
-
"build:test": " yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
71
|
-
"build:test:source-map": "yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-maps inline --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
70
|
+
"build:test": " yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.mjs *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
71
|
+
"build:test:source-map": "yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-maps inline --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.mjs *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
72
72
|
"build:types": "tsc --declaration --emitDeclarationOnly",
|
|
73
73
|
"check": "yarn check:types; yarn lint",
|
|
74
74
|
"check:types": "tsc --noEmit",
|
|
75
|
-
"clear": "rimraf --glob apiDocumentation browser.d.ts configurator.d.ts ejsLoader.d.ts eslint.config.d.ts helper.d.ts index.d.ts jestSetup.d.ts jestEnvironmentBrowser.d.ts 'plugins/*.d.ts' 'plugins/*.js' stylelintConfigurator.d.ts 'test/*.js' 'test/*.compiled.*' 'test/*.d.ts' 'test/**/.yarn' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.
|
|
75
|
+
"clear": "rimraf --glob apiDocumentation browser.d.ts configurator.d.ts ejsLoader.d.ts eslint.config.d.ts helper.d.ts index.d.ts jestSetup.d.ts jestEnvironmentBrowser.d.ts 'plugins/*.d.ts' 'plugins/*.js' stylelintConfigurator.d.ts 'test/*.js' 'test/*.compiled.*' 'test/*.d.ts' 'test/**/.yarn' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.compiled.*' '*.compiled' '*.html' '*.js' '*.log' '*.mjs' node_modules/weboptimizer .coverage .nyc_output",
|
|
76
76
|
"document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation *.js",
|
|
77
77
|
"lint": "yarn build:lint && yarn lint:base",
|
|
78
78
|
"lint:base": "eslint *.ts */*.ts test/*/*.ts",
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
},
|
|
89
89
|
"runkitExample": "require('@babel/runtime/package.json')\n\nconst {default: main} = require('weboptimizer')\n\nawait main('./', './', ['clear'])",
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@babel/core": "^7.24.
|
|
91
|
+
"@babel/core": "^7.24.7",
|
|
92
92
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
93
|
-
"@babel/plugin-proposal-decorators": "^7.24.
|
|
93
|
+
"@babel/plugin-proposal-decorators": "^7.24.7",
|
|
94
94
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
95
|
-
"@babel/plugin-transform-runtime": "^7.24.
|
|
96
|
-
"@babel/preset-env": "^7.24.
|
|
97
|
-
"@babel/preset-typescript": "^7.24.
|
|
98
|
-
"@babel/runtime": "^7.24.
|
|
95
|
+
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
96
|
+
"@babel/preset-env": "^7.24.7",
|
|
97
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
98
|
+
"@babel/runtime": "^7.24.7",
|
|
99
99
|
"babel-loader": "^9.1.3",
|
|
100
100
|
"babel-plugin-transform-modern-regexp": "^0.0.6",
|
|
101
101
|
"babel-preset-minify": "^0.5.2",
|
|
@@ -117,30 +117,30 @@
|
|
|
117
117
|
"webpack-sources": "^3.2.3"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@babel/cli": "^7.24.
|
|
121
|
-
"@babel/eslint-parser": "^7.24.
|
|
120
|
+
"@babel/cli": "^7.24.7",
|
|
121
|
+
"@babel/eslint-parser": "^7.24.7",
|
|
122
122
|
"@types/ejs": "^3.1.5",
|
|
123
123
|
"@types/eslint": "^8.56.10",
|
|
124
124
|
"@types/html-minifier": "^4.0.5",
|
|
125
125
|
"@types/html-minifier-terser": "^7.0.2",
|
|
126
|
-
"@types/imagemin": "^
|
|
127
|
-
"@types/node": "^20.
|
|
126
|
+
"@types/imagemin": "^9.0.0",
|
|
127
|
+
"@types/node": "^20.14.2",
|
|
128
128
|
"@types/postcss-import": "^14.0.3",
|
|
129
129
|
"@types/postcss-url": "^10.0.4",
|
|
130
130
|
"@types/webpack-env": "^1.18.5",
|
|
131
131
|
"@types/webpack-sources": "^3.2.3",
|
|
132
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
133
|
-
"@typescript-eslint/parser": "^7.
|
|
132
|
+
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
|
133
|
+
"@typescript-eslint/parser": "^7.12.0",
|
|
134
134
|
"css-loader": "^7.1.2",
|
|
135
|
-
"cssnano": "^7.0.
|
|
135
|
+
"cssnano": "^7.0.2",
|
|
136
136
|
"documentation-website": "^1.0.326",
|
|
137
|
-
"eslint": "^9.
|
|
137
|
+
"eslint": "^9.4.0",
|
|
138
138
|
"eslint-config-google": "^0.14.0",
|
|
139
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
139
|
+
"eslint-plugin-jsdoc": "^48.2.8",
|
|
140
140
|
"favicons": "^7.2.0",
|
|
141
141
|
"favicons-webpack-plugin": "^6.0.1",
|
|
142
142
|
"globals": "^15.3.0",
|
|
143
|
-
"image-minimizer-webpack-plugin": "^4.0.
|
|
143
|
+
"image-minimizer-webpack-plugin": "^4.0.2",
|
|
144
144
|
"jest": "^29.7.0",
|
|
145
145
|
"jsdoc": "^4.0.3",
|
|
146
146
|
"mini-css-extract-plugin": "^2.9.0",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"stylelint": "^16.6.1",
|
|
159
159
|
"stylelint-config-standard": "^36.0.0",
|
|
160
160
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
161
|
-
"typescript-eslint": "^7.
|
|
161
|
+
"typescript-eslint": "^7.12.0",
|
|
162
162
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
163
163
|
"workbox-webpack-plugin": "^7.1.0"
|
|
164
164
|
},
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
"arguments": [
|
|
465
465
|
"--config",
|
|
466
466
|
{
|
|
467
|
-
"__evaluate__": "`'${webOptimizerPath}/eslint.config.
|
|
467
|
+
"__evaluate__": "`'${webOptimizerPath}/eslint.config.mjs'`"
|
|
468
468
|
},
|
|
469
469
|
"--ignore-pattern",
|
|
470
470
|
{
|
|
@@ -497,8 +497,6 @@
|
|
|
497
497
|
{
|
|
498
498
|
"__evaluate__": "Tools.isFileSync(path.resolve(currentPath, 'tsconfig.json')) ? '--parser-options=project:tsconfig.json' : ''"
|
|
499
499
|
},
|
|
500
|
-
"--resolve-plugins-relative-to",
|
|
501
|
-
".",
|
|
502
500
|
"'**/*.{jsx,ts,tsx}'"
|
|
503
501
|
],
|
|
504
502
|
"command": "eslint",
|