1.0.5 • Published 5 years ago

@muffin-dev/eslint-config v1.0.5

Weekly downloads
18
License
ISC
Repository
gitlab
Last release
5 years ago

Muffin Dev for Node - ESLint Config

This module just exports a configuration preset for ESLint linting tool. This preset is used in most of the Muffin Dev's Node JS projects.

The rules configuration provided by this module are based on eslint "default" rules, typescript and unicorn. Note that you don't need to install other frameworks to get it work, only eslint module is required.

Installation

Basic installation

You need to install eslint and this module first:

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

You can also use unicorn and typescript plugins:

npm i --save-dev eslint eslint-plugin-unicorn @typescript-eslint/eslint-plugin

As a shortcut, you can add the lint script in your package.json:

{
    "scripts": {
        "lint": "eslint ./**/*.ts ./**/*.js",
    }
}

Create an .eslintrc file at the root of your project. This file is meant to contain the ESLint configuration. You must add this module to the extends options in order to use this preset:

{
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": [
        "@muffin-dev/eslint-config"
    ]
}

Recommended installation

Muffin Dev's projects usually use the standard preset, Typescript and Unicorn plugins for ESLint:

npm i --save-dev eslint @muffin-dev/eslint-config eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard eslint-plugin-unicorn @typescript-eslint/eslint-plugin @typescript-eslint/parser

.eslintrc file at the root of the projects:

{
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": [
        "standard",
        "plugin:unicorn/recommended",
        "plugin:@typescript-eslint/recommended",
        "@muffin-dev/eslint-config"
    ],
    "parser": "@typescript-eslint/parser",
    "plugins": [
        "@typescript-eslint"
    ]
}

package.json scripts:

{
    "scripts": {
        "lint": "eslint ./src/**/*.ts",
    }
}
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago