diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-30 10:55:59 -0600 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2023-07-30 23:57:51 +0000 |
commit | 080d8b05297f3f5afcf33354a40a5201697b1df5 (patch) | |
tree | 35180bd3cb9fcd137feca3fe169032cbbb469463 | |
parent | refactor: various improvements (#1296) (diff) | |
download | ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.tar.gz ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.tar.zst ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.zip |
refactor: more lint improvements
- set parserOptions.ecmaVersion to latest and env to es2024 in eslint config
- install missing types libraries
- install eslint-plugin-sonar
- enable eslint-plugin-sonar recommended rules and declare jsx-runtime for react in eslint config
- clean up disabled lint rules which don't inflict problems anymore
- disable various lint issues and fix others
50 files changed, 308 insertions, 98 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index ef8af48c8..94dcbf8e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js | |||
@@ -5,15 +5,17 @@ module.exports = { | |||
5 | ecmaFeatures: { | 5 | ecmaFeatures: { |
6 | jsx: true, | 6 | jsx: true, |
7 | }, | 7 | }, |
8 | ecmaVersion: 2018, | 8 | ecmaVersion: 'latest', |
9 | sourceType: 'module', | 9 | sourceType: 'module', |
10 | project: './tsconfig.json', | 10 | project: './tsconfig.json', |
11 | }, | 11 | }, |
12 | ignorePatterns: ['node_modules', 'build', 'recipes'], | 12 | ignorePatterns: ['node_modules', 'build', 'recipes'], |
13 | extends: [ | 13 | extends: [ |
14 | 'airbnb', | 14 | 'airbnb', |
15 | 'plugin:react/jsx-runtime', | ||
15 | 'plugin:jest/recommended', | 16 | 'plugin:jest/recommended', |
16 | 'plugin:unicorn/recommended', | 17 | 'plugin:unicorn/recommended', |
18 | 'plugin:sonar/recommended', | ||
17 | 'plugin:prettier/recommended', | 19 | 'plugin:prettier/recommended', |
18 | ], | 20 | ], |
19 | plugins: ['jest'], | 21 | plugins: ['jest'], |
@@ -28,7 +30,7 @@ module.exports = { | |||
28 | }, | 30 | }, |
29 | env: { | 31 | env: { |
30 | browser: true, | 32 | browser: true, |
31 | es6: true, | 33 | es2024: true, |
32 | node: true, | 34 | node: true, |
33 | jest: true, | 35 | jest: true, |
34 | }, | 36 | }, |
@@ -66,7 +68,7 @@ module.exports = { | |||
66 | '@typescript-eslint/no-empty-interface': 0, | 68 | '@typescript-eslint/no-empty-interface': 0, |
67 | 69 | ||
68 | // eslint-plugin-import | 70 | // eslint-plugin-import |
69 | 'import/no-extraneous-dependencies': 0, // various false positives, re-enable at some point | 71 | 'import/no-extraneous-dependencies': 0, |
70 | }, | 72 | }, |
71 | }, | 73 | }, |
72 | ], | 74 | ], |
@@ -75,8 +77,6 @@ module.exports = { | |||
75 | 'array-callback-return': 1, | 77 | 'array-callback-return': 1, |
76 | 'class-methods-use-this': 0, | 78 | 'class-methods-use-this': 0, |
77 | 'consistent-return': 1, | 79 | 'consistent-return': 1, |
78 | // TODO: Turn this rule on once the js to ts conversions are over | ||
79 | // This is necessary as workaround for window.ferdium vs window['ferdium'] | ||
80 | 'no-await-in-loop': 1, | 80 | 'no-await-in-loop': 1, |
81 | 'no-return-assign': 1, | 81 | 'no-return-assign': 1, |
82 | 'no-console': [ | 82 | 'no-console': [ |
@@ -94,26 +94,20 @@ module.exports = { | |||
94 | 'import/prefer-default-export': 0, | 94 | 'import/prefer-default-export': 0, |
95 | 'import/no-unresolved': 0, | 95 | 'import/no-unresolved': 0, |
96 | 'import/no-cycle': 1, | 96 | 'import/no-cycle': 1, |
97 | 'import/no-extraneous-dependencies': 0, // various false positives, re-enable at some point | 97 | 'import/no-extraneous-dependencies': 0, |
98 | // eslint-plugin-react | 98 | // eslint-plugin-react |
99 | 'react/forbid-prop-types': 1, | 99 | 'react/forbid-prop-types': 1, |
100 | 'react/destructuring-assignment': 0, | 100 | 'react/destructuring-assignment': 0, |
101 | 'react/react-in-jsx-scope': 0, | ||
102 | 'react/jsx-filename-extension': 1, | 101 | 'react/jsx-filename-extension': 1, |
103 | 'react/jsx-one-expression-per-line': 0, | ||
104 | 'react/jsx-no-bind': 1, | 102 | 'react/jsx-no-bind': 1, |
105 | 'react/jsx-props-no-spreading': 0, | 103 | 'react/jsx-props-no-spreading': 0, |
106 | 'react/prefer-stateless-function': 1, | 104 | 'react/prefer-stateless-function': 1, |
107 | 'react/prop-types': 0, | ||
108 | 'react/static-property-placement': 0, | 105 | 'react/static-property-placement': 0, |
109 | 'react/state-in-constructor': 1, | 106 | 'react/state-in-constructor': 1, |
110 | 'react/sort-comp': 0, | 107 | 'react/sort-comp': 0, |
111 | 'react/function-component-definition': 0, | 108 | 'react/function-component-definition': 0, |
112 | 'react/jsx-no-useless-fragment': 0, | ||
113 | // TODO: [TS DEBT] should remove below config once application converted to TS | ||
114 | 'react/default-props-match-prop-types': 0, | 109 | 'react/default-props-match-prop-types': 0, |
115 | 'react/require-default-props': 0, | 110 | 'react/require-default-props': 0, |
116 | 'react/button-has-type': 0, | ||
117 | 'react/no-unused-prop-types': 1, | 111 | 'react/no-unused-prop-types': 1, |
118 | 'react/no-deprecated': 1, | 112 | 'react/no-deprecated': 1, |
119 | // eslint-plugin-jsx-a11y | 113 | // eslint-plugin-jsx-a11y |
@@ -133,10 +127,8 @@ module.exports = { | |||
133 | // eslint-plugin-unicorn | 127 | // eslint-plugin-unicorn |
134 | 'unicorn/filename-case': 0, | 128 | 'unicorn/filename-case': 0, |
135 | 'unicorn/no-null': 0, | 129 | 'unicorn/no-null': 0, |
136 | 'unicorn/no-useless-undefined': 0, | ||
137 | 'unicorn/prefer-module': 0, | 130 | 'unicorn/prefer-module': 0, |
138 | 'unicorn/prevent-abbreviations': 0, | 131 | 'unicorn/prevent-abbreviations': 0, |
139 | 'unicorn/prefer-node-protocol': 0, | ||
140 | 'unicorn/import-style': [ | 132 | 'unicorn/import-style': [ |
141 | 2, | 133 | 2, |
142 | { | 134 | { |
@@ -148,7 +140,7 @@ module.exports = { | |||
148 | }, | 140 | }, |
149 | ], | 141 | ], |
150 | 'unicorn/consistent-destructuring': 0, | 142 | 'unicorn/consistent-destructuring': 0, |
151 | // INFO: Turned off due to src/internal-server/database/factory.js | 143 | // eslint-plugin-sonar |
152 | 'unicorn/no-empty-file': 0, | 144 | 'sonar/function-name': 0, |
153 | }, | 145 | }, |
154 | }; | 146 | }; |
diff --git a/package.json b/package.json index e3e4a4f44..7bbc85a3d 100644 --- a/package.json +++ b/package.json | |||
@@ -135,10 +135,12 @@ | |||
135 | "@electron/notarize": "1.2.3", | 135 | "@electron/notarize": "1.2.3", |
136 | "@formatjs/cli": "6.1.3", | 136 | "@formatjs/cli": "6.1.3", |
137 | "@jest/types": "29.6.1", | 137 | "@jest/types": "29.6.1", |
138 | "@types/auto-launch": "5.0.2", | ||
138 | "@types/color": "3.0.3", | 139 | "@types/color": "3.0.3", |
139 | "@types/fs-extra": "11.0.1", | 140 | "@types/fs-extra": "11.0.1", |
140 | "@types/jest": "29.5.3", | 141 | "@types/jest": "29.5.3", |
141 | "@types/lodash": "4.14.195", | 142 | "@types/lodash": "4.14.195", |
143 | "@types/minimist": "1.2.2", | ||
142 | "@types/ms": "0.7.31", | 144 | "@types/ms": "0.7.31", |
143 | "@types/node": "18.15.3", | 145 | "@types/node": "18.15.3", |
144 | "@types/prop-types": "15.7.5", | 146 | "@types/prop-types": "15.7.5", |
@@ -174,6 +176,7 @@ | |||
174 | "eslint-plugin-prettier": "5.0.0", | 176 | "eslint-plugin-prettier": "5.0.0", |
175 | "eslint-plugin-react": "7.33.0", | 177 | "eslint-plugin-react": "7.33.0", |
176 | "eslint-plugin-react-hooks": "4.6.0", | 178 | "eslint-plugin-react-hooks": "4.6.0", |
179 | "eslint-plugin-sonar": "0.12.0", | ||
177 | "eslint-plugin-unicorn": "48.0.0", | 180 | "eslint-plugin-unicorn": "48.0.0", |
178 | "gulp-livereload": "4.0.2", | 181 | "gulp-livereload": "4.0.2", |
179 | "husky": "8.0.3", | 182 | "husky": "8.0.3", |
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17b636a08..5b5d6d836 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml | |||
@@ -270,6 +270,9 @@ devDependencies: | |||
270 | '@jest/types': | 270 | '@jest/types': |
271 | specifier: 29.6.1 | 271 | specifier: 29.6.1 |
272 | version: 29.6.1 | 272 | version: 29.6.1 |
273 | '@types/auto-launch': | ||
274 | specifier: 5.0.2 | ||
275 | version: 5.0.2 | ||
273 | '@types/color': | 276 | '@types/color': |
274 | specifier: 3.0.3 | 277 | specifier: 3.0.3 |
275 | version: 3.0.3 | 278 | version: 3.0.3 |
@@ -282,6 +285,9 @@ devDependencies: | |||
282 | '@types/lodash': | 285 | '@types/lodash': |
283 | specifier: 4.14.195 | 286 | specifier: 4.14.195 |
284 | version: 4.14.195 | 287 | version: 4.14.195 |
288 | '@types/minimist': | ||
289 | specifier: 1.2.2 | ||
290 | version: 1.2.2 | ||
285 | '@types/ms': | 291 | '@types/ms': |
286 | specifier: 0.7.31 | 292 | specifier: 0.7.31 |
287 | version: 0.7.31 | 293 | version: 0.7.31 |
@@ -387,6 +393,9 @@ devDependencies: | |||
387 | eslint-plugin-react-hooks: | 393 | eslint-plugin-react-hooks: |
388 | specifier: 4.6.0 | 394 | specifier: 4.6.0 |
389 | version: 4.6.0(eslint@8.45.0) | 395 | version: 4.6.0(eslint@8.45.0) |
396 | eslint-plugin-sonar: | ||
397 | specifier: 0.12.0 | ||
398 | version: 0.12.0(@babel/core@7.20.5)(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4) | ||
390 | eslint-plugin-unicorn: | 399 | eslint-plugin-unicorn: |
391 | specifier: 48.0.0 | 400 | specifier: 48.0.0 |
392 | version: 48.0.0(eslint@8.45.0) | 401 | version: 48.0.0(eslint@8.45.0) |
@@ -677,6 +686,20 @@ packages: | |||
677 | - supports-color | 686 | - supports-color |
678 | dev: true | 687 | dev: true |
679 | 688 | ||
689 | /@babel/eslint-parser@7.22.9(@babel/core@7.20.5)(eslint@8.45.0): | ||
690 | resolution: {integrity: sha512-xdMkt39/nviO/4vpVdrEYPwXCsYIXSSAr6mC7WQsNIlGnuxKyKE7GZjalcnbSWiC4OXGNNN3UQPeHfjSC6sTDA==} | ||
691 | engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} | ||
692 | peerDependencies: | ||
693 | '@babel/core': '>=7.11.0' | ||
694 | eslint: ^7.5.0 || ^8.0.0 | ||
695 | dependencies: | ||
696 | '@babel/core': 7.20.5 | ||
697 | '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 | ||
698 | eslint: 8.45.0 | ||
699 | eslint-visitor-keys: 2.1.0 | ||
700 | semver: 6.3.1 | ||
701 | dev: true | ||
702 | |||
680 | /@babel/generator@7.20.5: | 703 | /@babel/generator@7.20.5: |
681 | resolution: {integrity: sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==} | 704 | resolution: {integrity: sha512-jl7JY2Ykn9S0yj4DQP82sYvPU+T3g0HFcWTqDLqiuA9tGRNIj9VfbtXGAYTTkyNEnQk1jkMGOdYka8aG/lulCA==} |
682 | engines: {node: '>=6.9.0'} | 705 | engines: {node: '>=6.9.0'} |
@@ -2060,6 +2083,12 @@ packages: | |||
2060 | prop-types: 15.8.1 | 2083 | prop-types: 15.8.1 |
2061 | dev: false | 2084 | dev: false |
2062 | 2085 | ||
2086 | /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: | ||
2087 | resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} | ||
2088 | dependencies: | ||
2089 | eslint-scope: 5.1.1 | ||
2090 | dev: true | ||
2091 | |||
2063 | /@nodelib/fs.scandir@2.1.5: | 2092 | /@nodelib/fs.scandir@2.1.5: |
2064 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} | 2093 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} |
2065 | engines: {node: '>= 8'} | 2094 | engines: {node: '>= 8'} |
@@ -2365,6 +2394,10 @@ packages: | |||
2365 | resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} | 2394 | resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} |
2366 | dev: true | 2395 | dev: true |
2367 | 2396 | ||
2397 | /@types/auto-launch@5.0.2: | ||
2398 | resolution: {integrity: sha512-b03X09+GCM9t6AUECpwA2gUPYs8s5tJHFJw92sK8EiJ7G4QNbsHmXV7nfCfP6G6ivtm230vi4oNfe8AzRgzxMQ==} | ||
2399 | dev: true | ||
2400 | |||
2368 | /@types/babel__core@7.1.20: | 2401 | /@types/babel__core@7.1.20: |
2369 | resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} | 2402 | resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} |
2370 | dependencies: | 2403 | dependencies: |
@@ -2629,6 +2662,34 @@ packages: | |||
2629 | '@types/node': 18.15.3 | 2662 | '@types/node': 18.15.3 |
2630 | optional: true | 2663 | optional: true |
2631 | 2664 | ||
2665 | /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4): | ||
2666 | resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} | ||
2667 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2668 | peerDependencies: | ||
2669 | '@typescript-eslint/parser': ^5.0.0 | ||
2670 | eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 | ||
2671 | typescript: '*' | ||
2672 | peerDependenciesMeta: | ||
2673 | typescript: | ||
2674 | optional: true | ||
2675 | dependencies: | ||
2676 | '@eslint-community/regexpp': 4.6.0 | ||
2677 | '@typescript-eslint/parser': 6.1.0(eslint@8.45.0)(typescript@5.0.4) | ||
2678 | '@typescript-eslint/scope-manager': 5.62.0 | ||
2679 | '@typescript-eslint/type-utils': 5.62.0(eslint@8.45.0)(typescript@5.0.4) | ||
2680 | '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@5.0.4) | ||
2681 | debug: 4.3.4 | ||
2682 | eslint: 8.45.0 | ||
2683 | graphemer: 1.4.0 | ||
2684 | ignore: 5.2.4 | ||
2685 | natural-compare-lite: 1.4.0 | ||
2686 | semver: 7.5.4 | ||
2687 | tsutils: 3.21.0(typescript@5.0.4) | ||
2688 | typescript: 5.0.4 | ||
2689 | transitivePeerDependencies: | ||
2690 | - supports-color | ||
2691 | dev: true | ||
2692 | |||
2632 | /@typescript-eslint/eslint-plugin@6.1.0(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4): | 2693 | /@typescript-eslint/eslint-plugin@6.1.0(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4): |
2633 | resolution: {integrity: sha512-qg7Bm5TyP/I7iilGyp6DRqqkt8na00lI6HbjWZObgk3FFSzH5ypRwAHXJhJkwiRtTcfn+xYQIMOR5kJgpo6upw==} | 2694 | resolution: {integrity: sha512-qg7Bm5TyP/I7iilGyp6DRqqkt8na00lI6HbjWZObgk3FFSzH5ypRwAHXJhJkwiRtTcfn+xYQIMOR5kJgpo6upw==} |
2634 | engines: {node: ^16.0.0 || >=18.0.0} | 2695 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2688,6 +2749,14 @@ packages: | |||
2688 | '@typescript-eslint/visitor-keys': 5.59.11 | 2749 | '@typescript-eslint/visitor-keys': 5.59.11 |
2689 | dev: true | 2750 | dev: true |
2690 | 2751 | ||
2752 | /@typescript-eslint/scope-manager@5.62.0: | ||
2753 | resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} | ||
2754 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2755 | dependencies: | ||
2756 | '@typescript-eslint/types': 5.62.0 | ||
2757 | '@typescript-eslint/visitor-keys': 5.62.0 | ||
2758 | dev: true | ||
2759 | |||
2691 | /@typescript-eslint/scope-manager@6.1.0: | 2760 | /@typescript-eslint/scope-manager@6.1.0: |
2692 | resolution: {integrity: sha512-AxjgxDn27hgPpe2rQe19k0tXw84YCOsjDJ2r61cIebq1t+AIxbgiXKvD4999Wk49GVaAcdJ/d49FYel+Pp3jjw==} | 2761 | resolution: {integrity: sha512-AxjgxDn27hgPpe2rQe19k0tXw84YCOsjDJ2r61cIebq1t+AIxbgiXKvD4999Wk49GVaAcdJ/d49FYel+Pp3jjw==} |
2693 | engines: {node: ^16.0.0 || >=18.0.0} | 2762 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2696,6 +2765,26 @@ packages: | |||
2696 | '@typescript-eslint/visitor-keys': 6.1.0 | 2765 | '@typescript-eslint/visitor-keys': 6.1.0 |
2697 | dev: true | 2766 | dev: true |
2698 | 2767 | ||
2768 | /@typescript-eslint/type-utils@5.62.0(eslint@8.45.0)(typescript@5.0.4): | ||
2769 | resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} | ||
2770 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2771 | peerDependencies: | ||
2772 | eslint: '*' | ||
2773 | typescript: '*' | ||
2774 | peerDependenciesMeta: | ||
2775 | typescript: | ||
2776 | optional: true | ||
2777 | dependencies: | ||
2778 | '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) | ||
2779 | '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@5.0.4) | ||
2780 | debug: 4.3.4 | ||
2781 | eslint: 8.45.0 | ||
2782 | tsutils: 3.21.0(typescript@5.0.4) | ||
2783 | typescript: 5.0.4 | ||
2784 | transitivePeerDependencies: | ||
2785 | - supports-color | ||
2786 | dev: true | ||
2787 | |||
2699 | /@typescript-eslint/type-utils@6.1.0(eslint@8.45.0)(typescript@5.0.4): | 2788 | /@typescript-eslint/type-utils@6.1.0(eslint@8.45.0)(typescript@5.0.4): |
2700 | resolution: {integrity: sha512-kFXBx6QWS1ZZ5Ni89TyT1X9Ag6RXVIVhqDs0vZE/jUeWlBv/ixq2diua6G7ece6+fXw3TvNRxP77/5mOMusx2w==} | 2789 | resolution: {integrity: sha512-kFXBx6QWS1ZZ5Ni89TyT1X9Ag6RXVIVhqDs0vZE/jUeWlBv/ixq2diua6G7ece6+fXw3TvNRxP77/5mOMusx2w==} |
2701 | engines: {node: ^16.0.0 || >=18.0.0} | 2790 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2721,6 +2810,11 @@ packages: | |||
2721 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 2810 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
2722 | dev: true | 2811 | dev: true |
2723 | 2812 | ||
2813 | /@typescript-eslint/types@5.62.0: | ||
2814 | resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} | ||
2815 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2816 | dev: true | ||
2817 | |||
2724 | /@typescript-eslint/types@6.1.0: | 2818 | /@typescript-eslint/types@6.1.0: |
2725 | resolution: {integrity: sha512-+Gfd5NHCpDoHDOaU/yIF3WWRI2PcBRKKpP91ZcVbL0t5tQpqYWBs3z/GGhvU+EV1D0262g9XCnyqQh19prU0JQ==} | 2819 | resolution: {integrity: sha512-+Gfd5NHCpDoHDOaU/yIF3WWRI2PcBRKKpP91ZcVbL0t5tQpqYWBs3z/GGhvU+EV1D0262g9XCnyqQh19prU0JQ==} |
2726 | engines: {node: ^16.0.0 || >=18.0.0} | 2820 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2747,6 +2841,27 @@ packages: | |||
2747 | - supports-color | 2841 | - supports-color |
2748 | dev: true | 2842 | dev: true |
2749 | 2843 | ||
2844 | /@typescript-eslint/typescript-estree@5.62.0(typescript@5.0.4): | ||
2845 | resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} | ||
2846 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2847 | peerDependencies: | ||
2848 | typescript: '*' | ||
2849 | peerDependenciesMeta: | ||
2850 | typescript: | ||
2851 | optional: true | ||
2852 | dependencies: | ||
2853 | '@typescript-eslint/types': 5.62.0 | ||
2854 | '@typescript-eslint/visitor-keys': 5.62.0 | ||
2855 | debug: 4.3.4 | ||
2856 | globby: 11.1.0 | ||
2857 | is-glob: 4.0.3 | ||
2858 | semver: 7.5.4 | ||
2859 | tsutils: 3.21.0(typescript@5.0.4) | ||
2860 | typescript: 5.0.4 | ||
2861 | transitivePeerDependencies: | ||
2862 | - supports-color | ||
2863 | dev: true | ||
2864 | |||
2750 | /@typescript-eslint/typescript-estree@6.1.0(typescript@5.0.4): | 2865 | /@typescript-eslint/typescript-estree@6.1.0(typescript@5.0.4): |
2751 | resolution: {integrity: sha512-nUKAPWOaP/tQjU1IQw9sOPCDavs/iU5iYLiY/6u7gxS7oKQoi4aUxXS1nrrVGTyBBaGesjkcwwHkbkiD5eBvcg==} | 2866 | resolution: {integrity: sha512-nUKAPWOaP/tQjU1IQw9sOPCDavs/iU5iYLiY/6u7gxS7oKQoi4aUxXS1nrrVGTyBBaGesjkcwwHkbkiD5eBvcg==} |
2752 | engines: {node: ^16.0.0 || >=18.0.0} | 2867 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2788,6 +2903,26 @@ packages: | |||
2788 | - typescript | 2903 | - typescript |
2789 | dev: true | 2904 | dev: true |
2790 | 2905 | ||
2906 | /@typescript-eslint/utils@5.62.0(eslint@8.45.0)(typescript@5.0.4): | ||
2907 | resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} | ||
2908 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2909 | peerDependencies: | ||
2910 | eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 | ||
2911 | dependencies: | ||
2912 | '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) | ||
2913 | '@types/json-schema': 7.0.12 | ||
2914 | '@types/semver': 7.5.0 | ||
2915 | '@typescript-eslint/scope-manager': 5.62.0 | ||
2916 | '@typescript-eslint/types': 5.62.0 | ||
2917 | '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) | ||
2918 | eslint: 8.45.0 | ||
2919 | eslint-scope: 5.1.1 | ||
2920 | semver: 7.5.4 | ||
2921 | transitivePeerDependencies: | ||
2922 | - supports-color | ||
2923 | - typescript | ||
2924 | dev: true | ||
2925 | |||
2791 | /@typescript-eslint/utils@6.1.0(eslint@8.45.0)(typescript@5.0.4): | 2926 | /@typescript-eslint/utils@6.1.0(eslint@8.45.0)(typescript@5.0.4): |
2792 | resolution: {integrity: sha512-wp652EogZlKmQoMS5hAvWqRKplXvkuOnNzZSE0PVvsKjpexd/XznRVHAtrfHFYmqaJz0DFkjlDsGYC9OXw+OhQ==} | 2927 | resolution: {integrity: sha512-wp652EogZlKmQoMS5hAvWqRKplXvkuOnNzZSE0PVvsKjpexd/XznRVHAtrfHFYmqaJz0DFkjlDsGYC9OXw+OhQ==} |
2793 | engines: {node: ^16.0.0 || >=18.0.0} | 2928 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -2815,6 +2950,14 @@ packages: | |||
2815 | eslint-visitor-keys: 3.4.1 | 2950 | eslint-visitor-keys: 3.4.1 |
2816 | dev: true | 2951 | dev: true |
2817 | 2952 | ||
2953 | /@typescript-eslint/visitor-keys@5.62.0: | ||
2954 | resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} | ||
2955 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | ||
2956 | dependencies: | ||
2957 | '@typescript-eslint/types': 5.62.0 | ||
2958 | eslint-visitor-keys: 3.4.1 | ||
2959 | dev: true | ||
2960 | |||
2818 | /@typescript-eslint/visitor-keys@6.1.0: | 2961 | /@typescript-eslint/visitor-keys@6.1.0: |
2819 | resolution: {integrity: sha512-yQeh+EXhquh119Eis4k0kYhj9vmFzNpbhM3LftWQVwqVjipCkwHBQOZutcYW+JVkjtTG9k8nrZU1UoNedPDd1A==} | 2962 | resolution: {integrity: sha512-yQeh+EXhquh119Eis4k0kYhj9vmFzNpbhM3LftWQVwqVjipCkwHBQOZutcYW+JVkjtTG9k8nrZU1UoNedPDd1A==} |
2820 | engines: {node: ^16.0.0 || >=18.0.0} | 2963 | engines: {node: ^16.0.0 || >=18.0.0} |
@@ -3878,7 +4021,6 @@ packages: | |||
3878 | /bytes@3.1.2: | 4021 | /bytes@3.1.2: |
3879 | resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} | 4022 | resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} |
3880 | engines: {node: '>= 0.8'} | 4023 | engines: {node: '>= 0.8'} |
3881 | dev: false | ||
3882 | 4024 | ||
3883 | /cacache@15.3.0: | 4025 | /cacache@15.3.0: |
3884 | resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} | 4026 | resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} |
@@ -5660,6 +5802,41 @@ packages: | |||
5660 | string.prototype.matchall: 4.0.8 | 5802 | string.prototype.matchall: 4.0.8 |
5661 | dev: true | 5803 | dev: true |
5662 | 5804 | ||
5805 | /eslint-plugin-sonar@0.12.0(@babel/core@7.20.5)(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4): | ||
5806 | resolution: {integrity: sha512-49linjQRXazFXZR4PXHwgMkkrnLavZTeSkxJ5+k3PoNqGm/shgJCVmdQAki3AJNqM+huZSwYxwsWS+LSpB48cQ==} | ||
5807 | engines: {node: '>=14'} | ||
5808 | peerDependencies: | ||
5809 | eslint: ^7.0.0 || ^8.0.0 | ||
5810 | typescript: ^4.0.0 || ^5.0.0 | ||
5811 | dependencies: | ||
5812 | '@babel/eslint-parser': 7.22.9(@babel/core@7.20.5)(eslint@8.45.0) | ||
5813 | '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@6.1.0)(eslint@8.45.0)(typescript@5.0.4) | ||
5814 | builtin-modules: 3.3.0 | ||
5815 | bytes: 3.1.2 | ||
5816 | eslint: 8.45.0 | ||
5817 | eslint-plugin-react: 7.33.0(eslint@8.45.0) | ||
5818 | eslint-plugin-react-hooks: 4.6.0(eslint@8.45.0) | ||
5819 | eslint-plugin-sonarjs: 0.19.0(eslint@8.45.0) | ||
5820 | functional-red-black-tree: 1.0.1 | ||
5821 | regexpp: 3.2.0 | ||
5822 | scslre: 0.2.0 | ||
5823 | tmp: 0.2.1 | ||
5824 | typescript: 5.0.4 | ||
5825 | transitivePeerDependencies: | ||
5826 | - '@babel/core' | ||
5827 | - '@typescript-eslint/parser' | ||
5828 | - supports-color | ||
5829 | dev: true | ||
5830 | |||
5831 | /eslint-plugin-sonarjs@0.19.0(eslint@8.45.0): | ||
5832 | resolution: {integrity: sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==} | ||
5833 | engines: {node: '>=14'} | ||
5834 | peerDependencies: | ||
5835 | eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 | ||
5836 | dependencies: | ||
5837 | eslint: 8.45.0 | ||
5838 | dev: true | ||
5839 | |||
5663 | /eslint-plugin-unicorn@48.0.0(eslint@8.45.0): | 5840 | /eslint-plugin-unicorn@48.0.0(eslint@8.45.0): |
5664 | resolution: {integrity: sha512-8fk/v3p1ro34JSVDBEmtOq6EEQRpMR0iTir79q69KnXFZ6DJyPkT3RAi+ZoTqhQMdDSpGh8BGR68ne1sP5cnAA==} | 5841 | resolution: {integrity: sha512-8fk/v3p1ro34JSVDBEmtOq6EEQRpMR0iTir79q69KnXFZ6DJyPkT3RAi+ZoTqhQMdDSpGh8BGR68ne1sP5cnAA==} |
5665 | engines: {node: '>=16'} | 5842 | engines: {node: '>=16'} |
@@ -5700,6 +5877,11 @@ packages: | |||
5700 | estraverse: 5.3.0 | 5877 | estraverse: 5.3.0 |
5701 | dev: true | 5878 | dev: true |
5702 | 5879 | ||
5880 | /eslint-visitor-keys@2.1.0: | ||
5881 | resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} | ||
5882 | engines: {node: '>=10'} | ||
5883 | dev: true | ||
5884 | |||
5703 | /eslint-visitor-keys@3.4.1: | 5885 | /eslint-visitor-keys@3.4.1: |
5704 | resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} | 5886 | resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} |
5705 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} | 5887 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} |
@@ -6384,6 +6566,10 @@ packages: | |||
6384 | functions-have-names: 1.2.3 | 6566 | functions-have-names: 1.2.3 |
6385 | dev: true | 6567 | dev: true |
6386 | 6568 | ||
6569 | /functional-red-black-tree@1.0.1: | ||
6570 | resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} | ||
6571 | dev: true | ||
6572 | |||
6387 | /functions-have-names@1.2.3: | 6573 | /functions-have-names@1.2.3: |
6388 | resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} | 6574 | resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} |
6389 | dev: true | 6575 | dev: true |
@@ -10691,6 +10877,13 @@ packages: | |||
10691 | strip-indent: 3.0.0 | 10877 | strip-indent: 3.0.0 |
10692 | dev: true | 10878 | dev: true |
10693 | 10879 | ||
10880 | /refa@0.11.0: | ||
10881 | resolution: {integrity: sha512-486O8/pQXwj9jV0mVvUnTsxq0uknpBnNJ0eCUhkZqJRQ8KutrT1PhzmumdCeM1hSBF2eMlFPmwECRER4IbKXlQ==} | ||
10882 | engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} | ||
10883 | dependencies: | ||
10884 | '@eslint-community/regexpp': 4.6.0 | ||
10885 | dev: true | ||
10886 | |||
10694 | /regenerator-runtime@0.13.11: | 10887 | /regenerator-runtime@0.13.11: |
10695 | resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} | 10888 | resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} |
10696 | 10889 | ||
@@ -10702,6 +10895,14 @@ packages: | |||
10702 | safe-regex: 1.1.0 | 10895 | safe-regex: 1.1.0 |
10703 | dev: false | 10896 | dev: false |
10704 | 10897 | ||
10898 | /regexp-ast-analysis@0.6.0: | ||
10899 | resolution: {integrity: sha512-OLxjyjPkVH+rQlBLb1I/P/VTmamSjGkvN5PTV5BXP432k3uVz727J7H29GA5IFiY0m7e1xBN7049Wn59FY3DEQ==} | ||
10900 | engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} | ||
10901 | dependencies: | ||
10902 | '@eslint-community/regexpp': 4.6.0 | ||
10903 | refa: 0.11.0 | ||
10904 | dev: true | ||
10905 | |||
10705 | /regexp-tree@0.1.27: | 10906 | /regexp-tree@0.1.27: |
10706 | resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} | 10907 | resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} |
10707 | hasBin: true | 10908 | hasBin: true |
@@ -10716,6 +10917,11 @@ packages: | |||
10716 | functions-have-names: 1.2.3 | 10917 | functions-have-names: 1.2.3 |
10717 | dev: true | 10918 | dev: true |
10718 | 10919 | ||
10920 | /regexpp@3.2.0: | ||
10921 | resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} | ||
10922 | engines: {node: '>=8'} | ||
10923 | dev: true | ||
10924 | |||
10719 | /regjsparser@0.10.0: | 10925 | /regjsparser@0.10.0: |
10720 | resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} | 10926 | resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} |
10721 | hasBin: true | 10927 | hasBin: true |
@@ -11046,6 +11252,14 @@ packages: | |||
11046 | resolution: {integrity: sha512-FaHoAk75AYhT+rnBmMpkvHSIcQma4OHzYXOhn1XXtgNomi0FTV8YEXYuh2EIdCg5IKMVyFbXeJT4Cn96+fzABg==} | 11252 | resolution: {integrity: sha512-FaHoAk75AYhT+rnBmMpkvHSIcQma4OHzYXOhn1XXtgNomi0FTV8YEXYuh2EIdCg5IKMVyFbXeJT4Cn96+fzABg==} |
11047 | dev: false | 11253 | dev: false |
11048 | 11254 | ||
11255 | /scslre@0.2.0: | ||
11256 | resolution: {integrity: sha512-4hc49fUMmX3jM0XdFUAPBrs1xwEcdHa0KyjEsjFs+Zfc66mpFpq5YmRgDtl+Ffo6AtJIilfei+yKw8fUn3N88w==} | ||
11257 | dependencies: | ||
11258 | '@eslint-community/regexpp': 4.6.0 | ||
11259 | refa: 0.11.0 | ||
11260 | regexp-ast-analysis: 0.6.0 | ||
11261 | dev: true | ||
11262 | |||
11049 | /seek-bzip@1.0.6: | 11263 | /seek-bzip@1.0.6: |
11050 | resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} | 11264 | resolution: {integrity: sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==} |
11051 | hasBin: true | 11265 | hasBin: true |
diff --git a/scripts/add-crowdin-contributors.ts b/scripts/add-crowdin-contributors.ts index 7a0d0e769..217de8cef 100644 --- a/scripts/add-crowdin-contributors.ts +++ b/scripts/add-crowdin-contributors.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import fs from 'fs-extra'; | 1 | import fs from 'fs-extra'; |
2 | import path from 'path'; | 2 | import path from 'node:path'; |
3 | import allContributors from 'all-contributors-cli'; | 3 | import allContributors from 'all-contributors-cli'; |
4 | 4 | ||
5 | /** | 5 | /** |
diff --git a/scripts/link-readme.ts b/scripts/link-readme.ts index d80739178..47440f699 100644 --- a/scripts/link-readme.ts +++ b/scripts/link-readme.ts | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | import fs from 'fs-extra'; | 9 | import fs from 'fs-extra'; |
10 | import path from 'path'; | 10 | import path from 'node:path'; |
11 | 11 | ||
12 | console.log('Linking issues and PRs in README.md'); | 12 | console.log('Linking issues and PRs in README.md'); |
13 | 13 | ||
diff --git a/src/api/UserApi.ts b/src/api/UserApi.ts index 31c8acead..2b319207a 100644 --- a/src/api/UserApi.ts +++ b/src/api/UserApi.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { BinaryLike } from 'crypto'; | 1 | import { BinaryLike } from 'node:crypto'; |
2 | import { hash } from '../helpers/password-helpers'; | 2 | import { hash } from '../helpers/password-helpers'; |
3 | 3 | ||
4 | export default class UserApi { | 4 | export default class UserApi { |
diff --git a/src/api/server/LocalApi.ts b/src/api/server/LocalApi.ts index a292bc42d..6764816f9 100644 --- a/src/api/server/LocalApi.ts +++ b/src/api/server/LocalApi.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { ExecException } from 'child_process'; | 1 | import { ExecException } from 'node:child_process'; |
2 | import { ipcRenderer } from 'electron'; | 2 | import { ipcRenderer } from 'electron'; |
3 | import fastFolderSize from 'fast-folder-size'; | 3 | import fastFolderSize from 'fast-folder-size'; |
4 | 4 | ||
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index de8e0a85c..7b17fcdcd 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable import/no-import-module-exports */ | 1 | /* eslint-disable import/no-import-module-exports */ |
2 | /* eslint-disable global-require */ | 2 | /* eslint-disable global-require */ |
3 | import { join } from 'path'; | 3 | import { join } from 'node:path'; |
4 | import tar from 'tar'; | 4 | import tar from 'tar'; |
5 | import { | 5 | import { |
6 | readdirSync, | 6 | readdirSync, |
diff --git a/src/components/auth/Welcome.tsx b/src/components/auth/Welcome.tsx index 047512ea4..259e3c335 100644 --- a/src/components/auth/Welcome.tsx +++ b/src/components/auth/Welcome.tsx | |||
@@ -91,6 +91,7 @@ class Welcome extends Component<IProps> { | |||
91 | className="settings__hr-sections" | 91 | className="settings__hr-sections" |
92 | style={{ marginTop: 24, marginBottom: 24, borderStyle: 'solid' }} | 92 | style={{ marginTop: 24, marginBottom: 24, borderStyle: 'solid' }} |
93 | /> | 93 | /> |
94 | {/* eslint-disable-next-line react/button-has-type */} | ||
94 | <button | 95 | <button |
95 | className="button" | 96 | className="button" |
96 | onClick={this.useLocalServer.bind(this)} | 97 | onClick={this.useLocalServer.bind(this)} |
diff --git a/src/components/services/content/ServiceView.tsx b/src/components/services/content/ServiceView.tsx index 19dcdd07a..37dcafbe4 100644 --- a/src/components/services/content/ServiceView.tsx +++ b/src/components/services/content/ServiceView.tsx | |||
@@ -136,6 +136,7 @@ class ServiceView extends Component<IProps, IState> { | |||
136 | </> | 136 | </> |
137 | )} | 137 | )} |
138 | {service.isEnabled ? ( | 138 | {service.isEnabled ? ( |
139 | // eslint-disable-next-line react/jsx-no-useless-fragment | ||
139 | <> | 140 | <> |
140 | {service.isHibernating ? ( | 141 | {service.isHibernating ? ( |
141 | <div | 142 | <div |
@@ -173,6 +174,7 @@ class ServiceView extends Component<IProps, IState> { | |||
173 | )} | 174 | )} |
174 | </> | 175 | </> |
175 | ) : ( | 176 | ) : ( |
177 | // eslint-disable-next-line react/jsx-no-useless-fragment | ||
176 | <> | 178 | <> |
177 | {service.isActive && ( | 179 | {service.isActive && ( |
178 | <ServiceDisabled | 180 | <ServiceDisabled |
diff --git a/src/components/services/content/ServiceWebview.tsx b/src/components/services/content/ServiceWebview.tsx index 008e1b227..50b5d478f 100644 --- a/src/components/services/content/ServiceWebview.tsx +++ b/src/components/services/content/ServiceWebview.tsx | |||
@@ -2,7 +2,7 @@ import { Component, ReactElement } from 'react'; | |||
2 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
3 | import { action, makeObservable, observable, reaction } from 'mobx'; | 3 | import { action, makeObservable, observable, reaction } from 'mobx'; |
4 | import ElectronWebView from 'react-electron-web-view'; | 4 | import ElectronWebView from 'react-electron-web-view'; |
5 | import { join } from 'path'; | 5 | import { join } from 'node:path'; |
6 | import ServiceModel from '../../../models/Service'; | 6 | import ServiceModel from '../../../models/Service'; |
7 | 7 | ||
8 | const debug = require('../../../preload-safe-debug')('Ferdium:Services'); | 8 | const debug = require('../../../preload-safe-debug')('Ferdium:Services'); |
diff --git a/src/components/settings/settings/EditSettingsForm.tsx b/src/components/settings/settings/EditSettingsForm.tsx index 099a27ebe..0b5d4374d 100644 --- a/src/components/settings/settings/EditSettingsForm.tsx +++ b/src/components/settings/settings/EditSettingsForm.tsx | |||
@@ -386,8 +386,8 @@ class EditSettingsForm extends Component<IProps, IState> { | |||
386 | const { lockingFeatureEnabled, scheduledDNDEnabled, reloadAfterResume } = | 386 | const { lockingFeatureEnabled, scheduledDNDEnabled, reloadAfterResume } = |
387 | window['ferdium'].stores.settings.all.app; | 387 | window['ferdium'].stores.settings.all.app; |
388 | 388 | ||
389 | let cacheSize: string; | 389 | let cacheSize; |
390 | let notCleared: boolean; | 390 | let notCleared; |
391 | 391 | ||
392 | if (this.state.activeSetttingsTab === 'advanced') { | 392 | if (this.state.activeSetttingsTab === 'advanced') { |
393 | const cacheSizeBytes = getCacheSize(); | 393 | const cacheSizeBytes = getCacheSize(); |
diff --git a/src/components/ui/Tabs/TabItem.tsx b/src/components/ui/Tabs/TabItem.tsx index 815dced8c..55dee42c6 100644 --- a/src/components/ui/Tabs/TabItem.tsx +++ b/src/components/ui/Tabs/TabItem.tsx | |||
@@ -12,8 +12,8 @@ export interface IProps { | |||
12 | title?: string; // it is used on Tabs.tsx | 12 | title?: string; // it is used on Tabs.tsx |
13 | } | 13 | } |
14 | 14 | ||
15 | function TabItem({ children, title = '' }: IProps): ReactElement { | 15 | const TabItem = ({ children, title = '' }: IProps): ReactElement => { |
16 | return <Fragment key={title}>{children}</Fragment>; | 16 | return <Fragment key={title}>{children}</Fragment>; |
17 | } | 17 | }; |
18 | 18 | ||
19 | export default TabItem; | 19 | export default TabItem; |
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index 3c31ca952..c37a88afa 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -237,6 +237,7 @@ class ButtonComponent extends Component<IProps, IState> { | |||
237 | ) : ( | 237 | ) : ( |
238 | <button | 238 | <button |
239 | id={id} | 239 | id={id} |
240 | // eslint-disable-next-line react/button-has-type | ||
240 | type={type} | 241 | type={type} |
241 | onClick={onClick} | 242 | onClick={onClick} |
242 | className={classnames({ | 243 | className={classnames({ |
diff --git a/src/components/ui/select/index.tsx b/src/components/ui/select/index.tsx index 902eb7748..650600fb3 100644 --- a/src/components/ui/select/index.tsx +++ b/src/components/ui/select/index.tsx | |||
@@ -191,12 +191,23 @@ class SelectComponent extends Component<IProps, IState> { | |||
191 | this.arrowKeysHandler = this.arrowKeysHandler.bind(this); | 191 | this.arrowKeysHandler = this.arrowKeysHandler.bind(this); |
192 | } | 192 | } |
193 | 193 | ||
194 | componentDidUpdate(): void { | 194 | UNSAFE_componentWillMount(): void { |
195 | const { open } = this.state; | 195 | const { value } = this.props; |
196 | 196 | ||
197 | if (this.searchInputRef?.current && open) { | 197 | if (this.componentRef?.current) { |
198 | this.searchInputRef.current.focus(); | 198 | this.componentRef.current.removeEventListener( |
199 | 'keydown', | ||
200 | this.keyListener, | ||
201 | ); | ||
199 | } | 202 | } |
203 | |||
204 | if (value) { | ||
205 | this.setState({ | ||
206 | value, | ||
207 | }); | ||
208 | } | ||
209 | |||
210 | this.setFilter(); | ||
200 | } | 211 | } |
201 | 212 | ||
202 | componentDidMount(): void { | 213 | componentDidMount(): void { |
@@ -212,23 +223,12 @@ class SelectComponent extends Component<IProps, IState> { | |||
212 | window.addEventListener('keydown', this.arrowKeysHandler, false); | 223 | window.addEventListener('keydown', this.arrowKeysHandler, false); |
213 | } | 224 | } |
214 | 225 | ||
215 | UNSAFE_componentWillMount(): void { | 226 | componentDidUpdate(): void { |
216 | const { value } = this.props; | 227 | const { open } = this.state; |
217 | |||
218 | if (this.componentRef?.current) { | ||
219 | this.componentRef.current.removeEventListener( | ||
220 | 'keydown', | ||
221 | this.keyListener, | ||
222 | ); | ||
223 | } | ||
224 | 228 | ||
225 | if (value) { | 229 | if (this.searchInputRef?.current && open) { |
226 | this.setState({ | 230 | this.searchInputRef.current.focus(); |
227 | value, | ||
228 | }); | ||
229 | } | 231 | } |
230 | |||
231 | this.setFilter(); | ||
232 | } | 232 | } |
233 | 233 | ||
234 | componentWillUnmount(): void { | 234 | componentWillUnmount(): void { |
diff --git a/src/electron/exception.ts b/src/electron/exception.ts index ada98d17b..a445a6475 100644 --- a/src/electron/exception.ts +++ b/src/electron/exception.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | // eslint-disable-next-line unicorn/no-empty-file | ||
1 | process.on('uncaughtException', err => { | 2 | process.on('uncaughtException', err => { |
2 | // handle the error safely | 3 | // handle the error safely |
3 | console.error(err); | 4 | console.error(err); |
diff --git a/src/electron/ipc-api/appIndicator.ts b/src/electron/ipc-api/appIndicator.ts index 766e6937a..c3232d89f 100644 --- a/src/electron/ipc-api/appIndicator.ts +++ b/src/electron/ipc-api/appIndicator.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { app, ipcMain, BrowserWindow } from 'electron'; | 1 | import { app, ipcMain, BrowserWindow } from 'electron'; |
2 | import { join } from 'path'; | 2 | import { join } from 'node:path'; |
3 | import { autorun } from 'mobx'; | 3 | import { autorun } from 'mobx'; |
4 | import { isMac, isWindows, isLinux } from '../../environment'; | 4 | import { isMac, isWindows, isLinux } from '../../environment'; |
5 | import TrayIcon from '../../lib/Tray'; | 5 | import TrayIcon from '../../lib/Tray'; |
diff --git a/src/electron/ipc-api/download.ts b/src/electron/ipc-api/download.ts index 851bff4c3..0c7e022d4 100644 --- a/src/electron/ipc-api/download.ts +++ b/src/electron/ipc-api/download.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; | 1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; |
2 | import { download } from 'electron-dl'; | 2 | import { download } from 'electron-dl'; |
3 | import { writeFileSync } from 'fs-extra'; | 3 | import { writeFileSync } from 'fs-extra'; |
4 | import { PathLike } from 'fs'; | 4 | import { PathLike } from 'node:fs'; |
5 | 5 | ||
6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:download'); | 6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:download'); |
7 | 7 | ||
diff --git a/src/electron/ipc-api/localServer.ts b/src/electron/ipc-api/localServer.ts index 6264e719d..5fdfad32c 100644 --- a/src/electron/ipc-api/localServer.ts +++ b/src/electron/ipc-api/localServer.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { randomBytes } from 'crypto'; | 1 | import { randomBytes } from 'node:crypto'; |
2 | import { ipcMain, BrowserWindow } from 'electron'; | 2 | import { ipcMain, BrowserWindow } from 'electron'; |
3 | import { createServer } from 'net'; | 3 | import { createServer } from 'node:net'; |
4 | import { LOCAL_HOSTNAME, LOCAL_PORT } from '../../config'; | 4 | import { LOCAL_HOSTNAME, LOCAL_PORT } from '../../config'; |
5 | import { userDataPath } from '../../environment-remote'; | 5 | import { userDataPath } from '../../environment-remote'; |
6 | import { server } from '../../internal-server/start'; | 6 | import { server } from '../../internal-server/start'; |
diff --git a/src/electron/macOSPermissions.ts b/src/electron/macOSPermissions.ts index 88706dd23..90056f59c 100644 --- a/src/electron/macOSPermissions.ts +++ b/src/electron/macOSPermissions.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { systemPreferences, BrowserWindow, dialog } from 'electron'; | 1 | import { systemPreferences, BrowserWindow, dialog } from 'electron'; |
2 | import { pathExistsSync, mkdirSync, writeFileSync } from 'fs-extra'; | 2 | import { pathExistsSync, mkdirSync, writeFileSync } from 'fs-extra'; |
3 | import macosVersion from 'macos-version'; | 3 | import macosVersion from 'macos-version'; |
4 | import { dirname } from 'path'; | 4 | import { dirname } from 'node:path'; |
5 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error | 5 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error |
6 | // @ts-ignore | 6 | // @ts-ignore |
7 | import { askForScreenCaptureAccess } from 'node-mac-permissions'; | 7 | import { askForScreenCaptureAccess } from 'node-mac-permissions'; |
diff --git a/src/environment-remote.ts b/src/environment-remote.ts index 5f2b68dab..691e19ef4 100644 --- a/src/environment-remote.ts +++ b/src/environment-remote.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { join } from 'path'; | 1 | import { join } from 'node:path'; |
2 | import { api as electronApi } from './electron-util'; | 2 | import { api as electronApi } from './electron-util'; |
3 | import { | 3 | import { |
4 | LIVE_FERDIUM_API, | 4 | LIVE_FERDIUM_API, |
diff --git a/src/environment.ts b/src/environment.ts index e17be0b7f..c3b9e7e58 100644 --- a/src/environment.ts +++ b/src/environment.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | // Note: This file has now become devoid of all references to values deduced from the remote process - all those now live in the `environment-remote.js` file | 1 | // Note: This file has now become devoid of all references to values deduced from the remote process - all those now live in the `environment-remote.js` file |
2 | 2 | ||
3 | import { arch, release } from 'os'; | 3 | import { arch, release } from 'node:os'; |
4 | 4 | ||
5 | export const isMac = process.platform === 'darwin'; | 5 | export const isMac = process.platform === 'darwin'; |
6 | export const isWindows = process.platform === 'win32'; | 6 | export const isWindows = process.platform === 'win32'; |
diff --git a/src/features/appearance/index.ts b/src/features/appearance/index.ts index da75bf57b..46403275e 100644 --- a/src/features/appearance/index.ts +++ b/src/features/appearance/index.ts | |||
@@ -146,12 +146,13 @@ function generateServiceRibbonWidthStyle( | |||
146 | ) { | 146 | ) { |
147 | const width = Number(widthStr); | 147 | const width = Number(widthStr); |
148 | const iconSize = Number(iconSizeStr) - iconSizeBias; | 148 | const iconSize = Number(iconSizeStr) - iconSizeBias; |
149 | let fontSize = 11; | ||
150 | let tabItemHeightBias = -5; | ||
151 | let sidebarSizeBias = 22; | ||
152 | const tabItemWidthBias = 3; | 149 | const tabItemWidthBias = 3; |
153 | const verticalStyleOffset = 29; | 150 | const verticalStyleOffset = 29; |
154 | 151 | ||
152 | let fontSize: number; | ||
153 | let tabItemHeightBias: number; | ||
154 | let sidebarSizeBias: number; | ||
155 | |||
155 | switch (width) { | 156 | switch (width) { |
156 | case 35: { | 157 | case 35: { |
157 | fontSize = 9; | 158 | fontSize = 9; |
diff --git a/src/features/workspaces/components/WorkspacesDashboard.tsx b/src/features/workspaces/components/WorkspacesDashboard.tsx index a823132c5..ba06730a0 100644 --- a/src/features/workspaces/components/WorkspacesDashboard.tsx +++ b/src/features/workspaces/components/WorkspacesDashboard.tsx | |||
@@ -152,6 +152,7 @@ class WorkspacesDashboard extends Component<IProps> { | |||
152 | {intl.formatMessage(messages.workspacesRequestFailed)} | 152 | {intl.formatMessage(messages.workspacesRequestFailed)} |
153 | </Infobox> | 153 | </Infobox> |
154 | ) : ( | 154 | ) : ( |
155 | // eslint-disable-next-line react/jsx-no-useless-fragment | ||
155 | <> | 156 | <> |
156 | {workspaces.length === 0 ? ( | 157 | {workspaces.length === 0 ? ( |
157 | <div className="align-middle settings__empty-state"> | 158 | <div className="align-middle settings__empty-state"> |
diff --git a/src/features/workspaces/containers/EditWorkspaceScreen.tsx b/src/features/workspaces/containers/EditWorkspaceScreen.tsx index 0b66db0d0..abc747c33 100644 --- a/src/features/workspaces/containers/EditWorkspaceScreen.tsx +++ b/src/features/workspaces/containers/EditWorkspaceScreen.tsx | |||
@@ -9,11 +9,10 @@ import { workspaceStore } from '../index'; | |||
9 | import { deleteWorkspaceRequest, updateWorkspaceRequest } from '../api'; | 9 | import { deleteWorkspaceRequest, updateWorkspaceRequest } from '../api'; |
10 | 10 | ||
11 | class EditWorkspaceScreen extends Component<StoresProps> { | 11 | class EditWorkspaceScreen extends Component<StoresProps> { |
12 | // @ts-expect-error Not all code paths return a value. | ||
13 | onDelete = () => { | 12 | onDelete = () => { |
14 | const { workspaceBeingEdited } = workspaceStore; | 13 | const { workspaceBeingEdited } = workspaceStore; |
15 | const { actions } = this.props; | 14 | const { actions } = this.props; |
16 | if (!workspaceBeingEdited) return null; | 15 | if (!workspaceBeingEdited) return; |
17 | actions.workspaces.delete({ workspace: workspaceBeingEdited }); | 16 | actions.workspaces.delete({ workspace: workspaceBeingEdited }); |
18 | }; | 17 | }; |
19 | 18 | ||
diff --git a/src/helpers/asar-helpers.ts b/src/helpers/asar-helpers.ts index 9d975c193..77dd50bb1 100644 --- a/src/helpers/asar-helpers.ts +++ b/src/helpers/asar-helpers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { join } from 'path'; | 1 | import { join } from 'node:path'; |
2 | 2 | ||
3 | export function asarPath(dir: string = '') { | 3 | export function asarPath(dir: string = '') { |
4 | return dir.replace('app.asar', 'app.asar.unpacked'); | 4 | return dir.replace('app.asar', 'app.asar.unpacked'); |
diff --git a/src/helpers/password-helpers.ts b/src/helpers/password-helpers.ts index d5f2d0c49..75ef5606a 100644 --- a/src/helpers/password-helpers.ts +++ b/src/helpers/password-helpers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { createHash, BinaryLike } from 'crypto'; | 1 | import { createHash, BinaryLike } from 'node:crypto'; |
2 | 2 | ||
3 | export function hash(password: BinaryLike): string { | 3 | export function hash(password: BinaryLike): string { |
4 | return createHash('sha256').update(password).digest('base64'); | 4 | return createHash('sha256').update(password).digest('base64'); |
diff --git a/src/helpers/recipe-helpers.ts b/src/helpers/recipe-helpers.ts index 68a1578e3..500be0cfc 100644 --- a/src/helpers/recipe-helpers.ts +++ b/src/helpers/recipe-helpers.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* eslint-disable import/no-import-module-exports */ | 1 | /* eslint-disable import/no-import-module-exports */ |
2 | /* eslint-disable global-require */ | 2 | /* eslint-disable global-require */ |
3 | import { parse } from 'path'; | 3 | import { parse } from 'node:path'; |
4 | import { userDataRecipesPath } from '../environment-remote'; | 4 | import { userDataRecipesPath } from '../environment-remote'; |
5 | 5 | ||
6 | export function getRecipeDirectory(id: string = ''): string { | 6 | export function getRecipeDirectory(id: string = ''): string { |
diff --git a/src/helpers/url-helpers.ts b/src/helpers/url-helpers.ts index 795d3f2cb..fe637bb08 100644 --- a/src/helpers/url-helpers.ts +++ b/src/helpers/url-helpers.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | // This is taken from: https://benjamin-altpeter.de/shell-openexternal-dangers/ | 1 | // This is taken from: https://benjamin-altpeter.de/shell-openexternal-dangers/ |
2 | import { URL } from 'url'; | 2 | import { URL } from 'node:url'; |
3 | import { ensureDirSync, existsSync } from 'fs-extra'; | 3 | import { ensureDirSync, existsSync } from 'fs-extra'; |
4 | import { shell } from 'electron'; | 4 | import { shell } from 'electron'; |
5 | import normalizeUrl from 'normalize-url'; | 5 | import normalizeUrl from 'normalize-url'; |
diff --git a/src/helpers/userAgent-helpers.ts b/src/helpers/userAgent-helpers.ts index a89207326..bc99fbc52 100644 --- a/src/helpers/userAgent-helpers.ts +++ b/src/helpers/userAgent-helpers.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { cpus } from 'os'; | 1 | import { cpus } from 'node:os'; |
2 | import macosVersion from 'macos-version'; | 2 | import macosVersion from 'macos-version'; |
3 | import { chrome } from 'useragent-generator'; | 3 | import { chrome } from 'useragent-generator'; |
4 | import { | 4 | import { |
@@ -14,6 +14,7 @@ function macOS() { | |||
14 | const version = macosVersion() ?? ''; | 14 | const version = macosVersion() ?? ''; |
15 | let cpuName = cpus()[0].model.split(' ')[0]; | 15 | let cpuName = cpus()[0].model.split(' ')[0]; |
16 | if (cpuName && /\(/.test(cpuName)) { | 16 | if (cpuName && /\(/.test(cpuName)) { |
17 | // eslint-disable-next-line prefer-destructuring | ||
17 | cpuName = cpuName.split('(')[0]; | 18 | cpuName = cpuName.split('(')[0]; |
18 | } | 19 | } |
19 | return `Macintosh; ${cpuName} Mac OS X ${version.replaceAll('.', '_')}`; | 20 | return `Macintosh; ${cpuName} Mac OS X ${version.replaceAll('.', '_')}`; |
diff --git a/src/index.ts b/src/index.ts index 1c616b499..5507a9ac4 100644 --- a/src/index.ts +++ b/src/index.ts | |||
@@ -11,11 +11,11 @@ import { | |||
11 | } from 'electron'; | 11 | } from 'electron'; |
12 | 12 | ||
13 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; | 13 | import { emptyDirSync, ensureFileSync } from 'fs-extra'; |
14 | import { join } from 'path'; | 14 | import { join } from 'node:path'; |
15 | import windowStateKeeper from 'electron-window-state'; | 15 | import windowStateKeeper from 'electron-window-state'; |
16 | import minimist from 'minimist'; | 16 | import minimist from 'minimist'; |
17 | import ms from 'ms'; | 17 | import ms from 'ms'; |
18 | import { EventEmitter } from 'events'; | 18 | import { EventEmitter } from 'node:events'; |
19 | import { enableWebContents, initializeRemote } from './electron-util'; | 19 | import { enableWebContents, initializeRemote } from './electron-util'; |
20 | import enforceMacOSAppLocation from './enforce-macos-app-location'; | 20 | import enforceMacOSAppLocation from './enforce-macos-app-location'; |
21 | 21 | ||
diff --git a/src/internal-server/app/Controllers/Http/ImageController.js b/src/internal-server/app/Controllers/Http/ImageController.js index 5b8337c49..3ce6fb22d 100644 --- a/src/internal-server/app/Controllers/Http/ImageController.js +++ b/src/internal-server/app/Controllers/Http/ImageController.js | |||
@@ -1,6 +1,6 @@ | |||
1 | const Env = use('Env'); | 1 | const Env = use('Env'); |
2 | 2 | ||
3 | const path = require('path'); | 3 | const path = require('node:path'); |
4 | const fs = require('fs-extra'); | 4 | const fs = require('fs-extra'); |
5 | const sanitize = require('sanitize-filename'); | 5 | const sanitize = require('sanitize-filename'); |
6 | 6 | ||
diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js index 43d925119..943d7705e 100644 --- a/src/internal-server/app/Controllers/Http/UserController.js +++ b/src/internal-server/app/Controllers/Http/UserController.js | |||
@@ -6,7 +6,7 @@ const { validateAll } = use('Validator'); | |||
6 | 6 | ||
7 | const fetch = require('node-fetch'); | 7 | const fetch = require('node-fetch'); |
8 | const { v4: uuid } = require('uuid'); | 8 | const { v4: uuid } = require('uuid'); |
9 | const crypto = require('crypto'); | 9 | const crypto = require('node:crypto'); |
10 | const { DEFAULT_APP_SETTINGS } = require('../../../../config'); | 10 | const { DEFAULT_APP_SETTINGS } = require('../../../../config'); |
11 | const { convertToJSON } = require('../../../../jsUtils'); | 11 | const { convertToJSON } = require('../../../../jsUtils'); |
12 | const { API_VERSION } = require('../../../../environment-remote'); | 12 | const { API_VERSION } = require('../../../../environment-remote'); |
@@ -224,11 +224,7 @@ class UserController { | |||
224 | } | 224 | } |
225 | 225 | ||
226 | // Account import/export | 226 | // Account import/export |
227 | async export({ | 227 | async export({ _auth, response }) { |
228 | // eslint-disable-next-line no-unused-vars | ||
229 | auth, | ||
230 | response, | ||
231 | }) { | ||
232 | const allServices = await Service.all(); | 228 | const allServices = await Service.all(); |
233 | const services = allServices.toJSON(); | 229 | const services = allServices.toJSON(); |
234 | const allWorkspaces = await Workspace.all(); | 230 | const allWorkspaces = await Workspace.all(); |
diff --git a/src/internal-server/app/Controllers/Http/WorkspaceController.js b/src/internal-server/app/Controllers/Http/WorkspaceController.js index 352589567..d271dac12 100644 --- a/src/internal-server/app/Controllers/Http/WorkspaceController.js +++ b/src/internal-server/app/Controllers/Http/WorkspaceController.js | |||
@@ -92,12 +92,7 @@ class WorkspaceController { | |||
92 | }); | 92 | }); |
93 | } | 93 | } |
94 | 94 | ||
95 | async delete({ | 95 | async delete({ response, params }) { |
96 | // eslint-disable-next-line no-unused-vars | ||
97 | request, | ||
98 | response, | ||
99 | params, | ||
100 | }) { | ||
101 | // Validate user input | 96 | // Validate user input |
102 | const validation = await validateAll(params, { | 97 | const validation = await validateAll(params, { |
103 | id: 'required', | 98 | id: 'required', |
diff --git a/src/internal-server/app/ImageHelper.js b/src/internal-server/app/ImageHelper.js index fba610069..b24a97836 100644 --- a/src/internal-server/app/ImageHelper.js +++ b/src/internal-server/app/ImageHelper.js | |||
@@ -2,7 +2,7 @@ const Env = use('Env'); | |||
2 | 2 | ||
3 | const { v4: uuid } = require('uuid'); | 3 | const { v4: uuid } = require('uuid'); |
4 | 4 | ||
5 | const path = require('path'); | 5 | const path = require('node:path'); |
6 | const fs = require('fs-extra'); | 6 | const fs = require('fs-extra'); |
7 | const { API_VERSION } = require('../../environment-remote'); | 7 | const { API_VERSION } = require('../../environment-remote'); |
8 | 8 | ||
diff --git a/src/internal-server/database/factory.js b/src/internal-server/database/factory.js index 8534fc20a..8cd45a80d 100644 --- a/src/internal-server/database/factory.js +++ b/src/internal-server/database/factory.js | |||
@@ -1,3 +1,4 @@ | |||
1 | /* eslint-disable unicorn/no-empty-file */ | ||
1 | /* | 2 | /* |
2 | |-------------------------------------------------------------------------- | 3 | |-------------------------------------------------------------------------- |
3 | | Factory | 4 | | Factory |
diff --git a/src/internal-server/start.ts b/src/internal-server/start.ts index f5e1953e7..b6ee65986 100644 --- a/src/internal-server/start.ts +++ b/src/internal-server/start.ts | |||
@@ -18,7 +18,7 @@ | |||
18 | import fold from '@adonisjs/fold'; | 18 | import fold from '@adonisjs/fold'; |
19 | import { Ignitor, hooks } from '@adonisjs/ignitor'; | 19 | import { Ignitor, hooks } from '@adonisjs/ignitor'; |
20 | import { readFile, stat, chmod, writeFile } from 'fs-extra'; | 20 | import { readFile, stat, chmod, writeFile } from 'fs-extra'; |
21 | import { join } from 'path'; | 21 | import { join } from 'node:path'; |
22 | import { LOCAL_HOSTNAME } from '../config'; | 22 | import { LOCAL_HOSTNAME } from '../config'; |
23 | import { isWindows } from '../environment'; | 23 | import { isWindows } from '../environment'; |
24 | 24 | ||
diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js index 8aca39347..2dbd0713e 100644 --- a/src/internal-server/start/routes.js +++ b/src/internal-server/start/routes.js | |||
@@ -5,7 +5,7 @@ | |||
5 | | | 5 | | |
6 | */ | 6 | */ |
7 | 7 | ||
8 | const { timingSafeEqual } = require('crypto'); | 8 | const { timingSafeEqual } = require('node:crypto'); |
9 | 9 | ||
10 | /** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */ | 10 | /** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */ |
11 | const Route = use('Route'); | 11 | const Route = use('Route'); |
diff --git a/src/internal-server/test.ts b/src/internal-server/test.ts index 6949df79e..c163656fb 100644 --- a/src/internal-server/test.ts +++ b/src/internal-server/test.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { join } from 'path'; | 1 | import { join } from 'node:path'; |
2 | import { ensureDirSync } from 'fs-extra'; | 2 | import { ensureDirSync } from 'fs-extra'; |
3 | import { server } from './start'; | 3 | import { server } from './start'; |
4 | 4 | ||
diff --git a/src/jsUtils.ts b/src/jsUtils.ts index f6a1df2fe..0095028ef 100644 --- a/src/jsUtils.ts +++ b/src/jsUtils.ts | |||
@@ -3,15 +3,15 @@ export const ifUndefined = <T>( | |||
3 | defaultValue: T, | 3 | defaultValue: T, |
4 | ): T => source ?? defaultValue; | 4 | ): T => source ?? defaultValue; |
5 | 5 | ||
6 | export const convertToJSON = (data: string | any | undefined | null) => | 6 | export const convertToJSON = (data?: string | any | null) => |
7 | data && typeof data === 'string' && data.length > 0 ? JSON.parse(data) : data; | 7 | data && typeof data === 'string' && data.length > 0 ? JSON.parse(data) : data; |
8 | 8 | ||
9 | export const cleanseJSObject = (data: any | undefined | null) => | 9 | export const cleanseJSObject = (data?: any | null) => |
10 | JSON.parse(JSON.stringify(data)); | 10 | JSON.parse(JSON.stringify(data)); |
11 | 11 | ||
12 | export const isEscKeyPress = (keyCode: number) => keyCode === 27; | 12 | export const isEscKeyPress = (keyCode: number) => keyCode === 27; |
13 | 13 | ||
14 | export const safeParseInt = (text: string | number | undefined | null) => { | 14 | export const safeParseInt = (text?: string | number | null) => { |
15 | if (text === undefined || text === null) { | 15 | if (text === undefined || text === null) { |
16 | return 0; | 16 | return 0; |
17 | } | 17 | } |
diff --git a/src/lib/Menu.ts b/src/lib/Menu.ts index f587f8df9..08ad9dabe 100644 --- a/src/lib/Menu.ts +++ b/src/lib/Menu.ts | |||
@@ -12,7 +12,7 @@ import { defineMessages, IntlShape } from 'react-intl'; | |||
12 | import osName from 'os-name'; | 12 | import osName from 'os-name'; |
13 | import { fromJS } from 'immutable'; | 13 | import { fromJS } from 'immutable'; |
14 | import semver from 'semver'; | 14 | import semver from 'semver'; |
15 | import os from 'os'; | 15 | import os from 'node:os'; |
16 | import { | 16 | import { |
17 | isWindows, | 17 | isWindows, |
18 | cmdOrCtrlShortcutKey, | 18 | cmdOrCtrlShortcutKey, |
diff --git a/src/lib/Tray.ts b/src/lib/Tray.ts index dafbb68aa..0d567fc13 100644 --- a/src/lib/Tray.ts +++ b/src/lib/Tray.ts | |||
@@ -9,7 +9,7 @@ import { | |||
9 | BrowserWindow, | 9 | BrowserWindow, |
10 | NativeImage, | 10 | NativeImage, |
11 | } from 'electron'; | 11 | } from 'electron'; |
12 | import { join } from 'path'; | 12 | import { join } from 'node:path'; |
13 | import macosVersion from 'macos-version'; | 13 | import macosVersion from 'macos-version'; |
14 | import { isMac, isWindows, isLinux } from '../environment'; | 14 | import { isMac, isWindows, isLinux } from '../environment'; |
15 | 15 | ||
diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts index 35e8d4979..a6d2fd86d 100644 --- a/src/models/Recipe.ts +++ b/src/models/Recipe.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import semver from 'semver'; | 1 | import semver from 'semver'; |
2 | import { pathExistsSync } from 'fs-extra'; | 2 | import { pathExistsSync } from 'fs-extra'; |
3 | import { join } from 'path'; | 3 | import { join } from 'node:path'; |
4 | import { DEFAULT_SERVICE_SETTINGS } from '../config'; | 4 | import { DEFAULT_SERVICE_SETTINGS } from '../config'; |
5 | import { ifUndefined } from '../jsUtils'; | 5 | import { ifUndefined } from '../jsUtils'; |
6 | 6 | ||
diff --git a/src/models/Service.ts b/src/models/Service.ts index af0085185..4a9fcf4fb 100644 --- a/src/models/Service.ts +++ b/src/models/Service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { autorun, action, computed, makeObservable, observable } from 'mobx'; | 1 | import { autorun, action, computed, makeObservable, observable } from 'mobx'; |
2 | import { ipcRenderer } from 'electron'; | 2 | import { ipcRenderer } from 'electron'; |
3 | import { webContents } from '@electron/remote'; | 3 | import { webContents } from '@electron/remote'; |
4 | import { join } from 'path'; | 4 | import { join } from 'node:path'; |
5 | import ElectronWebView from 'react-electron-web-view'; | 5 | import ElectronWebView from 'react-electron-web-view'; |
6 | 6 | ||
7 | import { todosStore } from '../features/todos'; | 7 | import { todosStore } from '../features/todos'; |
diff --git a/src/preload-safe-debug.ts b/src/preload-safe-debug.ts index d18dd8639..471ae1a1f 100644 --- a/src/preload-safe-debug.ts +++ b/src/preload-safe-debug.ts | |||
@@ -8,6 +8,7 @@ | |||
8 | * We disable the `debug` package in context isolated renderers, | 8 | * We disable the `debug` package in context isolated renderers, |
9 | * because they correspond to preload scripts. | 9 | * because they correspond to preload scripts. |
10 | */ | 10 | */ |
11 | // eslint-disable-next-line unicorn/no-empty-file | ||
11 | module.exports = function debug(namespace: string): (...params: any[]) => void { | 12 | module.exports = function debug(namespace: string): (...params: any[]) => void { |
12 | if ( | 13 | if ( |
13 | typeof process === 'object' && | 14 | typeof process === 'object' && |
@@ -18,13 +19,14 @@ module.exports = function debug(namespace: string): (...params: any[]) => void { | |||
18 | // We don't reimplement the matching algorithm from `debug` and just dump all | 19 | // We don't reimplement the matching algorithm from `debug` and just dump all |
19 | // messages to the console if some form of `Ferdium` debugging is enabled. | 20 | // messages to the console if some form of `Ferdium` debugging is enabled. |
20 | if (process.env.DEBUG?.startsWith('Ferdium:')) { | 21 | if (process.env.DEBUG?.startsWith('Ferdium:')) { |
22 | // eslint-disable-next-line no-console | ||
21 | return (...params) => console.debug(`[${namespace}]`, ...params); | 23 | return (...params) => console.debug(`[${namespace}]`, ...params); |
22 | } | 24 | } |
23 | return () => {}; | 25 | return () => {}; |
24 | } | 26 | } |
25 | /* | 27 | /* |
26 | eslint-disable-next-line global-require -- | ||
27 | This file contains a workaround for situations were global require is problematic. | 28 | This file contains a workaround for situations were global require is problematic. |
28 | */ | 29 | */ |
30 | // eslint-disable-next-line global-require | ||
29 | return require('debug')(namespace); | 31 | return require('debug')(namespace); |
30 | }; | 32 | }; |
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 412c52ecf..0bf845e4d 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -11,7 +11,7 @@ import { action, computed, makeObservable, observable } from 'mobx'; | |||
11 | import moment from 'moment'; | 11 | import moment from 'moment'; |
12 | import AutoLaunch from 'auto-launch'; | 12 | import AutoLaunch from 'auto-launch'; |
13 | import ms from 'ms'; | 13 | import ms from 'ms'; |
14 | import { URL } from 'url'; | 14 | import { URL } from 'node:url'; |
15 | import { readJsonSync } from 'fs-extra'; | 15 | import { readJsonSync } from 'fs-extra'; |
16 | 16 | ||
17 | import { Stores } from '../@types/stores.types'; | 17 | import { Stores } from '../@types/stores.types'; |
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts index 82f3b95ce..1cee0c57f 100644 --- a/src/stores/ServicesStore.ts +++ b/src/stores/ServicesStore.ts | |||
@@ -3,7 +3,7 @@ import { action, reaction, computed, observable, makeObservable } from 'mobx'; | |||
3 | import { debounce, remove } from 'lodash'; | 3 | import { debounce, remove } from 'lodash'; |
4 | import ms from 'ms'; | 4 | import ms from 'ms'; |
5 | import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra'; | 5 | import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra'; |
6 | import { join } from 'path'; | 6 | import { join } from 'node:path'; |
7 | 7 | ||
8 | import { Stores } from '../@types/stores.types'; | 8 | import { Stores } from '../@types/stores.types'; |
9 | import { ApiInterface } from '../api'; | 9 | import { ApiInterface } from '../api'; |
diff --git a/src/webview/darkmode.ts b/src/webview/darkmode.ts index f5e8700e0..88d39f19f 100644 --- a/src/webview/darkmode.ts +++ b/src/webview/darkmode.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { join } from 'path'; | 1 | import { join } from 'node:path'; |
2 | import { pathExistsSync, readFileSync } from 'fs-extra'; | 2 | import { pathExistsSync, readFileSync } from 'fs-extra'; |
3 | 3 | ||
4 | const debug = require('../preload-safe-debug')('Ferdium:DarkMode'); | 4 | const debug = require('../preload-safe-debug')('Ferdium:DarkMode'); |
diff --git a/src/webview/recipe.ts b/src/webview/recipe.ts index 76615d234..ee7fa26d2 100644 --- a/src/webview/recipe.ts +++ b/src/webview/recipe.ts | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | import { noop, debounce } from 'lodash'; | 4 | import { noop, debounce } from 'lodash'; |
5 | import { contextBridge, ipcRenderer } from 'electron'; | 5 | import { contextBridge, ipcRenderer } from 'electron'; |
6 | import { join } from 'path'; | 6 | import { join } from 'node:path'; |
7 | import { autorun, computed, makeObservable, observable } from 'mobx'; | 7 | import { autorun, computed, makeObservable, observable } from 'mobx'; |
8 | import { pathExistsSync, readFileSync } from 'fs-extra'; | 8 | import { pathExistsSync, readFileSync } from 'fs-extra'; |
9 | import { | 9 | import { |
@@ -11,7 +11,7 @@ import { | |||
11 | enable as enableDarkMode, | 11 | enable as enableDarkMode, |
12 | } from 'darkreader'; | 12 | } from 'darkreader'; |
13 | 13 | ||
14 | import { existsSync } from 'fs'; | 14 | import { existsSync } from 'node:fs'; |
15 | import ignoreList from './darkmode/ignore'; | 15 | import ignoreList from './darkmode/ignore'; |
16 | import customDarkModeCss from './darkmode/custom'; | 16 | import customDarkModeCss from './darkmode/custom'; |
17 | 17 | ||
diff --git a/test/jsUtils.test.ts b/test/jsUtils.test.ts index 73b36d990..138158611 100644 --- a/test/jsUtils.test.ts +++ b/test/jsUtils.test.ts | |||
@@ -54,7 +54,7 @@ describe('jsUtils', () => { | |||
54 | 54 | ||
55 | describe('convertToJSON', () => { | 55 | describe('convertToJSON', () => { |
56 | it('returns undefined for undefined input', () => { | 56 | it('returns undefined for undefined input', () => { |
57 | const result = jsUtils.convertToJSON(undefined); | 57 | const result = jsUtils.convertToJSON(); |
58 | expect(result).toEqual(undefined); | 58 | expect(result).toEqual(undefined); |
59 | }); | 59 | }); |
60 | 60 | ||
@@ -80,7 +80,7 @@ describe('jsUtils', () => { | |||
80 | describe('cleanseJSObject', () => { | 80 | describe('cleanseJSObject', () => { |
81 | // eslint-disable-next-line jest/no-disabled-tests | 81 | // eslint-disable-next-line jest/no-disabled-tests |
82 | it.skip('throws error for undefined input', () => { | 82 | it.skip('throws error for undefined input', () => { |
83 | const result = jsUtils.cleanseJSObject(undefined); | 83 | const result = jsUtils.cleanseJSObject(); |
84 | expect(result).toThrow(); | 84 | expect(result).toThrow(); |
85 | }); | 85 | }); |
86 | 86 | ||
@@ -110,7 +110,7 @@ describe('jsUtils', () => { | |||
110 | 110 | ||
111 | describe('safeParseInt', () => { | 111 | describe('safeParseInt', () => { |
112 | it('returns zero for undefined', () => { | 112 | it('returns zero for undefined', () => { |
113 | expect(jsUtils.safeParseInt(undefined)).toEqual(0); | 113 | expect(jsUtils.safeParseInt()).toEqual(0); |
114 | }); | 114 | }); |
115 | 115 | ||
116 | it('returns zero for null', () => { | 116 | it('returns zero for null', () => { |