Skip to content

Commit c52978d

Browse files
authored
chore: Update eslint to v9 with flat config (#1412)
* chore: Update eslint to v9 with flat config * disable eslint for that whole example file. v1 not worth it imo * update ts-eslint * lock versions * ci: update pnpm
1 parent c26b5cb commit c52978d

File tree

12 files changed

+1274
-2050
lines changed

12 files changed

+1274
-2050
lines changed

.eslintignore

-4
This file was deleted.

.eslintrc.json

-20
This file was deleted.

.github/workflows/audit-javascript.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
${{ runner.os }}-
4040
- uses: actions/setup-node@v3
4141
with:
42-
node-version: 18
42+
node-version: 20
4343
- uses: pnpm/action-setup@v2
4444
with:
45-
version: 7.x.x
45+
version: 9.x.x
4646
run_install: true
4747
- name: audit
4848
run: pnpm audit

.github/workflows/covector-version-or-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626

2727
- uses: pnpm/action-setup@v2
2828
with:
29-
version: 7.x.x
29+
version: 9.x.x
3030
run_install: true
3131

3232
- name: install webkit2gtk and libudev for [authenticator]

.github/workflows/lint-javascript.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ jobs:
4242
${{ runner.os }}-
4343
- uses: actions/setup-node@v3
4444
with:
45-
node-version: 18
45+
node-version: 20
4646
- uses: pnpm/action-setup@v2
4747
with:
48-
version: 7.x.x
48+
version: 9.x.x
4949
run_install: true
5050
- name: eslint
5151
run: pnpm lint
@@ -62,10 +62,10 @@ jobs:
6262
${{ runner.os }}-
6363
- uses: actions/setup-node@v3
6464
with:
65-
node-version: 18
65+
node-version: 20
6666
- uses: pnpm/action-setup@v2
6767
with:
68-
version: 7.x.x
68+
version: 9.x.x
6969
run_install: true
7070
- name: prettier check
7171
run: pnpm format-check

.github/workflows/sync.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
3131
- uses: actions/setup-node@v3
3232
with:
33-
node-version: 18
33+
node-version: 20
3434

3535
- uses: pnpm/action-setup@v2
3636
with:
37-
version: 7.x.x
37+
version: 9.x.x
3838
run_install: true
3939

4040
- name: Build packages

eslint.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import eslint from "@eslint/js";
2+
import eslintConfigPrettier from "eslint-config-prettier";
3+
import tseslint from "typescript-eslint";
4+
5+
export default tseslint.config(
6+
{
7+
ignores: [
8+
"**/target",
9+
"**/node_modules",
10+
"**/dist",
11+
"**/dist-js",
12+
"**/rollup.config.mjs",
13+
"**/vite.config.ts",
14+
".scripts",
15+
"eslint.config.js",
16+
],
17+
},
18+
eslint.configs.recommended,
19+
eslintConfigPrettier,
20+
...tseslint.configs.recommendedTypeChecked,
21+
{
22+
languageOptions: {
23+
parserOptions: { project: true, tsconfigRootDir: import.meta.dirname },
24+
},
25+
},
26+
);

package.json

+8-12
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,24 @@
1010
"format-check": "prettier --check ."
1111
},
1212
"devDependencies": {
13+
"@eslint/js": "9.4.0",
1314
"@rollup/plugin-node-resolve": "15.2.3",
1415
"@rollup/plugin-terser": "0.4.4",
1516
"@rollup/plugin-typescript": "11.1.6",
16-
"@typescript-eslint/eslint-plugin": "7.6.0",
17-
"@typescript-eslint/parser": "7.6.0",
18-
"eslint": "8.57.0",
17+
"@types/eslint__js": "8.42.3",
18+
"eslint": "9.4.0",
1919
"eslint-config-prettier": "9.1.0",
20-
"eslint-config-standard-with-typescript": "43.0.1",
21-
"eslint-plugin-import": "2.29.1",
22-
"eslint-plugin-n": "17.2.1",
23-
"eslint-plugin-promise": "6.1.1",
24-
"eslint-plugin-security": "3.0.0",
25-
"prettier": "3.2.5",
26-
"rollup": "4.14.3",
27-
"typescript": "5.4.5"
20+
"prettier": "3.3.0",
21+
"rollup": "4.18.0",
22+
"typescript": "5.4.5",
23+
"typescript-eslint": "rc-v8"
2824
},
2925
"resolutions": {
3026
"semver": ">=7.5.2",
3127
"optionator": ">=0.9.3"
3228
},
3329
"engines": {
34-
"pnpm": ">=7.33.1"
30+
"pnpm": "^9.0.0"
3531
},
3632
"pnpm": {
3733
"auditConfig": {

plugins/log/guest-js/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export async function attachLogger(fn: LoggerFn): Promise<UnlistenFn> {
200200
// Strip ANSI escape codes
201201
message = message.replace(
202202
// TODO: Investigate security/detect-unsafe-regex
203-
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
203+
// eslint-disable-next-line no-control-regex
204204
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
205205
"",
206206
);

plugins/upload/guest-js/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function listenToEventIfNeeded(event: string): Promise<void> {
1818

1919
// We're not awaiting this Promise to prevent issues with Promise.all
2020
// the listener will still be registered in time.
21-
appWindow.listen<ProgressPayload>(event, ({ payload }) => {
21+
void appWindow.listen<ProgressPayload>(event, ({ payload }) => {
2222
const handler = handlers.get(payload.id);
2323
if (handler != null) {
2424
handler(payload.progress, payload.total);

plugins/websocket/examples/tauri-app/src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
import WebSocket from "tauri-plugin-websocket-api";
23
import "./style.css";
34

0 commit comments

Comments
 (0)