1.0.2 • Published 1 year ago

@maxencebonamy/eslint-config v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

ESLint is a static code linter for JavaScript, which means it analyzes your JavaScript code for errors, style problems and coding convention violations. This is my ESLint configuration, which I use for my JavaScript and TypeScript projects.

Install the config:

!NOTE Prerequisites:

  • NodeJS must be installed on your computer. If not, click here.
  1. Install the dependency:
npm install -D eslint @maxencebonamy/eslint-config
  1. Paste the following code into the .eslintrc.json file:
{
    "extends": "@maxencebonamy"
}
  1. Add the scripts for linting into the package.json file by pasting the following code:
{
    "scripts": {
        "lint": "eslint .",
        "lint:fix": "eslint . --fix"
    }
}

Enable auto fix with VS Code:

  1. Install ESLint extension.

  2. Paste the folling code into the .vscode/settings.json file:

{
    "prettier.enable": false,
    "editor.formatOnSave": false,
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    }
}