Skip to content

Commit a66ec47

Browse files
committed
fix(deps): bump deps, migrate eslint, fix process undefined
1 parent 7916f8d commit a66ec47

File tree

6 files changed

+692
-687
lines changed

6 files changed

+692
-687
lines changed

.eslintrc.json

-46
This file was deleted.

.yarn/install-state.gz

-257 Bytes
Binary file not shown.

eslint.config.mjs

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import eslint from "@eslint/js";
2+
import prettierPlugin from "eslint-plugin-prettier";
3+
import unusedImportsPlugin from "eslint-plugin-unused-imports";
4+
import prettierExtends from "eslint-config-prettier";
5+
import { fixupPluginRules } from "@eslint/compat";
6+
import globals from "globals";
7+
import tseslint from "typescript-eslint";
8+
9+
const globalToUse = {
10+
...globals.browser,
11+
...globals.serviceworker,
12+
...globals.es2021,
13+
...globals.worker,
14+
...globals.node,
15+
};
16+
17+
export default tseslint.config({
18+
extends: [
19+
{
20+
ignores: [
21+
"client/cypress/plugins/index.js",
22+
".lintstagedrc.js",
23+
".next/**/*",
24+
"public/js/*",
25+
".yarn/js/*",
26+
"ui/out/**/*",
27+
"apps/expo/ios/**/*",
28+
"apps/expo/android/**/*",
29+
"electron/build/**/*",
30+
"public/*.js",
31+
"public/*.map",
32+
],
33+
},
34+
prettierExtends,
35+
eslint.configs.recommended,
36+
...tseslint.configs.recommended,
37+
],
38+
settings: {
39+
react: { version: "detect" },
40+
},
41+
plugins: {
42+
prettierPlugin,
43+
"unused-imports": fixupPluginRules(unusedImportsPlugin),
44+
},
45+
rules: {
46+
"prefer-rest-params": "off",
47+
"prefer-const": "error",
48+
"prefer-spread": "off",
49+
"no-case-declarations": "off",
50+
curly: ["error", "all"],
51+
"@typescript-eslint/no-non-null-assertion": "off",
52+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
53+
"@typescript-eslint/consistent-type-imports": [
54+
"error",
55+
{
56+
prefer: "type-imports",
57+
},
58+
],
59+
"@typescript-eslint/ban-ts-comment": "off",
60+
"@typescript-eslint/no-explicit-any": "off",
61+
"@typescript-eslint/no-use-before-define": ["off"],
62+
"object-shorthand": "error",
63+
"@typescript-eslint/no-unused-vars": [
64+
"warn",
65+
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_", ignoreRestSiblings: true },
66+
],
67+
"unused-imports/no-unused-imports": "error",
68+
},
69+
languageOptions: {
70+
globals: globalToUse,
71+
parserOptions: {
72+
ecmaFeatures: {
73+
jsx: true,
74+
},
75+
},
76+
},
77+
});

lib/util/url.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function isHttp(path: string) {
163163
*/
164164
export function isFileSystemPath(path: string | undefined) {
165165
// @ts-ignore
166-
if (typeof window !== "undefined" || process.browser) {
166+
if (typeof window !== "undefined" || (typeof process !== "undefined" && process.browser)) {
167167
// We're running in a browser, so assume that all paths are URLs.
168168
// This way, even relative paths will be treated as URLs rather than as filesystem paths
169169
return false;

package.json

+18-14
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,29 @@
6767
"test:watch": "vitest -w"
6868
},
6969
"devDependencies": {
70-
"@types/eslint": "8.56.10",
70+
"@types/eslint": "9.6.0",
7171
"@types/js-yaml": "^4.0.9",
72-
"@types/node": "^18",
73-
"@typescript-eslint/eslint-plugin": "^7.9.0",
74-
"@typescript-eslint/parser": "^7.9.0",
75-
"@vitest/coverage-v8": "^1.6.0",
72+
"@types/node": "^22",
73+
"@typescript-eslint/eslint-plugin": "^8.0.0",
74+
"@typescript-eslint/parser": "^8.0.0",
75+
"@vitest/coverage-v8": "^2.0.5",
7676
"cross-env": "^7.0.3",
77-
"eslint": "^8.57.0",
77+
"eslint": "^9.8.0",
7878
"eslint-config-prettier": "^9.1.0",
7979
"eslint-config-standard": "^17.1.0",
8080
"eslint-plugin-import": "^2.29.1",
81-
"eslint-plugin-prettier": "^5.1.3",
82-
"eslint-plugin-promise": "^6.1.1",
83-
"eslint-plugin-unused-imports": "^3.2.0",
84-
"jsdom": "^24.1.0",
85-
"prettier": "^3.3.0",
86-
"rimraf": "^5.0.7",
87-
"typescript": "^5.4.5",
88-
"vitest": "^1.6.0"
81+
"eslint-plugin-prettier": "^5.2.1",
82+
"eslint-plugin-promise": "^7.0.0",
83+
"eslint-plugin-unused-imports": "^4.0.1",
84+
"jsdom": "^24.1.1",
85+
"prettier": "^3.3.3",
86+
"rimraf": "^6.0.1",
87+
"typescript": "^5.5.4",
88+
"vitest": "^2.0.5",
89+
"@eslint/compat": "^1.1.1",
90+
"@eslint/js": "^9.8.0",
91+
"globals": "^15.9.0",
92+
"typescript-eslint": "^8.0.0"
8993
},
9094
"dependencies": {
9195
"@jsdevtools/ono": "^7.1.3",

0 commit comments

Comments
 (0)