Commit Graph

12 Commits

Author SHA1 Message Date
overlookmotel 6ad44809e6 refactor(linter/plugins): remove experimental warning (#18771)
As we prepare for alpha release of JS plugins, it feels like we can remove the warning logged to stderr.

```
WARNING: JS plugins are experimental and not subject to semver.
Breaking changes are possible while JS plugins support is under development.
```

They do still remain experimental, but I don't think we need to shout that quite as loudly now.
2026-01-31 17:28:11 +00:00
connorshea 529901cfc9 fix(linter): include JS plugin rules when calculating total rule count (#17520)
This ensures that we print the expected number of rules for users that are using JS Plugins.

Fix #17519.

Based on #17517, because otherwise we'd end up with weird snapshot differences when trying to merge these anyway.

AI Disclosure: The fix here was generated with Copilot + GitHub's Raptor mini model.
2025-12-31 23:14:52 +00:00
connorshea 96ef2cced3 fix(linter): print total rule # when using a single nested config (#17517)
For a while, we've been skipping the printing of rule runs unless `--disable-nested-config` was passed. This was a result of the nested_configs value including the base config (see #16356). When we were checking whether that value was empty, it would always have at least 1 item (unless nested configs were entirely disabled).

As part of this, I've updated some configs in the fixtures to disable correctness rules, otherwise we will end up with a bunch of fixture snapshots needing updates every time a new default rule is added.

It's probably easiest to review this one commit at a time.
2025-12-31 22:56:47 +00:00
overlookmotel b2b87c608f feat(linter/plugins): add getRange and getLoc methods to SourceCode (#17179)
ESLint has undocumented `getRange` and `getLoc` methods on `SourceCode`. Add them.

These are the last 2 missing methods on `SourceCode` (according to Claude).

Also add more tests for correct functioning of `range` and `loc` properties.
2025-12-20 15:49:56 +00:00
overlookmotel b38c2d06be feat(linter/plugins): add SourceCode#lineStartIndices getter (#16510)
Add a getter `lineStartIndices` to `SourceCode`. ESLint has this property, but it's undocumented. Possible that some ESLint plugins rely on it (if it's there, people will use it!).
2025-12-04 19:14:21 +00:00
overlookmotel d2ca540080 feat(linter/plugins): add SourceCode#isESTree property (#16499)
Add `isESTree` property to `SourceCode`. ESLint's has this property, though it's undocumented.
2025-12-04 16:39:55 +00:00
overlookmotel aefc8b3f6f feat(linter/plugins): implement SourceCode#getIndexFromLoc and getLocFromIndex (#14303)
Implement methods to convert offset to line+column, and vice-versa, using the lines table added in #14290.
2025-10-02 16:45:22 +00:00
overlookmotel 93807dbc5d feat(linter/plugins): implement SourceCode#lines property (#14290)
Add support for obtaining source text split into lines via `context.sourceCode.lines`.
2025-10-02 08:32:05 +00:00
overlookmotel 2f8c985393 feat(linter/plugins): implement SourceCode#visitorKeys property (#14289)
Add support for obtaining visitor keys for AST via `context.sourceCode.visitorKeys`.
2025-10-02 08:32:04 +00:00
overlookmotel b69028f5ac feat(linter/plugins): implement SourceCode#ast property (#14287)
Add support for obtaining the AST via `context.sourceCode.ast`.
2025-10-02 08:32:03 +00:00
overlookmotel 95a8cc41d1 perf(linter/plugins): use singleton for SourceCode (#14286)
Only 1 file is linted at a time, so it's unnecessary for each rule to have its own instance of `SourceCode`. Replace `SourceCode` class with a singleton object `SOURCE_CODE` which is reused for all rules, on all files.
2025-10-02 08:32:03 +00:00
overlookmotel bdf901033e feat(linter/plugins): add SourceCode API (#14281)
Add support for ESLint's `SourceCode` API. At present the only method on `SourceCode` is `getText`. More methods will be added in further PRs to follow.
2025-10-01 16:36:28 +00:00