Skip to content

Commit

Permalink
ci: improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
midrissi committed Nov 29, 2019
1 parent bd1d922 commit 8f70abd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion __tests__/assets/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function fn2() {
}

export function inner() {
const fn3 = () => {};
const fn3 = () => {
// Empty body
};
return fn3;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"test:tsc": "tsc --sourceMap __tests__/assets/*.ts",
"build": "tsc --build tsconfig.json",
"prebuild": "rimraf dist",
"lint": "eslint . && tslint -c tslint.json 'lib/**/*.ts'",
"lint": "eslint . && tslint -c tslint.json 'lib/**/*.ts' '__tests__/**/*.ts'",
"format": "prettier --write \"src/**/*.js\" \"__tests__/**/*.js\"",
"pretest": "npm run build && npm run lint",
"test": "nyc --reporter=html --reporter=text mocha",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SessionManager, ILocateOptions } from "./session-manager.class";
import { ILocation } from "./cache-amanger.class";
import { ILocateOptions, SessionManager } from "./session-manager.class";

const s = new SessionManager();

Expand Down
10 changes: 5 additions & 5 deletions src/session-manager.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PREFIX = "__functionLocation__";

export interface ILocateOptions {
sourceMap?: boolean;
};
}

export class SessionManager {
private cache: CacheManager = new CacheManager();
Expand Down Expand Up @@ -98,19 +98,19 @@ export class SessionManager {

// Construct the result object
let result: ILocation = {
path: source.substr(7),
column: location.value.value.columnNumber + 1,
line: location.value.value.lineNumber + 1,
path: source.substr(7),
source,
};

if(isMap) {
if (isMap) {
try {
const res = await SourceMapper.map(result);
if(res) {
if (res) {
result = res;
}
} catch(e) {
} catch (e) {
// Do nothing
}
}
Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"jsRules": {},
"rules": {},
"rulesDirectory": []
}
}

0 comments on commit 8f70abd

Please sign in to comment.