@pushwoosh/frontend-builder-engine 4.3.1 → 5.1.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.
@@ -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 importPlugin from 'eslint-plugin-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
- importPlugin.flatConfigs.recommended,
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
- reactPlugin.configs.flat.recommended,
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/jsx-max-props-per-line': [
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
- when: 'always',
46
- maximum: 3,
55
+ maximum: { single: 3, multi: 1 },
47
56
  },
48
57
  ],
49
58
  'max-len': [
@@ -82,7 +82,8 @@ program
82
82
  .description('Playground command')
83
83
  .action(async () => {
84
84
  const cmd = [
85
- bin('webpack-dev-server'),
85
+ bin('webpack-cli'),
86
+ 'serve',
86
87
  '--config',
87
88
  engineFile('webpack.playground.config.js'),
88
89
  '--stats-error-details',
@@ -7,7 +7,7 @@ const { loadPushwooshConfig } = require('./helpers');
7
7
 
8
8
  function getConfig() {
9
9
  const projectPath = process.cwd();
10
- const { parsed = {} } = dotenv.config();
10
+ const { parsed = {} } = dotenv.config({ quiet: true });
11
11
  const pushwooshConfig = loadPushwooshConfig();
12
12
  const config = {
13
13
  target: 'web',
@@ -3,7 +3,7 @@ const dotenv = require('dotenv');
3
3
  function loadVariables(loadLocal) {
4
4
  let variables = process.env;
5
5
  if (loadLocal) {
6
- const { error, parsed } = dotenv.config();
6
+ const { error, parsed } = dotenv.config({ quiet: true });
7
7
  if (error) {
8
8
  throw error;
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/frontend-builder-engine",
3
- "version": "4.3.1",
3
+ "version": "5.1.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/js": "^9.13.0",
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",
@@ -37,13 +38,12 @@
37
38
  "babel-plugin-react-compiler": "^1.0.0",
38
39
  "babel-plugin-styled-components": "^2.1.4",
39
40
  "babel-plugin-transform-imports": "^2.0.0",
40
- "commander": "^12.0.0",
41
+ "commander": "^15.0.0",
41
42
  "css-loader": "^7.1.2",
42
- "dotenv": "^16.4.5",
43
- "eslint": "^9.13.0",
44
- "eslint-plugin-import": "^2.31.0",
45
- "eslint-plugin-react": "^7.37.2",
46
- "eslint-plugin-react-hooks": "^7.0.1",
43
+ "dotenv": "^18.0.9",
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,11 +52,11 @@
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.65.0",
55
+ "typescript-eslint": "^8.72.1",
56
56
  "webpack": "^5.94.0",
57
57
  "webpack-bundle-analyzer": "^5.1.1",
58
- "webpack-cli": "^6.0.1",
59
- "webpack-dev-server": "^5.0.4",
58
+ "webpack-cli": "^7.3.1",
59
+ "webpack-dev-server": "^6.1.0",
60
60
  "webpack-merge": "^6.0.1"
61
61
  },
62
62
  "peerDependencies": {