Skip to content

Commit

Permalink
Fix linting (#314)
Browse files Browse the repository at this point in the history
* Fix linting npm script not working properly

* Update typescript and fix some linting errors
  • Loading branch information
david-tejada authored Sep 18, 2024
1 parent b6202fe commit af42008
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 22 deletions.
37 changes: 29 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint:css": "stylelint src/**/*.css",
"lint:js": "xo",
"lint": "run-p lint:* check-types",
"pretest": "NODE_ENV=test run-p lint:* unused-exports build:mv3",
"pretest": "NODE_ENV=test run-p lint unused-exports build:mv3",
"test": "jest --runInBand",
"watch": "parcel watch src/mv2/manifest.json --dist-dir dist-mv2 --no-cache --no-hmr",
"watch:mv3": "parcel watch src/mv3/manifest.json --dist-dir dist-mv3 --no-cache --no-hmr",
Expand Down Expand Up @@ -268,7 +268,7 @@
"stylelint-config-prettier": "^9.0.5",
"ts-jest": "^29.0.5",
"ts-unused-exports": "^8.0.5",
"typescript": "^4.6.3",
"typescript": "^5.6.2",
"web-ext": "^7.4.0",
"xo": "^0.48.0"
},
Expand Down
10 changes: 0 additions & 10 deletions src/content/actions/scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ import { getSetting } from "../settings/settingsManager";

const DEFAULT_SCROLL_FACTOR = 0.66;

// Officially "instant" is not part of the specification yet, although it works
// in Firefox, Chrome and Safari.
declare global {
interface ScrollToOptions {
left?: number;
top?: number;
behavior?: "auto" | "instant" | "smooth";
}
}

let lastScrollContainer: Element | undefined;
let lastScrollFactor: number;

Expand Down
4 changes: 3 additions & 1 deletion src/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ async function isWrongFrame(request: RequestFromBackground) {
browser.runtime.onMessage.addListener(
async (
request: RequestFromBackground
): Promise<string | string[] | TalonAction[] | boolean | undefined> => {
): Promise<
string | number | string[] | TalonAction[] | boolean | undefined
> => {
if (await isWrongFrame(request)) return;

if ("target" in request) {
Expand Down
2 changes: 1 addition & 1 deletion src/content/utils/combineArrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function odometerIncrement<T>(odometer: number[], arrayOfArrays: T[][]) {

if (odometer[iOdometerDigit]! + 1 <= maxee) {
// Increment, and you're done...
odometer[iOdometerDigit]++;
odometer[iOdometerDigit]!++;
return true;
}

Expand Down

0 comments on commit af42008

Please sign in to comment.