Skip to content

Commit 3c658df

Browse files
authored
Update JS dependencies (#19675)
* Update JS dependencies - Update all JS dependencies minus vue and vue-loader - Adapt to jest 28 - Add new eslint rules - Tested Mermaid and Swagger-UI * switch to @happy-dom/jest-environment for faster tests * bump eslint env to es2022
1 parent 9d0253a commit 3c658df

9 files changed

+3031
-2189
lines changed

.eslintrc

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extends:
1818
- plugin:vue/recommended
1919

2020
env:
21-
es2021: true
21+
es2022: true
2222
node: true
2323

2424
globals:
@@ -174,6 +174,7 @@ rules:
174174
no-confusing-arrow: [0]
175175
no-console: [1, {allow: [info, warn, error]}]
176176
no-const-assign: [2]
177+
no-constant-binary-expression: [2]
177178
no-constant-condition: [0]
178179
no-constructor-return: [2]
179180
no-continue: [0]
@@ -384,12 +385,14 @@ rules:
384385
unicorn/no-thenable: [2]
385386
unicorn/no-this-assignment: [2]
386387
unicorn/no-unreadable-array-destructuring: [0]
388+
unicorn/no-unreadable-iife: [2]
387389
unicorn/no-unsafe-regex: [0]
388390
unicorn/no-unused-properties: [2]
389391
unicorn/no-useless-fallback-in-spread: [2]
390392
unicorn/no-useless-length-check: [2]
391393
unicorn/no-useless-promise-resolve-reject: [2]
392394
unicorn/no-useless-spread: [2]
395+
unicorn/no-useless-switch-case: [2]
393396
unicorn/no-useless-undefined: [0]
394397
unicorn/no-zero-fractions: [2]
395398
unicorn/number-literal-case: [0]
@@ -411,7 +414,9 @@ rules:
411414
unicorn/prefer-json-parse-buffer: [0]
412415
unicorn/prefer-math-trunc: [2]
413416
unicorn/prefer-modern-dom-apis: [0]
417+
unicorn/prefer-modern-math-apis: [2]
414418
unicorn/prefer-module: [2]
419+
unicorn/prefer-native-coercion-functions: [2]
415420
unicorn/prefer-negative-index: [2]
416421
unicorn/prefer-node-append: [0]
417422
unicorn/prefer-node-protocol: [0]

jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export default {
22
rootDir: 'web_src',
33
setupFilesAfterEnv: ['jest-extended/all'],
4-
testEnvironment: 'jsdom',
4+
testEnvironment: '@happy-dom/jest-environment',
55
testMatch: ['<rootDir>/**/*.test.js'],
66
testTimeout: 20000,
77
transform: {
8-
'\\.svg$': 'jest-raw-loader',
8+
'\\.svg$': '<rootDir>/js/testUtils/jestRawLoader.js',
99
},
1010
verbose: false,
1111
};

0 commit comments

Comments
 (0)