Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .claude/skills/refactor-component/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ cd packages/app && yarn ci:unit # Unit tests (or the appropriate package)
make e2e # E2E tests — re-run the same tests from step 1 to catch regressions
```

If lint fails with import-sort or formatting errors, run `npx eslint --fix <file>` on the affected files and re-check. If there are unused-import warnings, remove the unused imports manually.
If lint fails with import-sort or formatting errors, run `npx oxlint --fix <file>` and `npx prettier --write <file>` from the package directory and re-check. If there are unused-import warnings, remove the unused imports manually.

If an E2E test fails, investigate whether the failure is related to the refactoring (e.g. a broken import path at runtime) or a pre-existing flake. Fix refactoring-related failures before presenting the result. The E2E tests identified in step 1 are the most important — if those pass, the refactor is safe.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
# Whole-repo escape-hatch ratchet — runs unconditionally (not via `nx
# affected`, and not via `make ci-lint`, which this job no longer calls),
# so the gate can't be silently skipped for a PR that touches few projects.
- name: Escape-hatch ratchet and ESLint wrapper tests
- name: Escape-hatch ratchet and lint wrapper tests
run:
node --test scripts/ci/__tests__/ratchet.test.mjs
scripts/ci/__tests__/eslint-warnings.test.mjs
scripts/ci/__tests__/oxlint-warnings.test.mjs
# Also unconditional, and against the PR's own tree. claude-code-review.yml
# runs this file too, but from a base-branch checkout, so a PR that breaks
# what it pins (the AGENTS.md heading every review footer links to) passes
Expand Down
18 changes: 18 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Only here so that oxlint run from the repo root (editors, lint-staged)
// accepts the options below, which oxlint reads from the top-level config
// only. Packages get their rules, and the same options, from their own
// .oxlintrc.json via oxlint/base.jsonc. Files outside a package are not linted.
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"options": { "typeAware": true, "reportUnusedDisableDirectives": "warn" },
"plugins": [],
"categories": {
"correctness": "off",
"suspicious": "off",
"pedantic": "off",
"perf": "off",
"style": "off",
"restriction": "off",
"nursery": "off"
}
}
2 changes: 0 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"fluid": false,
Comment on lines -9 to -10

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Invalid / deprecated options that were previously ignored now throw because we call prettier directly

"arrowParens": "avoid",
"proseWrap": "always"
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"vunguyentuan.vscode-css-variables",
"clinyong.vscode-css-modules",
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode"
]
Expand Down
12 changes: 3 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.fixAll.oxc": "always",
"source.fixAll.stylelint": "always"
},
"eslint.useFlatConfig": true,
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"[css]": {
"editor.defaultFormatter": "stylelint.vscode-stylelint"
},
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"stylelint.validate": ["css", "postcss", "scss"],
"cssVariables.lookupFiles": [
"**/*.css",
Expand Down
2 changes: 1 addition & 1 deletion agent_docs/code_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ The project uses Mantine UI with **custom variants** defined in `packages/app/sr
</ActionIcon>
```

This pattern cannot be enforced by ESLint and requires manual code review.
This pattern cannot be enforced by the linter and requires manual code review.

### Semantic component variants (Alert / Text / danger controls)

Expand Down
2 changes: 1 addition & 1 deletion agent_docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ does not overlap with CI integration tests (14320-40098) or the dev stack
The project uses Husky + lint-staged to automatically run:

- Prettier for formatting
- ESLint for linting
- oxlint for linting (each file with its package's `.oxlintrc.json`)
- API doc generation (for external API changes)

These run automatically on `git commit` for staged files.
Expand Down
2 changes: 1 addition & 1 deletion docker/hyperdx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ COPY .yarnrc.yml yarn.lock package.json nx.json .prettierrc .prettierignore ./ts
# full source is copied in the build stages that need it.
COPY ./packages/common-utils/package.json ./packages/common-utils/package.json
COPY ./packages/api/jest.config.js ./packages/api/tsconfig.json ./packages/api/tsconfig.build.json ./packages/api/package.json ./packages/api/
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.mjs ./packages/app/mdx.d.ts ./packages/app/css.d.ts ./packages/app/eslint.config.mjs ./packages/app/
COPY ./packages/app/jest.config.js ./packages/app/tsconfig.json ./packages/app/tsconfig.build.json ./packages/app/package.json ./packages/app/next.config.mjs ./packages/app/mdx.d.ts ./packages/app/css.d.ts ./packages/app/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

eslint didn't need to be in the Docker image anyway


# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
Expand Down
1 change: 0 additions & 1 deletion knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"project": ["src/**/*.{ts,tsx}", "pages/**/*.{ts,tsx}"],
"ignore": [".storybook/public/**"],
"ignoreDependencies": [
"eslint-config-next",
"@chromatic-com/storybook",
"@storybook/addon-themes",
"react-is"
Expand Down
8 changes: 5 additions & 3 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
"inputs": [
"default",
"^production",
// Each package's `lint` runs ESLint through this wrapper.
"{workspaceRoot}/scripts/ci/eslint-warnings.mjs",
// Each package's `lint` runs oxlint through this wrapper, and every
// package config extends the shared base and local plugins here.
"{workspaceRoot}/scripts/ci/oxlint-warnings.mjs",
"{workspaceRoot}/oxlint/**/*",
{ "runtime": "node --version" }
]
},
Expand Down Expand Up @@ -75,7 +77,7 @@
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/eslint.config.mjs"
"!{projectRoot}/.oxlintrc.json"
],
"sharedGlobals": [
"{workspaceRoot}/tsconfig.base.json",
Expand Down
143 changes: 143 additions & 0 deletions oxlint/base.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
// Rules every package shares. Mirrors what ESLint got from
// `@eslint/js` recommended + `typescript-eslint` recommended (as applied to
// .ts/.tsx files, i.e. after typescript-eslint's `eslint-recommended`
// disables the checks tsc already does) minus the formatting rules
// `eslint-config-prettier` turned off, plus the overrides every package set.
// Packages extend this and add their own plugins and rules.
{
"$schema": "../node_modules/oxlint/configuration_schema.json",
// Start from nothing so the enabled set is exactly the list below.
// Also set in the repo-root .oxlintrc.json: oxlint reads options only from
// the top-level config, which is this file (via extends) when run from a
// package and the root one when run from the repo root.
"options": { "typeAware": true, "reportUnusedDisableDirectives": "warn" },
"plugins": ["eslint", "typescript"],
"categories": {
"correctness": "off",
"suspicious": "off",
"pedantic": "off",
"perf": "off",
"style": "off",
"restriction": "off",
"nursery": "off",
},
"rules": {
// @eslint/js recommended
"for-direction": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": ["error", "except-parens"],
"no-constant-binary-expression": "error",
"no-constant-condition": ["error", { "checkLoops": "allExceptWhileTrue" }],
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-else-if": "error",
"no-duplicate-case": "error",
"no-empty": ["error", { "allowEmptyCatch": false }],
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-global-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-nonoctal-decimal-escape": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-self-assign": ["error", { "props": true }],
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-unsafe-finally": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
// typescript-eslint eslint-recommended (turned on for .ts files)
"no-var": "error",
"prefer-const": ["error", { "destructuring": "any" }],
"prefer-rest-params": "error",
"prefer-spread": "error",
// typescript-eslint recommended
"typescript/ban-ts-comment": "error",
"no-array-constructor": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"no-unused-expressions": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error",
// Shared overrides
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
// typescript-eslint reports a value only referenced in `typeof`.
"reportVarsOnlyUsedAsTypes": true,
},
],
"no-restricted-imports": [
"error",
{
"patterns": [
{
"regex": "^\\.\\.(/|$)",
"message": "Use the @/ path alias instead of parent-relative imports (../).",
},
],
},
],
},
"overrides": [
{
// typescript-eslint's `eslint-recommended` turns these off for TS files
// because tsc reports them, and turns no-var/prefer-* on. Plain JS files
// keep the @eslint/js defaults.
"files": ["**/*.{js,jsx,mjs,cjs}"],
"rules": {
"constructor-super": "error",
"getter-return": "error",
"no-class-assign": "error",
"no-const-assign": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-func-assign": "error",
"no-import-assign": "error",
"no-new-native-nonconstructor": "error",
"no-obj-calls": "error",
"no-redeclare": ["error", { "builtinGlobals": true }],
"no-setter-return": "error",
"no-this-before-super": "error",
"no-undef": "error",
"no-unreachable": "error",
"no-unsafe-negation": "error",
"no-with": "error",
"no-var": "off",
"prefer-const": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
},
},
],
}
8 changes: 8 additions & 0 deletions oxlint/react-hook-form-plugin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* eslint-plugin-react-hook-form still calls the ESLint 8 `context.getScope()`,
* which neither ESLint 9 nor oxlint provides. `fixupPluginRules` adds it back.
*/
import { fixupPluginRules } from '@eslint/compat';
import reactHookForm from 'eslint-plugin-react-hook-form';

export default fixupPluginRules(reactHookForm);
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@dotenvx/dotenvx": "^1.51.1",
"@eslint/js": "^9.39.1",
"@eslint/compat": "^2.0.0",
"@types/ungap__structured-clone": "^1.2.0",
"@ungap/structured-clone": "^1.3.0",
"babel-plugin-react-compiler": "^1.0.0",
Expand All @@ -18,19 +18,20 @@
"dotenv-cli": "^8.0.0",
"dotenv-expand": "^12.0.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hook-form": "^0.3.1",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "^8.0.3",
"jscpd": "5.1.2",
"knip": "^6.19.0",
"lint-staged": "^13.1.2",
"nx": "23.3.2",
"oxlint": "^1.92.0",
"oxlint-plugin-eslint": "^1.93.0",
"oxlint-tsgolint": "^7.0.2006",
"prettier": "3.3.3",
"tslib": "^2.6.0",
"typescript-eslint": "^8.46.0"
"tslib": "^2.6.0"
},
"scripts": {
"setup": "yarn install && husky install",
Expand Down Expand Up @@ -60,12 +61,12 @@
"lint-staged": {
"packages/api/src/{routers/external-api/**/*.ts,utils/swagger.ts}": [
"prettier --write --ignore-unknown",
"node scripts/ci/eslint-warnings.mjs --staged --flag v10_config_lookup_from_file --fix",
"node scripts/ci/oxlint-warnings.mjs --staged --fix",
"sh -c 'cd packages/api && yarn run lint:openapi && git add openapi.json'"
],
"**/*.{ts,tsx}": [
"prettier --write --ignore-unknown",
"node scripts/ci/eslint-warnings.mjs --staged --flag v10_config_lookup_from_file --fix"
"node scripts/ci/oxlint-warnings.mjs --staged --fix"
],
"**/*.{mdx,json,yml}": [
"prettier --write --ignore-unknown"
Expand Down
Loading
Loading