Skip to content

docs(linter): include license notices and attribution for ESLint plugins#22733

Closed
Boshen wants to merge 0 commit into
mainfrom
linter-license-attribution
Closed

docs(linter): include license notices and attribution for ESLint plugins#22733
Boshen wants to merge 0 commit into
mainfrom
linter-license-attribution

Conversation

@Boshen

@Boshen Boshen commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

Resolves #22732eslint-plugin-unicorn author @sindresorhus asked oxc to include proper license notice and attribution for ported ESLint plugins. The existing attribution was incomplete: THIRD-PARTY-LICENSE listed only 4 of the 14 ported plugins, and most rule files had no link back to the rule they were ported from.

This PR brings attribution into compliance and wires it into the rule generator so future rules ship attributed by default.

  • THIRD-PARTY-LICENSE — appended full verbatim upstream license text for the 9 previously-uncredited plugins (typescript-eslint, unicorn, react, react-perf, jsx-a11y, jsdoc, eslint-plugin-n, eslint-plugin-next, vitest, vue).
  • crates/oxc_linter/src/rules.rs — added /// upstream-repo URL above every plugin module, matching the pre-existing pattern for import and jsdoc.
  • Rule generator (tasks/rulegen/) — new upstream_docs_url helper plus a ### References section emitted inside declare_oxc_lint!(...) so the link renders on the oxc.rs rule docs.
  • One-shot backfill binary (tasks/rulegen/src/bin/backfill_attribution.rs) — added ### References to every existing ported rule. Idempotent; handles both inline-doc rules and the shared pub const DOCUMENTATION form (jest/vitest, eslint/unicorn — both URLs listed in those).

closes #22526

@Boshen Boshen requested a review from camc314 as a code owner May 26, 2026 05:16
@github-actions github-actions Bot added the A-linter Area - Linter label May 26, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e00c40a23

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tasks/rulegen/src/bin/backfill_attribution.rs Outdated
@codspeed-hq

codspeed-hq Bot commented May 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing linter-license-attribution (387fd86) with main (261c477)2

Open in CodSpeed

Footnotes

  1. 52 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (c65e8ad) during the generation of this report, so 261c477 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Boshen Boshen self-assigned this May 26, 2026
@Boshen Boshen force-pushed the linter-license-attribution branch from 1e00c40 to 5fe5c1a Compare May 27, 2026 03:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fe5c1ac73

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/oxc_linter/src/rules/react/rules_of_hooks.rs Outdated
@Boshen Boshen force-pushed the linter-license-attribution branch 2 times, most recently from f465b1b to 81347ad Compare May 27, 2026 03:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81347ad6ef

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread THIRD-PARTY-LICENSE Outdated
Comment on lines +542 to +546
eslint-plugin-react

The MIT License (MIT)

Copyright (c) 2014 Yannick Croissant

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the react-hooks license notice

The newly added React attribution only covers eslint-plugin-react, but this module also contains rules sourced from the separate eslint-plugin-react-hooks package: rules_of_hooks.rs and exhaustive_deps.rs both use the react-hooks scope and cite facebook/react/.../packages/eslint-plugin-react-hooks. In distributions that include those ported rules, THIRD-PARTY-LICENSE still omits the upstream React Hooks license/copyright, so the compliance gap this change is meant to close remains for those rules.

Useful? React with 👍 / 👎.

@Boshen Boshen force-pushed the linter-license-attribution branch from 81347ad to 2da9677 Compare May 27, 2026 04:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2da9677559

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tasks/rulegen/src/main.rs Outdated
),
RuleKind::NextJS => format!("https://nextjs.org/docs/messages/{kebab_name}"),
RuleKind::JSDoc => format!(
"https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/{camel_name}.md"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use kebab-case for JSDoc docs links

When generating a JSDoc rule, this builds a docs link with the camel-cased source filename (requireParam.md, checkAccess.md), but the upstream docs/rules directory uses kebab-case names such as require-param.md and check-access.md while only the source/test paths use camelCase. New JSDoc rules generated from this template will therefore ship with a broken attribution link in the rendered rule docs.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db37df5e13

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -164,6 +164,7 @@ declare_oxc_lint!(
react,
restriction,
config = OnlyExportComponentsConfig,
references = "https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/docs/only-export-components.md",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point react-refresh rule at an existing upstream doc

For the generated react/only-export-components docs, this reference URL currently 404s because eslint-plugin-react-refresh does not have docs/only-export-components.md; the rule documentation is in the upstream README. Users following the new References section for this rule will be sent to a broken attribution link, unlike the other plugin references added here.

Useful? React with 👍 / 👎.

@Boshen Boshen force-pushed the linter-license-attribution branch from db37df5 to 12dd6fb Compare May 27, 2026 06:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12dd6fb914

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

writeln!(
self.page,
"\n## How to use\n<RuleHowToUse />\n\n## Version\nThis rule was added in v{version}.\n\n## References\n<RuleReferences />"
"\n## How to use\n<RuleHowToUse />\n\n## Version\nThis rule was added in v{version}.{upstream_section}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the standard rule references component

For any rule whose new upstream metadata is None (for example native oxc/* rules), this format string now emits no ## References section at all; for ported rules it emits only the upstream URL. The generated pages previously always mounted <RuleReferences />, which is the common hook for the docs site's standard per-rule references, so this change drops those built-in references instead of adding the upstream link alongside them.

Useful? React with 👍 / 👎.

@Boshen Boshen force-pushed the linter-license-attribution branch from 12dd6fb to 7385070 Compare May 27, 2026 06:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7385070c67

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// ```ts
/// class StaticConstants {
/// static readonly version = 42;
/// static readonly reference = "https://typescript-eslint.io/rules/no-extraneous-class/", version = 42;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the upstream URL out of the code example

When the rule docs are rendered, this line is shown as the incorrect-code example for no-extraneous-class; the attribution URL has been spliced into the class field and changes the intended static readonly version = 42; sample into unrelated, likely invalid TypeScript. This makes the published rule documentation confusing for users copying or comparing the example, so the URL should live in the rule metadata/references section instead of inside the fenced code sample.

Useful? React with 👍 / 👎.

@Boshen Boshen force-pushed the linter-license-attribution branch from 7385070 to 20326eb Compare May 27, 2026 06:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20326eba67

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +28 to +30
"react" => format!(
"https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/{name}.md"
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add React upstream overrides for non-jsx-eslint rules

The react fallback still sends every React rule without an override to jsx-eslint/eslint-plugin-react, but several existing React rules explicitly document other upstreams: no-clone-element and no-react-children cite @eslint-react, and prefer-function-component cites eslint-plugin-react-prefer-function-component. For those generated pages this publishes a misleading or broken upstream reference instead of the rule’s actual source, so they need per-rule overrides like the hooks/refresh cases.

Useful? React with 👍 / 👎.

Comment thread THIRD-PARTY-LICENSE Outdated
Comment on lines +542 to +546
eslint-plugin-react

The MIT License (MIT)

Copyright (c) 2014 Yannick Croissant

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include licenses for remaining React-derived rules

This new React notice set still omits upstream packages that are shipped as ported React rules: only_export_components.rs says it is based on eslint-plugin-react-refresh, no_clone_element.rs/no_react_children.rs cite @eslint-react, and prefer_function_component.rs cites eslint-plugin-react-prefer-function-component. Distributions including those rules therefore still lack the corresponding third-party license notices, leaving the compliance gap this change is trying to close.

Useful? React with 👍 / 👎.

@Boshen Boshen force-pushed the linter-license-attribution branch from 20326eb to 387fd86 Compare May 27, 2026 08:13
@Boshen Boshen closed this May 27, 2026
@Boshen Boshen force-pushed the linter-license-attribution branch from 387fd86 to c65e8ad Compare May 27, 2026 13:15
Boshen added a commit that referenced this pull request May 27, 2026
## Summary

Brings license attribution for ported ESLint plugins into compliance
(#22732).

- Expand `THIRD-PARTY-LICENSE` with upstream MIT/BSD license text for 10
previously-uncredited plugins: typescript-eslint, unicorn, react,
react-perf, jsx-a11y, jsdoc, eslint-plugin-n, @next/eslint-plugin-next,
eslint-plugin-vitest, eslint-plugin-vue, and eslint-plugin-react-hooks.
- Add an upstream-repo URL doc comment above every plugin module in
`crates/oxc_linter/src/rules.rs`.

Split out of #22733; the rendering of upstream docs in the website
References section will follow in a separate PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include the proper license notice and attribution for eslint plugins

1 participant