mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Fix lint errors
This commit is contained in:
@@ -13,19 +13,17 @@ namespace ts {
|
||||
return getSymbolWalker;
|
||||
|
||||
function getSymbolWalker(accept: (symbol: Symbol) => boolean = () => true): SymbolWalker {
|
||||
let visitedTypes = createMap<Type>(); // Key is id as string
|
||||
let visitedSymbols = createMap<Symbol>(); // Key is id as string
|
||||
const visitedTypes = createMap<Type>(); // Key is id as string
|
||||
const visitedSymbols = createMap<Symbol>(); // Key is id as string
|
||||
|
||||
return {
|
||||
walkType: type =>
|
||||
{
|
||||
walkType: type => {
|
||||
visitedTypes.clear();
|
||||
visitedSymbols.clear();
|
||||
visitType(type);
|
||||
return { visitedTypes: arrayFrom(visitedTypes.values()), visitedSymbols: arrayFrom(visitedSymbols.values()) };
|
||||
},
|
||||
walkSymbol: symbol =>
|
||||
{
|
||||
walkSymbol: symbol => {
|
||||
visitedTypes.clear();
|
||||
visitedSymbols.clear();
|
||||
visitSymbol(symbol);
|
||||
|
||||
@@ -2674,9 +2674,9 @@ namespace ts {
|
||||
/* @internal */
|
||||
export interface SymbolWalker {
|
||||
/** Note: Return values are not ordered. */
|
||||
walkType(root: Type) : { visitedTypes: ReadonlyArray<Type>, visitedSymbols: ReadonlyArray<Symbol> };
|
||||
walkType(root: Type): { visitedTypes: ReadonlyArray<Type>, visitedSymbols: ReadonlyArray<Symbol> };
|
||||
/** Note: Return values are not ordered. */
|
||||
walkSymbol(root: Symbol) : { visitedTypes: ReadonlyArray<Type>, visitedSymbols: ReadonlyArray<Symbol> };
|
||||
walkSymbol(root: Symbol): { visitedTypes: ReadonlyArray<Type>, visitedSymbols: ReadonlyArray<Symbol> };
|
||||
}
|
||||
|
||||
export interface SymbolDisplayBuilder {
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function foo(a: number, b: Bar): void {}`, (file, checker) => {
|
||||
let foundCount = 0;
|
||||
let stdLibRefSymbols = 0;
|
||||
const expectedSymbols = ["default", "a", "b", "Bar", "x", "y", "history"];
|
||||
let walker = checker.getSymbolWalker(symbol => {
|
||||
const walker = checker.getSymbolWalker(symbol => {
|
||||
const isStdLibSymbol = forEach(symbol.declarations, d => {
|
||||
return getSourceFileOfNode(d).hasNoDefaultLib;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user