Skip to content

Commit 3cb8def

Browse files
committed
using oxlint (draft).
1 parent 6f078f7 commit 3cb8def

8 files changed

Lines changed: 359 additions & 60 deletions

File tree

.oxlintrc.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"plugins": ["typescript"],
3+
"categories": {
4+
"correctness": "error"
5+
},
6+
"env": {
7+
"builtin": true,
8+
"node": true
9+
},
10+
"ignorePatterns": ["dist/", "coverage/"],
11+
"rules": {
12+
"unicorn/prefer-node-protocol": "warn",
13+
"constructor-super": "error",
14+
"for-direction": "error",
15+
"getter-return": "error",
16+
"no-async-promise-executor": "error",
17+
"no-case-declarations": "error",
18+
"no-class-assign": "error",
19+
"no-compare-neg-zero": "error",
20+
"no-cond-assign": "error",
21+
"no-const-assign": "error",
22+
"no-constant-binary-expression": "error",
23+
"no-constant-condition": "error",
24+
"no-control-regex": "error",
25+
"no-debugger": "error",
26+
"no-delete-var": "error",
27+
"no-dupe-class-members": "error",
28+
"no-dupe-else-if": "error",
29+
"no-dupe-keys": "error",
30+
"no-duplicate-case": "error",
31+
"no-empty": ["error", { "allowEmptyCatch": true }],
32+
"no-empty-character-class": "error",
33+
"no-empty-pattern": ["error", { "allowObjectPatternsAsParameters": true }],
34+
"no-empty-static-block": "error",
35+
"no-ex-assign": "error",
36+
"no-extra-boolean-cast": "error",
37+
"no-fallthrough": "error",
38+
"no-func-assign": "error",
39+
"no-global-assign": "error",
40+
"no-import-assign": "error",
41+
"no-invalid-regexp": "error",
42+
"no-irregular-whitespace": "error",
43+
"no-loss-of-precision": "error",
44+
"no-misleading-character-class": "error",
45+
"no-new-native-nonconstructor": "error",
46+
"no-nonoctal-decimal-escape": "error",
47+
"no-obj-calls": "error",
48+
"no-prototype-builtins": "error",
49+
"no-redeclare": "error",
50+
"no-regex-spaces": "error",
51+
"no-self-assign": "error",
52+
"no-setter-return": "error",
53+
"no-shadow-restricted-names": "error",
54+
"no-sparse-arrays": "error",
55+
"no-this-before-super": "error",
56+
"no-unassigned-vars": "error",
57+
"no-unexpected-multiline": "error",
58+
"no-unreachable": "error",
59+
"no-unsafe-finally": "error",
60+
"no-unsafe-negation": "error",
61+
"no-unsafe-optional-chaining": "error",
62+
"no-unused-labels": "error",
63+
"no-unused-private-class-members": "error",
64+
"no-unused-vars": "error",
65+
"no-useless-backreference": "error",
66+
"no-useless-catch": "error",
67+
"no-useless-escape": "error",
68+
"no-with": "error",
69+
"preserve-caught-error": "error",
70+
"require-yield": "error",
71+
"use-isnan": "error",
72+
"valid-typeof": "error",
73+
"no-array-constructor": "error",
74+
"no-unused-expressions": "error",
75+
"curly": ["warn", "multi-or-nest", "consistent"],
76+
"no-duplicate-imports": "warn",
77+
"no-shadow": "warn",
78+
"typescript/ban-ts-comment": "error",
79+
"typescript/no-duplicate-enum-values": "error",
80+
"typescript/no-empty-object-type": "error",
81+
"typescript/no-explicit-any": "error",
82+
"typescript/no-extra-non-null-assertion": "error",
83+
"typescript/no-misused-new": "error",
84+
"typescript/no-namespace": "error",
85+
"typescript/no-non-null-asserted-optional-chain": "error",
86+
"typescript/no-require-imports": "error",
87+
"typescript/no-this-alias": "error",
88+
"typescript/no-unnecessary-type-constraint": "error",
89+
"typescript/no-unsafe-declaration-merging": "error",
90+
"typescript/no-unsafe-function-type": "error",
91+
"typescript/no-wrapper-object-types": "error",
92+
"typescript/prefer-as-const": "error",
93+
"typescript/prefer-namespace-keyword": "error",
94+
"typescript/triple-slash-reference": "error"
95+
}
96+
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ import fancyFn from "unlisted-module"; // Error: Importing unlisted-module is no
4545

4646
## Requirements
4747

48-
- `eslint@^9.0.0`
49-
- `typescript-eslint@^8.0.0`
50-
- `eslint@^10.0.0`
51-
- `typescript-eslint@^8.56.0`
5248
- Node.js `^22.19.0 || ^24.11.0 || ^26.0.0`
49+
- Either:
50+
- `eslint@^9.0.0` and `typescript-eslint@^8.0.0`
51+
- `eslint@^10.0.0` and `typescript-eslint@^8.56.0`
52+
- `oxlint@^1.76.0`
5353

5454
## Installation
5555

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,44 @@
4343
},
4444
"scripts": {
4545
"build": "tsdown",
46-
"lint": "oxfmt --check",
46+
"lint": "oxlint && oxfmt --check",
4747
"pretest": "tsc --noEmit",
4848
"test": "vitest run",
4949
"mdfix": "oxfmt *.md",
5050
"prepublishOnly": "pnpm run lint && pnpm run test && pnpm run build"
5151
},
5252
"dependencies": {
53+
"@oxlint/plugins": "^1.76.0",
5354
"ramda": "^0.32.0"
5455
},
5556
"devDependencies": {
5657
"@arethetypeswrong/core": "^0.18.2",
5758
"@tsconfig/node22": "^22.0.5",
5859
"@types/node": "^22.0.0",
5960
"@types/ramda": "^0.32.0",
60-
"@typescript-eslint/rule-tester": "^8.56.0",
6161
"@vitest/coverage-v8": "^4.1.10",
62-
"eslint": "^10.0.0",
6362
"json-schema-to-ts": "^3.1.1",
6463
"oxfmt": "^0.62.0",
64+
"oxlint": "^1.76.0",
6565
"tsdown": "^0.22.0",
6666
"typescript": "^6.0.2",
67-
"typescript-eslint": "^8.56.0",
6867
"vitest": "^4.1.10"
6968
},
7069
"peerDependencies": {
7170
"eslint": "^9.0.0 || ^10.0.0",
72-
"typescript-eslint": "^8.0.0"
71+
"typescript-eslint": "^8.0.0",
72+
"oxlint": "^1.76.0"
73+
},
74+
"peerDependenciesMeta": {
75+
"eslint": {
76+
"optional": true
77+
},
78+
"typescript-eslint": {
79+
"optional": true
80+
},
81+
"oxlint": {
82+
"optional": true
83+
}
7384
},
7485
"engines": {
7586
"node": "^22.19.0 || ^24.11.0 || ^26.0.0"

0 commit comments

Comments
 (0)