Socket
Book a DemoInstallSign in
Socket

@modyqyw/eslint-config-react

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modyqyw/eslint-config-react

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

latest
npmnpm
Version
1.5.9
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

@modyqyw/eslint-config-react

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

Usage

  • Install the config.
# for javascript
npm i -D eslint@~7.10.0 @modyqyw/eslint-config-react@~1.5.0
# for typescript
npm i -D eslint@~7.10.0 @modyqyw/eslint-config-react@~1.5.0 typescript@~4.0.0

For yarn, run scripts below.

# for javascript
yarn add -D eslint@~7.10.0 @modyqyw/eslint-config-react@~1.5.0
# for typescript
yarn add -D eslint@~7.10.0 @modyqyw/eslint-config-react@~1.5.0 typescript@~4.0.0
  • Add tsconfig.json into the project root if you use typescript. Check Intro to the TSConfig Reference.

  • 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",
    "vue-html": "html"
  },
  "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",
    "*.swan": "html",
    "*.ttml": "html",
    "*.ttss": "css",
    "*.jxml": "html",
    "*.jxss": "css",
    "*.wpy": "vue",
    "*.json": "jsonc",
    "*.nvue": "vue",
    "*.ux": "vue"
  },
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  }
}

More Config

License

MIT

Copyright (c) 2020-present MillCloud

Keywords

eslint

FAQs

Package last updated on 19 Oct 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