Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
please-rewrite opened this issue Feb 15, 2022 · 0 comments
Open

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

please-rewrite opened this issue Feb 15, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@please-rewrite
Copy link

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.

@styfle styfle added the bug Something isn't working label Mar 1, 2022
@styfle styfle changed the title Mixed Project Compilation Issues tsconfig.json with allowJs: true does not downlevel JS Mar 1, 2022
@styfle styfle changed the title tsconfig.json with allowJs: true does not downlevel JS tsconfig.json with allowJs: true does not downlevel JS Mar 1, 2022
dorny added a commit to dorny/test-reporter that referenced this issue Aug 23, 2022
[email protected] has a dependency on @sindresorhus/[email protected] and it uses optional chaining operator "?.".  
Probably due to issue vercel/ncc#873 this syntax got into our dist/index.js. For some unknown reason it results in error when action is executed in GitHub runner despite the node version is 16.17.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants