Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashikmeerankutty/eslint-config
Eslint and Prettier Setup
https://github.com/ashikmeerankutty/eslint-config
Last synced: 17 days ago
JSON representation
Eslint and Prettier Setup
- Host: GitHub
- URL: https://github.com/ashikmeerankutty/eslint-config
- Owner: ashikmeerankutty
- Created: 2021-06-20T07:27:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-20T08:03:34.000Z (over 3 years ago)
- Last Synced: 2024-10-19T07:11:08.817Z (25 days ago)
- Language: JavaScript
- Size: 53.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Eslint and Prettier Setup
These are my settings for ESLint and Prettier
## Installing
1. Install everything needed by the config:
```
npx install-peerdeps --dev eslint-config-mrdevops
```2. You can see in your package.json there are now a big list of devDependencies.
3. Create a `.eslintrc` file in the root of your project's directory (it should live where package.json does). Your `.eslintrc` file should look like this:
```json
{
"extends": ["mrdevops"]
}
```4. Add scripts to lint and fix:
```json
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
```5. Lint your code by running `npm run lint` and fix all fixable issues with `npm run lint:fix`.
## VS Code Settings
1. Install the [ESLint package](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
2. Add these settings to VSCODE `settings.json````js
// Auto format on save
"editor.formatOnSave": true,
// turn it off for JS and JSX, we will do this via eslint
"[javascriptreact]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": false
},
"[javascript]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": false
},
// show eslint icon at bottom toolbar
"eslint.alwaysShowStatus": true,
// tell the ESLint plugin to run on save
"editor.codeActionsOnSave": {
"source.fixAll": true
}
```