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 25, 2024
1 parent d8b50c5 commit a7a2092
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 257 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"
}
3 changes: 3 additions & 0 deletions src/components/Player.tsx
Original file line number Diff line number Diff line change
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
1 change: 1 addition & 0 deletions src/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,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
2 changes: 1 addition & 1 deletion src/components/Settings/BulkListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export function BulkListing({
size="small"
fill="outline"
color="primary"
disabled={!booksSelected?.length}
disabled={!!booksSelected?.length}
className="text-surface"
onClick={() => {
if (downloadProgress?.started) {
Expand Down
1 change: 1 addition & 0 deletions src/components/Settings/SpeedControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function SpeedControl(props: SpeedControlParams) {
setPreferredSpeed(curAppState.preferredSpeed);
}

// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
useEffect(() => {
setInitialPlayerSpeed();
}, []);
Expand Down
4 changes: 2 additions & 2 deletions src/customTypes/bcApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ export class HttpClient<SecurityDataType = unknown> {
property instanceof Blob
? property
: typeof property === "object" && property !== null
? JSON.stringify(property)
: `${property}`,
? JSON.stringify(property)
: `${property}`,
);
return formData;
}, new FormData()),
Expand Down
1 change: 0 additions & 1 deletion src/lib/Ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ export async function updatePrefsInBackground({
}
}

// I'm destructuring to pick off the videos and formatted because we are using updating those properties with the spread on cacheBcPlaylistJson
const { videos, formattedVideos, ...restPlaylistData } = data;
mutateTimeStampBcResponse(restPlaylistData);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function massageVidsArray(vids: IVidWithCustom[]) {
const bBookSort = getBibleBookSort(bCustomBook);
const aChap = Number(a.custom_fields?.chapter);
const bChap = Number(b.custom_fields?.chapter);
let retVal: undefined | number;
let retVal: number;
if (aBookSort === bBookSort) {
retVal = aChap < bChap ? -1 : aChap === bChap ? 0 : 1;
} else {
Expand Down
Loading

0 comments on commit a7a2092

Please sign in to comment.