Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 165466d

Browse files
committed
add eslinter, remove prettier, restructure a bit
1 parent cd35c0c commit 165466d

File tree

17 files changed

+1515
-40
lines changed

17 files changed

+1515
-40
lines changed

‎.eslintignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src/services/chrome.js
2+
src/services/db.js
3+
src/services/schema.js

‎.eslintrc‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"plugins": [
3+
"react"
4+
],
5+
"parser": "babel-eslint",
6+
"parserOptions": {
7+
"ecmaVersion": 6,
8+
"sourceType": "module",
9+
"ecmaFeatures": {
10+
"jsx": true
11+
}
12+
},
13+
"env": {
14+
"es6": true,
15+
"browser": true,
16+
"node": true,
17+
"mocha": true
18+
},
19+
"globals": {
20+
"chrome": true
21+
},
22+
"extends": [
23+
"eslint:recommended",
24+
"plugin:react/recommended"
25+
],
26+
"rules": {
27+
"semi": [2, "always"],
28+
"indent": ["error", 2],
29+
"object-curly-spacing": ["error", "always"],
30+
"no-extra-parens": "error",
31+
"max-len": ["error", { "code": 100 }],
32+
"no-multi-spaces": "error",
33+
"no-prototype-builtins": 0,
34+
"no-console": ["error"]
35+
},
36+
"settings": {
37+
"react": {
38+
"version": "16.3"
39+
}
40+
}
41+
}

‎package.json‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
"prettier_check_popup": "prettier --check src/**/*.{js,jsx}",
1515
"prettier_check_option": "prettier --check src/**/*.{js,jsx}",
1616
"prettier_check_content": "prettier --check src/**/*.{js,jsx}",
17-
"test": "yarn prettier_check_src && yarn prettier_check_popup && yarn prettier_check_option && yarn prettier_check_content && yarn build"
17+
"lint": "eslint",
18+
"lint:fix": "eslint --fix"
1819
},
1920
"husky": {
2021
"hooks": {
21-
"pre-commit": "pretty-quick --staged"
22+
"pre-commit": "npm run build"
2223
}
2324
},
2425
"keywords": [],
@@ -34,6 +35,7 @@
3435
"@babel/preset-react": "^7.0.0",
3536
"babel-loader": "^8.0.6",
3637
"copy-webpack-plugin": "^5.0.4",
38+
"css-loader": "^4.3.0",
3739
"dotenv": "^8.2.0",
3840
"file-loader": "^4.2.0",
3941
"gh-pages": "^2.1.1",
@@ -43,8 +45,14 @@
4345
"prettier": "1.18.2",
4446
"pretty-quick": "^2.0.0",
4547
"react-hot-loader": "^4.12.10",
48+
"style-loader": "^1.2.1",
4649
"webpack": "^4.39.1",
4750
"webpack-cli": "^3.3.6",
51+
"babel-eslint": "^10.1.0",
52+
"eslint": "^7.6.0",
53+
"eslint-loader": "^4.0.2",
54+
"eslint-plugin-react": "^7.20.5",
55+
"eslint-watch": "^7.0.0",
4856
"webpack-dev-server": "^3.7.2"
4957
},
5058
"dependencies": {
@@ -53,6 +61,7 @@
5361
"@material-ui/core": "^4.3.3",
5462
"@material-ui/icons": "^4.2.1",
5563
"react": "^16.8.6",
56-
"react-dom": "^16.8.6"
64+
"react-dom": "^16.8.6",
65+
"react-frame-component": "^4.1.3"
5766
}
5867
}

‎sandbox.config.json‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎src/app/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"background": {
1111
"scripts": ["background.bundle.js"]
1212
},
13-
"permissions": ["storage", "webNavigation", "*://*/*"],
13+
"permissions": ["storage", "tabs", "*://*/*"],
1414
"browser_action": {
1515
"default_icon": {
1616
"19": "images/icon-19.png",

‎src/background.js‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "@babel/polyfill";
2+
import chromeService from './services/chrome';
23

34
let AppInitState = 0; // it means app is off on startup
45

@@ -8,10 +9,18 @@ let AppInitState = 0; // it means app is off on startup
89
* @class Main
910
*/
1011
class Main {
11-
constructor() {}
12+
constructor() {
13+
this.init();
14+
}
15+
16+
init = () => {
17+
this.popUpClickSetup();
18+
}
19+
1220
popUpClickSetup() {
13-
chrome.browserAction.onClicked.addListener(tab => {
21+
chrome.browserAction.onClicked.addListener(() => {
1422
if (this.toggleApp()) {
23+
chromeService.openHelpPage('');
1524
} else {
1625
this.stopApp();
1726
}
@@ -39,3 +48,5 @@ class Main {
3948
AppInitState = 0;
4049
};
4150
}
51+
52+
new Main();

‎src/content-scripts/components/index.jsx‎ renamed to ‎src/components/Demo.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export default class Index extends React.Component {
55
super(props);
66
}
77
render() {
8-
return <div></div>;
8+
return <div>Demo</div>;
99
}
1010
}

‎src/content-scripts/App.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3-
import Index from "./components";
3+
import Index from "../components/Demo";
44

55
const Element = document.createElement("div");
66
Element.setAttribute("id", "dfghbnjmERHJKFGHNMVBNMFBNMbmvvxnbdgf");

‎src/option-page/App.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3-
import Index from "./components";
3+
import Index from "../components/Demo";
44

55
const Element = document.createElement("div");
66
Element.setAttribute("id", "dfghbnjmERHJKFGHNMVBNMFBNMbmvvxnbdgf");

‎src/option-page/components/index.jsx‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /