
경로 별칭을 통해 절대경로를 깔끔하게 설정하고 모듈을 자동완성으로 불러오면, 상대경로로 불러와지는 것을 확인할 수 있다.
우리는 상대경로를 지양하기 위해 경로별칭을 통한 절대경로를 사용하는 것이기 때문에, 절대경로로 자동완성 되도록 설정해보려한다
settings.json파일에 아래 기술한 코드를 추가한다.
단축키 : ctrl + shift + p , settings.json 검색
// (ts/js) 절대경로로 자동완성
"typescript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifier": "non-relative",
// (ts/js) 모듈 경로 끝에 확장자 생략
"typescript.preferences.importModuleSpecifierEnding": "minimal",
"javascript.preferences.importModuleSpecifierEnding": "minimal"
.preferences.importModuleSpecifier": "non-relative" : 모듈을 불러올 때, 경로별칭으로 설정된 절대경로로 불러온다..preferences.importModuleSpecifierEnding": "minimal" : 모듈 경로 끝에 불필요한 확장자를 생략할 수 있게 한다.