IntelliJ의 Nuxt.js 프로젝트에서 Prettier와 ESLint를 도입하여 코드를 자동 성형합니다.
.eslintrc.js
의 Rules가 반영되지 않는 것과 Ctrl + s
설정했습니다.node 모듈 넣기
// vue-cliでNuxt.jsプロジェクトが入ってる前提です。
// 追加で以下をdevDependenciesにインストール
$ yarn add -D prettier eslint-config-prettier eslint-plugin-prettier
.eslintrc.js 설정
#ESLint 및 Prettier -Nuxt.js
위의 Nuxt.js 공식 문서대로
.eslintrc.js
단지 상기와 같으면 더블 쿼테이션을 사용하는 설정이 되어 있기 때문에 singleQuote: true
를 추가했습니다..eslintrc.js
module.exports = {
// ~~~~~~~~~~~~~~~~
rules: {
'semi': [2, 'never'],
'no-console': 'off',
'vue/max-attributes-per-line': 'off',
'prettier/prettier': ['error', { 'singleQuote': true, 'semi': false }]
}
}
IntelliJ or WebStorm에 File Watchers 플러그인 추가
추가하십시오. 재부팅 후 설정 → 도구 → 파일 감시가 있으면 OK입니다.
File Watchers 설정
위와 같은 느낌으로 설정했습니다.
--ignore-path
의 설정하지 않으면 node_modules
라든지 .nuxt
에도 일해 죽기 때문에 주의해 주세요.
Reference
이 문제에 관하여(IntelliJ의 Nuxt.js 프로젝트에서 Prettier와 ESLint를 도입하여 코드를 자동 성형합니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/sho_yamane/items/741eba2df147ddd91bf0텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)