1.6.0-1 • Published 7 years ago

eslint-config-lffg v1.6.0-1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

eslint-config-lffg

My default ESLint (with Prettier) configuration.

NPM

Important code style info:

  • 2 spaces for indentation;
  • Single quotes;
  • Semicolons as required.

What it does

  • Lints JavaScript based on the latest standards;
  • Formats the code with Prettier;
  • Lints and fixes erros in HTML script tags;
  • You can see all the rules here.

Installing

You can use ESLint globally and/or locally per project.

Per Project Install

  1. If you don't already have a package.json file, create one with yarn init -y.

  2. Then install everything needed by the config:

yarn add eslint eslint-config-lffg --dev
  1. Create a .eslintrc.json file in the root of your project's directory (it should live where package.json does). Your .eslintrc.json file should look like this:
{
  "extends": ["lffg"]
}
  1. Optional You can add two scripts to your package.json to lint and fix:
"scripts": {
  "lint": "eslint . --ext .jsx,.js,.ts,.tsx",
  "lint:fix": "yarn lint --fix"
},
  1. Now you can manually lint your code by running yarn lint and fix all fixable issues with yarn lint:fix. You probably want your editor to do this though.

Global Install

  1. First install everything needed:
yarn global add eslint eslint-config-lffg
  1. Then you need to make a global .eslintrc.json file:

ESLint will look for one in your home directory.

  • ~/.eslintrc.json for Mac; or:
  • C:\Users\<user>\.eslintrc.json for Windows.

Your .eslintrc.json file should look like this:

{
  "extends": ["lffg"]
}
  1. To use from the CLI, you can now run eslint . or configure your editor as we show next.

Integration With VS Code

Once you have done the installation, you probably want your editor to lint and fix for you. Here are the instructions for VS Code:

  1. Install the ESLint extension;
  2. Open the VSCode settings in Code/FilePreferencesSettings. It's easier to enter these settings while editing the settings.json file, so click the {} icon in the top right corner:
"javascript.format.enable": false,
"editor.formatOnSave": true,
"[javascript]": {
  "editor.formatOnSave": false
},
"[javascriptreact]": {
  "editor.formatOnSave": false
},

"eslint.autoFixOnSave": true,

// 🛑 If you're using Yarn:
"eslint.packageManager": "yarn",

// 🛑 Optional BUT IMPORTANT: If you have the prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through ESLint already.
"prettier.disableLanguages": [
  "javascript",
  "javascriptreact",
  "typescript",
  "typescriptreact"
],

Extra Rules Configuration

If you'd like to overwrite ESLint or Prettier rules, you can add the rules in your .eslintrc.json file:

{
  "extends": ["lffg"],
  "rules": {
    // Your ESLint rules here.
    // <https://eslint.org/docs/rules/>

    "prettier/prettier": [
      "error",
      {
        // Your Prettier options here.
        // <https://prettier.io/docs/en/options.html>
      }
    ]
  }
}

This package is released under the MIT License.

This is a fork of eslint-config-wesbos and heavily inspired by the eslint-config-react-app rules.

21.0.0-0

5 years ago

21.0.0-1

5 years ago

20.0.0

6 years ago

20.0.0-1

6 years ago

20.0.0-0

6 years ago

19.0.0

6 years ago

18.0.1

6 years ago

18.0.0

6 years ago

17.1.0

6 years ago

17.1.0-pre-0

6 years ago

17.0.0

6 years ago

15.0.0

6 years ago

16.0.0

6 years ago

14.0.0

6 years ago

14.0.0-0

6 years ago

13.0.0

6 years ago

12.0.0

6 years ago

11.0.0

6 years ago

10.0.1

6 years ago

10.0.0

6 years ago

9.0.2

6 years ago

9.0.1

6 years ago

9.0.0

6 years ago

8.0.0

6 years ago

8.0.0-1

6 years ago

8.0.0-0

6 years ago

7.0.0

6 years ago

6.0.0

6 years ago

6.0.0-4

6 years ago

6.0.0-3

6 years ago

6.0.0-2

6 years ago

6.0.0-1

6 years ago

6.0.0-0

6 years ago

5.0.0

6 years ago

4.0.0

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.8.0

6 years ago

1.7.0

7 years ago

1.6.0

7 years ago

1.6.0-2

7 years ago

1.6.0-1

7 years ago

1.6.0-0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.7-4

7 years ago

0.0.7-3

7 years ago

0.0.7-2

7 years ago

0.0.7-1

7 years ago

0.0.7-0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0-alpha.1

7 years ago