Skip to content

fix: resolve exadev rules set by a block with no files after the shared config - #132

Merged
Mearman merged 3 commits into
mainfrom
fix/unscoped-exadev-rules
Oct 10, 2026
Merged

Mearman merged 3 commits into
mainfrom
fix/unscoped-exadev-rules

Conversation

@Mearman

@Mearman Mearman commented Oct 10, 2026

Copy link
Copy Markdown
Member

An unscoped block of this package's rules after the shared config (the shape the README documents for exadev/barrel-policy, exadev/test-file-kind and others) fails at config load with could not find plugin "exadev" in a repository that lints a JSON or Markdown file.

The plugin was registered only in the blocks that select JS/TS files, package.json and the files each preset wires. A block with no files also applies to tsconfig.json, other JSON and Markdown, and ESLint resolves the rule id per file. In 2.12.1 JSON was not linted at all, so such a block never reached one. Bisected against the published releases: with a plain *.json file the first bad version is 2.14.0 (RFC 8785 canonical JSON bundled), with only tsconfig*.json, turbo.json or *.jsonc it is 2.16.0 (JSONC config added). 2.12.1 to 2.13.0 and 2.15.0 respectively are fine.

The shared config now starts with a block that registers the plugin and nothing else, so the namespace resolves for every file. Registering it was not enough on its own: ESLint then runs the rule on the JSON or Markdown source, and the rules that need scope analysis, parser services or a JSX program threw there. Each of them now returns no listeners unless the source is an ESTree Program. JSON and Markdown rules declare meta.languages, and ESLint refuses to enable those for a JS file by design, so they still need files; the README says so.

The new integration test builds a temporary project with tsconfig.json, package.json, plain JSON, Markdown and TypeScript, applies ...exadevConfig() plus an unscoped rules block, and enables every non-JSON rule of the plugin in turn. It fails on 3.0.0 (44 of 46 cases) and passes here.

…ed config

A block placed after the shared config that sets an exadev rule and carries no
files also applies to tsconfig.json, other JSON files and Markdown, where the
plugin was not registered, so ESLint failed at config load with
could not find plugin "exadev".

The shared config now opens with a block that registers the plugin for every
file. The rules that read JavaScript or TypeScript syntax, scope analysis or
parser services return no listeners for a file of another language, so they no
longer throw when such a block hands them one.
@Mearman
Mearman marked this pull request as ready for review October 10, 2026 08:34
@Mearman

Mearman commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-10T08:38:00.031056Z e065fd4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: e065fd4c0f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman
Mearman merged commit de15519 into main Oct 10, 2026
10 checks passed
@Mearman
Mearman deleted the fix/unscoped-exadev-rules branch October 10, 2026 08:38
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant