eslint-config-fb
The Form Builder ESLint configuration implements Standard JS and additional rules, outlined below.
Installation
Install from NPM:
npm i -D @ministryofjustice/eslint-config-fb
Usage
Create an .eslintrc
file in the root of your package:
{
"extends": "@ministryofjustice/eslint-config-fb"
}
Rules
- array-bracket-newline
- array-bracket-spacing
- no-extra-parens
- no-var
- object-curly-spacing
- prefer-template
- quote-props
- quotes
- template-curly-spacing
array-bracket-newline
Enforces line breaks after opening and before closing array brackets
array-bracket-spacing
Enforces consistent spacing inside array brackets
no-extra-parens
Ignores extra parentheses (according to conditions)
no-var
Discourages the use of var
and encourages the use of const
or let
object-curly-spacing
prefer-template
Flags usage of +
operators with strings
quote-props
Requires quotes around object literal property names
quotes
Enforces the consistent use of either backticks, double, or single quotes
template-curly-spacing
Maintains consistency around the spacing inside of template literal