1.0.0 • Published 2 months ago

@mracette/eslint-config v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

@mracette/eslint-config

A personalized ESLint config with Typescript support

Usage

  1. Initialize your project with package.json if you haven't already

  2. Install @mracette/eslint-config and its peer dependencies into your project:

    If using npm: npx install-peerdeps --dev @mracette/eslint-config

    If using yarn: same as above, but pass --yarn

  3. Create a file .eslintrc at the root of your project's directory and add the following:

{
    "extends": [
        "@mracette"
    ],
    "parserOptions": {
        "project": "./tsconfig.json"
    }
}

Alternatively, you can put this object in your package.json under the property "eslintConfig". This makes one less file in your projects.

Extra Configuration

There are a few more optional steps which could help you get the most out of your eslint configuration.

  1. Add .eslintignore. At a very minimum, you should ignore node_modules. Here are some more to get you started:
**/.git/**
**/node_modules/**
  1. You can override rules in the config or extend it by adding a rules section to your project's .eslintrc:
"rules": {
    "no-alert": "warn"
}

## Understanding ESlint plugins vs. configs

In short:

- a plugin provides new rules
- a plugin may also contain 0, 1, or multiple configs
- a config applies a set of rules when added to the extends array

Here is a good Stack Overflow answer with more detail on this: https://stackoverflow.com/a/54522973/3064334

## mracette/eslint-config rules hierarchy:

- `@mracette` (the config provided by this package)
    - `plugin:@typescript-eslint` (provides lint rules for TS)
        - `plugin:@typescript-eslint/recommended` (the set of rules which are recommended for all projects by the ESLint team and _do not require_ type-checking to run)
        - `plugin:@typescript-eslint/recommended-requiring-type-checking` (recommended rules which _do require_ type-checking in order to be implemented correctly)
    - `prettier:/@typescript-eslint` (turns _off_ all rules that are unnecessary or might conflict with Prettier)
1.0.0

2 months ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.19

1 year ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago