diff --git a/.changeset/oxlint-1-86-suppressions.md b/.changeset/oxlint-1-86-suppressions.md new file mode 100644 index 0000000000..ca8a5f2f54 --- /dev/null +++ b/.changeset/oxlint-1-86-suppressions.md @@ -0,0 +1,21 @@ +--- +'@sanity/assist': patch +'@sanity/block-insert-picker': patch +'@sanity/code-input': patch +'@sanity/cross-dataset-duplicator': patch +'@sanity/dashboard': patch +'@sanity/document-internationalization': patch +'@sanity/embeddings-index-ui': patch +'@sanity/personalization-plugin': patch +'@sanity/sfcc': patch +'@sanity/themer': patch +'sanity-naive-html-serializer': patch +'sanity-plugin-internationalized-array': patch +'sanity-plugin-markdown': patch +'sanity-plugin-media': patch +'sanity-plugin-mux-input': patch +'sanity-plugin-shopify-assets': patch +'sanity-translations-tab': patch +--- + +Update inline oxlint suppressions for the updated shared lint rules diff --git a/.changeset/plugin-kit-oxlint-1-86.md b/.changeset/plugin-kit-oxlint-1-86.md new file mode 100644 index 0000000000..b9dc25a23a --- /dev/null +++ b/.changeset/plugin-kit-oxlint-1-86.md @@ -0,0 +1,5 @@ +--- +'@sanity/plugin-kit': patch +--- + +Require oxlint ^1.86.0, and ban `export *` barrel files that load over 100 modules (`oxc/no-barrel-file`) and the `styled-components` default import in the shared oxlint config diff --git a/AGENTS.md b/AGENTS.md index fd36117ec2..adf605a93b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -230,7 +230,8 @@ Note on **knip**: in-file usage keeps an exported type "used" (`ignoreExportsUse ### Lint Specifics -- **oxlint**: Type-aware linting with `--deny-warnings` (warnings are errors). React Compiler rules run natively via the [React Compiler vendored into oxlint](https://oxc.rs/blog/2026-08-18-react-compiler-support.html); the root `oxlint.config.ts` enables all of them (stricter than the plugin-kit preset) since this monorepo builds plugins with React Compiler. +- **oxlint**: Type-aware linting with `--deny-warnings` (warnings are errors). React Compiler rules run natively via the [React Compiler vendored into oxlint](https://oxc.rs/blog/2026-08-18-react-compiler-support.html); the root `oxlint.config.ts` enables all of them (stricter than the plugin-kit preset) since this monorepo builds plugins with React Compiler, except `react/exhaustive-effect-dependencies`, which only checks effects and duplicates `react/exhaustive-deps`. Keep the `oxlint`/`oxlint-tsgolint` versions and the rules in line with sanity-io/ui. +- **`oxc/no-barrel-file`** fails files whose `export *` re-exports load more than 100 modules, counting everything they import, type-only imports included. Prefer named re-exports (or `export type *` for modules that only export types); the existing `export *` entry points carry inline suppressions. - **TypeScript type checking** is included in `pnpm lint` via oxlint — no separate `tsc` needed - **stylelint** lints every `*.css` file (`pnpm lint:css`, part of `pnpm lint`) with the `@sanity/plugin-kit/stylelint` preset: `stylelint-config-recommended` plus `stylelint-config-css-modules`, formatting rules off since oxfmt owns formatting. The root `stylelint.config.mjs` imports and spreads the preset; it is `.mjs` on purpose, as stylelint loads `.ts` configs through the TypeScript compiler API that TypeScript 7 does not ship. stylelint 17 has no GitHub formatter, so the CI lint job registers `.github/problem-matchers/stylelint.json` to turn its default output into annotations. - Run `pnpm lint:fix` to auto-fix issues when possible (regenerates the CSS module typings, then stylelint and oxlint with `--fix`) @@ -566,10 +567,10 @@ The oxfmt version, options and ignore patterns match sanity-io/ui's `.oxfmtrc.js Changesets are formatted like any other file, so their frontmatter uses single quotes, and Changesets formats the changesets it writes with oxfmt. Renovate's changeset action writes double quotes, so after a Renovate PR merges, the Auto format workflow opens a `chore(format): 🤖 ✨` PR that requotes it, as in sanity-io/ui. -A lefthook pre-commit hook (`lefthook.yml`, set up like sanity-io/sanity's) runs oxfmt on the staged files and re-stages them. `pnpm install` installs the hook through lefthook's own install script, which `allowBuilds` in `pnpm-workspace.yaml` permits and which skips when `CI` is set. Skip the hook once with `LEFTHOOK=0 git commit`. +A lefthook pre-commit hook (`lefthook.yml`, set up like sanity-io/sanity's) runs oxfmt on the staged files, then `oxlint --fix --quiet` on the staged scripts, and re-stages them; a lint error that `--fix` can't resolve blocks the commit. `pnpm install` installs the hook through lefthook's own install script, which `allowBuilds` in `pnpm-workspace.yaml` permits and which skips when `CI` is set. Skip the hook once with `LEFTHOOK=0 git commit`. - **Clones that ran husky:** they still have `core.hooksPath` set to `.husky/_`, and lefthook won't install there. Run `git config --unset core.hooksPath && pnpm install` once. -- **Hook commands:** they call `node_modules/.bin/oxfmt` directly. `pnpm ` in a hook runs pnpm 12's implicit install, which flips the peer toggle described under pnpm Version. +- **Hook commands:** they call `node_modules/.bin/oxfmt` and `node_modules/.bin/oxlint` directly. `pnpm ` in a hook runs pnpm 12's implicit install, which flips the peer toggle described under pnpm Version. - **Local scripts:** `pnpm --config.verify-deps-before-run=false