fix eslint, add to ci

This commit is contained in:
Dima Gerasimov 2019-01-06 20:49:39 +00:00 committed by Dmitrii Gerasimov
parent de46310d93
commit 3eb72bab9d
6 changed files with 15 additions and 5 deletions

View file

@ -28,6 +28,9 @@ jobs:
- run: - run:
name: flow name: flow
command: npm run flow command: npm run flow
- run:
name: eslint
command: npm run eslint
# - store_artifacts: # - store_artifacts:
# path: test-results.xml # path: test-results.xml
# prefix: tests # prefix: tests

View file

@ -1,7 +1,12 @@
module.exports = { module.exports = {
"parser": "babel-eslint",
"plugins": [
"flowtype"
],
'extends': [ 'extends': [
// "google", // "google",
"eslint:recommended", "eslint:recommended",
"plugin:flowtype/recommended",
], ],
'env': { 'env': {
'browser': true, 'browser': true,

View file

@ -13,11 +13,13 @@
"@babel/core": "^7.2.2", "@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3", "@babel/preset-env": "^7.2.3",
"@babel/preset-flow": "^7.0.0", "@babel/preset-flow": "^7.0.0",
"babel-eslint": "^10.0.1",
"clean-webpack-plugin": "^1.0.0", "clean-webpack-plugin": "^1.0.0",
"copy-webpack-plugin": "^4.2.0", "copy-webpack-plugin": "^4.2.0",
"css-loader": "^2.1.0", "css-loader": "^2.1.0",
"eslint": "^5.12.0", "eslint": "^5.12.0",
"eslint-config-google": "^0.11.0", "eslint-config-google": "^0.11.0",
"eslint-plugin-flowtype": "^3.2.0",
"file-loader": "^3.0.1", "file-loader": "^3.0.1",
"flow-bin": "^0.89.0", "flow-bin": "^0.89.0",
"flow-interfaces-chrome": "^0.5.3", "flow-interfaces-chrome": "^0.5.3",

View file

@ -88,7 +88,7 @@ chrome.commands.onCommand.addListener(command => {
} }
}); });
chrome.runtime.onMessage.addListener((message: any, sender: chrome$MessageSender, sendResponse) => { chrome.runtime.onMessage.addListener((message: any, sender: chrome$MessageSender, sendResponse) => { // eslint-disable-line no-unused-vars
if (message.method === METHOD_CAPTURE_WITH_EXTRAS) { if (message.method === METHOD_CAPTURE_WITH_EXTRAS) {
const comment = message.comment; const comment = message.comment;
const tag_str = message.tag_str; const tag_str = message.tag_str;

View file

@ -8,7 +8,7 @@ export function showNotification(text: string, priority: number=0) {
Notification.requestPermission(); Notification.requestPermission();
} else { } else {
// TODO ugh. is there no way to show in-browser only notification?? // TODO ugh. is there no way to show in-browser only notification??
const notification = new Notification( new Notification(
'grasp-notification', 'grasp-notification',
// $FlowFixMe // $FlowFixMe
{ {

View file

@ -8,12 +8,12 @@ const COMMENT_ID = 'comment_id';
const TAGS_ID = 'tags_id'; const TAGS_ID = 'tags_id';
function getComment(): HTMLInputElement { function getComment(): HTMLInputElement {
const comment = ((document.getElementById(COMMENT_ID) : any): HTMLInputElement); const comment = ((document.getElementById(COMMENT_ID): any): HTMLInputElement);
return comment; return comment;
} }
function getTags(): HTMLInputElement { function getTags(): HTMLInputElement {
const tags = ((document.getElementById(TAGS_ID) : any): HTMLInputElement); const tags = ((document.getElementById(TAGS_ID): any): HTMLInputElement);
return tags; return tags;
} }
@ -30,7 +30,7 @@ function submitComment () {
'method': METHOD_CAPTURE_WITH_EXTRAS, 'method': METHOD_CAPTURE_WITH_EXTRAS,
'comment': comment_text, 'comment': comment_text,
'tag_str': tag_str, 'tag_str': tag_str,
}, resp => { }, () => {
console.log("[popup] captured!"); console.log("[popup] captured!");
}); });
window.close(); window.close();