https://github.com/labnol/eslint-config-labnol
ESLint and Prettier configuration for Digital Inspiration projects
https://github.com/labnol/eslint-config-labnol
Last synced: over 1 year ago
JSON representation
ESLint and Prettier configuration for Digital Inspiration projects
- Host: GitHub
- URL: https://github.com/labnol/eslint-config-labnol
- Owner: labnol
- Created: 2020-12-15T08:13:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-08T06:19:25.000Z (over 4 years ago)
- Last Synced: 2025-04-03T12:02:22.228Z (over 1 year ago)
- Language: JavaScript
- Size: 439 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eslint-config-labnol
ESLint and Prettier configuration for [Digital Inspiration](https://digitalinspiration.com/) projects
## Installation
```sh
npm install --save-dev eslint-config-labnol
```
## Usage
Then add the extends to your `.eslintrc.js` file:
The ESLint rules go directly under "rules" while prettier options go under "prettier/prettier". Note that prettier rules overwrite anything in my config (trailing comma, and single quote), so you'll need to include those as well.
```js
module.exports = {
extends: 'labnol',
rules: {
'no-debugger': 'off',
'no-await-in-loop': 'warning',
'prettier/prettier': [
'error',
{
printWidth: 120,
trailingComma: 'es5',
singleQuote: true,
},
],
},
};
```
## ESlint and Prettier in VS Code
Update your VS Code settings to run the linter action on saving the file.
```json
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
"files.autoSave": "onFocusChange",
"eslint.validate": ["javascript", "javascriptreact"]
}
```