Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Lint
run: pnpm --color lint

- name: Type check
run: pnpm --color typecheck

- name: Forbid TODO
run: ./resources/scripts/forbid-todo.sh

Expand Down
1 change: 0 additions & 1 deletion .meta-updater/main.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-relative-packages
import { updater } from "../packages/tool-meta-updater/src/index.ts";

export default updater;
10 changes: 10 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"sortPackageJson": false,
"ignorePatterns": [
"/packages/app-vscode/src/keyboard/grammar/generated/",
"/packages/lib-engine/src/customCommandGrammar/generated/",
"/packages/lib-engine/src/snippets/vendor/",
"/resources/fixtures/recorded/**/*.yml"
]
}
142 changes: 142 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
"jsPlugins": [
{
"name": "mocha",
"specifier": "eslint-plugin-mocha"
}
],

"ignorePatterns": [
"resources/playground/**",
"packages/app-neovim/cursorless.nvim/**",
"packages/app-vscode/src/keyboard/grammar/generated/**",
"packages/lib-engine/src/customCommandGrammar/generated/**",
"packages/lib-engine/src/snippets/vendor/**"
],

"options": {
"typeAware": true,
"typeCheck": false
},

"rules": {
"curly": "warn",
"eqeqeq": [
"warn",
"always",
{
"null": "never"
}
],
"eslint/no-constant-condition": [
"warn",
{
"checkLoops": false
}
],
"eslint/no-restricted-imports": [
"warn",
{
"patterns": [
{
"group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"],
"message": "Relative package imports are not allowed"
}
]
}
],
"eslint/no-throw-literal": "warn",
"eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"import/no-duplicates": "warn",
"mocha/no-exclusive-tests": "warn",
"mocha/no-pending-tests": "warn",
"no-warning-comments": [
"warn",
{
"terms": ["todo"]
}
],
"typescript/consistent-type-assertions": [
"warn",
{
"assertionStyle": "as"
}
],
"typescript/consistent-type-imports": "warn",
"typescript/no-base-to-string": "off",
"typescript/restrict-template-expressions": "off",
"typescript/unbound-method": "off",
"unicorn/prefer-module": "warn",
"unicorn/throw-new-error": "warn"
},
"overrides": [
{
"files": ["packages/app-vscode/src/scripts/**/*.ts"],
"rules": {
"no-restricted-imports": [
"warn",
{
"paths": [
{
"name": "vscode",
"message": "Scripts shouldn't depend on vscode"
}
]
}
]
}
},

{
"files": ["packages/lib-common/**/*.ts", "packages/lib-engine/**/*.ts"],
"rules": {
"import/no-nodejs-modules": "warn"
}
},

{
"files": [
"packages/lib-common/**/*.test.ts",
"packages/lib-engine/**/*.test.ts",
"packages/lib-engine/src/scripts/**/*.ts",
"packages/lib-engine/src/testUtil/**/*.ts"
],
"rules": {
"import/no-nodejs-modules": "off"
}
},

{
"files": ["packages/lib-common/src/types/command/**/*.ts"],
"rules": {
"eslint/no-restricted-imports": [
"warn",
{
"patterns": [
{
"group": ["@cursorless/*", "../*"],
"message": "API types shouldn't have any dependencies"
}
],
"paths": [
{
"name": "@*",
"message": "API types shouldn't have any dependencies"
}
]
}
]
}
}
]
}
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ repos:

- repo: local
hooks:
- id: eslint
name: eslint
- id: oxlint
name: oxlint
files: \.(ts|tsx)$
language: system
entry: pnpm exec eslint
entry: pnpm exec oxlint
args: [--fix]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add --deny-warnings to the pre-commit oxlint hook

The new hook runs oxlint with only --fix, but the repository rule set is configured almost entirely at warning level ("warn" in .oxlintrc.json). Per Oxlint CLI docs, warnings only trigger a non-zero exit with --deny-warnings, so this hook will pass with unresolved lint violations that then fail later in CI (lint:ts uses oxlint --deny-warnings .). This regresses local guardrails by allowing commits that pre-commit should have blocked.

Useful? React with 👍 / 👎.


- repo: local
hooks:
- id: prettier
name: prettier
- id: oxfmt
name: oxfmt
types: [text]
language: system
entry: pnpm exec prettier
args: [--write, --list-different, --ignore-unknown]
entry: pnpm exec oxfmt
args: [--write, --list-different, --no-error-on-unmatched-pattern]

- repo: local
hooks:
Expand Down
18 changes: 0 additions & 18 deletions .prettierignore

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"recommendations": [
"AndreasArvidsson.andreas-talon",
"charliermarsh.ruff",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"oxc.oxc-vscode",
"jrieken.vscode-tree-sitter-query",
"wenkokke.talonfmt-vscode",
"usernamehw.commands",
Expand Down
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"pojo",
"subword"
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.workingDirectories": [{ "pattern": "packages/*/" }],
"editor.defaultFormatter": "oxc.oxc-vscode",
Comment thread
AndreasArvidsson marked this conversation as resolved.
"files.associations": {
".busted": "lua"
},
Expand Down
Loading
Loading