Skip to content

Commit 27bbae8

Browse files
authored
build: migrate to oxlint (#76)
1 parent c0d2c73 commit 27bbae8

File tree

12 files changed

+1063
-4210
lines changed

12 files changed

+1063
-4210
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
"extensions": [
1111
"bierner.markdown-preview-github-styles",
1212
"davidanson.vscode-markdownlint",
13-
"dbaeumer.vscode-eslint",
1413
"esbenp.prettier-vscode",
1514
"github.copilot",
1615
"github.copilot-chat",
1716
"github.vscode-github-actions",
1817
"github.vscode-pull-request-github",
1918
"me-dutour-mathieu.vscode-github-actions",
19+
"oxc.oxc-vscode",
2020
"redhat.vscode-yaml",
21-
"rvest.vs-code-prettier-eslint",
2221
"yzhang.markdown-all-in-one"
2322
],
2423
"settings": {

.eslintignore

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

.github/linters/.eslintrc.yml

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

.github/linters/tsconfig.json

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

.oxlintrc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript", "import", "vitest"],
4+
"categories": {
5+
"correctness": "warn"
6+
},
7+
"rules": {
8+
"no-console": "off",
9+
"typescript/array-type": "error",
10+
"typescript/ban-ts-comment": "error",
11+
"typescript/consistent-type-assertions": "error",
12+
"typescript/explicit-function-return-type": [
13+
"error",
14+
{ "allowExpressions": true }
15+
],
16+
"typescript/no-empty-interface": "error",
17+
"typescript/no-explicit-any": "error",
18+
"typescript/no-extraneous-class": "error",
19+
"typescript/no-inferrable-types": "error",
20+
"typescript/no-namespace": "error",
21+
"typescript/no-non-null-assertion": "warn",
22+
"typescript/no-require-imports": "error",
23+
"typescript/no-unnecessary-qualifier": "error",
24+
"typescript/no-unnecessary-type-assertion": "error",
25+
"typescript/no-useless-constructor": "error",
26+
"typescript/no-var-requires": "error",
27+
"typescript/prefer-for-of": "warn",
28+
"typescript/prefer-function-type": "warn",
29+
"typescript/prefer-includes": "error",
30+
"typescript/promise-function-async": "error",
31+
"typescript/restrict-plus-operands": "error"
32+
},
33+
"ignorePatterns": ["dist", "node_modules", "coverage", "*.json"]
34+
}

__tests__/lib.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('getHeadRef', () => {
121121
stderr: ''
122122
});
123123

124-
await expect(lib.getHeadRef()).rejects.toThrow();
124+
await expect(lib.getHeadRef()).rejects.toThrow(/Unexpected output/);
125125
});
126126

127127
it('is not silent in debug mode', async () => {

__tests__/main.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ describe('action', () => {
359359
it('stringifies non-errors', async () => {
360360
mockGetInput({ message, token });
361361
vi.mocked(lib.getStagedFiles).mockImplementation(() => {
362-
throw 42; // eslint-disable-line no-throw-literal
362+
throw 42; // oxlint-disable-line no-throw-literal
363363
});
364364

365365
await main.run();

0 commit comments

Comments
 (0)