Skip to content

Commit

Permalink
chore: add eslint and update manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
a90100 committed Apr 21, 2023
1 parent 76ac068 commit 7096258
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,32 @@
{
"env": {
"browser": true,
"es2021": true,
"webextensions": true
},
"extends": "eslint:recommended",
"overrides": [
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"indent": [
"off",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
2 changes: 2 additions & 0 deletions README.md
@@ -1 +1,3 @@
# Udemy Enhancer
This is a chrome extension to improve your user experience on the Udemy website.

2 changes: 1 addition & 1 deletion manifest.json
Expand Up @@ -9,7 +9,7 @@
"48": "dist/images/magic-wand48.png",
"128": "dist/images/magic-wand128.png"
},
"permissions": ["webRequest", "https://*.udemy.com/*", "storage", "declarativeContent", "tabs", "scripting"],
"permissions": ["https://*.udemy.com/*", "storage", "tabs"],
"host_permissions": ["https://*.udemy.com/*"],
"action": {
"default_title": "Click Me",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -7,7 +7,8 @@
"start": "npm run dev",
"watch": "webpack --mode=production --config webpack.config.js --watch",
"dev": "webpack-dev-server --mode=development --config webpack.config.js --open",
"build": "webpack --mode=production --config webpack.config.js"
"build": "webpack --mode=production --config webpack.config.js",
"lint":"eslint"
},
"keywords": [
"pug",
Expand All @@ -23,6 +24,7 @@
"clean-webpack-plugin": "~4.0.0",
"copy-webpack-plugin": "~11.0.0",
"css-loader": "~6.7.3",
"eslint": "^8.38.0",
"file-loader": "~6.2.0",
"html-loader": "~4.2.0",
"html-webpack-plugin": "~5.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/js/injector.js
@@ -1,7 +1,7 @@
// 用來操作、監聽 DOM 的檔案

const observer = new MutationObserver(() => {
chrome.storage?.local?.get(['defaultSpeed'], ({ defaultSpeed }) => {
chrome.storage?.local?.get(['defaultSpeed'], ({ defaultSpeed }) => {
setVideoSpeed(defaultSpeed);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/js/option.js
Expand Up @@ -47,4 +47,4 @@ saveBtn.addEventListener('click', () => {
});

alert('You stored the value successfully!');
})
});

0 comments on commit 7096258

Please sign in to comment.