1.0.1 • Published 2 years ago
@helloinspire/eslint-config v1.0.1
🚿 ESLint Rules for Inspire Javascript/Typescript applications
Base setup
- Install the following
devDependencies
in your project
yarn add @helloinspire/eslint-config --dev
yarn add eslint --dev
yarn add eslint-plugin-security --dev
- Extend the config in your
.eslintrc.js
module.exports = {
extends: ['@helloinspire/eslint-config'],
...
}
Use with React
- Follow step 1 of Base setup above
- Install the following
devDependencies
in your project
yarn add eslint-plugin-react --dev
yarn add eslint-plugin-react-hooks --dev
- Extend the configs in your
.eslintrc.js
module.exports = {
extends: [
'@helloinspire/eslint-config',
'@helloinspire/eslint-config/react',
],
...
}
Use with TypeScript
- Follow step 1 of Base setup above
- Install the following
devDependencies
in your project
yarn add @typescript-eslint/eslint-plugin@^2.16.0 --dev
yarn add @typescript-eslint/parser@^2.16.0 --dev
- Extend the configs in your
.eslintrc.js
module.exports = {
extends: [
'@helloinspire/eslint-config',
'@helloinspire/eslint-config/typescript',
],
...
}
Overwrite rules
If you want to overwrite a rule in the config, just add to the rules object in your application's .eslintrc.js
- It's highly encouraged that you don't overwrite rules unless your project specifically requires it. If you think a rule should be added/changed/removed, bring it up in #inspa-code-style and we'll discuss and update this package if necessary.
module.exports = {
extends: ['@helloinspire/eslint-config'],
rules: {
'eqeqeq': 'off',
},
...
}