Skip to content

add require-copyright-header eslint rule#6268

Merged
anonrig merged 1 commit intomainfrom
yagiz/add-require-header-eslint-rule
Mar 6, 2026
Merged

add require-copyright-header eslint rule#6268
anonrig merged 1 commit intomainfrom
yagiz/add-require-header-eslint-rule

Conversation

@anonrig
Copy link
Member

@anonrig anonrig commented Mar 6, 2026

I keep forgetting adding copyright headers.

@anonrig anonrig requested review from a team as code owners March 6, 2026 18:39
Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

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

This review was generated by an AI code review assistant and may contain inaccuracies.

Adds a require-copyright-header ESLint rule to enforce Cloudflare copyright headers on all TS/JS files, and backfills 80+ files that were missing them.

  • [LOW] The rule lacks auto-fix support, which would make it trivial to remediate violations on new files (see inline suggestion).

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 6, 2026

I'm Bonk, and I've done a quick review of your PR.

This PR adds a require-copyright-header ESLint rule enforced via the shared base config, and backfills 80+ files across src/cloudflare/, src/node/, src/pyodide/, and types/ that were missing the Cloudflare copyright header.

The rule implementation is correct -- the regex properly matches the expected header format (including year ranges), the base config integration is clean, and the src/node/eslint.config.mjs deduplication of the customRules plugin import is correct since it's now handled centrally.

One low-severity suggestion posted: adding fixable: 'code' + a fix() function so eslint --fix can auto-insert the header on new files, which directly addresses the "I keep forgetting" motivation.

github run

@anonrig anonrig force-pushed the yagiz/add-require-header-eslint-rule branch from 16162e9 to ffb16d7 Compare March 6, 2026 18:42
@anonrig anonrig enabled auto-merge March 6, 2026 18:43
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.68%. Comparing base (fd0665d) to head (ffb16d7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6268      +/-   ##
==========================================
- Coverage   70.69%   70.68%   -0.02%     
==========================================
  Files         417      417              
  Lines      111111   111111              
  Branches    18331    18331              
==========================================
- Hits        78552    78534      -18     
- Misses      21614    21630      +16     
- Partials    10945    10947       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig anonrig merged commit 1d99c25 into main Mar 6, 2026
39 of 41 checks passed
@anonrig anonrig deleted the yagiz/add-require-header-eslint-rule branch March 6, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants