Michail_04
@Michail_04

Как включить импорт до файла, а не до индекс в котором он экспортируется?

Есть три файла.

1.ts
export const testA = 1;
index.ts
export * from './1'
2.ts
import {testA} from '.'
const testB = testA;


Когда сохраняю второй файл vscode автоматически добавляет импорт до index.ts

Нужно что бы import * from '.' превратился в import * from './2'

Here is my settings.js

{
    "git.ignoreWindowsGit27Warning": true,
    "git.autofetch": true,
    "angular.experimental-ivy": true,
    "files.autoSave": "afterDelay",
    "git.enableSmartCommit": true,
    "explorer.confirmDragAndDrop": false,
    "typescript.updateImportsOnFileMove.enabled": "always",
    "explorer.confirmDelete": false,
    "workbench.editor.untitled.hint": "hidden",
    "workbench.startupEditor": "none",
    "javascript.preferences.quoteStyle": "single",
    "typescript.preferences.includePackageJsonAutoImports": "on",
    "eslint.enable": true,
    "eslint.format.enable": true,
    "javascript.suggest.autoImports": true,
    "editor.codeActionsOnSave": {
        "source.addMissingImports": true,
        "source.fixAll.eslint": true,
        "source.organizeImports": true
    },
    "typescript.preferences.importModuleSpecifier": "relative"
}
  • Вопрос задан
  • 85 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы