1.0.0 • Published 4 years ago

@lockerstock/react-ts-config v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@lockerstock/react-ts-config

A TypeScript config basis. Includes, tsconfig, tslint, tslint.commit, and prettier configurations.

Installation

npm install --save-dev @lockerstock/react-ts-config
yarn add @lockerstock/react-ts-config --dev

This tool has peer dependencies and will download them as needed.

Usage

Reference it in package.json using the prettier property:

{
	"name": "my-projects-name",
	"prettier": "@lockerstock/react-ts-config",
	"devDependencies": {
		"@lockerstock/react-ts-config": "^1.0.0",
		"husky": "^4.3.0",
		"lint-staged": "^10.3.0",
		"prettier": "^2.1.1"
	},
	"scripts": {
		"lint": "tslint --project tsconfig.json -c tslint.commit.json --fix"
	},
	"lint-staged": {
		"src/**/*.{ts,tsx}": ["yarn lint", "prettier --write"]
	},
	"husky": {
		"hooks": {
			"pre-commit": "lint-staged"
		}
	}
}

Extend the config in tsconfig.json

{
	"extends": "@lockerstock/react-ts-config/tslint.json"
}

Extend the config in tslint.json

{
	"extends": "@alehechlockerstockka/react-ts-config/tslint.json"
}

Extend the config in tslint.commit.json

{
	"extends": ["@lockerstock/react-ts-config/tslint.commit.json"]
}

If you're using VS Code, turn on the formatOnSave feature by adding .vscode/settings.json:

{
	"editor.formatOnSave": true
}