Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
eslint-config-zls
Advanced tools
npm install --save-dev eslint babel-eslint vue-eslint-parser eslint-plugin-vue eslint-config-zls
如果是使用 vue-cli 创建的旧项目,请先移除掉现有的 eslint 相关依赖再重新安装:
npm remove @vue/cli-plugin-eslint eslint babel-eslint eslint-plugin-vue
npm install @vue/cli-plugin-eslint@next eslint babel-eslint vue-eslint-parser eslint-plugin-vue eslint-config-zls
在你的项目的根目录下创建一个 .eslintrc.js
文件,并将以下内容复制进去:
module.exports = {
extends: [
'zls',
'zls/vue',
],
rules: {
// 自定义规则
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
};
根目录下创建一个 .eslintignore
文件,并将需要忽略的文件路径填进去,如:
/test/
/dist/
/*.test.js
eslint ^7.11.0
babel-eslint ^10.1.0
vue-eslint-parser ^7.1.1
eslint-plugin-vue ^6.2.2
需要安装的扩展:
ESLint https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
Prettier https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
Prettier-eslint https://marketplace.visualstudio.com/items?itemName=rvest.vs-code-prettier-eslint
Vetur https://marketplace.visualstudio.com/items?itemName=octref.vetur
打开 VsCode 的配置文件 settings.json
填入以下配置:
{
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"editor.formatOnSave": true,
}
FAQs
Unknown package
The npm package eslint-config-zls receives a total of 0 weekly downloads. As such, eslint-config-zls popularity was classified as not popular.
We found that eslint-config-zls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.