반응형
.eslintrc.js
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"plugin:prettier/recommended",
],
parserOptions: {
parser: "@babel/eslint-parser",
},
rules: {
"no-console": "off",
// "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
// "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
/*
이렇게 prettier를 설정해놓으면 width가 80이 아닐땐 error를 뿜게된다.
그러면 사람들이 width를 80으로 맞추는 코드 통일 효과를 얻을수 있다.
*/
"prettier/prettier": ['error', {
// 프리티어의 속성 정의 공간 ↓
singleQuote: true, // 싱글 따옴표 쓰겠다.
semi: true, // 세미콜론 붙이겠다.
useTabs: true,
tabWidth: 2,
trailingComma: 'all',
printWidth: 80,
bracketSpacing: true,
arrowParens: 'avoid',
}]
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
],
};
https://joshua1988.github.io/web-development/vuejs/boost-productivity/
반응형
'vue.js > vue.js 2' 카테고리의 다른 글
96. Prettier 플러그인 확인 및 설정할 때 주의 사항 (0) | 2022.10.03 |
---|---|
95. ESLint 플로그인 설치 및 설정 변경 (0) | 2022.10.03 |
93. Prettier 소개 및 ESLint와 같이 사용해야 하는 이유 (0) | 2022.10.03 |
92. ESLint 설정 파일 안내 (0) | 2022.10.03 |
91. ESLint 에러가 화면에 표시되지 않게 하는법 (0) | 2022.10.03 |