Skip to content

Support JS/JSX/MJS/CJS in ESLint, Vitest, and tsconfig#46

Merged
gtbuchanan merged 1 commit intomainfrom
fix/js-support
Apr 20, 2026
Merged

Support JS/JSX/MJS/CJS in ESLint, Vitest, and tsconfig#46
gtbuchanan merged 1 commit intomainfrom
fix/js-support

Conversation

@gtbuchanan
Copy link
Copy Markdown
Owner

Summary

  • Add shared scriptFileExtensions constants (8 extensions) to eslint-config and vitest-config
  • Replace all hardcoded ['**/*.ts'] patterns in ESLint plugin configs with the shared constant
  • Scope TS-syntax rules (explicit-function-return-type, consistent-type-exports, no-import-type-side-effects) and JSDoc/TSDoc rules to TS-only files
  • Extend Vitest test includes and coverage extensions to all 8 script extensions
  • Broaden tsconfig include to ['*', '.*'] for root-level config and dotfile coverage
  • Use vitest.config.* with !vitest.config.e2e.* negation in turbo test inputs

Test plan

  • 18 eslint-config tests pass (8 new: extension coverage, TS-only scoping)
  • 66 vitest-config tests pass (updated include assertions)
  • 159 CLI tests pass (updated turbo input assertions)
  • All package lints pass (including markdownlint-config/src/index.mjs)
  • turbo:init regenerated turbo.json and all tsconfig.json files

Closes #40

🤖 Generated with Claude Code

Add shared `scriptFileExtensions` constants covering all 8 script
extensions (cjs, cts, js, jsx, mjs, mts, ts, tsx). Replace hardcoded
`['**/*.ts']` patterns across ESLint plugin configs with the shared
constant so all script files are linted and type-checked.

- eslint-config: Shared `files.ts` with `scriptFiles` and `tsOnlyFiles`.
  All plugin configs target all script extensions. JSDoc/TSDoc and
  TS-syntax rules (`explicit-function-return-type`, `consistent-type-
  exports`, `no-import-type-side-effects`) scoped to TS-only files.
  `disableTypeChecked` ignores all script extensions so JS files stay
  type-checked when `allowJs` is enabled.
- vitest-config: Shared `files.ts` with `scriptFileExtensions`. Unit
  and e2e test includes cover all extensions. Coverage extensions now
  include `jsx` for consistency.
- cli: `typeCheckInclude` broadened to `['*', '.*']` so root-level
  config files and dotfiles (e.g. `.markdownlint.mjs`) are included
  in tsconfig projects. Turbo test inputs use `vitest.config.*` with
  `!vitest.config.e2e.*` negation for extension-agnostic cache keys.
- turbo:init regenerated turbo.json and all tsconfig.json files.

Closes #40

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gtbuchanan gtbuchanan merged commit 423fa74 into main Apr 20, 2026
7 of 8 checks passed
@gtbuchanan gtbuchanan deleted the fix/js-support branch April 20, 2026 13:20
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.

Consider JS/MJS/CJS support in TypeScript and ESLint configs

1 participant