Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.