Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
fix: sync with gpa
Browse files Browse the repository at this point in the history
  • Loading branch information
lishaduck committed Feb 21, 2024
1 parent 3d583ef commit b6d81cd
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
Binary file modified bun.lockb
Binary file not shown.
25 changes: 15 additions & 10 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// @ts-check
import { sheriff } from "eslint-config-sheriff";
import { defineFlatConfig } from "eslint-define-config";

/**
* @type import("@sherifforg/types").SheriffSettings
*/
const sheriffOptions = {
react: false,
lodash: false,
next: false,
playwright: false,
jest: false,
vitest: false,
// astro: false, // THIS DOESN'T DO ANYTHING!
pathsOveriddes: {
tsconfigLocation: [
"./tsconfig.json",
"./tsconfig.sw.json",
"./tsconfig.eslint.json",
],
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/dev-dist/**",
"**/build/**",
"**/.yarn/**",
"**/.pnp.*",
],
},
};

/**
* @type import("eslint-define-config").FlatESLintConfig[]
*/
// @ts-expect-error: null and undefined are different.
const sheriffRules = sheriff(sheriffOptions);

export default defineFlatConfig([
...sheriff(sheriffOptions),
...sheriffRules,
{
files: ["**/*.ts"],
rules: {
Expand All @@ -47,6 +48,10 @@ export default defineFlatConfig([
{ "ts-expect-error": true, "ts-check": false },
],
"import/no-unresolved": [2, { ignore: ["^virtual:"] }],
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/promise-function-async": "warn",
"@typescript-eslint/strict-boolean-expressions": "warn",
},
},
]);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"idb-keyval": "^6.2.1",
"pathfinding": "^0.4.18",
"turbo": "^1.12.0",
"unstorage": "^1.10.1",
"workbox-build": "^7.0.0",
"workbox-core": "^7.0.0",
Expand All @@ -41,6 +40,7 @@
"devDependencies": {
"@eslint-types/typescript-eslint": "^6.21.0",
"@eslint-types/unicorn": "^51.0.1",
"@sherifforg/types": "^3.0.0",
"@types/bun": "^1.0.5",
"@types/eslint": "^8.56.2",
"@types/pathfinding": "^0.0.9",
Expand All @@ -51,6 +51,7 @@
"eslint-define-config": "^2.1.0",
"lightningcss": "^1.23.0",
"prettier": "3.2.5",
"turbo": "^1.12.4",
"typescript": "^5.3.3",
"vite": "^5.1.1",
"vite-plugin-pwa": "^0.18.1",
Expand Down
6 changes: 3 additions & 3 deletions src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ async function locateCourses(profNum: number): Promise<void> {
profiles[profNum] = [];
profiles[0] = profiles[0] ?? [undefined, ""];

profiles[0]![profNum] = (
profiles[0][profNum] = (
document.getElementById(`nameProf${profNum}`) as HTMLInputElement
).value;
for (const [i] of document.querySelectorAll(`.prof${profNum}`).entries()) {
profiles[profNum]![i] = [];
(profiles[profNum]![i] as string[])![0] = (
(profiles[profNum]![i] as string[])[0] = (
document.getElementById(`rmnum${i + 1}${prof}txt`) as HTMLInputElement
).value;
(profiles[profNum]![i] as string[])![1] = (
(profiles[profNum]![i] as string[])[1] = (
document.getElementById(`cl${i + 1}${prof}txt`) as HTMLInputElement
).value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { precacheAndRoute } from "workbox-precaching";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error: __WB_MANIFEST is a placeholder that workbox-precaching will inject at compile time.
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
precacheAndRoute(self.__WB_MANIFEST || []);
precacheAndRoute(self.__WB_MANIFEST ?? []);
4 changes: 3 additions & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "./tsconfig.json",
"include": ["vite.config.ts", "eslint.config.js"],
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.extra.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.extra.json",
"allowJs": true,
"checkJs": true
}
}
4 changes: 2 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"lint": {
"inputs": [
"src/**",
"vite.config.ts"
"**/*.ts",
"eslint.config.js"
]
},
"typecheck": {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
},
},
target: browserslistToEsbuild(browsersList),
cssMinify: "lightningcss",
// cssMinify: "lightningcss",
},
css: {
transformer: "lightningcss",
Expand Down

0 comments on commit b6d81cd

Please sign in to comment.