Skip to content

Commit 80cf2ca

Browse files
Nemo157GuillaumeGomez
authored andcommitted
Update to eslint v9
Switch to using `deno` as that allows referring to the config packages without having to setup a `package.json` and other stuff required when running `eslint` through `node` now.
1 parent 36c721f commit 80cf2ca

File tree

4 files changed

+76
-74
lines changed

4 files changed

+76
-74
lines changed

.eslintrc.json

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ jobs:
180180
runs-on: ubuntu-latest
181181
steps:
182182
- uses: actions/checkout@v4
183-
- uses: actions/setup-node@v4
183+
- uses: denoland/setup-deno@v1
184184
- name: install `just`
185185
run: sudo snap install --edge --classic just
186-
- run: npm install -g eslint@8
187186
- run: just lint-js

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ lint:
1515
cargo clippy --all-features --all-targets --workspace --locked -- -D warnings
1616

1717
lint-js:
18-
eslint static templates gui-tests
18+
deno run -A npm:eslint@9 static templates gui-tests eslint.config.js

eslint.config.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import js from "npm:@eslint/js@9";
2+
import globals from "npm:globals@15";
3+
4+
export default [
5+
js.configs.recommended,
6+
{
7+
languageOptions: {
8+
ecmaVersion: 2022,
9+
},
10+
rules: {
11+
"arrow-parens": ["error", "as-needed"],
12+
"arrow-spacing": ["error", { before: true, after: true }],
13+
"block-scoped-var": "error",
14+
"brace-style": ["error", "1tbs", { allowSingleLine: false }],
15+
"comma-dangle": ["error", "always-multiline"],
16+
"comma-style": ["error", "last"],
17+
"eol-last": ["error", "always"],
18+
"eqeqeq": "error",
19+
"func-call-spacing": ["error", "never"],
20+
"guard-for-in": "error",
21+
"key-spacing": ["error", { beforeColon: false, afterColon: true, mode: "strict" }],
22+
"keyword-spacing": ["error", { before: true, after: true }],
23+
"linebreak-style": ["error", "unix"],
24+
"max-len": ["error", { code: 100, tabWidth: 4 }],
25+
"no-alert": "error",
26+
"no-confusing-arrow": "error",
27+
"no-const-assign": "error",
28+
"no-debugger": "error",
29+
"no-div-regex": "error",
30+
"no-dupe-args": "error",
31+
"no-dupe-else-if": "error",
32+
"no-dupe-keys": "error",
33+
"no-duplicate-case": "error",
34+
"no-ex-assign": "error",
35+
"no-fallthrough": "error",
36+
"no-floating-decimal": "error",
37+
"no-implicit-globals": "error",
38+
"no-implied-eval": "error",
39+
"no-import-assign": "error",
40+
"no-invalid-regexp": "error",
41+
"no-label-var": "error",
42+
"no-lonely-if": "error",
43+
"no-mixed-operators": "error",
44+
"no-multi-assign": "error",
45+
"no-return-assign": "error",
46+
"no-script-url": "error",
47+
"no-self-compare": "error",
48+
"no-sequences": "error",
49+
"no-template-curly-in-string": "error",
50+
"no-trailing-spaces": "error",
51+
"no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
52+
"no-var": ["error"],
53+
"prefer-arrow-callback": ["error"],
54+
"prefer-const": ["error"],
55+
"quotes": ["error", "double"],
56+
"semi": ["error", "always"],
57+
"space-before-blocks": "error",
58+
"space-before-function-paren": ["error", "never"],
59+
"space-infix-ops": "error",
60+
},
61+
},
62+
{
63+
files: ["static/**/*", "templates/**/*"],
64+
languageOptions: {
65+
globals: globals.browser,
66+
},
67+
},
68+
{
69+
files: ["gui-tests/**/*"],
70+
languageOptions: {
71+
globals: globals.node,
72+
},
73+
},
74+
];

0 commit comments

Comments
 (0)