@helloinspire/eslint-config

ESLint config for Inspire applications

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@helloinspire/eslint-config
1.0.16 months ago2 years agoMinified + gzip package size for @helloinspire/eslint-config in KB

Readme

🚿 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',
  },
  ...
}