You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-fsd
:
$ npm install eslint-plugin-fsd --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-fsd
globally.
Add fsd
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["fsd"]
}
You can configure rules in 2 ways:
{
"rules": {
"fsd/hof-name-prefix": "error",
"fsd/no-heavy-constructor": "error",
"fsd/jq-cache-dom-elements": "error",
"fsd/jq-use-js-prefix-in-selector": "error",
"fsd/no-function-declaration-in-event-listener": "error",
"fsd/split-conditionals": "error"
}
}
{
"extends": ["plugin:fsd/all"]
}
make
prefix in higher order function namesjs-
prefix in classes that are used to search the DOMIf you want to contribute, check out readme-dev.