-
Notifications
You must be signed in to change notification settings - Fork 889
Conversation
Hi @soniro, thanks for the PR! Sorry for the delay in reviewing this. I'm happy with the syntax you proposed, just one question: would |
@@ -23,20 +23,18 @@ export class Rule extends Lint.Rules.AbstractRule { | |||
/* tslint:disable:object-literal-sort-keys */ | |||
public static metadata: Lint.IRuleMetadata = { | |||
ruleName: "ban", | |||
description: "Bans the use of specific functions.", | |||
descriptionDetails: "At this time, there is no way to disable global methods with this rule.", | |||
description: "Bans the use of specific functions or global methods.", | |||
optionsDescription: "A list of `['object', 'method']` pairs which ban `object.method()`.", |
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.
Let's update this description as well?
This PR looks good by the way! Looks like you'll need to merge master into it before we can merge though |
ping @soniro? |
Hey guys! Sorry, for my delay, too. I'm very busy at the moment. The global ban will not ban 'someObject,someFunction()', so it has no unexpected side effects. |
* Add linterOptions to tslint.json - only enable type checking during tests when typeCheck: true is configured - fixes palantir#1402 * Code style
* Add new Rule: arrow-parens * Add test * modify some documentations
* Core quote-props rule * Tweaks for code review * rename
…#1097 (palantir#1349) * Implement rule to forbid return statements in finally blocks palantir#1097 * explore the try statement fully to pick up violations in nested scopes * switch to a scope aware rule walker to reduce number of passes over the AST * Add support for other control flow statements in finally blocks (break, continue, throws) * improve the rationale description for the no unsafe finally rule * rename rule to no-unsafe-finally to be inline with eslint * add new rule to latest config * pull out helper functions from the walker class. * fix tslint violations (which didn't occur locally)
* task(formatter): added stylish formatter * Support non-colors terminal in tests * fix(stylish): lint quotes * fix(stylish) 4 spaces indentation * fix(stylish): correct strpad amount * fix(stylish): test tuple position
* no-for-in-array rule * Change array check * Add typeCheck linterOption
…ges (palantir#1385) * Updating ban rule to have better messages, and an optional explanation message as a 3rd parameter
This allows the code to compile correctly with TS 1.8.x and TS 2.x See microsoft/TypeScript#9855 also
… name (string | Function) (palantir#1443)
* Created IFix and IReplacement structures for representing fixes * programWalker includes createFix and createReplacement * Added optional parameter to createFailure for suggesting fixes * Modified semicolon rule to suggest fixes (add / remove semicolon) * Modified testing to check against a file with fixes applied * If there is a ".ts.fix" file, then the test will take the first suggested fix and apply to the test file (without markup) and compare Addresses palantir#561
* Add ArrayType to SyntaxWalker
* Remove docs/_site files that shouldn't be checked in * gitignore files that shoudln't be checked in * Don't tie site to a specific version of ruby * Add note that type info is required for some rules
Sorry for the delay. Please let me know if you have problems to merge my pull request. |
Also related: #733 |
Thanks @soniro! |
@soniro Does this still allow for custom ban messages like below?
Would this allow for custom messages on the global function bans also? |
Fixes #327.
This is my suggested solution. Please see the discussion in the issue about the syntax of global bans.