Coder Social home page Coder Social logo

eslint-config-za's Introduction

eslint-config-za

npm version

众安 ESLint 规则
基于airbnb的 ESLint 规则,进行二次定制。

使用

JavaScrip

npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-config-za
{
  "root": true,
  "extends": "za"
}

React

npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-config-za
{
  "root": true,
  "extends": "za/react"
}

Vue

npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-vue eslint-config-za
{
  "root": true,
  "extends": "za/vue"
}

TypeScript

npm install --save-dev eslint typescript  eslint-plugin-babel eslint-plugin-import @typescript-eslint/eslint-plugin eslint-config-za
{
  "root": true,
  "extends": "za/typescript"
}

VSCode 中使用

VSCode 的 ESLint 插件默认并不支持 vue ts tsx,需要自行修改插件配置。配置参考如下

{
    "eslint.validate": [
        "javascript",
        "javascriptreact",
        "typescript",
        "typescriptreact",
        "vue"
    ]
}

提示

eslint-config-za 定义了相应的 peerDependencies。因此选择不同规则时需要自行安装对应的依赖。具体参考使用说明。

npm info "eslint-config-za@latest" peerDependencies
npx install-peerdeps --dev eslint-config-za

打印规则

npx eslint --print-config .eslintrc > /path/you/file

规则链接

eslint
import
jsx-a11y
react
react-hooks
typescript

eslint-config-za's People

Contributors

jinasonlin avatar thyiad avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.