1.0.1 • Published 2 years ago

@helloinspire/eslint-config v1.0.1

Weekly downloads
118
License
ISC
Repository
-
Last release
2 years ago

🚿 ESLint Rules for Inspire Javascript/Typescript applications

npm package

Base setup

  1. Install the following devDependencies in your project
yarn add @helloinspire/eslint-config --dev
yarn add eslint --dev
yarn add eslint-plugin-security --dev
  1. Extend the config in your .eslintrc.js
module.exports = {
  extends: ['@helloinspire/eslint-config'],
  ...
}

Use with React

  1. Follow step 1 of Base setup above
  2. Install the following devDependencies in your project
yarn add eslint-plugin-react --dev
yarn add eslint-plugin-react-hooks --dev
  1. Extend the configs in your .eslintrc.js
module.exports = {
  extends: [
    '@helloinspire/eslint-config',
    '@helloinspire/eslint-config/react',
  ],
  ...
}

Use with TypeScript

  1. Follow step 1 of Base setup above
  2. 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
  1. 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',
  },
  ...
}