반응형
윈도우 ctrl + , 누르면 vscode 설정파일 열림
ESLint: Probe
이게 바로 ESLint가 동작할 파일의 확장자들을 나열한 것
이게 있어야 ESLint가 정확하게 동작한다
ESlint: Validate 에서 setting.json에서 편집 버튼을 누르면
이런 파일이 열린다.
{
"workbench.editor.enablePreview": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Night Owl",
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"eslint.validate": [
{
"language": "vue",
"autoFix": true
},
{
"language": "javascript",
"autoFix": true
},
{
"language": "javascriptreact",
"autoFix": true
},
{
"language": "typescript",
"autoFix": true
},
{
"language": "types",
"autoFix": true
}
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.workingDirectories": [{ "mode": "auto" }]
}
eslint.validate 내용 추가하기
이 파일들 대상으로 해서 auroFix를 넣어주면
이 파일들을 대상으로 파일을 저장할때 ESLint를 돌려서 자동으로 저장해주는 효과를 얻을수 있다.
반응형
'vue.js > vue.js 2' 카테고리의 다른 글
97. 프로젝트 레벨로 ESLint 규칙을 관리해야 하는 이유와 ESLint 규칙 설명 (0) | 2022.10.03 |
---|---|
96. Prettier 플러그인 확인 및 설정할 때 주의 사항 (0) | 2022.10.03 |
94. ESLInt에 Prettier 규칙 적용 | Prettier 캡틴판교 블로그 (0) | 2022.10.03 |
93. Prettier 소개 및 ESLint와 같이 사용해야 하는 이유 (0) | 2022.10.03 |
92. ESLint 설정 파일 안내 (0) | 2022.10.03 |