remove tslint configuration

This commit is contained in:
Alexander T
2019-06-27 13:49:35 +03:00
parent 136f4cfc0f
commit 769bb0b475
42 changed files with 30 additions and 97 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ namespace ts {
let symbolCount = 0;
let Symbol: new (flags: SymbolFlags, name: __String) => Symbol; // tslint:disable-line variable-name
let Symbol: new (flags: SymbolFlags, name: __String) => Symbol;
let classifiableNames: UnderscoreEscapedMap<true>;
const unreachableFlow: FlowNode = { flags: FlowFlags.Unreachable };
-4
View File
@@ -56,11 +56,9 @@ namespace ts {
let requestedExternalEmitHelpers: ExternalEmitHelpers;
let externalHelpersModule: Symbol;
// tslint:disable variable-name
const Symbol = objectAllocator.getSymbolConstructor();
const Type = objectAllocator.getTypeConstructor();
const Signature = objectAllocator.getSignatureConstructor();
// tslint:enable variable-name
let typeCount = 0;
let symbolCount = 0;
@@ -32656,7 +32654,6 @@ namespace ts {
}
namespace JsxNames {
// tslint:disable variable-name
export const JSX = "JSX" as __String;
export const IntrinsicElements = "IntrinsicElements" as __String;
export const ElementClass = "ElementClass" as __String;
@@ -32666,6 +32663,5 @@ namespace ts {
export const IntrinsicAttributes = "IntrinsicAttributes" as __String;
export const IntrinsicClassAttributes = "IntrinsicClassAttributes" as __String;
export const LibraryManagedAttributes = "LibraryManagedAttributes" as __String;
// tslint:enable variable-name
}
}
+1 -2
View File
@@ -1638,7 +1638,7 @@ namespace ts {
case SyntaxKind.NullKeyword:
reportInvalidOptionValue(option && option.name === "extends"); // "extends" is the only option we don't allow null/undefined for
return null; // tslint:disable-line:no-null-keyword
return null;
case SyntaxKind.StringLiteral:
if (!isDoubleQuotedString(valueExpression)) {
@@ -2007,7 +2007,6 @@ namespace ts {
}
function isNullOrUndefined(x: any): x is null | undefined {
// tslint:disable-next-line:no-null-keyword
return x === undefined || x === null;
}
+3 -3
View File
@@ -75,7 +75,7 @@ namespace ts {
/** Create a MapLike with good performance. */
function createDictionaryObject<T>(): MapLike<T> {
const map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword
const map = Object.create(/*prototype*/ null);
// Using 'delete' on an object causes V8 to put the object in dictionary mode.
// This disables creation of hidden classes, which are expensive when an object is
@@ -1609,7 +1609,7 @@ namespace ts {
}
/** Does nothing. */
export function noop(_?: {} | null | undefined): void { } // tslint:disable-line no-empty
export function noop(_?: {} | null | undefined): void { }
/** Do nothing and return false */
export function returnFalse(): false { return false; }
@@ -2159,7 +2159,7 @@ namespace ts {
return arg => f(arg) || g(arg);
}
export function assertType<T>(_: T): void { } // tslint:disable-line no-empty
export function assertType<T>(_: T): void { }
export function singleElementArray<T>(t: T | undefined): T[] | undefined {
return t === undefined ? undefined : [t];
-1
View File
@@ -3182,7 +3182,6 @@ namespace ts {
return node;
}
// tslint:disable-next-line variable-name
let SourceMapSource: new (fileName: string, text: string, skipTrivia?: (pos: number) => number) => SourceMapSource;
/**
+1 -2
View File
@@ -420,7 +420,6 @@ namespace ts {
const packageJsonPath = combinePaths(root, normalized, "package.json");
// `types-publisher` sometimes creates packages with `"typings": null` for packages that don't provide their own types.
// See `createNotNeededPackageJSON` in the types-publisher` repo.
// tslint:disable-next-line:no-null-keyword
const isNotNeededPackage = host.fileExists(packageJsonPath) && (readJson(packageJsonPath, host) as PackageJson).typings === null;
if (!isNotNeededPackage) {
const baseFileName = getBaseFileName(normalized);
@@ -977,7 +976,7 @@ namespace ts {
if (traceEnabled) {
trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
Debug.assert(host.fileExists(real), `${path} linked to nonexistent file ${real}`); // tslint:disable-line
Debug.assert(host.fileExists(real), `${path} linked to nonexistent file ${real}`);
return real;
}
+1 -5
View File
@@ -8,12 +8,10 @@ namespace ts {
JSDoc = 1 << 5,
}
// tslint:disable variable-name
let NodeConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let TokenConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let IdentifierConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
let SourceFileConstructor: new (kind: SyntaxKind, pos?: number, end?: number) => Node;
// tslint:enable variable-name
export function createNode(kind: SyntaxKind, pos?: number, end?: number): Node {
if (kind === SyntaxKind.SourceFile) {
@@ -584,12 +582,10 @@ namespace ts {
const disallowInAndDecoratorContext = NodeFlags.DisallowInContext | NodeFlags.DecoratorContext;
// capture constructors in 'initializeState' to avoid null checks
// tslint:disable variable-name
let NodeConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
let TokenConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
let IdentifierConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
let SourceFileConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
// tslint:enable variable-name
let sourceFile: SourceFile;
let parseDiagnostics: DiagnosticWithLocation[];
@@ -6395,7 +6391,7 @@ namespace ts {
export function parseIsolatedJSDocComment(content: string, start: number | undefined, length: number | undefined): { jsDoc: JSDoc, diagnostics: Diagnostic[] } | undefined {
initializeState(content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined, ScriptKind.JS);
sourceFile = <SourceFile>{ languageVariant: LanguageVariant.Standard, text: content }; // tslint:disable-line no-object-literal-type-assertion
sourceFile = <SourceFile>{ languageVariant: LanguageVariant.Standard, text: content };
const jsDoc = parseJSDocCommentWorker(start, length);
const diagnostics = parseDiagnostics;
clearState();
+1 -1
View File
@@ -3095,7 +3095,7 @@ namespace ts {
function getCompilerOptionsObjectLiteralSyntax() {
if (_compilerOptionsObjectLiteralSyntax === undefined) {
_compilerOptionsObjectLiteralSyntax = null; // tslint:disable-line:no-null-keyword
_compilerOptionsObjectLiteralSyntax = null;
const jsonObjectLiteral = getTsConfigObjectLiteralExpression(options.configFile);
if (jsonObjectLiteral) {
for (const prop of getPropertyAssignment(jsonObjectLiteral, "compilerOptions")) {
+1 -1
View File
@@ -418,7 +418,7 @@ namespace ts {
if (isInDirectoryPath(rootPath, failedLookupLocationPath)) {
// Ensure failed look up is normalized path
failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
Debug.assert(failedLookupLocation.length === failedLookupLocationPath.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`); // tslint:disable-line
Debug.assert(failedLookupLocation.length === failedLookupLocationPath.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`);
const subDirectoryInRoot = failedLookupLocationPath.indexOf(directorySeparator, rootPath.length + 1);
if (subDirectoryInRoot !== -1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
-2
View File
@@ -309,12 +309,10 @@ namespace ts {
}
function isStringOrNull(x: any) {
// tslint:disable-next-line:no-null-keyword
return typeof x === "string" || x === null;
}
export function isRawSourceMap(x: any): x is RawSourceMap {
// tslint:disable-next-line:no-null-keyword
return x !== null
&& typeof x === "object"
&& x.version === 3
+1 -3
View File
@@ -592,10 +592,8 @@ namespace ts {
case SyntaxKind.NoSubstitutionTemplateLiteral:
return "`" + escapeText(node.text, CharacterCodes.backtick) + "`";
case SyntaxKind.TemplateHead:
// tslint:disable-next-line no-invalid-template-strings
return "`" + escapeText(node.text, CharacterCodes.backtick) + "${";
case SyntaxKind.TemplateMiddle:
// tslint:disable-next-line no-invalid-template-strings
return "}" + escapeText(node.text, CharacterCodes.backtick) + "${";
case SyntaxKind.TemplateTail:
return "}" + escapeText(node.text, CharacterCodes.backtick) + "`";
@@ -7010,7 +7008,7 @@ namespace ts {
}
}
function Signature() {} // tslint:disable-line no-empty
function Signature() {}
function Node(this: Node, kind: SyntaxKind, pos: number, end: number) {
this.pos = pos;
+3 -3
View File
@@ -252,7 +252,7 @@ namespace collections {
constructor(parent?: Metadata) {
this._parent = parent;
this._map = Object.create(parent ? parent._map : null); // tslint:disable-line:no-null-keyword
this._map = Object.create(parent ? parent._map : null);
}
public get size(): number {
@@ -299,7 +299,7 @@ namespace collections {
}
public clear(): void {
this._map = Object.create(this._parent ? this._parent._map : null); // tslint:disable-line:no-null-keyword
this._map = Object.create(this._parent ? this._parent._map : null);
this._size = -1;
this._version++;
}
@@ -318,4 +318,4 @@ namespace collections {
return (text.length >= 3 && text.charAt(0) === "_" && text.charAt(1) === "_" && text.charAt(2) === "_" ? text.slice(1) : text);
}
}
}
}
-1
View File
@@ -22,7 +22,6 @@ namespace evaluator {
// Define a custom "Symbol" constructor to attach missing built-in symbols without
// modifying the global "Symbol" constructor
// tslint:disable-next-line:variable-name
const FakeSymbol: SymbolConstructor = ((description?: string) => Symbol(description)) as any;
(<any>FakeSymbol).prototype = Symbol.prototype;
for (const key of Object.getOwnPropertyNames(Symbol)) {
+1 -11
View File
@@ -1127,7 +1127,6 @@ namespace Harness {
export function doErrorBaseline(baselinePath: string, inputFiles: ReadonlyArray<TestFile>, errors: ReadonlyArray<ts.Diagnostic>, pretty?: boolean) {
Baseline.runBaseline(baselinePath.replace(/\.tsx?$/, ".errors.txt"),
// tslint:disable-next-line no-null-keyword
!errors || (errors.length === 0) ? null : getErrorBaseline(inputFiles, errors, pretty));
}
@@ -1206,9 +1205,7 @@ namespace Harness {
const [, content] = value;
result += content;
}
/* tslint:disable:no-null-keyword */
return result || null;
/* tslint:enable:no-null-keyword */
}
function *iterateBaseLine(isSymbolBaseline: boolean, skipBaseline?: boolean): IterableIterator<[string, string]> {
@@ -1279,9 +1276,7 @@ namespace Harness {
if ((options.noEmitOnError && result.diagnostics.length !== 0) || result.maps.size === 0) {
// We need to return null here or the runBaseLine will actually create a empty file.
// Baselining isn't required here because there is no output.
/* tslint:disable:no-null-keyword */
sourceMapCode = null;
/* tslint:enable:no-null-keyword */
}
else {
sourceMapCode = "";
@@ -1336,7 +1331,7 @@ namespace Harness {
jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics);
}
Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ts.Extension.Js), jsCode.length > 0 ? tsCode + "\r\n\r\n" + jsCode : null); // tslint:disable-line no-null-keyword
Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ts.Extension.Js), jsCode.length > 0 ? tsCode + "\r\n\r\n" + jsCode : null);
}
function fileOutput(file: documents.TextDocument, harnessSettings: TestCaseParser.CompilerSettings): string {
@@ -1490,9 +1485,7 @@ namespace Harness {
const opts: CompilerSettings = {};
let match: RegExpExecArray | null;
/* tslint:disable:no-null-keyword */
while ((match = optionRegex.exec(content)) !== null) {
/* tslint:enable:no-null-keyword */
opts[match[1]] = match[2].trim();
}
@@ -1670,9 +1663,7 @@ namespace Harness {
const refFileName = referencePath(relativeFileName, opts && opts.Baselinefolder, opts && opts.Subfolder);
/* tslint:disable:no-null-keyword */
if (actual === null) {
/* tslint:enable:no-null-keyword */
actual = noContent;
}
@@ -1735,7 +1726,6 @@ namespace Harness {
const gen = generateContent();
const writtenFiles = ts.createMap<true>();
const errors: Error[] = [];
// tslint:disable-next-line:no-null-keyword
if (gen !== null) {
for (let {done, value} = gen.next(); !done; { done, value } = gen.next()) {
const [name, content, count] = value as [string, string, number | undefined];
-1
View File
@@ -1,7 +1,6 @@
namespace Harness.LanguageService {
export function makeDefaultProxy(info: ts.server.PluginCreateInfo): ts.LanguageService {
// tslint:disable-next-line:no-null-keyword
const proxy = Object.create(/*prototype*/ null);
const langSvc: any = info.languageService;
for (const k of Object.keys(langSvc)) {
+2 -2
View File
@@ -248,10 +248,10 @@ namespace Playback {
const getBase = () => recordLogFileNameBase + i;
while (underlying.fileExists(ts.combinePaths(getBase(), "test.json"))) i++;
const newLog = oldStyleLogIntoNewStyleLog(recordLog, (path, str) => underlying.writeFile(path, str), getBase());
underlying.writeFile(ts.combinePaths(getBase(), "test.json"), JSON.stringify(newLog, null, 4)); // tslint:disable-line:no-null-keyword
underlying.writeFile(ts.combinePaths(getBase(), "test.json"), JSON.stringify(newLog, null, 4));
const syntheticTsconfig = generateTsconfig(newLog);
if (syntheticTsconfig) {
underlying.writeFile(ts.combinePaths(getBase(), "tsconfig.json"), JSON.stringify(syntheticTsconfig, null, 4)); // tslint:disable-line:no-null-keyword
underlying.writeFile(ts.combinePaths(getBase(), "tsconfig.json"), JSON.stringify(syntheticTsconfig, null, 4));
}
recordLog = undefined;
}
-3
View File
@@ -1,4 +1,3 @@
// tslint:disable:no-null-keyword
namespace vfs {
/**
* Posix-style path to the TypeScript compiler build outputs (including tsc.js, lib.d.ts, etc.)
@@ -1305,7 +1304,6 @@ namespace vfs {
public isSocket() { return (this.mode & S_IFMT) === S_IFSOCK; }
}
// tslint:disable-next-line:variable-name
export const IOErrorMessages = Object.freeze({
EACCES: "access denied",
EIO: "an I/O error occurred",
@@ -1560,4 +1558,3 @@ namespace vfs {
return text;
}
}
// tslint:enable:no-null-keyword
-1
View File
@@ -1,6 +1,5 @@
/* @internal */
namespace ts.server {
// tslint:disable variable-name
export const ActionSet: ActionSet = "action::set";
export const ActionInvalidate: ActionInvalidate = "action::invalidate";
export const ActionPackageInstalled: ActionPackageInstalled = "action::packageInstalled";
-2
View File
@@ -3,7 +3,6 @@ namespace ts.server {
/*@internal*/
export const maxFileSize = 4 * 1024 * 1024;
// tslint:disable variable-name
export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
export const ProjectLoadingStartEvent = "projectLoadingStart";
export const ProjectLoadingFinishEvent = "projectLoadingFinish";
@@ -12,7 +11,6 @@ namespace ts.server {
export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
export const ProjectInfoTelemetryEvent = "projectInfo";
export const OpenFileInfoTelemetryEvent = "openFileInfo";
// tslint:enable variable-name
export interface ProjectsUpdatedInBackgroundEvent {
eventName: typeof ProjectsUpdatedInBackgroundEvent;
+1 -1
View File
@@ -118,7 +118,7 @@ namespace ts.server {
// we want to ensure the value is maintained in the out since the file is
// built using --preseveConstEnum.
export type CommandNames = protocol.CommandTypes;
export const CommandNames = (<any>protocol).CommandTypes; // tslint:disable-line variable-name
export const CommandNames = (<any>protocol).CommandTypes;
export function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string {
const verboseLogging = logger.hasLevel(LogLevel.verbose);
+1 -1
View File
@@ -1184,7 +1184,7 @@ namespace ts.formatting {
export function getRangeOfEnclosingComment(
sourceFile: SourceFile,
position: number,
precedingToken?: Node | null, // tslint:disable-line:no-null-keyword
precedingToken?: Node | null,
tokenAtPosition = getTokenAtPosition(sourceFile, position),
): CommentRange | undefined {
const jsdoc = findAncestor(tokenAtPosition, isJSDoc);
+1 -1
View File
@@ -34,7 +34,7 @@ namespace ts.formatting {
const precedingToken = findPrecedingToken(position, sourceFile, /*startNode*/ undefined, /*excludeJsdoc*/ true);
const enclosingCommentRange = getRangeOfEnclosingComment(sourceFile, position, precedingToken || null); // tslint:disable-line:no-null-keyword
const enclosingCommentRange = getRangeOfEnclosingComment(sourceFile, position, precedingToken || null);
if (enclosingCommentRange && enclosingCommentRange.kind === SyntaxKind.MultiLineCommentTrivia) {
return getCommentIndent(sourceFile, position, options, enclosingCommentRange);
}
-3
View File
@@ -17,7 +17,6 @@
let debugObjectHost: { CollectGarbage(): void } = (function (this: any) { return this; })(); // eslint-disable-line prefer-const
// We need to use 'null' to interface with the managed side.
/* tslint:disable:no-null-keyword */
/* eslint-disable microsoft-typescript/no-in-operator */
/* @internal */
@@ -1272,8 +1271,6 @@ namespace ts {
}
/* eslint-enable microsoft-typescript/no-in-operator */
/* tslint:enable:no-null */
/// TODO: this is used by VS, clean this up on both sides of the interface
/* @internal */
+1 -1
View File
@@ -223,7 +223,7 @@ class CompilerTest {
const record = utils.removeTestPathPrefixes(this.result.getSourceMapRecord()!);
const baseline = (this.options.noEmitOnError && this.result.diagnostics.length !== 0) || record === undefined
// Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required.
? null // tslint:disable-line no-null-keyword
? null
: record;
Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".sourcemap.txt"), baseline);
}
-3
View File
@@ -95,7 +95,6 @@ class UserCodeRunner extends ExternalCompileRunnerBase {
return "user";
}
report(result: ExecResult) {
// tslint:disable-next-line:no-null-keyword
return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status}
Standard output:
${sortErrors(stripAbsoluteImportPaths(result.stdout.toString().replace(/\r\n/g, "\n")))}
@@ -145,7 +144,6 @@ class DockerfileRunner extends ExternalCompileRunnerBase {
}
}
report(result: ExecResult) {
// tslint:disable-next-line:no-null-keyword
return result.status === 0 && !result.stdout.length && !result.stderr.length ? null : `Exit Code: ${result.status}
Standard output:
${sanitizeDockerfileOutput(result.stdout.toString())}
@@ -227,7 +225,6 @@ class DefinitelyTypedRunner extends ExternalCompileRunnerBase {
report(result: ExecResult, cwd: string) {
const stdout = removeExpectedErrors(result.stdout.toString(), cwd);
const stderr = result.stderr.toString();
// tslint:disable-next-line:no-null-keyword
return !stdout.length && !stderr.length ? null : `Exit Code: ${result.status}
Standard output:
${stdout.replace(/\r\n/g, "\n")}
+1 -5
View File
@@ -1,8 +1,5 @@
// tslint:disable no-unnecessary-type-assertion (TODO: tslint can't find node types)
namespace Harness.Parallel.Host {
export function start() {
// tslint:disable-next-line:variable-name
const Mocha = require("mocha") as typeof import("mocha");
const Base = Mocha.reporters.Base;
const color = Base.color;
@@ -17,7 +14,6 @@ namespace Harness.Parallel.Host {
const { statSync, readFileSync } = require("fs") as typeof import("fs");
// NOTE: paths for module and types for FailedTestReporter _do not_ line up due to our use of --outFile for run.js
// tslint:disable-next-line:variable-name
const FailedTestReporter = require(path.resolve(__dirname, "../../scripts/failed-tests")) as typeof import("../../../scripts/failed-tests");
const perfdataFileNameFragment = ".parallelperf";
@@ -595,7 +591,7 @@ namespace Harness.Parallel.Host {
consoleReporter.epilogue();
if (noColors) Base.useColors = savedUseColors;
IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword
IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4));
if (xunitReporter) {
xunitReporter.done(errorResults.length, failures => process.exit(failures));
+1 -4
View File
@@ -1,5 +1,3 @@
// tslint:disable no-unnecessary-type-assertion (TODO: tslint can't find node types)
namespace Harness.Parallel.Worker {
export function start() {
function hookUncaughtExceptions() {
@@ -21,7 +19,7 @@ namespace Harness.Parallel.Worker {
let exceptionsHooked = false;
hookUncaughtExceptions();
// tslint:disable-next-line:variable-name - Capitalization is aligned with the global `Mocha` namespace for typespace/namespace references.
// Capitalization is aligned with the global `Mocha` namespace for typespace/namespace references.
const Mocha = require("mocha") as typeof import("mocha");
/**
@@ -99,7 +97,6 @@ namespace Harness.Parallel.Worker {
* @param context The test context (usually the NodeJS `global` object).
*/
function shimTestInterface(rootSuite: Mocha.Suite, context: Mocha.MochaGlobals) {
// tslint:disable-next-line:variable-name
const suites = [rootSuite];
context.before = (title: string | Mocha.Func | Mocha.AsyncFunc, fn?: Mocha.Func | Mocha.AsyncFunc) => { suites[0].beforeAll(title as string, fn); };
context.after = (title: string | Mocha.Func | Mocha.AsyncFunc, fn?: Mocha.Func | Mocha.AsyncFunc) => { suites[0].afterAll(title as string, fn); };
-2
View File
@@ -1,6 +1,4 @@
// In harness baselines, null is different than undefined. See `generateActual` in `harness.ts`.
/* tslint:disable:no-null-keyword */
namespace RWC {
function runWithIOLog(ioLog: IoLog, fn: (oldIO: Harness.IO) => void) {
const oldIO = Harness.IO;
-2
View File
@@ -1,6 +1,4 @@
// In harness baselines, null is different than undefined. See `generateActual` in `harness.ts`.
/* tslint:disable:no-null-keyword */
class Test262BaselineRunner extends RunnerBase {
private static readonly basePath = "internal/cases/test262";
private static readonly helpersFilePath = "tests/cases/test262-harness/helpers.d.ts";
-1
View File
@@ -104,7 +104,6 @@ namespace ts {
builderProgram = createEmitAndSemanticDiagnosticsBuilderProgram(program, host, builderProgram);
const outputFileNames: string[] = [];
try {
// tslint:disable-next-line no-empty
do {
assert.isFalse(cancel);
if (outputFileNames.length === cancelAfterEmitLength) {
@@ -159,7 +159,6 @@ namespace ts {
"dev/configs/third.json": JSON.stringify({
extends: "./second",
compilerOptions: {
// tslint:disable-next-line:no-null-keyword
module: null
},
include: ["../supplemental.*"]
@@ -169,7 +168,6 @@ namespace ts {
compilerOptions: {
module: "system"
},
// tslint:disable-next-line:no-null-keyword
include: null,
files: ["../main.ts"]
}),
@@ -135,7 +135,7 @@ namespace ts {
function createDiagnosticForConfigFile(json: any, start: number, length: number, diagnosticMessage: DiagnosticMessage, arg0: string) {
const text = JSON.stringify(json);
const file = <SourceFile>{ // tslint:disable-line no-object-literal-type-assertion
const file = <SourceFile>{
fileName: caseInsensitiveTsconfigPath,
kind: SyntaxKind.SourceFile,
text
@@ -29,7 +29,6 @@ namespace ts {
}
const initResult = convertToTSConfig(commandLine, configPath, configParseHost);
// tslint:disable-next-line:no-null-keyword
Harness.Baseline.runBaseline(outputFileName, JSON.stringify(initResult, null, 4) + "\n");
});
});
+1 -1
View File
@@ -170,7 +170,7 @@ namespace ts {
testTypingsIgnored(["a", "b"]);
testTypingsIgnored({ a: "b" });
testTypingsIgnored(/*typings*/ true);
testTypingsIgnored(/*typings*/ null); // tslint:disable-line no-null-keyword
testTypingsIgnored(/*typings*/ null);
testTypingsIgnored(/*typings*/ undefined);
});
it("module name as directory - load index.d.ts", () => {
@@ -1,5 +1,4 @@
// Some tests have trailing whitespace
// tslint:disable trim-trailing-whitespace
namespace ts {
describe("unittests:: services:: textChanges", () => {
@@ -53,14 +53,12 @@ namespace ts {
it("Correct errors for " + justName, () => {
Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".errors.txt"),
// tslint:disable-next-line no-null-keyword
transpileResult.diagnostics!.length === 0 ? null : Harness.Compiler.getErrorBaseline(toBeCompiled, transpileResult.diagnostics!));
});
if (canUseOldTranspile) {
it("Correct errors (old transpile) for " + justName, () => {
Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".oldTranspile.errors.txt"),
// tslint:disable-next-line no-null-keyword
oldTranspileDiagnostics.length === 0 ? null : Harness.Compiler.getErrorBaseline(toBeCompiled, oldTranspileDiagnostics));
});
}
@@ -193,7 +193,6 @@ declare const console: { log(msg: any): void; };`;
function generateBaseline(fs: vfs.FileSystem, proj: string, scenario: string, subScenario: string, baseFs: vfs.FileSystem) {
const patch = fs.diff(baseFs);
// tslint:disable-next-line:no-null-keyword
Harness.Baseline.runBaseline(`tsbuild/${proj}/${subScenario.split(" ").join("-")}/${scenario.split(" ").join("-")}.js`, patch ? vfs.formatPatch(patch) : null);
}
+2 -2
View File
@@ -118,7 +118,7 @@ namespace ts.tscWatch {
const tests = subProjectFiles(SubProject.tests);
const ui = subProjectFiles(SubProject.ui);
const allFiles: ReadonlyArray<File> = [libFile, ...core, ...logic, ...tests, ...ui];
const testProjectExpectedWatchedFiles = [core[0], core[1], core[2]!, ...logic, ...tests].map(f => f.path.toLowerCase()); // tslint:disable-line no-unnecessary-type-assertion (TODO: type assertion should be necessary)
const testProjectExpectedWatchedFiles = [core[0], core[1], core[2]!, ...logic, ...tests].map(f => f.path.toLowerCase()); // TODO: type assertion should be necessary
const testProjectExpectedWatchedDirectoriesRecursive = [projectPath(SubProject.core), projectPath(SubProject.logic)];
function createSolutionInWatchMode(allFiles: ReadonlyArray<File>, defaultOptions?: BuildOptions, disableConsoleClears?: boolean) {
@@ -297,7 +297,7 @@ export class someClass2 { }`);
const allFiles = [libFile, ...core, logic[1], ...tests];
const host = createTsBuildWatchSystem(allFiles, { currentDirectory: projectsLocation });
createSolutionBuilderWithWatch(host, [`${project}/${SubProject.tests}`]);
checkWatchedFiles(host, [core[0], core[1], core[2]!, logic[0], ...tests].map(f => f.path.toLowerCase())); // tslint:disable-line no-unnecessary-type-assertion (TODO: type assertion should be necessary)
checkWatchedFiles(host, [core[0], core[1], core[2]!, logic[0], ...tests].map(f => f.path.toLowerCase())); // TODO: type assertion should be necessary
checkWatchedDirectories(host, emptyArray, /*recursive*/ false);
checkWatchedDirectories(host, [projectPath(SubProject.core)], /*recursive*/ true);
checkOutputErrorsInitial(host, [
File diff suppressed because one or more lines are too long
@@ -283,9 +283,7 @@ namespace ts.server {
session.onMessage(JSON.stringify(req));
req.seq = i;
i++;
/* tslint:disable no-null-keyword */
req.arguments = null;
/* tslint:enable no-null-keyword */
session.onMessage(JSON.stringify(req));
req.seq = i;
i++;
@@ -548,7 +546,6 @@ namespace ts.server {
});
});
it("has access to the project service", () => {
// tslint:disable-next-line no-unused-expression
new class extends TestSession {
constructor() {
super();
-2
View File
@@ -138,7 +138,6 @@ namespace ts {
configParseResult.errors.forEach(reportDiagnostic);
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
// tslint:disable-next-line:no-null-keyword
sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine);
return sys.exit(ExitStatus.Success);
}
@@ -156,7 +155,6 @@ namespace ts {
}
else {
if (commandLineOptions.showConfig) {
// tslint:disable-next-line:no-null-keyword
sys.write(JSON.stringify(convertToTSConfig(commandLine, combinePaths(sys.getCurrentDirectory(), "tsconfig.json"), sys), null, 4) + sys.newLine);
return sys.exit(ExitStatus.Success);
}
-4
View File
@@ -1,5 +1,3 @@
// tslint:disable no-unnecessary-type-assertion (TODO: tslint can't find node types)
namespace ts.server {
const childProcess: {
fork(modulePath: string, args: string[], options?: { execArgv: string[], env?: MapLike<string> }): NodeChildProcess;
@@ -200,7 +198,6 @@ namespace ts.server {
private write(s: string) {
if (this.fd >= 0) {
const buf = sys.bufferFrom!(s);
// tslint:disable-next-line no-null-keyword
fs.writeSync(this.fd, buf, 0, buf.length, /*position*/ null!); // TODO: GH#18217
}
if (this.traceToConsole) {
@@ -959,7 +956,6 @@ namespace ts.server {
ioSession.logError(err, "unknown");
});
// See https://github.com/Microsoft/TypeScript/issues/11348
// tslint:disable-next-line no-unnecessary-type-assertion-2
(process as any).noAsar = true;
// Start listening
ioSession.listen();