docs(linter): include license notices and attribution for ESLint plugins#22733
docs(linter): include license notices and attribution for ESLint plugins#22733Boshen wants to merge 0 commit into
Conversation
There was a problem hiding this comment.
💡 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".
Merging this PR will not alter performance
Comparing Footnotes
|
1e00c40 to
5fe5c1a
Compare
There was a problem hiding this comment.
💡 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".
f465b1b to
81347ad
Compare
There was a problem hiding this comment.
💡 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".
| eslint-plugin-react | ||
|
|
||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2014 Yannick Croissant |
There was a problem hiding this comment.
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 👍 / 👎.
81347ad to
2da9677
Compare
There was a problem hiding this comment.
💡 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".
| ), | ||
| 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" |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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", | |||
There was a problem hiding this comment.
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 👍 / 👎.
db37df5 to
12dd6fb
Compare
There was a problem hiding this comment.
💡 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}" |
There was a problem hiding this comment.
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 👍 / 👎.
12dd6fb to
7385070
Compare
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
7385070 to
20326eb
Compare
There was a problem hiding this comment.
💡 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".
| "react" => format!( | ||
| "https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/{name}.md" | ||
| ), |
There was a problem hiding this comment.
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 👍 / 👎.
| eslint-plugin-react | ||
|
|
||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2014 Yannick Croissant |
There was a problem hiding this comment.
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 👍 / 👎.
20326eb to
387fd86
Compare
387fd86 to
c65e8ad
Compare
## 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)
Summary
Resolves #22732 —
eslint-plugin-unicornauthor @sindresorhus asked oxc to include proper license notice and attribution for ported ESLint plugins. The existing attribution was incomplete:THIRD-PARTY-LICENSElisted 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 forimportandjsdoc.tasks/rulegen/) — newupstream_docs_urlhelper plus a### Referencessection emitted insidedeclare_oxc_lint!(...)so the link renders on the oxc.rs rule docs.tasks/rulegen/src/bin/backfill_attribution.rs) — added### Referencesto every existing ported rule. Idempotent; handles both inline-doc rules and the sharedpub const DOCUMENTATIONform (jest/vitest, eslint/unicorn — both URLs listed in those).closes #22526