Skip to content

Commit 7a30af3

Browse files
Replace eslint and prettier with oxlint and oxfmt (#3250)
1 parent 961d0be commit 7a30af3

117 files changed

Lines changed: 1003 additions & 1960 deletions

File tree

Some content is hidden

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

.meta-updater/main.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// eslint-disable-next-line import/no-relative-packages
21
import { updater } from "../packages/tool-meta-updater/src/index.ts";
32

43
export default updater;

.oxfmtrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"sortPackageJson": false,
4+
"ignorePatterns": [
5+
"/packages/app-vscode/src/keyboard/grammar/generated/",
6+
"/packages/lib-engine/src/customCommandGrammar/generated/",
7+
"/packages/lib-engine/src/snippets/vendor/",
8+
"/resources/fixtures/recorded/**/*.yml"
9+
]
10+
}

.oxlintrc.json

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
4+
"jsPlugins": [
5+
{
6+
"name": "mocha",
7+
"specifier": "eslint-plugin-mocha"
8+
}
9+
],
10+
11+
"ignorePatterns": [
12+
"resources/playground/**",
13+
"packages/app-neovim/cursorless.nvim/**",
14+
"packages/app-vscode/src/keyboard/grammar/generated/**",
15+
"packages/lib-engine/src/customCommandGrammar/generated/**",
16+
"packages/lib-engine/src/snippets/vendor/**"
17+
],
18+
19+
"options": {
20+
"typeAware": true,
21+
"typeCheck": false
22+
},
23+
24+
"rules": {
25+
"curly": "warn",
26+
"eqeqeq": [
27+
"warn",
28+
"always",
29+
{
30+
"null": "never"
31+
}
32+
],
33+
"eslint/no-constant-condition": [
34+
"warn",
35+
{
36+
"checkLoops": false
37+
}
38+
],
39+
"eslint/no-restricted-imports": [
40+
"warn",
41+
{
42+
"patterns": [
43+
{
44+
"group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"],
45+
"message": "Relative package imports are not allowed"
46+
}
47+
]
48+
}
49+
],
50+
"eslint/no-throw-literal": "warn",
51+
"eslint/no-unused-vars": [
52+
"warn",
53+
{
54+
"argsIgnorePattern": "^_",
55+
"varsIgnorePattern": "^_",
56+
"caughtErrorsIgnorePattern": "^_",
57+
"ignoreRestSiblings": true
58+
}
59+
],
60+
"import/no-duplicates": "warn",
61+
"mocha/no-exclusive-tests": "warn",
62+
"mocha/no-pending-tests": "warn",
63+
"no-warning-comments": [
64+
"warn",
65+
{
66+
"terms": ["todo"]
67+
}
68+
],
69+
"typescript/consistent-type-assertions": [
70+
"warn",
71+
{
72+
"assertionStyle": "as"
73+
}
74+
],
75+
"typescript/consistent-type-imports": "warn",
76+
"typescript/no-base-to-string": "off",
77+
"typescript/restrict-template-expressions": "off",
78+
"typescript/unbound-method": "off",
79+
"unicorn/prefer-module": "warn",
80+
"unicorn/throw-new-error": "warn"
81+
},
82+
"overrides": [
83+
{
84+
"files": ["packages/app-vscode/src/scripts/**/*.ts"],
85+
"rules": {
86+
"no-restricted-imports": [
87+
"warn",
88+
{
89+
"paths": [
90+
{
91+
"name": "vscode",
92+
"message": "Scripts shouldn't depend on vscode"
93+
}
94+
]
95+
}
96+
]
97+
}
98+
},
99+
100+
{
101+
"files": ["packages/lib-common/**/*.ts", "packages/lib-engine/**/*.ts"],
102+
"rules": {
103+
"import/no-nodejs-modules": "warn"
104+
}
105+
},
106+
107+
{
108+
"files": [
109+
"packages/lib-common/**/*.test.ts",
110+
"packages/lib-engine/**/*.test.ts",
111+
"packages/lib-engine/src/scripts/**/*.ts",
112+
"packages/lib-engine/src/testUtil/**/*.ts"
113+
],
114+
"rules": {
115+
"import/no-nodejs-modules": "off"
116+
}
117+
},
118+
119+
{
120+
"files": ["packages/lib-common/src/types/command/**/*.ts"],
121+
"rules": {
122+
"eslint/no-restricted-imports": [
123+
"warn",
124+
{
125+
"patterns": [
126+
{
127+
"group": ["@cursorless/*", "../*"],
128+
"message": "API types shouldn't have any dependencies"
129+
}
130+
],
131+
"paths": [
132+
{
133+
"name": "@*",
134+
"message": "API types shouldn't have any dependencies"
135+
}
136+
]
137+
}
138+
]
139+
}
140+
}
141+
]
142+
}

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ repos:
5858
5959
- repo: local
6060
hooks:
61-
- id: eslint
62-
name: eslint
61+
- id: oxlint
62+
name: oxlint
6363
files: \.(ts|tsx)$
6464
language: system
65-
entry: pnpm exec eslint
65+
entry: pnpm exec oxlint
6666
args: [--fix]
6767

6868
- repo: local
6969
hooks:
70-
- id: prettier
71-
name: prettier
70+
- id: oxfmt
71+
name: oxfmt
7272
types: [text]
7373
language: system
74-
entry: pnpm exec prettier
75-
args: [--write, --list-different, --ignore-unknown]
74+
entry: pnpm exec oxfmt
75+
args: [--write, --no-error-on-unmatched-pattern]
7676

7777
- repo: local
7878
hooks:

.prettierignore

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

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
"recommendations": [
55
"AndreasArvidsson.andreas-talon",
66
"charliermarsh.ruff",
7-
"dbaeumer.vscode-eslint",
8-
"esbenp.prettier-vscode",
7+
"oxc.oxc-vscode",
98
"jrieken.vscode-tree-sitter-query",
109
"wenkokke.talonfmt-vscode",
1110
"usernamehw.commands",

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"pojo",
1919
"subword"
2020
],
21-
"editor.defaultFormatter": "esbenp.prettier-vscode",
22-
"eslint.workingDirectories": [{ "pattern": "packages/*/" }],
21+
"editor.defaultFormatter": "oxc.oxc-vscode",
2322
"files.associations": {
2423
".busted": "lua"
2524
},

eslint.config.mts

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

0 commit comments

Comments
 (0)