Closed RodrigoTomeES closed 5 months ago
Hi Rodrigo, have you try importing the entry in a *.ts
but not *.d.ts
declaration file?
What does your tsconfig.json look like? Which moduleResolution are you using?
@mattpocock this is our tsconfig
{
"compilerOptions": {
"baseUrl": ".",
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"downlevelIteration": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"paths": {
"@/config": ["config"],
"@/config/*": ["config/*"],
"@/assets": ["public/assets"],
"@/assets/*": ["public/assets/*"],
"@/hoc": ["components/hoc"],
"@/hoc/*": ["components/hoc/*"],
"@/icons": ["components/icons"],
"@/icons/*": ["components/icons/*"],
"@/atoms": ["components/atoms"],
"@/atoms/*": ["components/atoms/*"],
"@/molecules": ["components/molecules"],
"@/molecules/*": ["components/molecules/*"],
"@/organisms": ["components/organisms"],
"@/organisms/*": ["components/organisms/*"],
"@/templates": ["components/templates"],
"@/templates/*": ["components/templates/*"],
"@/pages": ["components/pages"],
"@/pages/*": ["components/pages/*"],
"@/layouts": ["components/layouts"],
"@/layouts/*": ["components/layouts/*"],
"@/components": ["components"],
"@/components/*": ["components/*"],
"@/styles": ["styles"],
"@/styles/*": ["styles/*"],
"@/stories": ["stories"],
"@/stories/*": ["stories/*"],
"@/uikit": ["stories/uikit"],
"@/uikit/*": ["stories/uikit/*"],
"@/lib": ["lib"],
"@/lib/*": ["lib/*"],
"@/types": ["types"],
"@/types/*": ["types/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "**/*.spec.ts", "stories/assets"]
}
@alphakevin yes, that works
@RodrigoTomeES As it says in the readme, your moduleResolution needs to be NodeNext or Bundler.
@mattpocock where? because I only saw this
Added a PR to add 'Bundler' to this list, which is what you should have in your tsconfig. moduleResolution: 'node' is legacy.
Import only one TS Reset as documented here https://www.totaltypescript.com/ts-reset doesn't work
https://github.com/total-typescript/ts-reset/assets/13077343/b2271413-f1af-4574-9aae-489b19be0630