Skip to content

Commit b81440a

Browse files
Update linter
1 parent f415c0a commit b81440a

43 files changed

Lines changed: 553 additions & 218 deletions

Some content is hidden

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

.oxfmtrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"/packages/lib-engine/src/customCommandGrammar/generated/",
77
"/packages/lib-engine/src/snippets/vendor/",
88
"/resources/fixtures/recorded/**/*.yml"
9-
]
9+
],
1010
}

.oxlintrc.json

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,70 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
33
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
4+
"jsPlugins": [
5+
{
6+
"name": "mocha",
7+
"specifier": "eslint-plugin-mocha"
8+
}
9+
],
10+
411
"ignorePatterns": [
5-
".git/**",
612
"resources/playground/**",
7-
"packages/*/out/**",
8-
"packages/*/dist/**",
9-
"packages/app-web-docs/.docusaurus/**",
10-
"packages/app-neovim/cursorless.nvim/**",
11-
"packages/app-vscode/src/keyboard/grammar/generated/**",
12-
"packages/lib-engine/src/customCommandGrammar/generated/**",
13-
"packages/lib-engine/src/snippets/vendor/**",
14-
"**/node_modules/**"
13+
"packages/app-neovim/cursorless.nvim/**"
1514
],
15+
16+
"options": {
17+
"typeAware": true,
18+
"typeCheck": false
19+
},
20+
1621
"rules": {
17-
"import/no-relative-packages": "error",
18-
"import/no-duplicates": "error",
19-
"unused-imports/no-unused-imports": "error",
20-
"@typescript-eslint/consistent-type-imports": "error",
21-
"@typescript-eslint/consistent-type-assertions": [
22-
"error",
22+
"import/no-relative-packages": "warn",
23+
"import/no-duplicates": "warn",
24+
"typescript/consistent-type-imports": "warn",
25+
"typescript/consistent-type-assertions": [
26+
"warn",
2327
{
2428
"assertionStyle": "as"
2529
}
2630
],
27-
"@typescript-eslint/naming-convention": [
28-
"error",
29-
{
30-
"selector": ["objectLiteralProperty"],
31-
"format": ["camelCase"],
32-
"filter": {
33-
"regex": "[.]",
34-
"match": false
35-
}
36-
}
37-
],
38-
"@typescript-eslint/no-floating-promises": "error",
39-
"@typescript-eslint/no-explicit-any": "off",
40-
"@typescript-eslint/no-inferrable-types": "off",
41-
"@typescript-eslint/no-non-null-assertion": "off",
42-
"@typescript-eslint/no-unused-vars": [
43-
"error",
31+
"typescript/no-explicit-any": "off",
32+
"typescript/no-inferrable-types": "off",
33+
"typescript/restrict-template-expressions": "off",
34+
"typescript/no-base-to-string": "off",
35+
"typescript/unbound-method": "off",
36+
"eslint/no-unused-vars": [
37+
"warn",
4438
{
4539
"argsIgnorePattern": "^_",
4640
"varsIgnorePattern": "^_",
4741
"caughtErrorsIgnorePattern": "^_",
4842
"ignoreRestSiblings": true
4943
}
5044
],
51-
"curly": "error",
45+
"curly": "warn",
5246
"eqeqeq": [
53-
"error",
47+
"warn",
5448
"always",
5549
{
5650
"null": "never"
5751
}
5852
],
59-
"no-constant-condition": [
60-
"error",
53+
"no-warning-comments": [
54+
"warn",
6155
{
62-
"checkLoops": false
56+
"terms": ["todo"]
6357
}
6458
],
65-
"no-restricted-syntax": [
66-
"error",
67-
"MemberExpression[object.property.name='constructor'][property.name='name']"
59+
"eslint/no-constant-condition": [
60+
"warn",
61+
{
62+
"checkLoops": false
63+
}
6864
],
69-
"no-throw-literal": "error",
70-
"semi": "off",
71-
"unicorn/prefer-module": "error",
72-
"mocha/no-pending-tests": "error",
73-
"mocha/no-exclusive-tests": "error"
74-
},
75-
"overrides": []
65+
"eslint/no-throw-literal": "warn",
66+
"unicorn/prefer-module": "warn",
67+
"mocha/no-pending-tests": "warn",
68+
"mocha/no-exclusive-tests": "warn"
69+
}
7670
}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
"@pnpm/meta-updater": "^2.0.6",
3838
"@types/node": "^24.12.0",
3939
"esbuild": "^0.27.4",
40-
"oxfmt": "^0.16.0",
41-
"oxlint-tsgolint": "^0.17.1",
42-
"oxlint": "^1.15.0",
43-
"stylelint-config-standard-scss": "^17.0.0",
44-
"stylelint-config-standard": "^40.0.0",
40+
"eslint-plugin-mocha": "^11.2.0",
41+
"oxfmt": "^0.41.0",
42+
"oxlint": "^1.56.0",
43+
"oxlint-tsgolint": "^0.17.2",
4544
"stylelint": "^17.5.0",
45+
"stylelint-config-standard": "^40.0.0",
46+
"stylelint-config-standard-scss": "^17.0.0",
4647
"syncpack": "^14.2.1",
4748
"tsx": "^4.21.0",
4849
"typescript": "^5.9.3"

packages/app-vscode/.oxlintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": ["../../.oxlintrc.json"],
3+
"ignorePatterns": ["src/keyboard/grammar/generated/**"],
4+
"overrides": [
5+
{
6+
"files": ["src/scripts/**/*.ts"],
7+
"rules": {
8+
"no-restricted-imports": [
9+
"warn",
10+
{
11+
"paths": [
12+
{
13+
"name": "vscode",
14+
"message": "Scripts shouldn't depend on vscode"
15+
}
16+
]
17+
}
18+
]
19+
}
20+
}
21+
]
22+
}

packages/app-vscode/src/ide/vscode/VSCodeScopeVisualizer/VscodeFancyRangeHighlighter/generateDifferentiatedRanges.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ export function* generateDifferentiatedRanges(
2727

2828
for (const range of ranges) {
2929
// Remove any ranges that have ended before the start of the current range.
30-
currentRanges = [
31-
...currentRanges.filter(({ range: previousRange }) =>
32-
generalizedRangeTouches(previousRange, range),
33-
),
34-
];
30+
currentRanges = currentRanges.filter(({ range: previousRange }) =>
31+
generalizedRangeTouches(previousRange, range),
32+
);
3533

3634
const differentiatedRange = {
3735
range,

packages/app-vscode/src/ide/vscode/VscodeToggleBreakpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { VscodeTextEditor } from "./VscodeTextEditor";
55

66
export async function vscodeToggleBreakpoint(
77
editor: VscodeTextEditor,
8-
ranges?: GeneralizedRange[] | undefined,
8+
ranges?: GeneralizedRange[],
99
): Promise<void> {
1010
if (ranges == null) {
1111
return await vscode.commands.executeCommand(

packages/app-web-docs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"@cursorless/lib-node-common": "workspace:*",
4646
"@docusaurus/module-type-aliases": "^3.9.2",
4747
"@docusaurus/types": "^3.9.2",
48-
"@tsconfig/docusaurus": "^2.0.9",
4948
"@types/mdast": "^4.0.4",
5049
"@types/react": "^19.2.14",
5150
"sass": "^1.98.0",

packages/app-web-docs/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @ts-check
1+
// @ts-nocheck
22

33
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
44
export default {

packages/app-web-docs/src/plugins/scope-tests-plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import {
66
import type { LoadContext, Plugin, PluginOptions } from "@docusaurus/types";
77
import * as fs from "node:fs";
88
import * as path from "node:path";
9+
import { fileURLToPath } from "node:url";
910
import type {
1011
Fixture,
1112
Scope,
1213
ScopeTests,
1314
Target,
1415
} from "../docs/components/types";
1516

17+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
18+
1619
export default function prepareAssetsPlugin(
1720
_context: LoadContext,
1821
_options: PluginOptions,
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
2-
"extends": ["@tsconfig/docusaurus/tsconfig.json", "../../tsconfig.web.json"],
2+
"extends": ["../../tsconfig.web.json"],
33
"compilerOptions": {
44
"jsx": "react-jsx",
5-
"jsxImportSource": "react"
5+
"jsxImportSource": "react",
6+
"skipLibCheck": true,
7+
"types": ["@docusaurus/theme-classic"],
68
},
79
"include": [
810
"src/**/*.ts",
911
"src/**/*.tsx",
1012
"src/**/*.json",
11-
"../../resources/typings/**/*.d.ts"
13+
"../../resources/typings/**/*.d.ts",
1214
],
13-
"exclude": ["node_modules"]
15+
"exclude": ["node_modules"],
1416
}

0 commit comments

Comments
 (0)