You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ To enable TSSLint in VSCode, follow these steps:
61
61
62
62
### Create a Rule
63
63
64
-
To create a rule, you need to define a function that receives the context of the current diagnostic task. Within this function, you can call `reportError()` or `reportWarning()` to report an error.
64
+
To create a rule, you need to define a function that receives the context of the current diagnostic task. Within this function, you can call `report()` to report an error.
65
65
66
66
As an example, let's create a `no-console` rule under `[project root]/rules/`.
67
67
@@ -71,14 +71,14 @@ Here's the code for `[project root]/rules/noConsoleRule.ts`:
After saving the config file, you will notice that `console.log` is now reporting errors in the editor. The error message will also display the specific line of code where the error occurred. Clicking on the error message will take you to line 11 in `noConsoleRule.ts`, where the `reportWarning()` code is located.
117
+
After saving the config file, you will notice that `console.log` is now reporting errors in the editor. The error message will also display the specific line of code where the error occurred. Clicking on the error message will take you to line 11 in `noConsoleRule.ts`, where the `report()` code is located.
118
118
119
119
> Full example: https://github.com/johnsoncodehk/tsslint/tree/master/fixtures/define-a-rule
0 commit comments