Skip to content

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

@gtbuchanan

Description

@gtbuchanan

Summary

The shared tsconfig and eslint-config packages currently only target TypeScript files. Consider extending support to JavaScript files (.js, .mjs, .cjs) and ensuring .mts/.cts coverage.

Context

The eslint-config strictTypeChecked preset and projectService require linted files to be part of a TypeScript project. JavaScript files outside the tsconfig include cause was not found by the project service errors.

Most plugin configs in eslint-config use **/*.ts without .mts/.cts — only node.ts includes all three. A shared tsFiles pattern would ensure consistency.

Areas to evaluate

  • tsconfig: Add allowJs: true and include JS file patterns in generated tsconfigs
  • eslint-config: Define a shared tsFiles glob (.ts, .mts, .cts) used by all plugin configs, and extend to JS when ready
  • disableTypeChecked: Currently covers JSON/YAML — may need to cover JS files if allowJs isn't enabled, or use allowDefaultProject as a fallback
  • vitest: Test file patterns (**/test/**/*.ts, **/e2e/**/*.ts) should also cover .mts/.cts
  • entryPoints: Default patterns (**/bin/**/*.ts, **/scripts/**/*.ts) should also cover .mts/.cts

Motivation

Consumer repos may have JS files (config files, scripts, legacy code) that should be linted by the shared config. Even without JS support, .mts/.cts files are currently missed by most plugin configs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions