Skip to content

Commit

Permalink
fix(deps): bump deps, migrate eslint, fix process undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
jonluca committed Aug 1, 2024
1 parent 7916f8d commit a66ec47
Show file tree
Hide file tree
Showing 6 changed files with 692 additions and 687 deletions.
46 changes: 0 additions & 46 deletions .eslintrc.json

This file was deleted.

Binary file modified .yarn/install-state.gz
Binary file not shown.
77 changes: 77 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import eslint from "@eslint/js";
import prettierPlugin from "eslint-plugin-prettier";
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import prettierExtends from "eslint-config-prettier";
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import tseslint from "typescript-eslint";

const globalToUse = {
...globals.browser,
...globals.serviceworker,
...globals.es2021,
...globals.worker,
...globals.node,
};

export default tseslint.config({
extends: [
{
ignores: [
"client/cypress/plugins/index.js",
".lintstagedrc.js",
".next/**/*",
"public/js/*",
".yarn/js/*",
"ui/out/**/*",
"apps/expo/ios/**/*",
"apps/expo/android/**/*",
"electron/build/**/*",
"public/*.js",
"public/*.map",
],
},
prettierExtends,
eslint.configs.recommended,
...tseslint.configs.recommended,
],
settings: {
react: { version: "detect" },
},
plugins: {
prettierPlugin,
"unused-imports": fixupPluginRules(unusedImportsPlugin),
},
rules: {
"prefer-rest-params": "off",
"prefer-const": "error",
"prefer-spread": "off",
"no-case-declarations": "off",
curly: ["error", "all"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": ["off"],
"object-shorthand": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_", ignoreRestSiblings: true },
],
"unused-imports/no-unused-imports": "error",
},
languageOptions: {
globals: globalToUse,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
});
2 changes: 1 addition & 1 deletion lib/util/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export function isHttp(path: string) {
*/
export function isFileSystemPath(path: string | undefined) {
// @ts-ignore
if (typeof window !== "undefined" || process.browser) {
if (typeof window !== "undefined" || (typeof process !== "undefined" && process.browser)) {
// We're running in a browser, so assume that all paths are URLs.
// This way, even relative paths will be treated as URLs rather than as filesystem paths
return false;
Expand Down
32 changes: 18 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,29 @@
"test:watch": "vitest -w"
},
"devDependencies": {
"@types/eslint": "8.56.10",
"@types/eslint": "9.6.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^18",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^22",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unused-imports": "^3.2.0",
"jsdom": "^24.1.0",
"prettier": "^3.3.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.0.0",
"eslint-plugin-unused-imports": "^4.0.1",
"jsdom": "^24.1.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"typescript": "^5.5.4",
"vitest": "^2.0.5",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.8.0",
"globals": "^15.9.0",
"typescript-eslint": "^8.0.0"
},
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
Expand Down
Loading

0 comments on commit a66ec47

Please sign in to comment.