eslint-config-majestic
v8.0.1
Published
Majestic code style for ES2015 (ES6) and React 0.14+ (JSX)
Downloads
45
Maintainers
Readme
eslint-config-majestic
This package provides a majestic code style as the smartest ESLint shared config.
Usage
We export one smart ESLint configuration for your usage.
eslint-config-majestic
Contains all the core ESLint rules for linting ES2015 (ES6)+ code.
It only requires eslint
.
npm i -D eslint-config-majestic eslint
- add
"extends": "majestic"
to your .eslintrc
Example .eslintrc.json
{
"root": true,
"extends": ["majestic"]
}
ESLint Plugins
We also provide linting rules for ESLint plugins. To enable them, all you have to do is install the relevant plugin:
npm i -D eslint-plugin-react
You will automatically get the ESLint rules defined for the plugin.
Supported plugins
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-import
- eslint-plugin-prefer-spread
- eslint-plugin-you-dont-need-lodash-underscore
- eslint-plugin-promise
- eslint-plugin-more
- eslint-plugin-filenames
- eslint-plugin-sort-class-members
- eslint-plugin-babel
- eslint-plugin-jsx-a11y
- eslint-plugin-class-property
- eslint-plugin-css-modules
- eslint-plugin-jest
- eslint-plugin-mysticatea
- eslint-plugin-optimize-regex
- eslint-plugin-prefer-class-properties
- eslint-plugin-unicorn
- eslint-plugin-variables
- eslint-plugin-prefer-object-spread
Prettier support
If you use Prettier to format your code, you will need to disable some conflicting rules.
By installing eslint-config-prettier, Majestic will turn off the relevant rules, for the plugins you have installed. Install it with:
npm i -D eslint-config-prettier
Note: Majestic won't run Prettier - to get eslint to run it for you, you can install eslint-plugin-prettier
npm i -D eslint-plugin-prettier
Example .eslintrc.json
{
"root": true,
"extends": ["majestic"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error"
}
}