@lockerstock/react-tsconfig
v1.0.5
Published
A TypeScript config basis. Includes, tsconfig, tslint, tslint.commit, and prettier configurations.
Downloads
2
Maintainers
Readme
@lockerstock/react-tsconfig
A TypeScript config basis. Includes, tsconfig, tslint, tslint.commit, and prettier configurations.
Installation
npm install --save-dev @lockerstock/react-tsconfig
yarn add @lockerstock/react-tsconfig --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-tsconfig",
"devDependencies": {
"@lockerstock/react-tsconfig": "^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-tsconfig/tslint.json"
}
Extend the config in tslint.json
{
"extends": "@alehechlockerstockka/react-tsconfig/tslint.json"
}
Extend the config in tslint.commit.json
{
"extends": ["@lockerstock/react-tsconfig/tslint.commit.json"]
}
If you're using VS Code, turn on the formatOnSave
feature by adding .vscode/settings.json
:
{
"editor.formatOnSave": true
}