mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 13:45:34 -05:00
Replace eslint rulesdir with eslint-plugin-local, convert eslint rules to JS (#50380)
This commit is contained in:
@@ -819,7 +819,7 @@ namespace ts {
|
||||
// defined in `ts.commentPragmas` would be excessive, but we can avoid
|
||||
// some obvious false positives (e.g. in XML-like doc comments) by
|
||||
// checking the element name.
|
||||
// eslint-disable-next-line no-in-operator
|
||||
// eslint-disable-next-line local/no-in-operator
|
||||
if (!match[3] || !(match[3] in commentPragmas)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
// return undefined argName when arg is null or undefined
|
||||
// eslint-disable-next-line no-in-operator
|
||||
// eslint-disable-next-line local/no-in-operator
|
||||
if (!name || "identifier" in name && name.identifier.text === "undefined") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -1725,7 +1725,7 @@ namespace ts.FindAllReferences {
|
||||
}
|
||||
|
||||
function addReference(referenceLocation: Node, relatedSymbol: Symbol | RelatedSymbol, state: State): void {
|
||||
const { kind, symbol } = "kind" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }; // eslint-disable-line no-in-operator
|
||||
const { kind, symbol } = "kind" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }; // eslint-disable-line local/no-in-operator
|
||||
|
||||
// if rename symbol from default export anonymous function, for example `export default function() {}`, we do not need to add reference
|
||||
if (state.options.use === FindReferencesUse.Rename && referenceLocation.kind === SyntaxKind.DefaultKeyword) {
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
private assertHasRealPosition(message?: string) {
|
||||
// eslint-disable-next-line debug-assert
|
||||
// eslint-disable-next-line local/debug-assert
|
||||
Debug.assert(!positionIsSynthesized(this.pos) && !positionIsSynthesized(this.end), message || "Node must have a real position for this operation");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ let debugObjectHost: { CollectGarbage(): void } = (function (this: any) { // esl
|
||||
})();
|
||||
|
||||
// We need to use 'null' to interface with the managed side.
|
||||
/* eslint-disable no-in-operator */
|
||||
/* eslint-disable local/no-in-operator */
|
||||
|
||||
/* @internal */
|
||||
namespace ts {
|
||||
@@ -1357,4 +1357,4 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-enable no-in-operator */
|
||||
/* eslint-enable local/no-in-operator */
|
||||
|
||||
@@ -407,11 +407,11 @@ namespace ts.SignatureHelp {
|
||||
// not enough to put us in the substitution expression; we should consider ourselves part of
|
||||
// the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1).
|
||||
//
|
||||
/* eslint-disable no-double-space */
|
||||
/* eslint-disable local/no-double-space */
|
||||
// Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # `
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^ ^
|
||||
// Case: 1 1 3 2 1 3 2 2 1
|
||||
/* eslint-enable no-double-space */
|
||||
/* eslint-enable local/no-double-space */
|
||||
Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node.");
|
||||
if (isTemplateLiteralToken(node)) {
|
||||
if (isInsideTemplateLiteral(node, position, sourceFile)) {
|
||||
|
||||
Reference in New Issue
Block a user