vscode 원 키 규범 코드 형식의 실현

vscode 를 사용 하 는 과정 에서 자신 이나 push 코드 를 사용 한 후 코드 의 형식 이 어 지 러 울 수 있 습 니 다.
성숙 한 개발 로 서 당연히 코드 규범 을 지 켜 야 한다.먼저 코드 의 청결 도 는 첫 번 째 에 있어 야 한다.
vscode 포맷 코드 를 사용 하면 소량의 경우 수 동 으로 포맷 을 수정 할 수 있 지만,대량의 포맷 이 정렬 되 지 않 은 경우 어떻게 해 야 합 니까?
파일->첫 번 째 옵션->설정->{}

오른쪽 사용자 설정 에서 현재 편집기 의 기본 값 을 변경 할 수 있 습 니 다.
아래 의 복 사 는 사용자 설정 에 있 습 니 다ctrl + s코드 에 대한 규범 을 완성 할 수 있 습 니 다.

{
  // vscode               tabsize   
  "editor.detectIndentation": false,
  //     tabsize
  "editor.tabSize": 2,
  // #             
  "editor.formatOnSave": true,
  // #           eslint      
  "eslint.autoFixOnSave": true,
  //    vue   
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "vue",
      "autoFix": true
    }
  ],
  // # prettier  eslint          
  "prettier.eslintIntegration": true,
  // #          
  "prettier.semi": false,
  // #           
  "prettier.singleQuote": true,
  // #   ( )            
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  // #            
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  // # vue  js       ts        
  "vetur.format.defaultFormatter.js": "vscode-typescript",
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force-aligned"
      // #vue   html       
    }
  },
  //    stylus,    Manta's Stylus Supremacy  
  "stylusSupremacy.insertColons": false, //       
  "stylusSupremacy.insertSemicolons": false, //       
  "stylusSupremacy.insertBraces": false, //        
  "stylusSupremacy.insertNewLineAroundImports": false, // import      
  "stylusSupremacy.insertNewLineAroundBlocks": false //           
}

vscode 원 키 규범 코드 형식 실현 에 관 한 이 글 은 여기까지 소개 되 었 습 니 다.더 많은 vscode 규범 코드 형식 내용 은 우리 의 이전 글 을 검색 하거나 아래 의 관련 글 을 계속 조회 하 시기 바 랍 니 다.앞으로 많은 지원 바 랍 니 다!

좋은 웹페이지 즐겨찾기