Enable "object-literal-shorthand" lint rule (#16987)

This commit is contained in:
Andy
2017-07-07 07:26:58 -07:00
committed by GitHub
parent dc81b456e2
commit e7dc2a67ca
32 changed files with 94 additions and 174 deletions

View File

@@ -21180,7 +21180,7 @@ namespace ts {
for (const prop of properties) {
const existing = seen.get(prop.name);
if (!existing) {
seen.set(prop.name, { prop: prop, containingType: base });
seen.set(prop.name, { prop, containingType: base });
}
else {
const isInheritedProperty = existing.containingType !== type;

View File

@@ -151,11 +151,7 @@ namespace ts {
*/
export function resolveTypeReferenceDirective(typeReferenceDirectiveName: string, containingFile: string | undefined, options: CompilerOptions, host: ModuleResolutionHost): ResolvedTypeReferenceDirectiveWithFailedLookupLocations {
const traceEnabled = isTraceEnabled(options, host);
const moduleResolutionState: ModuleResolutionState = {
compilerOptions: options,
host: host,
traceEnabled
};
const moduleResolutionState: ModuleResolutionState = { compilerOptions: options, host, traceEnabled };
const typeRoots = getEffectiveTypeRoots(options, host);
if (traceEnabled) {

View File

@@ -145,7 +145,7 @@ namespace ts {
// Initialize source map data
sourceMapData = {
sourceMapFilePath: sourceMapFilePath,
sourceMapFilePath,
jsSourceMappingURL: !compilerOptions.inlineSourceMap ? getBaseFileName(normalizeSlashes(sourceMapFilePath)) : undefined,
sourceMapFile: getBaseFileName(normalizeSlashes(filePath)),
sourceMapSourceRoot: compilerOptions.sourceRoot || "",
@@ -292,8 +292,8 @@ namespace ts {
// New span
lastRecordedSourceMapSpan = {
emittedLine: emittedLine,
emittedColumn: emittedColumn,
emittedLine,
emittedColumn,
sourceLine: sourceLinePos.line,
sourceColumn: sourceLinePos.character,
sourceIndex: sourceMapSourceIndex

View File

@@ -325,7 +325,7 @@ namespace ts {
const nodeSystem: System = {
args: process.argv.slice(2),
newLine: _os.EOL,
useCaseSensitiveFileNames: useCaseSensitiveFileNames,
useCaseSensitiveFileNames,
write(s: string): void {
process.stdout.write(s);
},
@@ -394,9 +394,7 @@ namespace ts {
}
);
},
resolvePath: function(path: string): string {
return _path.resolve(path);
},
resolvePath: path => _path.resolve(path),
fileExists,
directoryExists,
createDirectory(directoryName: string) {

View File

@@ -2220,8 +2220,8 @@ namespace ts {
beginBlock(<LoopBlock>{
kind: CodeBlockKind.Loop,
isScript: false,
breakLabel: breakLabel,
continueLabel: continueLabel
breakLabel,
continueLabel,
});
return breakLabel;
}
@@ -2262,7 +2262,7 @@ namespace ts {
beginBlock(<SwitchBlock>{
kind: CodeBlockKind.Switch,
isScript: false,
breakLabel: breakLabel
breakLabel,
});
return breakLabel;
}