1.42.0 • Published 2 years ago

@schoero/eslint-config v1.42.0

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

eslint-config

Personal ESLint config

Key features

  • No prettier
  • Linting and auto fixing for the following languages:
    • JavaScript
    • TypeScript
    • JSON
    • YAML
  • Linting and auto fixing in code fences in markdown files
  • Linting of JSDoc/TSDoc comments
  • Auto sort and group imports with auto removal of unused imports
  • Auto sort keys in objects, types, interfaces, json files and yaml files

Code style

  • Semicolons
  • Double quotes
  • 2 spaces
  • No trailing commas

Installation

npm i --save-dev @schoero/eslint-config

If you use npm < 7, you need to install the peer dependencies manually.

Usage

Create a .eslintrc.json with the following content:

{
  "extends": "@schoero"
}

Config

It is also recommended to create a .eslintignore file with the following content:

node_modules
!/.vscode
!/.github

VSCode integration

For automatic code formatting on save, install the ESLint extension.

To recommend the extension in your repository create a .vscode/extensions.json with the following content:

{
  "recommendations": [
    "dbaeumer.vscode-eslint"
  ]
}

To configure the extension properly, create a .vscode/settings.json with the following content:

{
  "[javascript]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "[json]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "[json5]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "[typescript]": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true,
    "source.organizeImports": false
  },
  "editor.formatOnSave": false,
  "eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5", "yaml"],
  "prettier.enable": false
}

If you want to have linting scripts, you can use something like this in the package.json:

{
  "scripts": {
    "lint": "node_modules/.bin/eslint --ext .ts,.tsx,.js,.jsx,.json,.jsonc,.yml ./",
    "lint:ci": "npm run lint -- --max-warnings 0",
    "lint:fix": "npm run lint -- --fix"
  }
}
1.41.20

2 years ago

1.41.18

2 years ago

1.41.17

2 years ago

1.41.16

2 years ago

1.41.15

2 years ago

1.41.19

2 years ago

1.41.10

2 years ago

1.41.14

2 years ago

1.41.13

2 years ago

1.41.12

2 years ago

1.41.11

2 years ago

1.41.7

2 years ago

1.41.6

2 years ago

1.41.9

2 years ago

1.41.8

2 years ago

1.42.0

2 years ago

1.40.0

2 years ago

1.38.3

2 years ago

1.38.4

2 years ago

1.41.1

2 years ago

1.41.0

2 years ago

1.41.3

2 years ago

1.41.2

2 years ago

1.41.5

2 years ago

1.41.4

2 years ago

1.39.0

2 years ago

1.37.0

2 years ago

1.37.1

2 years ago

1.37.2

2 years ago

1.38.2

2 years ago

1.38.0

2 years ago

1.38.1

2 years ago

1.35.1

2 years ago

1.35.2

2 years ago

1.35.0

2 years ago

1.35.5

2 years ago

1.35.6

2 years ago

1.35.3

2 years ago

1.35.4

2 years ago

1.35.9

2 years ago

1.35.7

2 years ago

1.35.8

2 years ago

1.35.10

2 years ago

1.35.11

2 years ago

1.35.12

2 years ago

1.35.13

2 years ago

1.35.14

2 years ago

1.35.15

2 years ago

1.36.0

2 years ago

1.36.1

2 years ago

1.34.6

2 years ago

1.34.7

2 years ago

1.34.4

2 years ago

1.34.10

2 years ago

1.34.5

2 years ago

1.34.8

2 years ago

1.34.9

2 years ago

1.33.1

3 years ago

1.31.3

3 years ago

1.33.2

3 years ago

1.31.4

3 years ago

1.29.0

3 years ago

1.29.1

3 years ago

1.32.0

3 years ago

1.30.0

3 years ago

1.34.2

2 years ago

1.34.3

2 years ago

1.34.0

3 years ago

1.34.1

2 years ago

1.28.12

3 years ago

1.28.13

3 years ago

1.28.14

3 years ago

1.28.15

3 years ago

1.28.10

3 years ago

1.28.11

3 years ago

1.28.1

3 years ago

1.28.2

3 years ago

1.28.0

3 years ago

1.28.5

3 years ago

1.28.6

3 years ago

1.28.3

3 years ago

1.28.4

3 years ago

1.28.9

3 years ago

1.28.7

3 years ago

1.28.8

3 years ago

1.31.1

3 years ago

1.33.0

3 years ago

1.31.2

3 years ago

1.31.0

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago

1.12.1

3 years ago

1.12.0

3 years ago

1.18.1

3 years ago

1.18.0

3 years ago

1.16.0

3 years ago

1.14.2

3 years ago

1.18.2

3 years ago

1.21.0

3 years ago

1.21.1

3 years ago

1.25.0

3 years ago

1.23.0

3 years ago

1.27.0

3 years ago

1.15.0

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.11.2

3 years ago

1.11.1

3 years ago

1.19.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.19.2

3 years ago

1.19.1

3 years ago

1.22.0

3 years ago

1.20.0

3 years ago

1.26.0

3 years ago

1.22.1

3 years ago

1.24.0

3 years ago

1.22.2

3 years ago

1.26.3

3 years ago

1.26.4

3 years ago

1.26.1

3 years ago

1.26.2

3 years ago

1.26.6

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.2.0

3 years ago

1.1.0

4 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.0.0

4 years ago