1.5.9 • Published 4 years ago
@modyqyw/eslint-config-react v1.5.9
@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
. ThenF1 => 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
Copyright (c) 2020-present MillCloud
1.5.9
4 years ago
1.5.8
4 years ago
1.5.7
4 years ago
1.5.6
4 years ago
1.5.5
4 years ago
1.5.4
4 years ago
1.5.3
4 years ago
1.5.2
4 years ago
1.5.1
4 years ago
1.5.0
4 years ago
1.4.1
4 years ago
1.4.0
4 years ago
1.3.2
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago