今天接受了一个 Vue 项目,在执行 npm run serve
命令运行项目时报错:
Error: No ESLint configuration found.
解决方法:
安装 ESlint 并初始化配置:
方法一:
全局安装 ESLint :
npm i eslint -g
生成配置文件:
eslint --init
根据自己的项目需求进行设置:
√ How would you like to use ESLint · problems
√ What type of modules does your project use · esm
√ Which framework does your project use · vue
√ Does your project use TypeScript · No / Yes
√ Where does your code run · browser
√ What format do you want your config file to be in · JavaScript
The config that you’ve selected requires the following dependencies:
[email protected]/* */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e–;)if(t[e].getAttribute('data-yjshash'))r