/jm-eslint-config-ts

ESLint configuration linting TypeScript

Primary LanguageJavaScript

@jm/eslint-config-ts

An ESLint config that enforces best practices and prevents possible problems for TypeScript.

It is meant as an extention to @jm/eslint-config-base, but can be used without. By default it does not include any rules with regard to styling and formatting.

The idea is to use prettier for styling and so it does not include rules that are conflicting with prettier.

Available configs

  • ts, The, default, base configuration that does not include any rules with regard to styling
  • formatting, Extention to the ts config that does include styling rules but only those that are not covered by prettier.
  • relaxed, Base configuration with some relaxed rules. Better suitable for personal or small projects.
  • formatting-relaxed, Formatting configuration with some relaxed rules. Better suitable for personal or small projects.

Installation

# inside your project's working tree
npm install @jm/eslint-config-ts --save-dev

Usage

Example .eslintrc.json with only the base config

{
  "extends": ["@jm/ts"]
}

Example .eslintrc.json with base config extended with formatting rules

{
  "extends": ["@jm/ts", "@jm/eslint-config-ts/formatting"]
}

Recommended usage

{
  "extends": ["@jm/base", "@jm/ts"]
}

Or with formatting:

{
  "extends": [
    "@jm/base",
    "@jm/eslint-config-base/formatting",
    "@jm/ts",
    "@jm/eslint-config-ts/formatting"
  ]
}

With relaxed configuration:

{
  "extends": [
    "@jm/eslint-config-base/relaxed",
    "@jm/eslint-config-base/formatting-relaxed",
    "@jm/eslint-config-ts/relaxed",
    "@jm/eslint-config-ts/formatting-relaxed"
  ]
}