Skip to content

Commit

Permalink
style: tslint enforces no debugger statements left behind (angular#25532
Browse files Browse the repository at this point in the history
)

PR Close angular#25532
  • Loading branch information
mhevery authored and jasonaden committed Aug 16, 2018
1 parent 503905c commit 116946f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ describe('Esm2015ReflectionHost', () => {
const host = new Esm2015ReflectionHost(program.getTypeChecker());
const classNode =
getDeclaration(program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isClassDeclaration);
debugger;
const members = host.getMembersOfClass(classNode);

const staticMethod = members.find(member => member.name === 'staticMethod') !;
Expand Down
2 changes: 0 additions & 2 deletions packages/compiler-cli/src/ngcc/test/host/esm5_host_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ describe('Esm5ReflectionHost', () => {
const host = new Esm5ReflectionHost(program.getTypeChecker());
const classNode = getDeclaration(
program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isVariableDeclaration);
debugger;
const decorators = host.getDecoratorsOfDeclaration(classNode) !;

expect(decorators).toBeDefined();
Expand Down Expand Up @@ -584,7 +583,6 @@ describe('Esm5ReflectionHost', () => {
const host = new Esm5ReflectionHost(program.getTypeChecker());
const classNode = getDeclaration(
program, SOME_DIRECTIVE_FILE.name, 'SomeDirective', ts.isVariableDeclaration);
debugger;
const members = host.getMembersOfClass(classNode);

const staticMethod = members.find(member => member.name === 'staticMethod') !;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ describe('SelectorScopeRegistry', () => {

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

debugger;
const scope = registry.lookupCompilationScope(ProgramCmp) !;
expect(scope).toBeDefined();
expect(scope.directives).toBeDefined();
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/di/injectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ export interface Injectable { providedIn?: Type<any>|'root'|null; }
* @Annotation
*/
export const Injectable: InjectableDecorator = makeDecorator(
'Injectable', undefined, undefined, undefined, (type: Type<any>, meta: Injectable) => {
debugger;
return R3_COMPILE_INJECTABLE(type, meta);
});
'Injectable', undefined, undefined, undefined,
(type: Type<any>, meta: Injectable) => R3_COMPILE_INJECTABLE(type, meta));

/**
* Type representing injectable service.
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/render3/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function assertNgModuleType(
}

function throwError(msg: string): never {
// tslint:disable-next-line
debugger; // Left intentionally for better debugger experience.
throw new Error(`ASSERTION ERROR: ${msg}`);
}
1 change: 1 addition & 0 deletions packages/core/testing/src/testing_internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function _it(
jsmFn: Function, testName: string, testFn: (done?: DoneFn) => any, testTimeout = 0): void {
if (runnerStack.length == 0) {
// This left here intentionally, as we should never get here, and it aids debugging.
// tslint:disable-next-line
debugger;
throw new Error('Empty Stack!');
}
Expand Down
3 changes: 0 additions & 3 deletions tools/symbol-extractor/symbol_extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export class SymbolExtractor {
// Left for easier debugging.
// console.log('###', ts.SyntaxKind[child.kind], child.getText());
}
if (symbols.length && symbols[symbols.length - 1].name == 'type') {
debugger;
}
}
visitor(source);
symbols.sort(SymbolExtractor.symbolSort);
Expand Down
51 changes: 40 additions & 11 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,56 @@
"node_modules/tslint-eslint-rules/dist/rules"
],
"rules": {
"file-header": [true, "Copyright Google Inc\\."],
"no-console": [true, "log"],
"file-header": [
true,
"Copyright Google Inc\\."
],
"no-console": [
true,
"log"
],
"no-duplicate-imports": true,
"no-duplicate-variable": true,
"no-jasmine-focus": true,
"no-var-keyword": true,
"require-internal-with-underscore": true,
"rollup-config": true,
"semicolon": [true],
"variable-name": [true, "ban-keywords"],
"no-inner-declarations": [true, "function"]
"semicolon": [
true
],
"variable-name": [
true,
"ban-keywords"
],
"no-inner-declarations": [
true,
"function"
],
"no-debugger": true
},
"jsRules": {
"file-header": [true, "Copyright Google Inc\\."],
"no-console": [true, "log"],
"file-header": [
true,
"Copyright Google Inc\\."
],
"no-console": [
true,
"log"
],
"no-duplicate-imports": true,
"no-duplicate-variable": true,
"no-jasmine-focus": true,
"require-internal-with-underscore": true,
"semicolon": [true],
"variable-name": [true, "ban-keywords"],
"no-inner-declarations": [true, "function"]
"semicolon": [
true
],
"variable-name": [
true,
"ban-keywords"
],
"no-inner-declarations": [
true,
"function"
]
}
}
}

0 comments on commit 116946f

Please sign in to comment.