Skip to content

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Jul 7, 2025

No description provided.

Copy link
Contributor Author

camc314 commented Jul 7, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI labels Jul 7, 2025
@camc314 camc314 marked this pull request as ready for review July 7, 2025 09:57
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Jul 7, 2025
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 93913f9 to 823e29c Compare July 7, 2025 09:59
@camc314 camc314 changed the base branch from c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ to graphite-base/12117 July 7, 2025 10:00
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 7, 2025

CodSpeed Instrumentation Performance Report

Merging #12117 will not alter performance

Comparing c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins (a4dae73) with main (35c6d48)

Summary

✅ 34 untouched benchmarks

@camc314 camc314 force-pushed the graphite-base/12117 branch from a18c4ed to bb6fbe5 Compare July 7, 2025 10:02
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 823e29c to 92ddb0b Compare July 7, 2025 10:02
@camc314 camc314 changed the base branch from graphite-base/12117 to c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ July 7, 2025 10:02
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 92ddb0b to 42969dc Compare July 7, 2025 10:03
@camc314 camc314 requested a review from overlookmotel July 7, 2025 10:04
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 42969dc to 07b5aff Compare July 7, 2025 10:07
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 07b5aff to c395e0a Compare July 7, 2025 10:17
@camc314 camc314 changed the base branch from c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ to graphite-base/12117 July 7, 2025 10:17
@camc314 camc314 force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from c395e0a to e5c18a9 Compare July 7, 2025 10:18
@camc314 camc314 changed the base branch from graphite-base/12117 to c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ July 7, 2025 10:18
@camc314 camc314 changed the base branch from c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ to graphite-base/12117 July 7, 2025 10:19
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 7, 2025
Copy link
Member

overlookmotel commented Jul 7, 2025

Merge activity

graphite-app bot pushed a commit that referenced this pull request Jul 7, 2025
this is a simple LSP rename from `LintPlugins` to `BuiltinLintPlugins` to reduce the diff on #12117
@graphite-app graphite-app bot force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from e5c18a9 to 8959c8d Compare July 7, 2025 13:34
@github-actions github-actions bot added the A-parser Area - Parser label Jul 7, 2025
@graphite-app graphite-app bot changed the base branch from graphite-base/12117 to c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ July 7, 2025 13:34
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 7, 2025
Base automatically changed from c/07-07-refactor_linter_rename_lintplugins_to_builtinlintplugins_ to main July 7, 2025 13:41
@graphite-app graphite-app bot force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from 8959c8d to cb54827 Compare July 7, 2025 13:47
@graphite-app graphite-app bot force-pushed the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch from cb54827 to a4dae73 Compare July 7, 2025 13:49
@graphite-app graphite-app bot merged commit a4dae73 into main Jul 7, 2025
24 checks passed
@graphite-app graphite-app bot deleted the c/07-07-feat_linter_introduce_lintplugins_to_store_builtin_custom_plugins branch July 7, 2025 13:58
camc314 added a commit that referenced this pull request Jul 16, 2025
## [1.7.0] - 2025-07-16

### 🚀 Features

- 5e428a4 linter/eslint-plugin-next: No-html-link-for-pages rule
addition (#12194) (Gabriel Díaz Aguilera)
- 9b14fbc ast: Add `ThisExpression` to `TSTypeName` (#12156) (Boshen)
- c551b8f linter: Report diagnostics from custom plugins (#12219)
(camc314)
- d387729 linter: JS custom rules config (#12160) (camc314)
- 152e59d napi/oxlint: Read source text into start of allocator (#12122)
(overlookmotel)
- bde1ef1 linter: Load custom JS plugins (#11980) (camc314)
- d4ebd14 linter: Add `oxlint2`/`disable_oxlint2` feature flags (#12130)
(camc314)
- a4dae73 linter: Introduce `LintPlugins` to store builtin + custom
plugins (#12117) (camc314)

### 🐛 Bug Fixes

- 3f9a1f0 linter/no-unused-private-class-members: Fix false positive
with nullish coalescing assignments (#12317) (camc314)
- 47fad0e linter/no-empty-file: False positive with empty file with
triple slash directive (#12293) (camc314)
- 633ba30 linter: False positive with unknown plugins when unmatched
eslint rule (#12285) (camc314)
- 9720774 linter: Report implicit config parse errors (#12260) (Simon
Buchan)
- 1920c6b language_server: Respect the root `.oxlintrc.json` file for
`ignorePatterns` (#12171) (Sysix)
- 98708eb linter: Fix inconsistent behavior in `no-duplicate-imports`
rule (#12192) (yefan)
- 853d2bc linter, language_server: Correctly identify usage of `import`
plugin (#12157) (overlookmotel)

### 🚜 Refactor

- ee761de ast: Remove `AstKind` for `AssignmentTarget` (#12252) (Tyler
Earls)
- c68b607 ast: Rename `TemplateLiteral::quasi` to
`TemplateLiteral::single_quasi` (#12266) (Dunqing)
- 32c32af ast: Check whether there is a single `quasi` in
`TemplateLiteral::quasi` (#12265) (Dunqing)
- 8f6a1da linter/js-plugins: Use `u32` for IDs (#12243) (overlookmotel)
- 36cd364 linter/js-plugins: Clean up code (#12242) (overlookmotel)
- 8c02ebd linter/js-plugins: Rename `specifiers` to `paths` (#12241)
(overlookmotel)
- 3adaf98 linter: Simplify getting nodes count (#12239) (overlookmotel)
- 6e54645 language_server: Store `LintService` instead of `Linter`
(#12016) (Sysix)
- 113cf8c linter: Move `LintServiceOptions.paths` to
`LintService.with_paths` (#12015) (Sysix)
- acfac68 oxlint: Adjust ignore patterns by counting bytes instead of
chars (#12209) (Sysix)
- 729b82b linter: Rename `plugin_name` to `plugin_specifier` (#12148)
(overlookmotel)
- 532b816 linter: Use `to_string` instead of `into` (#12147)
(overlookmotel)
- 89f2a69 linter: TODO comment (#12146) (overlookmotel)
- f90d3e1 linter: Feature gate `load_external_plugin` by both `oxlint2`
and `disable_oxlint2` features (#12141) (overlookmotel)
- 12e4ec7 linter: Make `tokio` dependency optional (#12140)
(overlookmotel)
- 1d2eaca oxlint2: Introduce `force_test_reporter` feature for
consistent graphical outputs (#12133) (camc314)
- 8814c53 ast: Remove `AstKind` for `PropertyKey` (#12108) (camchenry)
- 228cff5 semantic,linter: Assert that Program is always the first node
(#12123) (Ulrich Stark)
- e8e2a25 ast: Remove `AstKind` for `AssignmentTargetPattern` (#12105)
(camchenry)
- f7c675d linter: Rename `LintPlugins` to `BuiltinLintPlugins` (#12116)
(camc314)
- a9e5ec0 linter: Access plugins through config instead of storing
directly (#12115) (camc314)
- 9736a7f linter: Simplify `unicorn/require-post-message-target-origin`
(#12110) (shulaoda)

### 📚 Documentation

- 2e3db46 linter: Add missing backtick preventing website from building
(#12113) (camc314)

### ⚡ Performance

- d0f8b88 linter/js-plugins: Do not copy `Vec` (#12248) (overlookmotel)
- 4284d19 linter/js-plugins: Use hashmap `Entry` API + remove temp `Vec`
(#12247) (overlookmotel)
- c7889c3 semantic,linter: Simplify implementation and uses of ancestors
iterators (#12164) (Ulrich Stark)
- f99959c linter: Move work out of loop (#12145) (overlookmotel)
- 514d40c linter: Do not create `Resolver` unless required (#12142)
(overlookmotel)
- 7103527 linter/no-constructor-return: Optimize loop (#12138)
(overlookmotel)

### 🧪 Testing

- d1194e8 oxlint: Ignore test on windows (#12262) (camc314)

Co-authored-by: camc314 <18101008+camc314@users.noreply.github.com>
@connorshea
Copy link
Collaborator

@camc314 Was it intentional that this resulted in plugins in the configuration_schema.json allowing any string value?

The schema has this for the definition of the plugins value:

"LintPlugins": {
  "type": "array",
  "items": {
    "anyOf": [
      {
        "$ref": "#/definitions/LintPluginOptionsSchema"
      },
      {
        "type": "string"
      }
    ]
  }
},

Which results in my editor not validating whether the given plugins are actually allowed.

Screenshot 2025-11-03 at 6 35 26 PM

If I change it to this, like it was before:

"LintPlugins": {
  "type": "array",
  "items": {
    "$ref": "#/definitions/LintPluginOptionsSchema"
  }
},

I do get validation:

Screenshot 2025-11-03 at 6 35 12 PM

camc314 pushed a commit that referenced this pull request Nov 4, 2025
…s enum. (#15259)

This ensures that VS Code and other editors will not accept unknown
values for the plugins field.

I believe `string` was allowed initially because of the way jsPlugins
were going to be implemented (see #12117), but then the jsPlugins plans
changed to use a separate config field? I'm not 100% sure, but that
appears to be the case. Anyway, the schema was never updated after that
pivot, and so this fixes the problem. We could probably remove the
`any_of` to simplify things, but eh I just want to fix this for now.

With this change, jsPlugins still allows arbitrary values, while
`plugins` only allows known values:

<img width="222" height="280" alt="Screenshot 2025-11-03 at 11 16 41 PM"
src="https://github.com/user-attachments/assets/7f7c8756-f9c3-4dad-8642-189197cfa1cc"
/>

In the future, it'd probably be good to add tests to do basic schema
validation (e.g. here are 10 JSON blobs that should pass, here are 10
JSON blobs that should fail) so we can ensure regressions don't occur
for this kind of developer experience nice-to-have.

Part of #15247.
@camc314
Copy link
Contributor Author

camc314 commented Nov 7, 2025

Yes, sorry, we went back and forward here. Initially, JS plugins were going to be enabled via the same plugins array so any string was allowed here. but that later changed, and i think we forgot to update the schema

@connorshea
Copy link
Collaborator

Yes, sorry, we went back and forward here. Initially, JS plugins were going to be enabled via the same plugins array so any string was allowed here. but that later changed, and i think we forgot to update the schema

Makes sense! I opened #15468 for adding some basic JSON Schema tests that might be useful to prevent this kind of regression in the future (though maybe not really this case, since the test would've ended up removed when we moved to allowing any string)

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

Labels

A-cli Area - CLI A-linter Area - Linter A-parser Area - Parser C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants