Skip to content

Commit 136f4cf

Browse files
committed
no-redeclare
1 parent 8103035 commit 136f4cf

15 files changed

Lines changed: 26 additions & 5 deletions

File tree

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"no-multiple-empty-lines": "off",
100100
"no-new-func": "error",
101101
"no-new-wrappers": "error",
102-
"no-redeclare": "off",
102+
"no-redeclare": "error",
103103
"no-return-await": "error",
104104
"no-restricted-globals": ["error",
105105
{ "name": "setTimeout" },

scripts/failed-tests.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ declare class FailedTestsReporter extends Mocha.reporters.Base {
1212
done(failures: number, fn?: (failures: number) => void): void;
1313
}
1414

15+
// eslint-disable-next-line no-redeclare
1516
declare namespace FailedTestsReporter {
1617
interface ReporterOptions {
1718
file?: string;
1819
keepFailed?: boolean;
1920
reporter?: string | Mocha.ReporterConstructor;
2021
reporterOptions?: any;
2122
}
22-
}
23+
}

src/compiler/builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ namespace ts {
10551055
}
10561056
}
10571057

1058+
// eslint-disable-next-line no-redeclare
10581059
namespace ts {
10591060
export type AffectedFileResult<T> = { result: T; affected: SourceFile | Program; } | undefined;
10601061

src/compiler/builderState.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace ts {
1212
}
1313
}
1414

15-
/*@internal*/
15+
/* @internal */
16+
// eslint-disable-next-line no-redeclare
1617
namespace ts {
1718
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean,
1819
cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput {
@@ -80,7 +81,8 @@ namespace ts {
8081
}
8182
}
8283

83-
/*@internal*/
84+
/* @internal */
85+
// eslint-disable-next-line no-redeclare
8486
namespace ts.BuilderState {
8587
/**
8688
* Information about the source file: Its version and optional signature from last emit

src/compiler/core.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace ts {
66
export const version = `${versionMajorMinor}.0-dev`;
77
}
88

9+
// eslint-disable-next-line no-redeclare
910
namespace ts {
1011
/**
1112
* Type of objects whose values are all of the same type.
@@ -68,6 +69,7 @@ namespace ts {
6869
}
6970

7071
/* @internal */
72+
// eslint-disable-next-line no-redeclare
7173
namespace ts {
7274
export const emptyArray: never[] = [] as never[];
7375

src/compiler/factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3423,6 +3423,7 @@ namespace ts {
34233423
}
34243424

34253425
/* @internal */
3426+
// eslint-disable-next-line no-redeclare
34263427
namespace ts {
34273428
export const nullTransformationContext: TransformationContext = {
34283429
enableEmitNotification: noop,

src/compiler/performance.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace ts {
77

88
/*@internal*/
99
/** Performance measurements for the compiler. */
10+
// eslint-disable-next-line no-redeclare
1011
namespace ts.performance {
1112
declare const onProfilerEvent: { (markName: string): void; profiler: boolean; };
1213

src/compiler/tsbuild.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ namespace ts {
150150
}
151151
}
152152

153+
// eslint-disable-next-line no-redeclare
153154
namespace ts {
154155
const minimumDate = new Date(-8640000000000000);
155156
const maximumDate = new Date(8640000000000000);

src/compiler/utilities.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace ts {
1212
}
1313

1414
/* @internal */
15+
// eslint-disable-next-line no-redeclare
1516
namespace ts {
1617
export const resolvingEmptyArray: never[] = [] as never[];
1718
export const emptyMap = createMap<never>() as ReadonlyMap<never> & ReadonlyPragmaMap;
@@ -4615,6 +4616,7 @@ namespace ts {
46154616
}
46164617
}
46174618

4619+
// eslint-disable-next-line no-redeclare
46184620
namespace ts {
46194621
export function getDefaultLibFileName(options: CompilerOptions): string {
46204622
switch (options.target) {
@@ -5391,6 +5393,7 @@ namespace ts {
53915393
}
53925394

53935395
// Simple node tests of the form `node.kind === SyntaxKind.Foo`.
5396+
// eslint-disable-next-line no-redeclare
53945397
namespace ts {
53955398
// Literals
53965399
export function isNumericLiteral(node: Node): node is NumericLiteral {
@@ -6129,6 +6132,7 @@ namespace ts {
61296132
//
61306133
// All node tests in the following list should *not* reference parent pointers so that
61316134
// they may be used with transformations.
6135+
// eslint-disable-next-line no-redeclare
61326136
namespace ts {
61336137
/* @internal */
61346138
export function isSyntaxList(n: Node): n is SyntaxList {
@@ -6971,8 +6975,8 @@ namespace ts {
69716975
}
69726976
}
69736977

6974-
69756978
/* @internal */
6979+
// eslint-disable-next-line no-redeclare
69766980
namespace ts {
69776981
export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports {
69786982
return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports;
@@ -7588,6 +7592,7 @@ namespace ts {
75887592
}
75897593

75907594
/* @internal */
7595+
// eslint-disable-next-line no-redeclare
75917596
namespace ts {
75927597
export function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName) {
75937598
const fromComponents = reducePathComponents(getPathComponents(from));

src/compiler/visitor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ namespace ts {
935935
}
936936

937937
/* @internal */
938+
// eslint-disable-next-line no-redeclare
938939
namespace ts {
939940
function reduceNode<T>(node: Node | undefined, f: (memo: T, node: Node) => T, initial: T) {
940941
return node ? f(initial, node) : initial;

0 commit comments

Comments
 (0)