Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-nicolaz-base

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-nicolaz-base

Ncolaz's base JavaScript Eslint config

  • 0.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-nicolaz-base

上手

安装

npx install-peerdeps --dev eslint-config-nicolaz-base

配置 .eslintrc

{
  "extends": "nicolaz-base"
}

支持实验性的 ES6+ 语法特性检查

安装 babel-eslint

npm install --save-dev babel-eslint

.eslintrc

{
  "extends": "nicolaz-base",
+ "parser": "babel-eslint"
}

Vue

如果你安装了 eslint-plugin-vue 来检查你的 Vue 项目,你需要修改上面的 parser 选项。

因为该插件依赖 vue-eslint-parser 来解析 *.vue 文件,如果重写了 parser 选项,就会导致该插件无法工作,参见:eslint-plugin-vue 用户手册

{
  "extends": [
    "nicolaz-base",
 	  "plugin:vue/recommended"
  ],
- "parser": "babel-eslint",
  "parserOptions": {
+   "parser": "babel-eslint"
  }
}

混合 TypeScript

1、安装 TypeScript ESLint 插件相关的包:

npm i --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin

2、配置 .eslintrc

{
  "extends": "nicolaz-base",
+ "overrides": [
+   {
+     "files": ["**/*.ts?(x)"],
+     "extends": ["plugin:@typescript-eslint/recommended"]
+   }
+ ],
}

License

MIT © nicolaszhao

Keywords

FAQs

Package last updated on 19 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc