Skip to content

Commit

Permalink
Added 'noUnusedLocals' rule in tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Oct 29, 2018
1 parent 7f0d388 commit c34d4be
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/tests/integration/count-file-repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe("CountFileRepository", (): void => {

it("should create the count file if it does not exist yet", (): void => {
const countRepository = new CountFileRepository(filePath);
countRepository.getCount(); // just to ignore tsconfig 'noUnusedLocals' rule
const fileExists = existsSync(filePath);
expect(fileExists).toBe(true);
});
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/injector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ describe(Injector.name, () => {

try {
const regexp = new RegExp(webUrlRegexp);
regexp.test(""); // just to ignore tsconfig 'noUnusedLocals' rule
regexIsValid = true;
} catch (error) {
regexIsValid = false;
Expand Down
1 change: 0 additions & 1 deletion src/ts/input-validators/calculator-input-validator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { InputValidator } from "./input-validator";
import * as math from "mathjs";
import { StringHelpers } from "../helpers/string-helpers";

export class CalculatorInputValidator implements InputValidator {
public isValidForSearchResults(userInput: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/ts/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from "path";
import { platform } from "os";
import { app, BrowserWindow, globalShortcut, ipcMain, Menu, Tray, screen, MenuItem, MenuItemConstructorOptions } from "electron";
import { app, BrowserWindow, globalShortcut, ipcMain, Menu, Tray, screen, MenuItemConstructorOptions } from "electron";
import { autoUpdater } from "electron-updater";
import { FilePathExecutionArgumentValidator } from "./execution-argument-validators/file-path-execution-argument-validator";
import { ExecutionService } from "./execution-service";
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"strict": false, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
"strictNullChecks": true, /* Enable strict null checks. */
"resolveJsonModule": true
"resolveJsonModule": true,
"noUnusedLocals": true
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
Expand Down

0 comments on commit c34d4be

Please sign in to comment.