Skip to content

codehwl/eslint-plugin-react-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-react-project

简体中文说明

A eslint plugin for react project.

Installation

You just need to install eslint-plugin-react-project.

npm install eslint-plugin-react-project --save-dev

Usage

Add .eslintrc.json configuration file to the project root directory:

  • if you use React and JavaScript:

    {
      "extends": [
        "plugin:react-project/base"
      ],
      "plugins": [
        "react-project"
      ]
    }
  • if you use React and TypeScript:

    {
      "extends": [
        "plugin:react-project/typescript"
      ],
      "plugins": [
        "react-project"
      ]
    }

With Visual Studio Code

1、Install VS Code ESLint extension.

2、Add .vscode/settings.json file to the project root directory:

{
  "javascript.format.enable": false,
  "typescript.format.enable": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.fixAll.stylelint": true
  },
  "editor.formatOnSave": true,
  "eslint.format.enable": true,
  "eslint.alwaysShowStatus": true,
  "eslint.validate": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact"
  ],
  "prettier.enable": false
}

3、Reload your VS Code window.

About

A eslint plugin for react project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published