-
Notifications
You must be signed in to change notification settings - Fork 889
Conversation
The failing test seems unrelated to my change? |
Friendly ping :) |
Hi @bowenni - sorry for taking so long to review this PR. Theres a couple of new maintainers coming on to tslint - we're just ramping up to the codebase, then planning to fix up the failing test suite, and finally work through these PRs one by one and get them merged in. Thank you for your patience! Until that time, a friendly reminder that you're able to use this rule locally as a custom rule in your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One grammar comment, other than that LGTM
src/rules/banTsIgnoreRule.ts
Outdated
}; | ||
/* tslint:disable:object-literal-sort-keys */ | ||
|
||
public static FAILURE_STRING = 'Do not use "// @ts-ignore" comments because it suppresses compilation errors.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar nit: Do not use "// @ts-ignore" comments because they suppress compilation errors.
@bowenni The ability to add code examples to rule documentation just landed in master, would you mind adding some for this rule? The best example of how to do this (on master) is the |
Sure @aervin . |
Thanks @bowenni . We did some research on building docs locally in this thread. The picture of the result may be enough for you to go on without having to actually build the docs. |
Thanks for the pointer @aervin . |
src/rules/banTsIgnoreRule.ts
Outdated
@@ -0,0 +1,52 @@ | |||
/** | |||
* @license | |||
* Copyright 2013 Palantir Technologies, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you change the dates to 2018 in this file and the examples file? I think the other example files have this error too...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
"rules": { "ban-ts-ignore": true } | ||
`, | ||
pass: Lint.Utils.dedent` | ||
console.log("hello"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think use the same code snippet from the fail
example, but change the comment text to
// Compiler warns about unreachable code error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(i pushed a commit to undo irrelevant copyright change)
looks good!
@@ -1,6 +1,6 @@ | |||
/** | |||
* @license | |||
* Copyright 2013 Palantir Technologies, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is not relevant. do not update copyright statements.
Friendly ping :) |
Hi @bowenni, can you please merge with master to ensure that the tests pass and then I can merge this. |
Thanks @johnwiseheart. Done. |
Thanks for contributing! |
Hello, |
PR checklist
Overview of change:
Add a new rule to ban "// @ts-ignore" comments.
Is there anything you'd like reviewers to focus on?
CHANGELOG.md entry:
[new-rule]
ban-ts-ignore