evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
37.59k stars 1.11k forks source link

esbuild doesn't respect noImplicitUseStrict option in tsconfig.json #3789

Closed dknight closed 1 month ago

dknight commented 1 month ago

If you are using tsconfig.json and put stict: true or alwaysStrict: true for IIEF bundles "use strict"; is automatically added in the beginning of the file. At this moment there is no possibility to disable this feature.

I would propose to respect property in tsconfig.json option noImplicitUseStrict.

Consider:

{
  "compilerOptions": {
    "strict": true,
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "noImplicitUseStrict": true  <---- this is ingored
  }
}
dknight commented 1 month ago

Actually it was my mistake, if you set alwaysStrict: false then "use strict"; is not added.

Closed.