Skip to content

Lint config files with ESLint and Prettier - #1655

Draft
VPS-thodax wants to merge 1 commit into
mainfrom
claude/com-239-status-9z5xwf
Draft

Lint config files with ESLint and Prettier#1655
VPS-thodax wants to merge 1 commit into
mainfrom
claude/com-239-status-9z5xwf

Conversation

@VPS-thodax

@VPS-thodax VPS-thodax commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Motivation

ESLint runs on src/ and **/*.json only, and the Prettier globs miss .mjs/.mts as well as every file in the repository root — so config files are effectively unlinted. As a result three eslint.config.mjs files and site-configs/site-configs.ts are unformatted on main, and the next.config.* override in site/eslint.config.mjs that bans process.env is dead configuration: the file it targets never reaches ESLint.

Solution

  • lint:eslint and lint:prettier now cover the package-root config files, and lint:root covers repository-root files plus site-configs/, which the old glob excluded by prefix.
  • lint-staged mirrors the new patterns.
  • Fixed the findings this surfaced, and lint:create-app, which ran the API lint instead of create-app's.

Decisions

  • Config files get an ESLint override instead of being added to the tsconfigs. They are in no TypeScript project, so typescript-eslint's project service can't parse them; each eslint.config.mjs disables it for them and allows devDependency imports. Adding them to every tsconfig.json include would have pulled tooling configs into tsc and the build output. No rule loses type information — the shared preset uses tseslint.configs.recommended, not the type-checked variant.

Further information

Config files were largely excluded from linting: ESLint only ran on `src/`
and JSON files, so no `.mjs`/`.mts`/`.ts` config file was ever checked, and the
Prettier globs missed `.mjs`/`.mts` entirely as well as every file in the
repository root. As a result `site/eslint.config.mjs` and
`site-configs/site-configs.ts` were unformatted, and the `next.config.*`
override in `site/eslint.config.mjs` was dead configuration.

- Each package's `lint:eslint` now also covers the package-root
  `*.{ts,mts,js,mjs,cjs}` files, and `lint:prettier` adds `mts`/`mjs`/`cjs`
- Each `eslint.config.mjs` disables the TypeScript project service for those
  config files (they are not part of any tsconfig) and allows them to import
  devDependencies
- Root `lint:root`/`lint:fix:root` now cover repository-root files and
  `site-configs/`, which the previous glob excluded, plus `ts`/`mts`/`mjs`/`cjs`
- `lint-staged` mirrors the new patterns and runs ESLint on config files
- Fixed the findings this surfaced, and the `lint:create-app` script, which ran
  the API lint instead of create-app's

COM-239
@VPS-thodax VPS-thodax self-assigned this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants