jmurphyau / ember-truth-helpers

Ember HTMLBars Helpers for {{if}} & {{unless}}: not, and, or, eq & is-array
MIT License
706 stars 95 forks source link

Remove file extensions from import paths #186

Closed owzzz closed 11 months ago

owzzz commented 1 year ago

In trying out the 4.0.0-beta.0 release I noticed eslint was complaining about the file extension being used on the import path.

The error was:

node_modules/ember-truth-helpers/declarations/template-registry.d.ts(13,37): error TS2691: An import path cannot end with a '.ts' extension. Consider importing './helpers/xor.js' instead

This PR removes the file extensions completely where applicable.

SergeAstapov commented 1 year ago

@owzzz interesting, why would this to do anything with ESLint in your app? Note that .ts extension was added deliberately, for some more info see https://github.com/embroider-build/addon-blueprint/pull/160

locks commented 1 year ago

CI is not happy 😬

SergeAstapov commented 1 year ago

TBH I think this is wrong thing to change as .ts extension only affects authoring format (required by rollup) and should not affect publishing format.

@owzzz may I ask you to create a simple repro repository so I can dig into the problem?

owzzz commented 1 year ago

Hey Serge, only just returning to this. Will do. I'll take a look this week and provide a more detailed write up.

NullVoxPopuli commented 11 months ago

Hey, @owzzz were you able to get ESLint/tsc to ignore your node_modules? otherwise, you may need to enable the following TS options:

    "allowImportingTsExtensions": true

https://github.com/embroider-build/addon-blueprint/blob/main/files/__addonLocation__/tsconfig.json#L24

SergeAstapov commented 11 months ago

we have v4.0.0 out and believe this is not an issue with addon but rather an issue with ESLint on this particular case which should not lint node_modules folder