Skip to content

chore: enable dormant eslint rules and include .mjs in lint/format globs - #823

Merged
robsongajunior merged 4 commits into
mainfrom
chore/eslint-dormant-rules
Jul 29, 2026
Merged

chore: enable dormant eslint rules and include .mjs in lint/format globs#823
robsongajunior merged 4 commits into
mainfrom
chore/eslint-dormant-rules

Conversation

@robsongajunior

@robsongajunior robsongajunior commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Turns the three dormant spots in the eslint setup into working configuration, and adopts the globals package (engineering-audit hygiene items):

  • eslint-plugin-unused-imports was registered in plugins but had no rule enabled — dead weight. Now runs the canonical pair: unused-imports/no-unused-imports (autofixable import removal on --fix) + unused-imports/no-unused-vars with the ^_ ignore patterns, and @typescript-eslint/no-unused-vars turned off so unused code isn't double-reported.
  • The commented-out vue/no-reserved-component-names block is replaced by the rule enabled, tuned for this design system: htmlElementCaseSensitive: true keeps PascalCase roots (Table, Button, Link) valid while both disallow*BuiltInComponents: true prevent a future component from shadowing Transition/Teleport/Suspense/KeepAlive.
  • Residue comments fossilizing old indecision ('no-unused-vars': 'off', // 'error') removed — the off is now the deliberate half of the unused-imports pairing.
  • The 38-entry hand-maintained globals allowlist is replaced by ...globals.browser, ...globals.node (the globals package). It covers every previously-listed global plus the ones the hand list missed (MutationObserver, getComputedStyle, matchMedia, AbortController, structuredClone). The redundant Promise/Symbol/Reflect trio is dropped — flat config auto-enables ES built-ins per ecmaVersion (JSON/Math were never listed and lint always passed).
  • webkit lint/format scripts include .mjs; the three test/**/*.mjs files the widened prettier glob caught are formatted.
  • Lint canaries updated for the rule swap (the lint-canary job correctly flagged the @typescript-eslint/no-unused-vars guard as weakened): that canary now guards unused-imports/no-unused-vars, a new fixture guards unused-imports/no-unused-imports, and the newly-enabled vue/no-reserved-component-names gets its own canary. DOC_LINTS.md §2/§4/§5 rewritten for the new rule ids and the three now-false §12 footnotes dropped. Runner: 56/56 still broken.

Notes

  • No release: chore (dev tooling only, no runtime change).
  • One new root devDependency: globals@17.8.0 (was only a transitive dep; pnpm requires the direct declaration for the import in eslint.config.js). Dev-only, no runtime impact.
  • Validated locally after each change: pnpm --filter webkit lint is clean tree-wide with the new rules and the globals swap (the rules had never run against the full catalog); format:check is clean on tracked files; node lint-canaries/index.js passes 56/56.
  • The eslint flat-config files glob still doesn't cover .mjs scripts/hooks outside src — that's the broader quality-gates work, out of scope here.

@robsongajunior
robsongajunior requested a review from a team as a code owner July 29, 2026 03:55
Comment thread lint-canaries/eslint/import-hygiene/no-unused-imports.ts Dismissed
Comment thread lint-canaries/eslint/typescript/no-unused-vars.ts Dismissed
@robsongajunior robsongajunior added governance Lints, Type Checks, Engineering flow lint labels Jul 29, 2026
@robsongajunior

robsongajunior commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

ESLint and Documentation Updates

Adopt globals package in eslint.config.js (§3)

Fixed: 2026-07-29, PR #823

The 38-entry hand-maintained allowlist has been replaced by:

...globals.browser, ...globals.node

Details:

  • globals@17.8.0 added as new root devDependency
  • Covers every previously-listed global plus five missing ones:
    • MutationObserver
    • getComputedStyle
    • matchMedia
    • AbortController
    • structuredClone
  • Redundant entries (Promise/Symbol/Reflect) dropped — flat config auto-enables ES built-ins per ecmaVersion, proven by JSON/Math never needing to be listed
  • Validation: webkit:lint clean tree-wide, canaries 56/56 ✓

Three ESLint Smells (§3)

Fixed: 2026-07-29, PR #823

1. eslint-plugin-unused-imports Now Enabled

  • Added rule: unused-imports/no-unused-imports: error
  • Added rule: unused-imports/no-unused-vars with ^_ ignore patterns
  • Turned off: @typescript-eslint/no-unused-vars (to avoid double reports)
  • Verification: Live — flags unused var/let/const in components

2. no-unused-vars Comment Cleanup

  • Removed residue comment (// 'error') that suggested the rule was toggled
  • The off is now the deliberate configuration

3. vue/no-reserved-component-names Tuning

  • Replaced commented-out block with enabled rule configured as:
    • htmlElementCaseSensitive: true
    • disallowBuiltInComponents: true
    • disallowComponentAsTag: true
  • Rationale: Only mode compatible with the DS's PascalCase roots (Table/Button/Link)

Residue

The .mjs-outside-every-glob hole remains in item 3, not duplicated here.


Purge Dangling .releaserc Mentions (§6 follow-up)

Tracked as: #818
Fixed: 2026-07-28 — six files updated (five uncommitted in working tree; GOVERNANCE_IMPLEMENTATION.md via item 18 refresh, PR #820)

Updated Files

  • compound-api.md
  • component-scaffold/SKILL.md
  • COMPONENT_REQUIREMENTS.md (×2)
  • STYLEGUIDE.md:497
  • docs/OVERVIEW_LINT.md (§6 rewritten)

Changes

  • Removed d.ts-at-publish claims referencing .releaserc
  • Now name the publish workflows: package-webkit.yml runs vue-tsc --declaration --emitDeclarationOnly right before npm publish on release-please's release: published event
  • OVERVIEW_LINT.md rewrite for release-please:

Acceptance

Grep clean — only deliberate don't-do-this notes in release-types.md and one past-tense migration note in GOVERNANCE_IMPLEMENTATION.md remain.

Action: Close #818 when sweep PR lands.


Docs-Drift Residue (§6, changed since audit)

Tracked as: #819

Status

Item Status Notes
GOVERNANCE_NEXT_STEPS.md Resolved by deletion Nothing to do
packages/webkit/docs/GOVERNANCE_IMPLEMENTATION.md Refreshed 2026-07-28 Resurrected by #768 after #741 deleted it; ships to npm via files: docs

Updates to GOVERNANCE_IMPLEMENTATION.md

  • .releaserc claim → publish-workflow mechanism
  • CI section rewritten for current 12-job pipeline:
    • main-only triggers
    • Plain pnpm audit
    • Sharded tests/visual
    • Lint canary/smoke
  • Scripts/hooks/config locations brought current
  • Refresh sits in working tree — lands with next PR

Action: Close #819 when it merges.

# ESLint and Documentation Updates

Adopt globals package in eslint.config.js (§3)

Fixed: 2026-07-29, PR [#823](#823)

The 38-entry hand-maintained allowlist has been replaced by:

...globals.browser, ...globals.node

Details:

  • globals@17.8.0 added as new root devDependency
  • Covers every previously-listed global plus five missing ones:
    • MutationObserver
    • getComputedStyle
    • matchMedia
    • AbortController
    • structuredClone
  • Redundant entries (Promise/Symbol/Reflect) dropped — flat config auto-enables ES built-ins per ecmaVersion, proven by JSON/Math never needing to be listed
  • Validation: webkit:lint clean tree-wide, canaries 56/56 ✓

Three ESLint Smells (§3)

Fixed: 2026-07-29, PR [#823](#823)

1. eslint-plugin-unused-imports Now Enabled

  • Added rule: unused-imports/no-unused-imports: error
  • Added rule: unused-imports/no-unused-vars with ^_ ignore patterns
  • Turned off: @typescript-eslint/no-unused-vars (to avoid double reports)
  • Verification: Live — flags unused var/let/const in components

2. no-unused-vars Comment Cleanup

  • Removed residue comment (// 'error') that suggested the rule was toggled
  • The off is now the deliberate configuration

3. vue/no-reserved-component-names Tuning

  • Replaced commented-out block with enabled rule configured as:
    • htmlElementCaseSensitive: true
    • disallowBuiltInComponents: true
    • disallowComponentAsTag: true
  • Rationale: Only mode compatible with the DS's PascalCase roots (Table/Button/Link)

Residue

The .mjs-outside-every-glob hole remains in item 3, not duplicated here.


Purge Dangling .releaserc Mentions (§6 follow-up)

Tracked as: [#818](#818)
Fixed: 2026-07-28 — six files updated (five uncommitted in working tree; GOVERNANCE_IMPLEMENTATION.md via item 18 refresh, PR [#820](#820))

Updated Files

  • compound-api.md
  • component-scaffold/SKILL.md
  • COMPONENT_REQUIREMENTS.md (×2)
  • STYLEGUIDE.md:497
  • docs/OVERVIEW_LINT.md (§6 rewritten)

Changes

  • Removed d.ts-at-publish claims referencing .releaserc
  • Now name the publish workflows: package-webkit.yml runs vue-tsc --declaration --emitDeclarationOnly right before npm publish on release-please's release: published event
  • OVERVIEW_LINT.md rewrite for release-please:

Acceptance

Grep clean — only deliberate don't-do-this notes in release-types.md and one past-tense migration note in GOVERNANCE_IMPLEMENTATION.md remain.

Action: Close #818 when sweep PR lands.


Docs-Drift Residue (§6, changed since audit)

Tracked as: [#819](#819)

Status

Item Status Notes
GOVERNANCE_NEXT_STEPS.md Resolved by deletion Nothing to do
packages/webkit/docs/GOVERNANCE_IMPLEMENTATION.md Refreshed 2026-07-28 Resurrected by #768 after #741 deleted it; ships to npm via files: docs

Updates to GOVERNANCE_IMPLEMENTATION.md

  • .releaserc claim → publish-workflow mechanism
  • CI section rewritten for current 12-job pipeline:
    • main-only triggers
    • Plain pnpm audit
    • Sharded tests/visual
    • Lint canary/smoke
  • Scripts/hooks/config locations brought current
  • Refresh sits in working tree — lands with next PR

Action: Close #819 when it merges.

@robsongajunior
robsongajunior merged commit af2aa48 into main Jul 29, 2026
23 checks passed
@robsongajunior
robsongajunior deleted the chore/eslint-dormant-rules branch July 29, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

governance Lints, Type Checks, Engineering flow lint

Development

Successfully merging this pull request may close these issues.

3 participants