Enable import-extension and TypeScript type-import rules

Open
#9,501 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
eslint, typescript

Research direction

Start with eslint.config.mjs and tsconfig.json (moduleResolution: bundler, allowImportingTsExtensions), then compare how src/types/index.ts and typeof import('../../store/filters.js') in src/tests/store/filters.spec.ts are imported. Enable one rule at a time, run npm run lint to collect its output, and check each proposed change against npm run ts:check, npm test and npm run build. Done means each rule is enabled or its exact incompatible cases are documented, with a separate signed-off commit per rule. Coordinate overlaps with #9500 and leave import sorting out.

Written by the indexing model from the issue text.

Description

frontend help wanted javascript technical debt

Goal

Enable three deferred import rules without breaking TypeScript resolution, Vite builds, runtime imports or Vitest mocks.

Rules

  • import-extensions/extensions (~558 historical hits)
  • import-extensions/ban-inline-type-imports (~68)
  • @typescript-eslint/consistent-type-imports (~66)

These are historical and possibly overlapping counts; refresh them before editing.

Starting point and procedure

  1. Inspect eslint.config.mjs, tsconfig.json (notably moduleResolution: bundler and allowImportingTsExtensions), and import conventions in src/.
  2. Review real type imports such as src/types/index.ts and dynamic/mock patterns such as typeof import('../../store/filters.js') in src/tests/store/filters.spec.ts. They are examples for inspection, not automatically incorrect code.
  3. Enable one rule at a time at its effective preset options. Collect lint output and preview fixes before editing. Separate a type-only import from a runtime/value import only if its semantics and type checking are preserved.
  4. Preserve all runtime side effects and lazy imports. Do not rewrite paths merely to quiet a lint error; verify each path against the project's actual TypeScript/Vite resolution contract.
  5. Keep one DCO-signed commit per rule; document an exact, narrow incompatibility rather than force a broad suppressor. Coordinate potential import-block overlaps with #9500.

Verification

Run git diff --check, npm run lint, npm run ts:check, npm test and npm run build. Add focused regression checks for altered mocks, dynamic imports or entrypoints. Do not hand-edit generated OpenAPI types or built assets.

Done when

  • The three rules are enabled where compatible, or exact unsupported cases are documented for maintainer decision.
  • Type-only imports, lazy imports, runtime evaluation and test mocking retain their original contracts.
  • The recorded checks pass or reproducible blockers are documented; each rule has a separate signed-off commit.
  • No generated code, public APIs or unrelated import ordering is changed.

Out of scope and contributor suitability

Do not perform import sorting (#9500). This requires module-resolution and test expertise and is not proposed as good first issue in its current combined form.

Additional context

Development workflow: https://docs.libresign.coop/developer_manual/development-workflow.html
Questions: https://t.me/LibreSign

Dominant language
PHP
Stars
844
Forks
176
Avg merge
14h 3m
Merged PRs (30d)
344

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LibreSign/libresign

All issues in LibreSign/libresign

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.