0.0.2 • Published 6 years ago

eslint-plugin-nnimetz v0.0.2

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

eslint-plugin-nnimetz NPM version BuildStatus javascript style guide jest

ESLint pluging by Nicolas Nimetz

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-nnimetz:

$ yarn add eslint-plugin-nnimetz --dev

Or

$ npm install eslint-plugin-nnimetz --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-nnimetz globally.

Usage

Add nnimetz to the extends and plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "extends": [
      "standard",
      "plugin:nnimetz/recommended"
    ],
    "plugins": [
        "nnimetz"
    ]
}

Or you can configure the rules you want to use under the rules section after added nnimetz to the plugins section.

{
    "extends": "standard",
    "plugins": [
        "nnimetz"
    ],
    "rules": {
        "nnimetz/rule-name": 2
    }
}

Table of Contents

  1. Modules
  2. Variables
  3. Testing

Modules

  • 1.1 Import single function over a full FP library. For this use the rule no-full-fp-lib: more details with the doc.
// bad
import _ from 'lodash'

// good
import { filter } from 'lodash'

⬆ back to top

Variables

  • 2.1 Always use let or const to declare variables. For this, use the rule no-var-set: more details with the doc.
// bad
var variable = 'hello'

// good
let variable = 'hello'

⬆ back to top

Testing

  • 3.1 more details with the doc.
// bad
describe.only('test', () => { })

// good
describe('test', () => { })

⬆ back to top