Skip to content

feat(webpack): add inherit-jsdoc rule with auto-fix - #198

Merged
alexander-akait merged 1 commit into
mainfrom
feat/inherit-jsdoc-rule
Sep 12, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
feat/inherit-jsdoc-rule

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

Ports the inherit-types check from the tooling repo to a type-aware ESLint rule, continuing the move of webpack's lint:special checks into this config (after webpack/valid-schema in #192 and webpack/format-schema in #195).

webpack/inherit-jsdoc requires an overriding method to carry the JSDoc of the method it overrides, with @abstract dropped, and auto-fixes both a missing block and one that has drifted. The new webpack/types config wires up the TypeScript parser the rule needs.

It also fixes webpack/require-license-comment, which read espree's non-standard start/end on comments — @typescript-eslint/parser does not set those, so the rule failed on every file the new config touches.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes — fixtures in validation/webpack/lib/ covering a three-level inheritance chain and a method with no base declaration, linted by the repo's own lint run.

Parity against the script it replaces was verified two ways on webpack's lib/: on the unmodified tree both report nothing, and on a tree with 421 JSDoc blocks scrambled across 141 files (half deleted, half reworded) the rule's auto-fix and the script's --write converge to byte-identical output, both in three passes.

Does this PR introduce a breaking change?

No — webpack/types is opt-in and the rule is not in recommended.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Documented in this PR: the README gains the webpack/types row, the stripTags option, and a note that the rule needs a tsconfig.json plus typescript, and that cross-file inheritance takes more than one --fix run.

Use of AI

Claude Code wrote the rule, the fixtures and the docs, and ran the parity verification described above, under my review and direction.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VMRMJTfRYkzN1N6GwmLbgp


Generated by Claude Code

@changeset-bot

changeset-bot Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c4a0ec2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-config-webpack Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Ports tooling's `inherit-types` check to a type-aware ESLint rule: an
overriding method must carry the JSDoc of the method it overrides, with
`@abstract` dropped. The fix inserts a missing block and rewrites a
drifted one.

Also adds the `webpack/types` config that wires up the TypeScript parser
the rule needs, and fixes `require-license-comment` to read a comment's
`range` rather than espree's non-standard `start`/`end`, which that
parser does not set.
@alexander-akait
alexander-akait merged commit 39ed6b3 into main Sep 12, 2026
12 checks passed
@alexander-akait
alexander-akait deleted the feat/inherit-jsdoc-rule branch September 12, 2026 21:16
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.

1 participant