728x90
반응형
에러 발생 환경
package.json
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-service": "^4.5.14",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^6.0.1",
"prettier": "^2.5.1",
"sass-loader": "^10.2.0",
"vue-template-compiler": "^2.6.14"
},
.eslintrc
{
"extends": [
"airbnb",
...
],
...
}
vue.config.js
module.exports = {
lintOnSave: true,
...
};
해결 절차
이슈 1
Syntax Error: Thread Loader (Worker 0)
Failed to load config "airbnb" to extend from.
Referenced from: C:\Users\sy\test-project\.eslintrc
at _normalizeObjectConfigDataBody.next (<anonymous>)
at _normalizeObjectConfigData.next (<anonymous>)
해결 1
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
install-peerdeps --dev eslint-config-airbnb-base
※ install-peerdeps --dev eslint-config-airbnb eslint-config-airbnb-base => 이렇게는 안됨. 에러 발생
출처 : https://stackoverflow.com/questions/69733256/failed-to-load-config-airbnb-to-extend-from-gitlab-ci
위 명령어 수행 후 업데이트된 package.json
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-service": "^4.5.14",
"babel-eslint": "^10.1.0",
"eslint": "^8.2.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^6.0.1",
"prettier": "^2.5.1",
"sass-loader": "^10.2.0",
"vue-template-compiler": "^2.6.14"
},
vue-cli-service build 수행
이슈 2
Syntax Error: Thread Loader (Worker 0)
eslint.CLIEngine is not a constructor
해결 2
npm uninstall eslint
npm install eslint@5.16.0 --save-dev
출처 : https://tristan91.tistory.com/516
vue-cli-service build 수행
결과
eslint 수행 후 정상적으로 빌드 완료
728x90
반응형