Skip to content

Commit

Permalink
Add package.json, add eslint and format the whole files
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwartzblat committed Oct 18, 2024
1 parent b94bce6 commit 0d1ff01
Show file tree
Hide file tree
Showing 14 changed files with 3,894 additions and 507 deletions.
39 changes: 39 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"overrides": [
{
"files": ["packed.js"],
"rules": {
"no-unused-vars": "error",
"no-undef": "error"
}
}
],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-undef": "off",
"no-unused-vars": "off"
}
}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,3 @@ dist
.yarn/install-state.gz
.pnp.*
.idea
/package.json
/package-lock.json
9 changes: 7 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ module.exports = function(grunt) {
grunt.initConfig({
concat: {
options: {
banner: 'window.plus_main = () => {\n',
footer: '\n};\nif (!window.is_plus_loaded) {\n\twindow.is_plus_loaded = true;\n\twindow.plus_main()\n}',
banner: '/* global require */\nwindow.plus_main = () => {\n',
footer: '\n};\nif (!window.is_plus_loaded) {\n window.is_plus_loaded = true;\n window.plus_main();\n}',
separator: '\n\n',
process: function(file) {
return file.split('\n').map(function(line) {
return ' ' + line;
}).join('\n');
}
},
dist: {
src: [
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function handle_settings_update(settings) {
inject_script('packed.js');


chrome.storage.sync.onChanged.addListener(function (changes, namespace) {
chrome.storage.sync.onChanged.addListener(function (changes) {
if (changes?.settings !== undefined) {
handle_settings_update(changes.settings.newValue);
}
Expand Down
Loading

0 comments on commit 0d1ff01

Please sign in to comment.