1.0.24 • Published 2 years ago

eslint-config-labnol v1.0.24

Weekly downloads
30
License
MIT
Repository
github
Last release
2 years ago

eslint-config-labnol

ESLint and Prettier configuration for Digital Inspiration projects

Installation

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.

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.

{
  "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"]
}
1.0.24

2 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago