@plato/eslint-config-ts

1.0.0 • Public • Published

@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"
	}
}

Package Sidebar

Install

npm i @plato/eslint-config-ts

Weekly Downloads

34

Version

1.0.0

License

MIT

Unpacked Size

5.87 kB

Total Files

7

Last publish

Collaborators

  • k4rliky
  • nickav
  • evgeny_trubish
  • jeremyjackson89
  • nikoloffgeorgi
  • geoffblair
  • fralmei
  • platochris
  • hyperandroid
  • bennettstruttman
  • nazariglez