[vue] Vue eslint 규칙 설정

2022. 3. 17. 12:17·Express, Vue
728x90
반응형

Vue3 프로젝트를 생성하고 실행시키는 중 아래와 같은 에러를 발견하였다.

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
ERROR  Error: Build failed with errors.

작업을 하다보면 Vue 규칙을 지키기 어렵다.

npm install --save-dev eslint eslint-plugin-vue@next

위 명령어를 입력하여 eslint-plugin을 받은 뒤

프로젝트 내에 .eslintignore 파일과 .eslintrc.js 파일을 추가한다.

 

.eslintignore 

/build/
/config/
/dist/
/*.js

.eslintrc.js

module.exports = {
  root: true,
  parserOptions: {
    parser: "babel-eslint",
    sourceType: 'module'
  },
  env: {
    browser: true,
  },
  extends: [
    "standard",
    "plugin:vue/recommended"
  ],
  plugins: [
    "html",
    "standard",
    "vue"
  ],
  // add your custom rules here
  rules: {
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  }
}
 

이후, package.json 파일에서 

eslintConfig 로 묶여져 있는 영역의

"extends": [
      "plugin:vue/vue3-essential",
      "eslint:recommended"
    ],
위 부분을 
아래와 같이 변경한다.
"extends": [
      "eslint:recommended",
      "plugin:vue/recommended"
    ],

 

728x90
반응형

'Express, Vue' 카테고리의 다른 글

[node] pm2 설치  (0) 2022.03.29
[centos7] npm install 시 (npm ERR! gyp ERR! find Python 오류 해결)  (0) 2022.03.28
[express] 로컬에서 express 생성 시 액세스 거부 오류  (0) 2022.03.22
[vue] express, vue3 설치  (0) 2022.03.22
[vue] vue cli 프로젝트 설정  (0) 2022.03.17
'Express, Vue' 카테고리의 다른 글
  • [centos7] npm install 시 (npm ERR! gyp ERR! find Python 오류 해결)
  • [express] 로컬에서 express 생성 시 액세스 거부 오류
  • [vue] express, vue3 설치
  • [vue] vue cli 프로젝트 설정
밍글링글링
밍글링글링
mingling - 밍글링, 밍글밍글링. 코드와 어우러지다. IT/ 프로그래밍/소스
    반응형
    250x250
  • 밍글링글링
    mingling
    밍글링글링
  • 전체
    오늘
    어제
    • 밍글링글링 (407) N
      • Flutter (2)
      • 일상생활 (8)
        • 리뷰 (1)
        • 생활정보 (4)
        • 맛집 (0)
        • 여행 (0)
        • 모든정보 (3)
      • JAVA (126)
        • 개념 (6)
        • 예제 (115)
        • Exception (2)
      • C (1)
        • C (1)
        • C++ (0)
        • C# (0)
      • JS (29)
        • JavaScript (18)
        • JQuery (5)
        • AJax (0)
        • NODE.JS (6)
        • Angular.JS 2.0 (0)
      • WEB (87)
        • HTML (6)
        • CSS (61)
        • JSP (20)
        • JSTL (0)
      • FrameWork (8)
        • Spring (8)
        • BootStrap (0)
        • MyBATIS (0)
        • JUnit (0)
      • 외부 라이브러리 (5)
      • 공유 소스 관리 (5)
        • Git (5)
        • SVN (0)
      • 빅데이터 프로그래밍 (37)
        • Python (37)
        • R Programming (0)
      • DB (7)
        • ORACLE (0)
        • MySql (6)
      • Development Tools (7)
        • StarUML (0)
        • eXERD (0)
        • Eclipse (4)
      • SKILL (6)
        • Migration (0)
        • Security (6)
      • MicroSoft (0)
        • Excel (0)
        • Word (0)
      • Android (0)
      • Server (21)
        • Ubuntu (5)
        • Linux (15)
      • IOS (0)
      • XML (0)
      • 미디어 (0)
      • 공지사항 (3)
      • NETWORK (1)
      • 게임 (4)
        • 피파 (1)
        • 리니지M (0)
        • 배틀그라운드 (1)
        • 듀랑고 (2)
      • 세상 이슈 (6)
      • 일렉트론 (0)
      • 대회 소식 (4)
      • 업무 (2)
      • Express, Vue (6)
      • docker (11)
      • svelte (3)
      • 블록체인 (1)
      • IT (10) N
      • Rust (0)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    Rust lang
    vue 설치
    브라우저 자동화
    React Compiler
    jsp include
    css tb
    gitlab 설치
    jsp parameter
    nginx ssl 적용
    자바 클래스
    css block
    API 설계
    rust linux
    nginx
    자바 exception
    svelte
    자바 배열
    AI 코딩 에이전트
    리눅스 설치
    css perspective
    티스토리 자동화
    servlet class
    SSL 인증서
    java casting
    Extension Bisect
    ubuntu
    자바 생성자
    클론코딩
    nginx ssl 설정
    vue cli
    vscode
    mysql db
    lang rust
    자바 객체 지향
    docker
    proxy pass
    spring java
    css list
    ssl 인증서 발급
    Java Array
    css transition
    프런트엔드
    VS Code 팁
    러스트
    css float
    css table
    자바 for문
    에디터 팁
    오류
    Node
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
밍글링글링
[vue] Vue eslint 규칙 설정
상단으로

티스토리툴바