@modyqyw/eslint-config-react
An ESLint shareable config for react. Also support taro and react-native.
Last updated a day ago by modyqyw .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @modyqyw/eslint-config-react 
SYNC missed versions from official npm registry.

@modyqyw/eslint-config-react

An ESLint shareable config for react. Also support taro and react-native.

Usage

  • Install the config.
 # for javascript
npm i eslint@~6.8.0 @modyqyw/eslint-config-react@~1.1.0 -D
# for typescript
npm i eslint@~6.8.0 @modyqyw/eslint-config-react@~1.1.0 typescript@~3.9.0 @typescript-eslint/eslint-plugin@~2.34.0 @typescript-eslint/parser@~2.34.0 -D

For yarn, run scripts below.

# for javascript
yarn add eslint@~6.8.0 @modyqyw/eslint-config-react@~1.1.0 -D
# for typescript
yarn add eslint@~6.8.0 @modyqyw/eslint-config-react@~1.1.0 typescript@~3.9.0 @typescript-eslint/eslint-plugin@~2.34.0 @typescript-eslint/parser@~2.34.0 -D
  • Add tsconfig.json into the project root if you use typescript.

  • Set up.

// .eslintrc.js
module.exports = {
  extends: ["@modyqyw/react"],
};

Attention

  • You need to import React or Taro manually cause eslint won't check this.
  • Not support mobx yet.

VSCode

  • Install plugins.
  • Set up Settings.json. Then F1 => Format Document => F1 => File: Save.
{
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    "typescript": "typescriptreact",
    "json": "jsonc"
  },
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "html",
    "vue",
    "vue-html"
  ],
  "files.eol": "\n",
  "files.associations": {
    "*.js": "javascriptreact",
    "*.ts": "typescriptreact",
    "*.wxml": "html",
    "*.wxs": "javascriptreact",
    "*.wxss": "css",
    "*.axml": "html",
    "*.sjs": "javascriptreact",
    "*.acss": "css",
    "*.wpy": "html",
    "*.json": "jsonc",
    "*.nvue": "vue",
    "*.ux": "vue"
  },
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  }
}

More Config

License

MIT

Copyright (c) 2020-present Millcloud

Current Tags

  • 1.1.5                                ...           latest (a day ago)

9 Versions

  • 1.1.5                                ...           a day ago
  • 1.1.4                                ...           a day ago
  • 1.1.3                                ...           a day ago
  • 1.1.2                                ...           a day ago
  • 1.1.1                                ...           2 days ago
  • 1.1.0                                ...           2 days ago
  • 1.0.2                                ...           20 days ago
  • 1.0.1                                ...           21 days ago
  • 1.0.0                                ...           21 days ago
Maintainers (1)
Downloads
Today 0
This Week 66
This Month 96
Last Day 61
Last Week 0
Last Month 0
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |