-
Notifications
You must be signed in to change notification settings - Fork 889
jsRules:true does not copy over explicitly disabled rules #4513
Comments
@mlavina - As the original PR author, can you provide any insight into why explicitly disabled rules are intentionally ignored when copying over to |
@UselessPickles my best guess was that it was because that was my best guess for the issue here #2198 Which specifically states |
Though I don't have a strong opinion either way haha |
Hmmm... is there a distinction between a "non-active" rule and a rule that is explicitly disabled via the config. I wonder if the original intent/desire was to copy over all "specified" rules, rather than all "active" rules? |
Either way, I feel like my expectations are quite reasonable: however I configured the If someone with authority can make the decision, I will gladly create a PR for this. |
@UselessPickles I think your expectations are reasonable, it might end up being a breaking change but I'm open to PRs for this |
+1 just ran into this issue today. While it is something we can work around, it wasn't the behavior I was expecting. Thanks for your help! |
PR submitted: #4517 |
fixed by #4517 |
Bug Report
TypeScript code being linted
(any JS file)
with
tslint.json
configuration:Actual behavior
Default enabled rules are still applied to JS files, even when explicitly disabled in
"rules"
and"jsRules": true
is used.In this PR: https://github.com/palantir/tslint/pull/3641/files
The implementation of
filterValidJsRules
only copies over JS-compatible rules ifruleOptions.ruleSeverity !== "off"
.This seems like an odd intentional behavior. I think simply removing that
if
check will produce expected behavior, but I'm hesitant because it appears that this was intentionally done for some reason. Is there a good reason that disabled rules are ignored?Expected behavior
Configuration of all JS-compatible rules should be copied over to and applied to JS files, including those that are explicitly disabled.
The text was updated successfully, but these errors were encountered: