@pushwoosh/frontend-builder-engine 4.3.1 → 5.0.0
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/lib/eslint.config.mjs +23 -14
- package/package.json +7 -7
package/lib/eslint.config.mjs
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
3
|
import eslint from '@eslint/js';
|
|
4
|
+
import eslintReact from '@eslint-react/eslint-plugin';
|
|
4
5
|
import stylistic from '@stylistic/eslint-plugin';
|
|
5
|
-
import
|
|
6
|
-
import reactPlugin from 'eslint-plugin-react';
|
|
6
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
7
7
|
import hooksPlugin from 'eslint-plugin-react-hooks';
|
|
8
8
|
import tseslint from 'typescript-eslint';
|
|
9
9
|
|
|
10
|
+
// Keeps the `import/` and `react/` rule prefixes so eslint-disable comments in consumers survive the plugin swap.
|
|
11
|
+
/** @type {(config: import('eslint').Linter.Config, from: string, to: string) => import('eslint').Linter.Config} */
|
|
12
|
+
const renamePlugin = (config, from, to) => ({
|
|
13
|
+
...config,
|
|
14
|
+
plugins: { [to]: config.plugins?.[from] ?? {} },
|
|
15
|
+
rules: Object.fromEntries(Object.entries(config.rules ?? {}).map(([rule, level]) => [rule.replace(`${from}/`, `${to}/`), level])),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// eslint-plugin-react-hooks stays the source of truth for hooks and React Compiler rules.
|
|
19
|
+
const reactRecommended = eslintReact.configs['recommended-typescript'];
|
|
20
|
+
const reactConfig = renamePlugin({
|
|
21
|
+
...reactRecommended,
|
|
22
|
+
rules: Object.fromEntries(Object.entries(reactRecommended.rules ?? {}).filter(([rule]) => !(rule.replace('@eslint-react/', '') in hooksPlugin.rules))),
|
|
23
|
+
}, '@eslint-react', 'react');
|
|
24
|
+
|
|
10
25
|
export default tseslint.config(
|
|
11
26
|
eslint.configs.recommended,
|
|
12
|
-
|
|
27
|
+
renamePlugin(importX.flatConfigs.recommended, 'import-x', 'import'),
|
|
13
28
|
...tseslint.configs.recommended,
|
|
14
29
|
stylistic.configs.customize({
|
|
15
30
|
indent: 2,
|
|
@@ -22,28 +37,22 @@ export default tseslint.config(
|
|
|
22
37
|
commaDangle: 'always-multiline',
|
|
23
38
|
arrowParens: 'always',
|
|
24
39
|
}),
|
|
25
|
-
|
|
26
|
-
reactPlugin.configs.flat['jsx-runtime'],
|
|
40
|
+
reactConfig,
|
|
27
41
|
{
|
|
28
42
|
plugins: {
|
|
29
43
|
'@stylistic': stylistic,
|
|
30
44
|
'react-hooks': hooksPlugin,
|
|
31
45
|
},
|
|
32
|
-
settings: {
|
|
33
|
-
react: {
|
|
34
|
-
version: 'detect',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
46
|
rules: {
|
|
38
47
|
...hooksPlugin.configs.recommended.rules,
|
|
39
48
|
'react-hooks/incompatible-library': 'error',
|
|
40
|
-
'react/display-name': 'off',
|
|
41
49
|
'react/no-array-index-key': 'error',
|
|
42
|
-
'react/
|
|
50
|
+
'react/dom-no-unknown-property': 'error',
|
|
51
|
+
'react/dom-no-unsafe-target-blank': 'error',
|
|
52
|
+
'@stylistic/jsx-max-props-per-line': [
|
|
43
53
|
'error',
|
|
44
54
|
{
|
|
45
|
-
|
|
46
|
-
maximum: 3,
|
|
55
|
+
maximum: { single: 3, multi: 1 },
|
|
47
56
|
},
|
|
48
57
|
],
|
|
49
58
|
'max-len': [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pushwoosh/frontend-builder-engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Pushwoosh frontend builder engine",
|
|
5
5
|
"main": "./lib/pushwoosh-frontend-builder-engine.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"@babel/preset-typescript": "^7.24.1",
|
|
28
28
|
"@babel/runtime": "^7.29.7",
|
|
29
29
|
"@babel/types": "^7.24.0",
|
|
30
|
-
"@eslint/
|
|
30
|
+
"@eslint-react/eslint-plugin": "^5.28.8",
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
31
32
|
"@stylistic/eslint-plugin": "^5.3.1",
|
|
32
33
|
"@svgr/webpack": "^8.1.0",
|
|
33
34
|
"@swc/core": "1.16.18",
|
|
@@ -40,10 +41,9 @@
|
|
|
40
41
|
"commander": "^12.0.0",
|
|
41
42
|
"css-loader": "^7.1.2",
|
|
42
43
|
"dotenv": "^16.4.5",
|
|
43
|
-
"eslint": "^
|
|
44
|
-
"eslint-plugin-import": "^
|
|
45
|
-
"eslint-plugin-react": "^7.
|
|
46
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
44
|
+
"eslint": "^10.14.0",
|
|
45
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
46
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
47
47
|
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
48
48
|
"html-webpack-plugin": "^5.6.0",
|
|
49
49
|
"knip": "^6.35.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"ts-loader": "^9.5.1",
|
|
53
53
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
54
54
|
"typescript": "^6.0.3",
|
|
55
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"typescript-eslint": "^8.72.1",
|
|
56
56
|
"webpack": "^5.94.0",
|
|
57
57
|
"webpack-bundle-analyzer": "^5.1.1",
|
|
58
58
|
"webpack-cli": "^6.0.1",
|