[Vue] Use // eslint-disable-next-line to ignore the next line.Use /* eslint-disable */ to ignore all warnings in a file.

2022. 12. 26. 23:44React.js | Vue.js

반응형

vue create 프로젝트명

 

뷰 프로젝트를 생성하고 나서,

 

npm run serve를 했더니 바로 아래와 같은 에러가 떳다.

 

Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

 

해결 방법)

vue.config.js 파일에서

const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    overlay: false,
  },
});

 

devServer: { overlay: false} 를 추가

 

하지만 이후 다시 또 다른 에러 발생 !

Strings must use singlequote  quotes

해당 에러는 

.eslintrc.js 파일에서

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    "plugin:vue/essential",
    "@vue/standard",
    "@vue/typescript/recommended",
  ],
  parserOptions: {
    ecmaVersion: 2020,
  },
  rules: {
    "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
    quotes: [2, "double", { avoidEscape: false }],
    "comma-dangle": "off",
    "@typescript-eslint/comma-dangle": "off",
    semi: [2, "always"],
  },
};


// quotes: [2, "double", { avoidEscape: false }] 를 추가해준다.
// 	comma 관련 에러
//	"comma-dangle": "off",   
//  "@typescript-eslint/comma-dangle": "off",
//  comma 관련 에러

// semi 관련 에러
// semi: [2, "always"],
// semi 관련 에러

다 된거 같지만 또 에러 발생 !

ㅡㅡ 진짜 너무한다 프로젝트 생성하자마자 에러가 이렇게 많이 나면은 하기 싫어진다 

 

Unexpected trailing comma.eslintcomma-dangle

이번엔 콤마 관련 에러다.

이 에러도 .eslintrc.js 에서 추가 해준다.

바로 위 👆에 기록 해놓았다.

마지막 에러 ! ㅡㅡ^

❗️ Extra semicolon.eslint(semi)

이 에러 또한 .eslintrc.js에서 추가 해준다

이도 위에 기록 해놓았다.

 

 

반응형

'React.js | Vue.js' 카테고리의 다른 글

[vue] Missing space before function parentheses.eslintspace-before-function-paren  (0) 2022.12.27
[Vue] ref  (0) 2022.08.31
[React] 이벤트 사용할때 주의 사항  (0) 2021.12.07
[React] state  (0) 2021.12.04
[React] props  (0) 2021.12.03