Skip to content

Commit

Permalink
Port to TypeScript, fix a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Brawl345 committed Aug 7, 2024
1 parent be8e262 commit 2949a8a
Show file tree
Hide file tree
Showing 20 changed files with 6,118 additions and 4,524 deletions.
42 changes: 31 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@
"serviceworker": true,
"webextensions": true
},
"extends": ["eslint:recommended", "plugin:unicorn/recommended", "prettier"],
"extends": [
"eslint:recommended",
"plugin:unicorn/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"modules": true
}
"project": [
"./tsconfig.json"
]
},
"plugins": ["unicorn"],
"plugins": [
"@typescript-eslint",
"unicorn"
],
"rules": {
"arrow-body-style": "error",
"consistent-return": "error",
Expand All @@ -25,19 +33,31 @@
"SwitchCase": 1
}
],
"linebreak-style": ["error", "unix"],
"linebreak-style": [
"error",
"unix"
],
"no-console": [
"error",
{
"allow": ["error"]
"allow": [
"error"
]
}
],
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-template": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"unicorn/no-null": "off"
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"unicorn/no-null": "off",
"unicorn/prefer-top-level-await": "off"
}
}
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package-lock.json
pnpm-lock.yaml
yarn.lock
public/build
*.html
*.html
*.json
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"quoteProps": "consistent",
"printWidth": 120,
"overrides": [
{
"files": ["*.js"],
"files": ["*.js", "*.ts"],
"options": {
"singleQuote": true
}
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

## 3.1.0

- Ported to TypeScript
- Redesign settings page
- Fix Firefox compatibility
- Fix selecting the add-on in the sidebar in Firefox
- Host permissions are optional again
- Fix a few smaller bugs

## 3.0.1

Expand Down
8 changes: 4 additions & 4 deletions esbuild.js → build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ try {

build({
entryPoints: [
resolve(__dirname, 'source', 'service-worker.js'),
resolve(__dirname, 'source', 'sidebar.js'),
resolve(__dirname, 'source', 'options.js'),
resolve(__dirname, 'source', 'service-worker.ts'),
resolve(__dirname, 'source', 'sidebar.ts'),
resolve(__dirname, 'source', 'options.ts'),
],
bundle: true,
minify: false,
format: 'esm',
splitting: true,
watch: !isProduction,
sourcemap: isProduction ? false : 'inline',
target: ['chrome96'],
target: ['chrome120', 'firefox120'],
logLevel: 'info',
legalComments: 'none',
outdir: resolve(__dirname, 'public', 'build'),
Expand Down
Loading

0 comments on commit 2949a8a

Please sign in to comment.