Skip to content

Commit 485adfa

Browse files
author
Corentin Mors
committed
Update eslint to v9
1 parent 5711312 commit 485adfa

File tree

7 files changed

+731
-483
lines changed

7 files changed

+731
-483
lines changed

.eslintrc.json

-40
This file was deleted.

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ yarn run pkg
4444

4545
It outputs in `bundle` directory. Be aware you must use the same Node version as the target.
4646

47+
> [!NOTE]
48+
> If you're using vscode, you need to enable eslint flat configuration in your settings `.vscode/settings.json`.
49+
>
50+
> ```
51+
> "eslint.experimental.useFlatConfig": true`
52+
> ```
53+
4754
### Debug mode
4855
4956
You can use `--debug` to see all the debug logs of the CLI.

eslint.config.mjs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import tseslint from 'typescript-eslint';
2+
import eslint from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
5+
export default tseslint.config(
6+
{
7+
ignores: ['**/documentation', '**/scripts'],
8+
},
9+
eslint.configs.recommended,
10+
...tseslint.configs.recommendedTypeChecked,
11+
eslintPluginPrettierRecommended,
12+
{
13+
languageOptions: {
14+
ecmaVersion: 2022,
15+
sourceType: 'module',
16+
parserOptions: {
17+
project: true,
18+
},
19+
},
20+
21+
rules: {
22+
'no-return-await': 'error',
23+
24+
'@typescript-eslint/no-explicit-any': 'off',
25+
'@typescript-eslint/no-empty-interface': 'off',
26+
27+
'@typescript-eslint/no-unused-vars': [
28+
'error',
29+
{
30+
varsIgnorePattern: '[iI]gnored',
31+
argsIgnorePattern: '^_',
32+
},
33+
],
34+
35+
'object-shorthand': ['error', 'always'],
36+
},
37+
}
38+
);

package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,29 @@
5252
},
5353
"devDependencies": {
5454
"@aivenio/tsc-output-parser": "^2.1.1",
55+
"@eslint/eslintrc": "^3.1.0",
56+
"@eslint/js": "^9.4.0",
5557
"@types/async": "^3.2.24",
5658
"@types/better-sqlite3": "^7.6.10",
5759
"@types/chai": "^4.3.16",
60+
"@types/eslint__js": "^8.42.3",
5861
"@types/inquirer": "^9.0.7",
5962
"@types/libsodium-wrappers": "^0.7.14",
6063
"@types/mocha": "^10.0.6",
6164
"@types/node": "^18.19.34",
62-
"@typescript-eslint/eslint-plugin": "^7.8.0",
63-
"@typescript-eslint/parser": "^7.8.0",
6465
"@yao-pkg/pkg": "^5.11.5",
6566
"chai": "^5.1.1",
6667
"esbuild": "^0.21.5",
67-
"eslint": "^8.57.0",
68+
"eslint": "^9.4.0",
6869
"eslint-config-prettier": "^9.1.0",
69-
"eslint-plugin-import": "^2.29.1",
70+
"eslint-plugin-prettier": "^5.1.3",
7071
"execa": "^9.2.0",
7172
"husky": "^9.0.11",
7273
"mocha": "^10.4.0",
73-
"prettier": "^3.2.5",
74+
"prettier": "^3.3.1",
7475
"ts-node": "^10.9.2",
75-
"typescript": "^5.4.5"
76+
"typescript": "^5.4.5",
77+
"typescript-eslint": "^7.12.0"
7678
},
7779
"dependencies": {
7880
"@dashlane/nsm-attestation": "^1.0.2",

src/command-handlers/configure.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const configureUserPresenceVerification = async (options: {
7272

7373
if (method === 'biometrics') {
7474
if (process.platform === 'darwin') {
75-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
75+
// eslint-disable-next-line @typescript-eslint/no-var-requires
7676
const nodemacauth = require('node-mac-auth') as typeof import('node-mac-auth');
7777
if (!nodemacauth.canPromptTouchID()) {
7878
throw new Error('Biometrics are not supported on your device.');

src/modules/auth/userPresenceVerification.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const userPresenceVerification = async (params: { deviceConfiguration: De
1313

1414
if (deviceConfiguration.userPresenceVerification === 'biometrics') {
1515
if (process.platform === 'darwin') {
16-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
16+
// eslint-disable-next-line @typescript-eslint/no-var-requires
1717
const nodemacauth = require('node-mac-auth') as typeof import('node-mac-auth');
1818
const { canPromptTouchID, promptTouchID } = nodemacauth;
1919
if (canPromptTouchID()) {

0 commit comments

Comments
 (0)