Skip to content

WEBDEV-8512: Enforce import type for type-only imports#49

Open
jbuckner wants to merge 2 commits into
mainfrom
WEBDEV-8512-eslint-import-type
Open

WEBDEV-8512: Enforce import type for type-only imports#49
jbuckner wants to merge 2 commits into
mainfrom
WEBDEV-8512-eslint-import-type

Conversation

@jbuckner
Copy link
Copy Markdown
Collaborator

@jbuckner jbuckner commented May 27, 2026

Summary

  • Add @typescript-eslint/consistent-type-imports ESLint rule to eslint.config.mjs, matching the configuration offshoot adopted in WEBDEV-8471: prefer: 'type-imports', fixStyle: 'separate-type-imports', disallowTypeAnnotations: true.
  • One-time autofix sweep (eslint --fix + prettier --write) across src/ and demo/ — 15 source files touched, purely import reshuffles. No runtime behavior changes.
  • No new dependencies — @typescript-eslint/eslint-plugin@^8.46.4 is already installed.

Test plan

  • npm run build — clean (tsc + tsc-alias + rsync)
  • npx vitest run — 144/144 tests pass
  • npx eslint src/ demo/ — 0 errors from the new rule (11 pre-existing no-explicit-any warnings unaffected)

Ticket: WEBDEV-8512

🤖 Generated with Claude Code

Add @typescript-eslint/consistent-type-imports with the same configuration
offshoot adopted in WEBDEV-8471. Rule options:
- prefer: 'type-imports'
- fixStyle: 'separate-type-imports'
- disallowTypeAnnotations: true

Plus a one-time autofix + prettier sweep across src/ and demo/.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-49/

Built to branch ghpages at 2026-05-28 20:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.75%. Comparing base (9a3b0f3) to head (5bdfebd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #49   +/-   ##
=======================================
  Coverage   78.75%   78.75%           
=======================================
  Files          16       16           
  Lines         645      645           
  Branches      168      168           
=======================================
  Hits          508      508           
  Misses         95       95           
  Partials       42       42           

☔ 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.

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.

2 participants