- A sample that executes the code format using tslint-plugin-prettier.
- By using Visual Studio Code and TSLint extensions, automatic formatting can be done when saving files.
- Node.js - 10.x
- Yarn - 1.13.x
- Visual Studio Code - 1.31.x
- TSLint - 1.0.0
- TypeScript - 3.2.x
- TSLint - 5.11.x
- prettier - 1.16.x
- tslint-plugin-prettier - 2.0.x
- tslint-config-prettier - 1.18.x
git clone git@github.com:yasu-s/tslint-prettier-sample.git
cd tslint-prettier-sample
yarn
yarn lint:fix
{
"tslint.configFile": "tslint.json",
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true
}
}
{
"rulesDirectory": [
"tslint-plugin-prettier"
],
"extends": [
"tslint:latest",
"tslint-config-prettier"
],
"rules": {
"prettier": [
true, {
"printWidth": 140,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always"
}
]
}
}