use both import in webstorm
Please tell me how to make the imports to the incoming file in the same used directory be relative, and if from another, then absolute. It can be done?
entities/foo
features/do-foo
//do-foo
import {Foo} from 'src/entities/foo'
import {Card} from '../ui' not src/features/do-foo/ui
//ts-config{
"compilerOptions": {
"target": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": ".",
"typeRoots": [
"src/shared/typings"
]
},
"include": [
"src"
],
"exclude": [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/stories"
]
Please sign in to leave a comment.
Possible if you have path mappings defined and Use path mappings from tsconfig.json is set to Only in files outside specified paths; with Use paths relative to tsconfig.json enabled, all imports are absolute (relative to the specified "baseUrl")
Not in my case. I need other behavior