Skip to content

Commit 116946f

Browse files
mheveryjasonaden
authored andcommitted
style: tslint enforces no debugger statements left behind (angular#25532)
PR Close angular#25532
1 parent 503905c commit 116946f

File tree

8 files changed

+44
-22
lines changed

8 files changed

+44
-22
lines changed

packages/compiler-cli/src/ngcc/test/host/esm2015_host_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ describe('Esm2015ReflectionHost', () => {
530530
const host = new Esm2015ReflectionHost(program.getTypeChecker());
531531
const classNode =
532532
getDeclaration(program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isClassDeclaration);
533-
debugger;
534533
const members = host.getMembersOfClass(classNode);
535534

536535
const staticMethod = members.find(member => member.name === 'staticMethod') !;

packages/compiler-cli/src/ngcc/test/host/esm5_host_spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ describe('Esm5ReflectionHost', () => {
414414
const host = new Esm5ReflectionHost(program.getTypeChecker());
415415
const classNode = getDeclaration(
416416
program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isVariableDeclaration);
417-
debugger;
418417
const decorators = host.getDecoratorsOfDeclaration(classNode) !;
419418

420419
expect(decorators).toBeDefined();
@@ -584,7 +583,6 @@ describe('Esm5ReflectionHost', () => {
584583
const host = new Esm5ReflectionHost(program.getTypeChecker());
585584
const classNode = getDeclaration(
586585
program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isVariableDeclaration);
587-
debugger;
588586
const members = host.getMembersOfClass(classNode);
589587

590588
const staticMethod = members.find(member => member.name === 'staticMethod') !;

packages/compiler-cli/src/ngtsc/annotations/test/selector_scope_spec.ts

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ describe('SelectorScopeRegistry', () => {
130130

131131
registry.registerSelector(ProgramCmp, 'program-cmp');
132132

133-
debugger;
134133
const scope = registry.lookupCompilationScope(ProgramCmp) !;
135134
expect(scope).toBeDefined();
136135
expect(scope.directives).toBeDefined();

packages/core/src/di/injectable.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ export interface Injectable { providedIn?: Type<any>|'root'|null; }
6060
* @Annotation
6161
*/
6262
export const Injectable: InjectableDecorator = makeDecorator(
63-
'Injectable', undefined, undefined, undefined, (type: Type<any>, meta: Injectable) => {
64-
debugger;
65-
return R3_COMPILE_INJECTABLE(type, meta);
66-
});
63+
'Injectable', undefined, undefined, undefined,
64+
(type: Type<any>, meta: Injectable) => R3_COMPILE_INJECTABLE(type, meta));
6765

6866
/**
6967
* Type representing injectable service.

packages/core/src/render3/assert.ts

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export function assertNgModuleType(
7777
}
7878

7979
function throwError(msg: string): never {
80+
// tslint:disable-next-line
8081
debugger; // Left intentionally for better debugger experience.
8182
throw new Error(`ASSERTION ERROR: ${msg}`);
8283
}

packages/core/testing/src/testing_internal.ts

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function _it(
116116
jsmFn: Function, testName: string, testFn: (done?: DoneFn) => any, testTimeout = 0): void {
117117
if (runnerStack.length == 0) {
118118
// This left here intentionally, as we should never get here, and it aids debugging.
119+
// tslint:disable-next-line
119120
debugger;
120121
throw new Error('Empty Stack!');
121122
}

tools/symbol-extractor/symbol_extractor.ts

-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ export class SymbolExtractor {
6161
// Left for easier debugging.
6262
// console.log('###', ts.SyntaxKind[child.kind], child.getText());
6363
}
64-
if (symbols.length && symbols[symbols.length - 1].name == 'type') {
65-
debugger;
66-
}
6764
}
6865
visitor(source);
6966
symbols.sort(SymbolExtractor.symbolSort);

tslint.json

+40-11
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,56 @@
55
"node_modules/tslint-eslint-rules/dist/rules"
66
],
77
"rules": {
8-
"file-header": [true, "Copyright Google Inc\\."],
9-
"no-console": [true, "log"],
8+
"file-header": [
9+
true,
10+
"Copyright Google Inc\\."
11+
],
12+
"no-console": [
13+
true,
14+
"log"
15+
],
1016
"no-duplicate-imports": true,
1117
"no-duplicate-variable": true,
1218
"no-jasmine-focus": true,
1319
"no-var-keyword": true,
1420
"require-internal-with-underscore": true,
1521
"rollup-config": true,
16-
"semicolon": [true],
17-
"variable-name": [true, "ban-keywords"],
18-
"no-inner-declarations": [true, "function"]
22+
"semicolon": [
23+
true
24+
],
25+
"variable-name": [
26+
true,
27+
"ban-keywords"
28+
],
29+
"no-inner-declarations": [
30+
true,
31+
"function"
32+
],
33+
"no-debugger": true
1934
},
2035
"jsRules": {
21-
"file-header": [true, "Copyright Google Inc\\."],
22-
"no-console": [true, "log"],
36+
"file-header": [
37+
true,
38+
"Copyright Google Inc\\."
39+
],
40+
"no-console": [
41+
true,
42+
"log"
43+
],
2344
"no-duplicate-imports": true,
2445
"no-duplicate-variable": true,
2546
"no-jasmine-focus": true,
2647
"require-internal-with-underscore": true,
27-
"semicolon": [true],
28-
"variable-name": [true, "ban-keywords"],
29-
"no-inner-declarations": [true, "function"]
48+
"semicolon": [
49+
true
50+
],
51+
"variable-name": [
52+
true,
53+
"ban-keywords"
54+
],
55+
"no-inner-declarations": [
56+
true,
57+
"function"
58+
]
3059
}
31-
}
60+
}

0 commit comments

Comments
 (0)