Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to TypeScript #127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
57 changes: 0 additions & 57 deletions dev

This file was deleted.

17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname
}
}
}
);
24 changes: 7 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
"build": "parcel build source/manifest.json --target webext-prod",
"build:dev": "parcel watch source/manifest.json --host localhost --target webext-dev",
"clean": "rimraf dist",
"format": "prettier --write \"./**/*.{json,js}\"",
"format:check": "prettier --check \"./**/*.{json,js}\"",
"lint": "eslint source/**/*.js",
"format": "prettier --write \"./**/*.{json,ts}\"",
"format:check": "prettier --check \"./**/*.{json,ts}\"",
"lint": "eslint source",
"release": "yarn install && yarn run format:check && yarn run lint && yarn run clean && yarn run build && web-ext lint && web-ext build --overwrite-dest && git archive -o web-ext-artifacts/source-code.zip HEAD",
"start": "yarn install && yarn run clean && concurrently --names \"parcel ,web-ext\" --timestamp-format HH:mm:ss.SSS -c \"yellow,green\" --prefix \"{name} | {time} | \" -s first \"yarn run build:dev\" \"wait-on dist/manifest.json && web-ext run --no-reload --firefox=firefoxdeveloperedition\""
},
"type": "module",
"dependencies": {
"font-color-contrast": "1.1.1",
"image-promise": "6.0.2",
Expand All @@ -33,6 +34,7 @@
"devDependencies": {
"@parcel/config-webextension": "2.12.0",
"@parcel/core": "2.12.0",
"@types/firefox-webext-browser": "120.0.3",
"concurrently": "8.2.2",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
Expand All @@ -41,23 +43,11 @@
"punycode": "1.4.1",
"querystring-es3": "0.2.1",
"rimraf": "5.0.5",
"typescript": "5.4.3",
"typescript-eslint": "7.3.1",
"wait-on": "7.2.0",
"web-ext": "7.11.0"
},
"eslintConfig": {
"env": {
"browser": true,
"commonjs": true,
"webextensions": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 8
}
},
"prettier": {
"bracketSpacing": false,
"singleQuote": true,
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions source/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
},
"permissions": ["<all_urls>", "tabs", "theme"],
"background": {
"scripts": ["background.js"]
"scripts": ["background.ts"]
},
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["content.js"]
"js": ["content.ts"]
}
]
}
11 changes: 11 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"sourceMap": true,
"strict": true,
"target": "es2020",
"types": ["firefox-webext-browser"]
},
"include": ["source/**/*"]
}
Loading
Loading