Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yantrab authored Mar 12, 2019
1 parent d772289 commit c6e2a36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Strongly typed validation
It is possible to do strongly typed validation with [class-validator](https://github.com/typestack/class-validator).

### example
### Example
This class
```typescript
enum Color { Red, Green, Blue }
Expand All @@ -26,7 +26,7 @@ class Model {
objectArray: SomeObject[];
}
```
should decorate like:
Should decorate like:
```typescript
enum Color { Red, Green, Blue }
class SomeObject {
Expand Down Expand Up @@ -66,13 +66,13 @@ class Model {
This rule reminds you to add the correct decorator and can fix your models.

## Get started
### install rule with dev flag:
### Install rule with dev flag:
```
npm i tslint-class-validator-rule -D
```

### tslint
Add tslint configoration to you root model folder
### tslint configuration
Add tslint configoration to root of your models folder
```json
{
"rulesDirectory": ["tslint-class-validator-rule"],
Expand All @@ -81,7 +81,7 @@ Add tslint configoration to you root model folder
}
}
```
fix
Fix
```
tslint -p . --fix
```
Expand Down

0 comments on commit c6e2a36

Please sign in to comment.