@robinblomberg/eslint-config-robinblomberg

0.28.0 • Public • Published

ESLint config

Installation

npm install -D @robinblomberg/eslint-config-robinblomberg

Configuration

Create a file called .eslintrc.js at the project root:

module.exports = {
  extends: '@robinblomberg/robinblomberg',
};

NPM scripts

Add the following scripts to your package.json:

{
  "scripts": {
    "lint-scripts": "eslint \"**/*.{js,jsx,ts,tsx}\"",
    "lint-scripts-fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix"
  }
}

Adjust the paths according to your project/file structure as necessary (e.g. "eslint \"lib/**/*.{ts,tsx}\"").

To run a script, enter the following in your command line:

npm run lint-scripts

Formatting on save

With this knowledge of ESLint messages in mind, we can modify VS Code to tell ESLint to fix any issues (mainly formatting) every time we save. To open the settings menu, click on the gear icon in the lower left, and then choose Settings.

Within the settings menu, search for eslint. In the results, you will see a checkbox for ESLint: Auto Fix on Save. Make sure this is checked:

VS Code Settings

Now, save your JavaScript file. You should see some changes, including fewer squiggles.

/@robinblomberg/eslint-config-robinblomberg/

    Package Sidebar

    Install

    npm i @robinblomberg/eslint-config-robinblomberg

    Weekly Downloads

    2

    Version

    0.28.0

    License

    none

    Unpacked Size

    531 kB

    Total Files

    6

    Last publish

    Collaborators

    • robinblomberg