Skip to content

Commit

Permalink
fix biome lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wkelly17 committed Apr 24, 2024
1 parent fbe2970 commit 8dc57a6
Show file tree
Hide file tree
Showing 24 changed files with 296 additions and 288 deletions.
68 changes: 34 additions & 34 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};
9 changes: 1 addition & 8 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@
"ignore": []
},
"files": {
"include": ["./src/**/*"],
"ignore": [
"node_modules",
"bcApi.ts",
"tests",
"playwright.config.ts",
"dotPlayer.js"
]
"ignore": [".DS_Store", "bcApi.ts"]
},
"linter": {
"enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CapacitorConfig } from "@capacitor/cli";
import type { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: "com.slbible.dotapp",
Expand Down
58 changes: 29 additions & 29 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import eslintReact from "eslint-plugin-react";
import js from "@eslint/js";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import eslintReact from "eslint-plugin-react";

export default [
js.configs.recommended,
js.configs.recommended,

eslintReact.configs.recommended,
// tseslint.configs.recommended,
{
files: ["src/**/*.{jsx,tsx,js,ts}"],
ignores: ["node_modules/*"],
eslintReact.configs.recommended,
// tseslint.configs.recommended,
{
files: ["src/**/*.{jsx,tsx,js,ts}"],
ignores: ["node_modules/*"],

linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: {
react: eslintReact,
},
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
// parser: {
// tsParser,
// },
// parserOptions: {
// ecmaVersion: "latest",
// sourceType: "module",
// }
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: {
react: eslintReact,
},
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
// parser: {
// tsParser,
// },
// parserOptions: {
// ecmaVersion: "latest",
// sourceType: "module",
// }
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
},
];
150 changes: 75 additions & 75 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
{
"name": "dotmobile",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "NODE_ENV=production tsc && vite build",
"preview": "vite preview",
"test.e2e": "playwright test",
"test.unit": "vitest",
"lint": "biome check --apply --verbose src/**/* src/",
"build-ios": "ionic capacitor build ios --release --prod --no-open",
"build-android": "ionic capacitor build android --release --prod --no-open",
"ios": "npm run build && npm run sync && npx cap run ios",
"android": "npm run build && npx cap run android",
"sync": "cap sync",
"iconGenerate": "npx @capacitor/assets generate --iconBackgroundColor '#eeeeee' --iconBackgroundColorDark '#1E1F1D' --splashBackgroundColor '#eeeeee' --splashBackgroundColorDark '#1E1F1D'",
"updateAllPackages": "npx npm-check-updates -i",
"prepare": "husky install"
},
"dependencies": {
"@capacitor/android": "^6.0.0",
"@capacitor/app": "6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/device": "^6.0.0",
"@capacitor/filesystem": "^6.0.0",
"@capacitor/haptics": "6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/keyboard": "6.0.0",
"@capacitor/preferences": "^6.0.0",
"@capacitor/status-bar": "6.0.0",
"@ionic/react": "^8.0.0",
"@ionic/react-router": "^8.0.0",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/video.js": "^7.3.58",
"capacitor-blob-writer": "^1.1.16",
"i18next": "^23.11.2",
"i18next-browser-languagedetector": "^7.2.1",
"ionicons": "^7.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^14.1.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@ionic/cli": "^7.2.0",
"@capacitor/cli": "^6.0.0",
"@biomejs/biome": "1.7.1",
"@capacitor/assets": "^3.0.5",
"@playwright/test": "^1.43.1",
"@testing-library/dom": ">=7.21.4",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@unocss/transformer-variant-group": "^0.59.4",
"@vitejs/plugin-legacy": "^5.3.2",
"@vitejs/plugin-react": "^4.2.1",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
"terser": "^5.30.4",
"typescript": "^5.4.5",
"unocss": "^0.59.4",
"vite": "^5.2.10",
"vitest": "^1.5.0"
},
"lint-staged": {
"*": "biome check --apply --verbose --config-path=./biome.json"
},
"description": "WA Sign language bibles app"
"name": "dotmobile",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "NODE_ENV=production tsc && vite build",
"preview": "vite preview",
"test.e2e": "playwright test",
"test.unit": "vitest",
"lint": "biome check --apply --verbose src/**/* src/",
"build-ios": "ionic capacitor build ios --release --prod --no-open",
"build-android": "ionic capacitor build android --release --prod --no-open",
"ios": "npm run build && npm run sync && npx cap run ios",
"android": "npm run build && npx cap run android",
"sync": "cap sync",
"iconGenerate": "npx @capacitor/assets generate --iconBackgroundColor '#eeeeee' --iconBackgroundColorDark '#1E1F1D' --splashBackgroundColor '#eeeeee' --splashBackgroundColorDark '#1E1F1D'",
"updateAllPackages": "npx npm-check-updates -i",
"prepare": "husky install"
},
"dependencies": {
"@capacitor/android": "^6.0.0",
"@capacitor/app": "6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/device": "^6.0.0",
"@capacitor/filesystem": "^6.0.0",
"@capacitor/haptics": "6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/keyboard": "6.0.0",
"@capacitor/preferences": "^6.0.0",
"@capacitor/status-bar": "6.0.0",
"@ionic/react": "^8.0.0",
"@ionic/react-router": "^8.0.0",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/video.js": "^7.3.58",
"capacitor-blob-writer": "^1.1.16",
"i18next": "^23.11.2",
"i18next-browser-languagedetector": "^7.2.1",
"ionicons": "^7.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^14.1.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@ionic/cli": "^7.2.0",
"@capacitor/cli": "^6.0.0",
"@biomejs/biome": "1.7.1",
"@capacitor/assets": "^3.0.5",
"@playwright/test": "^1.43.1",
"@testing-library/dom": ">=7.21.4",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@unocss/transformer-variant-group": "^0.59.4",
"@vitejs/plugin-legacy": "^5.3.2",
"@vitejs/plugin-react": "^4.2.1",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"lint-staged": "^15.2.2",
"terser": "^5.30.4",
"typescript": "^5.4.5",
"unocss": "^0.59.4",
"vite": "^5.2.10",
"vitest": "^1.5.0"
},
"lint-staged": {
"*": "biome check --apply --verbose src/**/* src/"
},
"description": "WA Sign language bibles app"
}
2 changes: 1 addition & 1 deletion src/components/ChapterSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef } from "react";
import { IVidWithCustom } from "../customTypes/types";
import type { IVidWithCustom } from "../customTypes/types";
import { ChapterList } from "./ChapterList";
import {
IconMaterialSymbolsChevronLeft,
Expand Down
11 changes: 7 additions & 4 deletions src/components/Player.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Dispatch, SetStateAction, useEffect, useRef } from "react";
import { VideoJsPlayer } from "video.js";
import { IVidWithCustom, chapterMarkers } from "../customTypes/types";
import { type Dispatch, type SetStateAction, useEffect, useRef } from "react";
import type { VideoJsPlayer } from "video.js";
import type { IVidWithCustom, chapterMarkers } from "../customTypes/types";
import { handleVideoJsTaps, playerCustomHotKeys } from "../lib/Ui";
import { getSavedAppPreferences } from "../lib/storage";
type Iplayer = {
Expand Down Expand Up @@ -40,7 +40,7 @@ export function VidJsPlayer({
? {
src: `${firstBook.savedSources?.video}`,
type: "video/mp4",
}
}
: firstBook.sources;

const firstPoster = firstBook.savedSources?.poster
Expand Down Expand Up @@ -158,9 +158,12 @@ export function VidJsPlayer({
}
}

// biome-ignore lint/correctness/useExhaustiveDependencies: <custom event listener>
useEffect(() => {
bootPlayer();
}, []);

// biome-ignore lint/correctness/useExhaustiveDependencies: <custom event listener>
useEffect(() => {
// a custom event dispatch listener
handleSpeedChangesInApp();
Expand Down
4 changes: 2 additions & 2 deletions src/components/PlaylistBookPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Dispatch, SetStateAction } from "react";
import type { Dispatch, SetStateAction } from "react";
import { useTranslation } from "react-i18next";
import { IVidWithCustom } from "../customTypes/types";
import type { IVidWithCustom } from "../customTypes/types";
import { manageShowingChapterArrows } from "../lib/Ui";
import { normalizeBookName } from "../lib/utils";
import { IconMaterialSymbolsCheckCircle } from "./Icons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlaylistInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";
import type { IVidWithCustom, validPlaylistSlugs } from "../customTypes/types";
import { formatPlayListName, normalizeBookName } from "../lib/utils";
import { IconMaterialSymbolsCheckCircle } from "./Icons";
type IPlaylistInfo = {
Expand Down
13 changes: 10 additions & 3 deletions src/components/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { IonButton, IonIcon, IonModal } from "@ionic/react";
import { close } from "ionicons/icons";
import { settingsOutline } from "ionicons/icons";
import { Dispatch, SetStateAction, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import { VideoJsPlayer } from "video.js";
import {
type Dispatch,
type SetStateAction,
useEffect,
useRef,
useState,
} from "react";
import { useTranslation } from "react-i18next";
import type { VideoJsPlayer } from "video.js";
import type {
IPlaylistData,
IVidWithCustom,
downloadProgressInfo,
Expand Down Expand Up @@ -205,6 +211,7 @@ export function Settings(props: ISettings) {
setCurrentVid: props.setCurrentVid,
});
}
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
useEffect(() => {
if (settingsRef?.current) {
if (!settingsRef.current.dataset.listening) {
Expand Down
Loading

0 comments on commit 8dc57a6

Please sign in to comment.