-
Make a new file, the name is important, it must be camel-case and not a
.ts
file (the@ts-check
declaration at the top of each file uses JSDoc to check types while developing rules – read here for more info). The suffix must be...Rule.js
. -
You will need to convert your camelCase name to kebab-case and add it to the
tslint.json
E.g.
noDoingAnythingRule.js
->no-doing-anything
and:{ "extends": ["tslint:recommended", "tslint-react", "tslint-config-prettier"], "rules": { "no-import-un-mocked": true, + "no-doing-anything": true, "curly": false, ...
-
You want to export a class called
Rule
that lints your file, this is what it used on the file. -
Ideally you can do simple string matching like in
noImportUnMockedRule.js
- but if not, study how to make an AST walker here
tslint
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||