Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hjxenjoy/eslint-config-react-jsone

react app eslint config for js
https://github.com/hjxenjoy/eslint-config-react-jsone

Last synced: about 1 month ago
JSON representation

react app eslint config for js

Awesome Lists containing this project

README

        

# eslint-config-react-jsone

eslint config for create-react-app

## Installation

```sh
npm install --save-dev eslint-config-react-jsone
yarn add -D eslint-config-react-jsone
```

## Configuration

### Add eslint config file

1. remove eslintConfig in `package.json`
2. create `.eslintrc` file in root directory

```json
{
"extends": "react-jsone"
}
```

### Add prettier config file

create `.prettierrc` file into root directory

```json
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "auto",
"overrides": [
{
"files": ["*.css", "*.less", "*.scss"],
"options": {
"singleQuote": false
}
}
]
}
```

### Add eslint autoFixOnSave

Add code below into `.vscode/settings.json`

```json
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
```