Skip to content

Commit abb7f5c

Browse files
Migrate to oxlint (#1104)
Migrates JavaScript linting from eslint to oxlint
1 parent 6affc47 commit abb7f5c

8 files changed

Lines changed: 380 additions & 796 deletions

File tree

‎.devcontainer/devcontainer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"extensions": [
1111
"EditorConfig.EditorConfig",
1212
"bmewburn.vscode-intelephense-client",
13-
"dbaeumer.vscode-eslint",
13+
"oxc.oxc-vscode",
1414
"streetsidesoftware.code-spell-checker"
1515
]
1616
}

‎.github/workflows/code-quality-js.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
eslint:
17-
name: ESLint
17+
name: Oxlint
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Checkout code
@@ -31,5 +31,5 @@ jobs:
3131
- name: Installing dependencies
3232
run: npm ci --ignore-scripts
3333

34-
- name: Run ESLint
34+
- name: Run Oxlint
3535
run: npm run lint

‎.oxlintrc.json‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [],
4+
"categories": {
5+
"correctness": "off"
6+
},
7+
"env": {
8+
"builtin": true,
9+
"es2026": true,
10+
"browser": true,
11+
"node": true
12+
},
13+
"rules": {
14+
"constructor-super": "error",
15+
"for-direction": "error",
16+
"getter-return": "error",
17+
"no-async-promise-executor": "error",
18+
"no-case-declarations": "error",
19+
"no-class-assign": "error",
20+
"no-compare-neg-zero": "error",
21+
"no-cond-assign": "error",
22+
"no-const-assign": "error",
23+
"no-constant-binary-expression": "error",
24+
"no-constant-condition": "error",
25+
"no-control-regex": "error",
26+
"no-debugger": "error",
27+
"no-delete-var": "error",
28+
"no-dupe-class-members": "error",
29+
"no-dupe-else-if": "error",
30+
"no-dupe-keys": "error",
31+
"no-duplicate-case": "error",
32+
"no-empty": "error",
33+
"no-empty-character-class": "error",
34+
"no-empty-pattern": "error",
35+
"no-empty-static-block": "error",
36+
"no-ex-assign": "error",
37+
"no-extra-boolean-cast": "error",
38+
"no-fallthrough": "error",
39+
"no-func-assign": "error",
40+
"no-global-assign": "error",
41+
"no-import-assign": "error",
42+
"no-invalid-regexp": "error",
43+
"no-irregular-whitespace": "error",
44+
"no-loss-of-precision": "error",
45+
"no-misleading-character-class": "error",
46+
"no-new-native-nonconstructor": "error",
47+
"no-nonoctal-decimal-escape": "error",
48+
"no-obj-calls": "error",
49+
"no-prototype-builtins": "error",
50+
"no-redeclare": "error",
51+
"no-regex-spaces": "error",
52+
"no-self-assign": "error",
53+
"no-setter-return": "error",
54+
"no-shadow-restricted-names": "error",
55+
"no-sparse-arrays": "error",
56+
"no-this-before-super": "error",
57+
"no-unassigned-vars": "error",
58+
"no-undef": "error",
59+
"no-unexpected-multiline": "error",
60+
"no-unreachable": "error",
61+
"no-unsafe-finally": "error",
62+
"no-unsafe-negation": "error",
63+
"no-unsafe-optional-chaining": "error",
64+
"no-unused-labels": "error",
65+
"no-unused-private-class-members": "error",
66+
"no-unused-vars": "error",
67+
"no-useless-assignment": "error",
68+
"no-useless-backreference": "error",
69+
"no-useless-catch": "error",
70+
"no-useless-escape": "error",
71+
"no-with": "error",
72+
"preserve-caught-error": "error",
73+
"require-yield": "error",
74+
"use-isnan": "error",
75+
"valid-typeof": "error"
76+
}
77+
}

‎eslint.config.mjs‎

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

‎frontend/js/class/Dialog/FilterAddDialog.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ export class FilterAddDialog extends ViewGroupDialogs {
192192
const select = document.getElementById(this.#getId('filter-value'))
193193
select.innerText = ''
194194

195-
let valueName = ''
196-
let textValueName = ''
195+
let valueName
196+
let textValueName
197197
switch (type) {
198198
case 'address':
199199
valueName = 'address'
@@ -227,7 +227,7 @@ export class FilterAddDialog extends ViewGroupDialogs {
227227

228228
const timeTypes = ['hour', 'minute', 'second']
229229

230-
let data = []
230+
let data
231231
if (type === 'version') {
232232
data = [{ number: 4 }, { number: 6 }]
233233
} else if (timeTypes.includes(type)) {

‎frontend/js/class/Pagination.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class Pagination {
4949
* Set buttons
5050
*/
5151
setButtons () {
52-
let prev = null
53-
let next = null
52+
let prev
53+
let next
5454
const last = this.#pageCount
5555

5656
if (this.#pageCount > 0) {

0 commit comments

Comments
 (0)