Privacy Cloud Code Linter configuration
These are common TSLint, ESLint and Prettier configurations.
TSLint configuration
Install
yarn add --dev typescript tslint @privacycloud/linter
Extending configuration
Project tslint.json
For example, client side:
{
"extends": "@privacycloud/linter/lib/tslint/base"
}
server side:
{
"extends": "@privacycloud/linter/lib/tslint/server"
}
Prettier configuration
Install
yarn add --dev prettier @privacycloud/linter
Extending configuration
You can define a .prettierrc.js
file.
module.exports = require('@privacycloud/linter/lib/prettier');
Updating package
To publish package:
yarn upload
How to try new rules
In order to try new rules we have added a playground folder with an example.ts
file. This folder has Prettier and ESLint configured to work with our local rules.
Remember to build (yarn build
) the project to actually see the inline errors in your VSCode editor