Closed gregveres closed 3 years ago
I'm not sure. Never heard of this before. Maybe because Typescript provides similar errors. But I think this issue should be raised at ESLint.
You are probably right. BTW, I converted the index.d.ts into a standard ts file and things work better. I had to rearrange things because you output things in alphabetical order rather than in use order, but after that everything works great.
Am starting work with CSS and i get same issue , i try many way ! Any tips ? my jsconfig.json
{
"compilerOptions": {
"target": "es2015",
"module": "es2015",
"jsx": "react",
"checkJs": true,
"lib": ["esnext", "dom"],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": ["src/**/*"]
}
@djmisterjon That seems to be a type error thought?
i found a workaround with import directly in jsdoc.
but i'm a bit idiot 🥇 , i just found out that React already has all types for css with CSSProperties['key'] ! So those thing work both, sorry for the inconvenience.
* @param {import('csstype').Property.FlexDirection} [props.FlexDirection] - Using Import() with csstype
* @param {React.CSSProperties['flexDirection']} [props.FlexDirection] - Using arrayKey with React
all fine thanks
the problem is the field "main" in the package.json is empty eslint-plugin-import tries to resolve the main field and fails.
You need to provide a index.js file, even if this one is empty. IN fact you need to provide the index.d.ts and the index.js produced by the typescript compilation
We recently changed our eslint rules to include import/no-unresolved Now I get an error on import * as CSS from 'csstype';
I get unable to resolve path to module.
I have seen the other issues where the solution is to ensure that tsconfig.ts: compilerOptions.moduleResolution = 'node' and that is what mine is set to.
Any suggestions?