This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 889
Rewrite enable/disable logic #2369
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0a7ddf0
Rewrite enable/disable logic
andy-hanson f7788e2
Use `find` helper
andy-hanson 4bc3d4b
Remove `isExplicitlyEnabled`: If a rule isn't turned on in config, ne…
andy-hanson c416136
Move max-file-line-count error to the bottom
andy-hanson 2b61c2d
Don't need WalkContext in max-file-line-count
andy-hanson d3da276
Remove other unnecessary WalkContext
andy-hanson a8459c2
Expose a single function 'removeDisabledFailures' instead of a Disabl…
andy-hanson c8a31d0
Merge branch 'master' into enable-disable
andy-hanson a0c68b4
Merge branch 'master' into enable-disable
andy-hanson acb22e4
Merge branch 'master' into enable-disable
andy-hanson 0d62d89
Merge branch 'master' into enable-disable
andy-hanson c3c819e
Merge branch 'master' into enable-disable
andy-hanson 34f5df1
Merge branch 'master' into enable-disable
andy-hanson a364779
Remove RuleStatic
andy-hanson 91990ff
Merge branch 'master' into enable-disable
andy-hanson 9cdbb18
Add back disabledIntervals, and deprecate it
andy-hanson 7036515
Add back doesIntersect
andy-hanson 7551a4b
Remove assertion
andy-hanson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,15 @@ import * as path from "path"; | |
import { isBlockScopedVariableDeclarationList } from "tsutils"; | ||
import * as ts from "typescript"; | ||
|
||
import {IDisabledInterval, RuleFailure} from "./rule/rule"; | ||
import {IDisabledInterval, RuleFailure} from "./rule/rule"; // tslint:disable-line deprecation | ||
|
||
export function getSourceFile(fileName: string, source: string): ts.SourceFile { | ||
const normalizedName = path.normalize(fileName).replace(/\\/g, "/"); | ||
return ts.createSourceFile(normalizedName, source, ts.ScriptTarget.ES5, /*setParentNodes*/ true); | ||
} | ||
|
||
export function doesIntersect(failure: RuleFailure, disabledIntervals: IDisabledInterval[]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. another breaking change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is public. (#2446) |
||
/** @deprecated See IDisabledInterval. */ | ||
export function doesIntersect(failure: RuleFailure, disabledIntervals: IDisabledInterval[]): boolean { // tslint:disable-line deprecation | ||
return disabledIntervals.some((interval) => { | ||
const maxStart = Math.max(interval.startPosition, failure.getStartPosition().getPosition()); | ||
const minEnd = Math.min(interval.endPosition, failure.getEndPosition().getPosition()); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 should be kept and deprecated for backwards compatibility