1.0.0 • Published 2 years ago

@plato/eslint-config-ts v1.0.0

Weekly downloads
8
License
MIT
Repository
-
Last release
2 years ago

@plato/eslint-config-ts

A shareable ESLint configuration for TypeScript projects at Plato.

Setup

Configuration

First, install this package, along with ESLint, TypeScript, and associated plugins, as development dependencies:

yarn add @plato/eslint-config-ts eslint typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser --dev

ℹ️ Since the command above can be difficult to visually parse, the required development dependencies are:

Next, add the ESLint configuration (which simply extends @plato/eslint-config-ts) to your project's package.json file:

{
  "eslintConfig": {
    "extends": "@plato/eslint-config-ts"
  }
}

ℹ️ You may also specify the ESLint configuration in a separate .eslintrc.json file.

Run the Linter

To easily run the linter from a shell, add a lint command to the scripts property of your project's package.json file:

{
  "scripts": {
    "lint": "eslint path/to/lint --ext .ts"
  }
}

Now you can run yarn lint to lint the project's code.

Editor Integration

Many editors support ESLint. Here are some common editors and associated ESLint plugins.

Example Configuration

A complete package.json might look similar to the following:

{
  "name": "my-package",
  "version": "0.1.0",
  "scripts": {
    "build": "tsc",
    "lint": "eslint path/to/lint --ext .ts"
  },
  "devDependencies": {
    "@plato/eslint-config-ts": "^0.3.0",
    "@typescript-eslint/eslint-plugin": "^4.13.0",
    "@typescript-eslint/parser": "^4.13.0",
    "eslint": "^7.17.0",
    "typescript": "^4.1.3"
  },
  "eslintConfig": {
    "extends": "@plato/eslint-config-ts"
  }
}
1.0.0

2 years ago

0.3.4

2 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

4 years ago

0.1.0

4 years ago