@wezom/eslint-config-ts

12.0.1 • Public • Published

@wezom/eslint-config-ts

ESLint shareable config for TypeScript based on the @wezom/eslint-config

Rules

See full list of extends with code examples

Usage

We strongly recommend using this config with Prettier together.
See description.

Install

# base packages
npm i -D eslint babel-eslint eslint-config-prettier
# wezom configs
npm i -D @wezom/eslint-config @wezom/eslint-config-ts

Setup linter
.eslintrc.json

{
	"root": true,
	"extends": ["@wezom/eslint-config", "eslint-config-prettier"],
	"parser": "babel-eslint",
	"overrides": [
		{
			"files": ["*.ts"],
			"extends": ["@wezom/eslint-config-ts", "eslint-config-prettier"],
			"parserOptions": {
				"project": "./tsconfig.json"
			}
		}
	]
}

Add npm scripts
package.json

{
	"scripts": {
		"test": "npm run prettier && npm run eslint",
		"eslint": "eslint src/**/*.{js,ts}",
		"eslint:autofix": "npm run eslint -- --fix",
		"prettier": "prettier src/ --check",
		"prettier:autofix": "npm run prettier -- --write"
	}
}

Test your files

npm run test

Package Sidebar

Install

npm i @wezom/eslint-config-ts

Weekly Downloads

267

Version

12.0.1

License

BSD-3-Clause

Unpacked Size

8.07 kB

Total Files

4

Last publish

Collaborators

  • dutchenkooleg