0.0.2 • Published 6 years ago
eslint-plugin-nnimetz v0.0.2
eslint-plugin-nnimetz
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
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'
Variables
- 2.1 Always use
let
orconst
to declare variables. For this, use the ruleno-var-set
: more details with the doc.
// bad
var variable = 'hello'
// good
let variable = 'hello'
Testing
// bad
describe.only('test', () => { })
// good
describe('test', () => { })