我的问题是当我编写vscode自动替换编辑器时,从相对路径到我项目中所有文件的绝对路径自动替换.
例如:当我像这样导入时:
import { login } from '../logic.redux/action'Run Code Online (Sandbox Code Playgroud)
五分钟后(可能是一些操作,如保存或导入另一个文件),它将转换为:
import { login } from '@module/login/logic.redux/action'Run Code Online (Sandbox Code Playgroud)
并且认真地将所有文件覆盖为绝对文件.告诉我,我做错了什么
我的项目包括:Typescript + react-native(项目)
这是我的tsconfig.json
{
"compilerOptions": {
"module": "es6",
"target": "es6",
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react-native",
"moduleResolution": "node",
"noEmit": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": false,
"baseUrl": "./src",
"paths": {
"@conf/*": ["./conf/*"],
"@i18n/*": ["./i18n/*"],
"@module/*": ["./module/*"],
"@router/*": ["./router/*"],
"@theme/*": ["./theme/*"],
"@tpl/*": ["./tpl/*"],
"@util/*": ["./util/*"]
}
}, …Run Code Online (Sandbox Code Playgroud)