mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Enable "object-literal-shorthand" lint rule (#16987)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user