Skip to content

Commit bb551db

Browse files
authored
Drop eslint and extend oxlint config including type aware rules (#1029)
* Drop eslint and only rely on oxlint. * Use addlicense for license checks * oxlint: Fix type related issues, configure oxc vscode extension correctly * Clean-up all default rules and added import rules again * Implemented review comments * Implemented further, review comments and commented further typescript rules with nursery * Made typescript/strict-boolean-expressions even stricter * Updated all dependencies
1 parent 5ceaabd commit bb551db

File tree

92 files changed

+2722
-6019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2722
-6019
lines changed

.oxlintrc.json

Lines changed: 48 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
33
"plugins": [
4-
"typescript"
4+
"typescript",
5+
"oxc",
6+
"promise",
7+
"import"
8+
// these rule sets may be added later
9+
// "vitest"
10+
// "react"
511
],
612
"categories": {
713
"correctness": "error"
@@ -23,90 +29,35 @@
2329
"**/production/**/*",
2430
"**/public/**/*",
2531
"**/.next/**/*",
26-
"**/*env.d.ts",
2732
"**/.pnp.cjs"
2833
],
34+
// see: https://oxc.rs/docs/guide/usage/linter/rules.html
2935
"rules": {
3036
"eqeqeq": "error",
3137
// currently in oxlint's nursery (=under development)
32-
"constructor-super": "error",
33-
// currently unsupported by oxlint
34-
"dot-notation": "error",
35-
"for-direction": "error",
36-
// currently in oxlint's nursery (=under development)
3738
"getter-return": "error",
3839
"guard-for-in": "error",
39-
// currently unsupported by oxlint
40-
"new-parens": "error",
41-
"no-async-promise-executor": "error",
40+
"no-array-constructor": "error",
4241
"no-bitwise": "error",
43-
"no-caller": "error",
4442
"no-case-declarations": "error",
45-
"no-class-assign": "error",
46-
"no-compare-neg-zero": "error",
47-
"no-cond-assign": "error",
48-
"no-const-assign": "error",
49-
"no-constant-binary-expression": "error",
50-
"no-constant-condition": "error",
51-
"no-control-regex": "error",
52-
"no-debugger": "error",
53-
"no-delete-var": "error",
54-
// currently unsupported by oxlint
55-
"no-dupe-args": "error",
56-
"no-dupe-class-members": "error",
57-
"no-dupe-else-if": "error",
58-
"no-dupe-keys": "error",
59-
"no-duplicate-case": "error",
6043
"no-empty": "error",
6144
"no-empty-character-class": "error",
6245
"no-empty-pattern": "error",
6346
"no-empty-static-block": "error",
64-
"no-eval": "error",
65-
"no-ex-assign": "error",
6647
"no-explicit-any": "error",
67-
"no-extra-boolean-cast": "error",
6848
"no-fallthrough": "error",
69-
"no-func-assign": "error",
70-
"no-global-assign": "error",
7149
"no-import-assign": "error",
7250
"no-inner-declarations": "off",
73-
"no-invalid-regexp": "error",
74-
"no-irregular-whitespace": "error",
7551
"no-labels": "error",
76-
"no-loss-of-precision": "error",
77-
// currently in oxlint's nursery (=under development)
7852
"no-misleading-character-class": "error",
79-
// currently unsupported by oxlint
80-
"no-multiple-empty-lines": ["error", {
81-
"max": 1
82-
}],
83-
"no-new-native-nonconstructor": "error",
8453
"no-new-wrappers": "error",
85-
"no-nonoctal-decimal-escape": "error",
86-
"no-obj-calls": "error",
87-
// currently unsupported by oxlint
88-
"no-octal": "error",
8954
"no-prototype-builtins": "error",
9055
"no-redeclare": "error",
9156
"no-regex-spaces": "error",
92-
"no-self-assign": "error",
93-
"no-setter-return": "error",
94-
"no-shadow-restricted-names": "error",
95-
"no-sparse-arrays": "error",
96-
"no-this-before-super": "error",
9757
"no-throw-literal": "error",
98-
// currently unsupported by oxlint
99-
"no-trailing-spaces": "error",
100-
// currently in oxlint's nursery (=under development)
101-
"no-undef": "off",
10258
"no-unexpected-multiline": "error",
10359
// currently in oxlint's nursery (=under development)
10460
"no-unreachable": "error",
105-
"no-unsafe-finally": "error",
106-
"no-unsafe-negation": "error",
107-
"no-unsafe-optional-chaining": "error",
108-
"no-unused-labels": "error",
109-
"no-unused-private-class-members": "error",
11061
"no-unused-vars": [
11162
"error",
11263
{
@@ -115,60 +66,53 @@
11566
"varsIgnorePattern": "^_"
11667
}
11768
],
118-
"no-useless-backreference": "error",
119-
"no-useless-catch": "error",
120-
"no-useless-escape": "error",
12169
"no-var": "error",
122-
"no-var-requires": "error",
123-
"no-with": "error",
124-
// currently unsupported by oxlint
12570
"prefer-const": "error",
12671
"prefer-rest-params": "error",
12772
"prefer-spread": "error",
128-
// currently unsupported by oxlint
129-
"quotes": [2, "single", {
130-
"avoidEscape": true
131-
}],
132-
"require-yield": "error",
133-
// currently unsupported by oxlint
134-
"semi": [2, "always"],
135-
// currently unsupported by oxlint
136-
"space-before-function-paren": ["error", {
137-
"anonymous": "never",
138-
"asyncArrow": "always",
139-
"named": "never"
140-
}],
141-
"use-isnan": "error",
142-
"valid-typeof": "error",
143-
"@typescript-eslint/ban-ts-comment": "error",
144-
"no-array-constructor": "error",
145-
"@typescript-eslint/adjacent-overload-signatures": "error",
146-
"@typescript-eslint/array-type": [
73+
74+
// all typescript related rules
75+
"typescript/adjacent-overload-signatures": "error",
76+
"typescript/array-type": [
14777
"error",
14878
{
14979
"default": "array-simple"
15080
}
15181
],
152-
"@typescript-eslint/no-duplicate-enum-values": "error",
153-
"@typescript-eslint/no-empty-object-type": "error",
154-
"@typescript-eslint/no-extra-non-null-assertion": "error",
155-
"@typescript-eslint/no-misused-new": "error",
156-
"@typescript-eslint/no-namespace": "off",
157-
"@typescript-eslint/no-non-null-assertion": "off",
158-
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
159-
"@typescript-eslint/prefer-for-of": "error",
160-
"@typescript-eslint/no-require-imports": "error",
161-
"@typescript-eslint/no-this-alias": "error",
162-
"@typescript-eslint/no-unnecessary-type-constraint": "error",
163-
"@typescript-eslint/no-unsafe-declaration-merging": "error",
164-
"@typescript-eslint/no-unsafe-function-type": "error",
165-
"@typescript-eslint/no-unused-expressions": "error",
166-
"@typescript-eslint/no-unnecessary-condition": "error",
167-
"@typescript-eslint/no-wrapper-object-types": "error",
168-
"@typescript-eslint/parameter-properties": "error",
169-
"@typescript-eslint/prefer-as-const": "error",
170-
"@typescript-eslint/prefer-namespace-keyword": "error",
171-
"@typescript-eslint/strict-boolean-expressions": "error",
172-
"@typescript-eslint/triple-slash-reference": "error",
82+
"typescript/ban-ts-comment": "error",
83+
// currently in oxlint's nursery (=under development)
84+
"typescript/dot-notation": "error",
85+
"typescript/no-empty-object-type": "error",
86+
"typescript/no-namespace": "off",
87+
// currently in oxlint's nursery (=under development)
88+
"typescript/no-unnecessary-condition": "error",
89+
"typescript/no-unnecessary-type-constraint": "error",
90+
"typescript/no-unsafe-function-type": "error",
91+
"typescript/no-unused-expressions": "error",
92+
"typescript/no-non-null-assertion": "off",
93+
"typescript/no-require-imports": "error",
94+
"typescript/no-var-requires": "error",
95+
"typescript/parameter-properties": "error",
96+
"typescript/prefer-for-of": "error",
97+
"typescript/prefer-namespace-keyword": "error",
98+
"typescript/prefer-nullish-coalescing": "error",
99+
// currently in oxlint's nursery (=under development)
100+
"typescript/prefer-optional-chain": "error",
101+
"typescript/strict-boolean-expressions": [
102+
"error",
103+
{
104+
"allowString": false,
105+
"allowNumber": false,
106+
"allowNullableObject": false
107+
}
108+
],
109+
"typescript/triple-slash-reference": "error",
110+
// all import related rules
111+
"import/no-duplicates": "error",
112+
"import/first": "error",
113+
"import/export": "error",
114+
"import/default": "error",
115+
"import/named": "error",
116+
"import/no-unresolved": "error"
173117
}
174118
}

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint",
3+
"oxc.oxc-vscode",
44
"editorconfig.editorconfig",
55
"davidanson.vscode-markdownlint",
66
"vitest.explorer"

.vscode/settings.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@
33
"editor.guides.bracketPairs": true,
44
"editor.formatOnSave": false,
55
"workbench.editor.revealIfOpen": true,
6+
"oxc.enable.oxlint": true,
7+
"oxc.typeAware": true,
68
"[javascript]": {
79
"editor.formatOnSave": true,
810
},
911
"[typescript]": {
1012
"editor.formatOnSave": true,
1113
},
12-
"eslint.codeAction.showDocumentation": {
13-
"enable": true
14-
},
15-
"eslint.format.enable": false,
16-
"eslint.validate": [
17-
"javascript",
18-
"typescript"
19-
],
2014
"[json]": {
2115
"editor.defaultFormatter": "vscode.json-language-features"
2216
},

LICENSE.header

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright (c) 2026 TypeFox and others.
2+
Licensed under the MIT License. See LICENSE in the package root for license information.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ These are the current versions of packages from this repository and their alignm
7575
- **monaco-languageclient**: `10.7.0` (release date: 2026-02-04)
7676
- **@typefox/monaco-editor-react**: `7.7.0` (release date: unrel2026-02-04eased)
7777
- Aligned with:
78-
- **@codingame/monaco-vscode-[editor]-api**: `26.0.1`
78+
- **@codingame/monaco-vscode-[editor]-api**: `26.2.1`
7979
- **vscode**: `1.108.2`
8080
- **monaco-editor**: `0.55.1`
8181
- **vscode-ws-jsonrpc**: `3.5.0` (release date: 2025-08-11)

docs/guides/troubleshooting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Whenever you use `monaco-editor`/`@codingame/monaco-vscode-editor-api` `vscode`/
1111
If you use pnpm or yarn, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency, otherwise the installation will fail:
1212

1313
```json
14-
"vscode": "npm:@codingame/monaco-vscode-extension-api@^26.0.1"
14+
"vscode": "npm:@codingame/monaco-vscode-extension-api@^26.2.1"
1515
```
1616

1717
### Missing Overrides or Resolutions
@@ -23,7 +23,7 @@ To ensure all Monaco-related packages use a single, compatible version, you must
2323
```json
2424
{
2525
"overrides": {
26-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"
26+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"
2727
}
2828
}
2929
```
@@ -33,7 +33,7 @@ To ensure all Monaco-related packages use a single, compatible version, you must
3333
```json
3434
{
3535
"resolutions": {
36-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"
36+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"
3737
}
3838
}
3939
```
@@ -50,7 +50,7 @@ Additionally, if you see a message in the browser console starting with `Another
5050

5151
### @codingame/monaco-vscode-editor-api / monaco-editor usage
5252

53-
When you use the libraries from this project you are no longer required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"` in you `package.json`. You can directly use it like so:
53+
When you use the libraries from this project you are no longer required to proxy `monaco-editor` like `"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"` in you `package.json`. You can directly use it like so:
5454

5555
```js
5656
import * as monaco from '@codingame/monaco-vscode-editor-api';
@@ -60,7 +60,7 @@ If your dependency stack already contains a reference `monaco-editor` you must e
6060

6161
```json
6262
"overrides": {
63-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"
63+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"
6464
}
6565
```
6666

docs/installation.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ If using npm or pnpm, and your dependencies already contain a reference to `mona
5757
```json
5858
{
5959
"overrides": {
60-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"
60+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"
6161
}
6262
}
6363
```
@@ -71,7 +71,7 @@ In yarn you have to specify `resolutions` instead of `overrides`:
7171
```json
7272
{
7373
"resolutions": {
74-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.0.1"
74+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@^26.2.1"
7575
}
7676
}
7777
```
@@ -83,17 +83,17 @@ If using pnpm, you have to add more transitive dependencies that npm or yarn aut
8383
```json
8484
{
8585
"dependencies": {
86-
"@codingame/monaco-vscode-api": "^26.0.1",
87-
"@codingame/monaco-vscode-configuration-service-override": "^26.0.1",
88-
"@codingame/monaco-vscode-editor-api": "^26.0.1",
89-
"@codingame/monaco-vscode-editor-service-override": "^26.0.1",
90-
"@codingame/monaco-vscode-extension-api": "^26.0.1",
91-
"@codingame/monaco-vscode-extensions-service-override": "^26.0.1",
92-
"@codingame/monaco-vscode-languages-service-override": "^26.0.1",
93-
"@codingame/monaco-vscode-localization-service-override": "^26.0.1",
94-
"@codingame/monaco-vscode-log-service-override": "^26.0.1",
95-
"@codingame/monaco-vscode-model-service-override": "^26.0.1",
96-
"vscode": "npm:@codingame/monaco-vscode-extension-api@^26.0.1"
86+
"@codingame/monaco-vscode-api": "^26.2.1",
87+
"@codingame/monaco-vscode-configuration-service-override": "^26.2.1",
88+
"@codingame/monaco-vscode-editor-api": "^26.2.1",
89+
"@codingame/monaco-vscode-editor-service-override": "^26.2.1",
90+
"@codingame/monaco-vscode-extension-api": "^26.2.1",
91+
"@codingame/monaco-vscode-extensions-service-override": "^26.2.1",
92+
"@codingame/monaco-vscode-languages-service-override": "^26.2.1",
93+
"@codingame/monaco-vscode-localization-service-override": "^26.2.1",
94+
"@codingame/monaco-vscode-log-service-override": "^26.2.1",
95+
"@codingame/monaco-vscode-model-service-override": "^26.2.1",
96+
"vscode": "npm:@codingame/monaco-vscode-extension-api@^26.2.1"
9797
}
9898
}
9999
```

docs/oxlint.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,31 @@ Useful links:
99

1010
## Eslint to Oxlint migration results
1111

12-
Performed on 2025-11-26.
13-
14-
```shell
15-
unsupported rule, but in development: constructor-super
16-
unsupported rule, but in development: getter-return
17-
unsupported rule: no-dupe-args
18-
unsupported rule, but in development: no-misleading-character-class
19-
unsupported rule: no-octal
20-
unsupported rule, but in development: no-undef
21-
unsupported rule, but in development: no-unreachable
22-
unsupported rule: prefer-const
23-
unsupported rule: dot-notation
24-
unsupported rule: new-parens
25-
unsupported rule: no-multiple-empty-lines
26-
unsupported rule: no-trailing-spaces
27-
unsupported rule: space-before-function-paren
28-
unsupported rule: semi
29-
unsupported rule: quotes
30-
unsupported rule: @typescript-eslint/parameter-properties
31-
unsupported rule: @typescript-eslint/no-unnecessary-condition
32-
```
12+
Performed on 2025-11-26 and updated 2026-02-20.
13+
14+
- unsupported rule: no-dupe-args
15+
- Not needed in modern code, strict is enforced by tsc
16+
- unsupported rule: no-octal
17+
- Not needed in modern code, strict is enforced by tsc
18+
- unsupported rule, but in development: no-undef
19+
- Not needed, handled by tsc
20+
- unsupported rule: dot-notation
21+
- Replaced by `typescript/dot-notation`
22+
- unsupported rule: new-parens
23+
- Is handled automatically by oxfmt
24+
- unsupported rule: no-multiple-empty-lines
25+
- Is handled automatically by oxfmt
26+
- unsupported rule: no-trailing-spaces
27+
- Is handled automatically by oxfmt
28+
- unsupported rule: space-before-function-paren
29+
- Is handled automatically by oxfmt
30+
- unsupported rule: semi
31+
- Is handled automatically by oxfmt
32+
- unsupported rule: quotes
33+
- Is handled by oxfmt via config `"singleQuote": true`
3334

3435
## Changes
3536

36-
- Replaced `@typescript-eslint/no-var-requires` with `no-var-requires`
37-
- Turned of recommended rule `no-undef` after migration
3837
- All rules in nursery (=under development) and unsupported rules are accompanied by a comment in [.oxlintrc.json](../.oxlintrc.json)
39-
- All rules unsupported by oxlint are still contained in [eslint.config.mjs](../eslint.config.mjs) and applied by eslint.
40-
- JsPlugins are instable in oxlint, therefore they are still contained in [eslint.config.mjs](../eslint.config.mjs) and applied by eslint.
38+
- 2026-02-20: Deleted eslint and all plugins
39+
- 2026-03-04: Fixed all type aware issues, added import rules and removed all default rules

0 commit comments

Comments
 (0)