vue.js/vue.js 2

95. ESLint 플로그인 설치 및 설정 변경

DEV-Front 2022. 10. 3. 15:45
반응형

 

윈도우 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를 돌려서 자동으로 저장해주는 효과를 얻을수 있다.

반응형