2.0.2 • Published 5 months ago

@kmhgmbh/eslint-config v2.0.2

Weekly downloads
60
License
MIT
Repository
-
Last release
5 months ago

@kmhgmbh/eslint-config

Rules

The main rule set is a modified airbnb-base.

Based on that, this package includes extended rule sets:

  • @kmhgmbh/eslint-config/frontend adds frontend- and Vue-specific rules
  • @kmhgmbh/eslint-config/backend adds backend-specific rules
  • @kmhgmbh/eslint-config/jest adds rules and configuration for Jest based tests
  • @kmhgmbh/eslint-config/typescript adds TypeScript-specific rules
  • @kmhgmbh/eslint-config/typescript-frontend is used for Vue projects written in TypeScript
  • @kmhgmbh/eslint-config/cdk adds AWS CDK specific rules to TypeScript and Jest rule sets

There is an additional rule set that enables settings specific to jest. If you use jest in your project, you should extend your .eslintrc further, e.g.:

 "extends": [
   "@kmhgmbh/eslint-config/backend",
   "@kmhgmbh/eslint-config/jest",
 ]

Usage

You need a minimal eslint configuration in your project that extends one of the rule sets in this package. The easiest way is to put it in your package.json:

 "eslintConfig": {
    "extends": "@kmhgmbh/eslint-config"
  }

You can, of course, use a separate .eslintrc

{
  "extends": "@kmhgmbh/eslint-config"
}

… or .eslintrc.js:

module.exports = {
  extends: '@kmhgmbh/eslint-config',
};

You probably also need an npm script in your package.json tu run eslint, e.g.:

 "scripts": {
    "lint": "eslint --ext .ts,.js,.vue src test"
 }

Which would run eslint on all files ending in .js, .ts or .vue found in src/ and test/.

Installation

npm install -D eslint eslint-plugin-import @kmhgmbh/eslint-config

Optional Peer Dependencies

Depending on the rule set you use, you need to install additional dependencies:

  • @kmhgmbh/eslint-config/jest needs eslint-plugin-jest
  • @kmhgmbh/eslint-config/frontend needs eslint-plugin-vue
  • @kmhgmbh/eslint-config/typescript needs @typescript-eslint/eslint-plugin

You only need to install peer dependencies for the rule sets you're using, even though npm will warn you about missing optional peer dependencies.

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

7 months ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago