eslint-config-reforis
v2.1.1
Published
ESLint configuration for reForis and its plugins.
Downloads
148
Readme
eslint-config-reforis
ESLint shareable configuration for reForis and its plugins. It lints javascript with ease, based on the popular javascript code style from Airbnb.
The config is built upon Airbnb's ESLint rules with additional rules and optimizations.
Features
- based on the popular javascript code style from Airbnb
- with React, react-hooks, and Prettier support
Installation
Install the package with
npm install eslint-config-reforis --save-dev
eslint-config-reforis
requires you to take care of it's peerDependencies
.
Install the correct version of each peerDependencies
package, which are listed
with the following command:
npm info "eslint-config-reforis@latest" peerDependencies
If using npm 5+, use this shortcut:
npx install-peerdeps --dev eslint-config-reforis
Usage
Now add eslint-config-reforis
to either your package.json
:
{
"eslintConfig": {
"extends": "eslint-config-reforis"
}
}
to your .eslintrc
:
{
"extends": "eslint-config-reforis"
}
or .eslintrc.js
:
module.exports = {
extends: "eslint-config-reforis",
};
Prettier Config
This is how you can use or extend the eslint-config-reforis
prettier config in
your app:
// prettier.config.js
module.exports = require("eslint-config-reforis/prettier.config");
Development
Shareable configs are simply npm packages that export a configuration object.
You can also test your shareable config on your computer before publishing by installing or linking your module globally. Type:
Linking module
Go to the local module directory (package you want to install) and enter this command.
npm link
Then, in your project that wants to use your shareable config, type:
npm link eslint-config-reforis
Installing module
In the project where you want to use your shareable config, type:
npm install /path-to-eslint-config-reforis
Using a Shareable Config
Shareable configs are designed to work with the extends feature of .eslintrc
files. Instead of using a file path for the value of extends, use your module
name. For example, in your project that wants to use your shareable config:
{
"extends": "eslint-config-myconfig"
}