I've just started looking at TypeScript, React and wanted to prepare a nice working environment for it.
I've began with
create-react-app my-app --scripts-version=react-scripts-ts
Added following dependencies
yarn add -D prettier tslint-config-prettier tslint-plugin-prettier husky pretty-quick
Let Prettier know that I want single quotes, not doubles:
{
"singleQuote": true
}
Have added the following to my tslint.json
:
{
"extends": [
"tslint-react",
"tslint-plugin-prettier",
"tslint-config-prettier"
],
"rules": {
...,
"prettier": true
}
}
And then added following line to my package.json
:
{
"scripts": {
...,
"precommit": "pretty-quick staged"
}
}
It does seem to work nice for myself. Formatting is left for prettier and linting is done by tslint. What kind of setup do you use?
Top comments (0)