Skip to content

Commit

Permalink
use typescript-eslint-parser to lint sources
Browse files Browse the repository at this point in the history
  • Loading branch information
zaggino committed Aug 29, 2016
1 parent 65fe0fa commit 3920b69
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .brackets.json
Expand Up @@ -32,7 +32,7 @@
"linting.usePreferredOnly": true
},
"typescript": {
"linting.prefer": ["TypeScript"],
"linting.prefer": ["TypeScript", "ESLint"],
"linting.usePreferredOnly": true
}
},
Expand Down
5 changes: 3 additions & 2 deletions .eslintrc.json
@@ -1,6 +1,7 @@
{
"parser": "typescript-eslint-parser",
"parserOptions": {
"ecmaVersion": 6
"sourceType": "module"
},
"rules": {
"no-bitwise": 0,
Expand Down Expand Up @@ -43,7 +44,7 @@
"new-parens": 2,
"no-new-object": 2,
"no-invalid-this": 0,
"indent": [0, 4],
"indent": [1, 4],

"valid-jsdoc": 0,
"valid-typeof": 2,
Expand Down
72 changes: 36 additions & 36 deletions app/auto-updater.ts
Expand Up @@ -6,45 +6,45 @@ const log = getLogger("auto-updater");
const UPDATE_SERVER_HOST = "brackets-electron-nuts.herokuapp.com";

function notify(title: string, message: string) {
let windows = BrowserWindow.getAllWindows();
if (windows.length === 0) {
return;
}
windows[0].webContents.send("notify", title, message);
let windows = BrowserWindow.getAllWindows();
if (windows.length === 0) {
return;
}
windows[0].webContents.send("notify", title, message);
}

export default class AppUpdater {
constructor(window: Electron.BrowserWindow) {
if (isDev()) {
return;
}

const version = app.getVersion();
autoUpdater.addListener("update-available", (event: any) => {
log.info("A new update is available");
});
autoUpdater.addListener(
"update-downloaded",
(event: any, releaseNotes: string, releaseName: string, releaseDate: string, updateURL: string) => {
notify(
"A new update is ready to install",
`Version ${releaseName} is downloaded and will be automatically installed on Quit`
);
constructor(window: Electron.BrowserWindow) {
if (isDev()) {
return;
}
);
autoUpdater.addListener("error", (error: any) => {
log.error(error);
});
autoUpdater.addListener("checking-for-update", (event: any) => {
log.info("checking-for-update");
});
autoUpdater.addListener("update-not-available", () => {
log.info("update-not-available");
});
autoUpdater.setFeedURL(`https://${UPDATE_SERVER_HOST}/update/${os.platform()}/${version}`);

window.webContents.once("did-frame-finish-load", (event: any) => {
autoUpdater.checkForUpdates();
});
}
const version = app.getVersion();
autoUpdater.addListener("update-available", (event: any) => {
log.info("A new update is available");
});
autoUpdater.addListener(
"update-downloaded",
(event: any, releaseNotes: string, releaseName: string, releaseDate: string, updateURL: string) => {
notify(
"A new update is ready to install",
`Version ${releaseName} is downloaded and will be automatically installed on Quit`
);
}
);
autoUpdater.addListener("error", (error: any) => {
log.error(error);
});
autoUpdater.addListener("checking-for-update", (event: any) => {
log.info("checking-for-update");
});
autoUpdater.addListener("update-not-available", () => {
log.info("update-not-available");
});
autoUpdater.setFeedURL(`https://${UPDATE_SERVER_HOST}/update/${os.platform()}/${version}`);

window.webContents.once("did-frame-finish-load", (event: any) => {
autoUpdater.checkForUpdates();
});
}
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -104,6 +104,7 @@
"q": "1.4.1",
"rimraf": "2.5.4",
"tslint": "3.15.1",
"typescript-eslint-parser": "0.1.3",
"xmldoc": "0.1.2"
}
}

0 comments on commit 3920b69

Please sign in to comment.