@lunit/eslint-config
A TypeScript ESLint ruleset designed for lunit projects based on @rushstack/eslint-config.
Installation
npm install --save-dev @lunit/eslint-config
Usage
Referring to the sapmple-project folder, create eslint-config folder in the project repository root folder, add index.js file, and then extend the eslint-config folder to the .eslintrc.cjs file.
# Project folder structure
sample-project/
├── .eslintrc.cjs
└── eslint-config
├── index.js
└── mixins
└── react.js
module.exports = {
...
extends: [
'./eslint-config',
],
settings: {
react: {
version: 'detect',
},
},
...
};
If necessary, add your own mixin to the eslint-config/mixins folder and use it, or use the mixins in @rushstack/eslint-config/mixins. (Refer to eslint-config/index.js)
module.exports = {
...
extends: [
'@lunit/eslint-config',
'./mixins/react',
],
...
};
Refer to the default settings in @lunit/eslint-config/index.js & @rushstack/eslint-config/profile/web-app and add your own rules to the config if necessary.
Any esconfig rule entries added must have a valid RATIONALE.
rules: {
...
'react/function-component-definition': 'error',
...
},