Skip to content

tsconfig.json with allowJs: true does not downlevel JS #873

@please-rewrite

Description

@please-rewrite

I have the following tsconfig.json in a mixed project (js/ts):

{
  "compilerOptions": {
    "target": "es2019",
    "module": "commonjs",
    "moduleResolution": "node",
    "allowJs": true,
    "esModuleInterop": true,
    "strict": true,
    "outDir": "dist",
    "skipLibCheck": true,
    "sourceMap": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules"]
}

It seems like the ts transpiler is only being applied to the typescript files and the js files are taking a different path.

I only assume this because I have optional chaining in both the js and ts files and only the ts files get the proper conversion from ?. operation to chained null checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions