mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Upgrade ESLint
This commit is contained in:
parent
ba51f19d6f
commit
5394614dd3
@ -1,10 +1,10 @@
|
||||
import { Prisma } from "@/generated/prisma/client";
|
||||
import { demoteAllContactChannelsToNonPrimary, setContactChannelAsPrimaryById } from "@/lib/contact-channel";
|
||||
import { normalizeEmail } from "@/lib/emails";
|
||||
import { markProjectUserForExternalDbSync, recordExternalDbSyncDeletion, withExternalDbSyncUpdate } from "@/lib/external-db-sync";
|
||||
import { ensureContactChannelDoesNotExists, ensureContactChannelExists } from "@/lib/request-checks";
|
||||
import { getPrismaClientForTenancy, retryTransaction } from "@/prisma-client";
|
||||
import { createCrudHandlers } from "@/route-handlers/crud-handler";
|
||||
import { Prisma } from "@/generated/prisma/client";
|
||||
import { KnownErrors } from "@stackframe/stack-shared";
|
||||
import { contactChannelsCrud } from "@stackframe/stack-shared/dist/interface/crud/contact-channels";
|
||||
import { userIdOrMeSchema, yupObject, yupString } from "@stackframe/stack-shared/dist/schema-fields";
|
||||
@ -62,6 +62,7 @@ export const contactChannelsCrudHandlers = createLazyProxy(() => createCrudHandl
|
||||
onCreate: async ({ auth, data }) => {
|
||||
let value = data.value;
|
||||
switch (data.type) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
case 'email': {
|
||||
value = normalizeEmail(value);
|
||||
break;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
import { useAdminApp } from "@/app/(main)/(protected)/projects/[projectId]/use-admin-app";
|
||||
import { ActionCell, ActionDialog, BadgeCell, DataTable, DataTableColumnHeader, SearchToolbarItem, SimpleTooltip } from "@/components/ui";
|
||||
import { ServerTeam, ServerUser } from '@stackframe/stack';
|
||||
import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
|
||||
import { ActionCell, ActionDialog, BadgeCell, DataTable, DataTableColumnHeader, SearchToolbarItem, SimpleTooltip } from "@/components/ui";
|
||||
import { ColumnDef, Row, Table } from "@tanstack/react-table";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import * as yup from "yup";
|
||||
@ -75,14 +75,14 @@ function EditPermissionDialog(props: {
|
||||
formSchema={formSchema}
|
||||
okButton={{ label: "Save" }}
|
||||
onSubmit={async (values) => {
|
||||
const promises = permissions.map(p => {
|
||||
const promises = permissions.map(async (p) => {
|
||||
if (values.permissions.includes(p.id)) {
|
||||
return props.user.grantPermission(props.team, p.id);
|
||||
return await props.user.grantPermission(props.team, p.id);
|
||||
} else if (props.user.permissions.includes(p.id)) {
|
||||
return props.user.revokePermission(props.team, p.id);
|
||||
return await props.user.revokePermission(props.team, p.id);
|
||||
}
|
||||
});
|
||||
await Promise.all(promises);
|
||||
await Promise.allSettled(promises);
|
||||
props.onSubmit();
|
||||
}}
|
||||
cancelButton
|
||||
|
||||
@ -37,7 +37,9 @@ module.exports = {
|
||||
"max-statements-per-line": "warn",
|
||||
semi: ["error", "always"],
|
||||
"no-fallthrough": "error",
|
||||
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
||||
"@typescript-eslint/switch-exhaustiveness-check": ["error", {
|
||||
"considerDefaultExhaustiveForUnions": true,
|
||||
}],
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
@ -48,7 +50,8 @@ module.exports = {
|
||||
"@typescript-eslint/return-await": ["error", "always"],
|
||||
"no-multiple-empty-lines": "warn",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
"@typescript-eslint/member-delimiter-style": [
|
||||
// TODO: Re-introduce this rule when we migrate to the Stylistic plugin/ESLint 9+
|
||||
/*"@typescript-eslint/member-delimiter-style": [
|
||||
"error",
|
||||
{
|
||||
multiline: {
|
||||
@ -60,7 +63,7 @@ module.exports = {
|
||||
},
|
||||
multilineDetection: "brackets",
|
||||
},
|
||||
],
|
||||
],*/
|
||||
"@typescript-eslint/no-unnecessary-condition": [
|
||||
"error",
|
||||
{ allowConstantLoopConditions: true },
|
||||
|
||||
@ -3,11 +3,5 @@
|
||||
"../configs/eslint/defaults.js",
|
||||
"../configs/eslint/next.js"
|
||||
],
|
||||
"ignorePatterns": ["/*", "!/src"],
|
||||
"rules": {
|
||||
// Temporarily downgrade some rules to warnings during migration
|
||||
// Remove these overrides once all issues are fixed
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "warn"
|
||||
}
|
||||
"ignorePatterns": ["/*", "!/src"]
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
"@types/node": "22.15.18",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "15.3.2",
|
||||
"glob": "^11.0.0",
|
||||
"postcss": "^8.5.3",
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"@types/node": "20.17.6",
|
||||
"@types/react": "link:@types/react@18.3.12",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "14.2.3",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
|
||||
@ -4,19 +4,4 @@ module.exports = {
|
||||
"../../configs/eslint/next.js",
|
||||
],
|
||||
"ignorePatterns": ['/*', '!/src'],
|
||||
rules: {
|
||||
"import/order": [
|
||||
1,
|
||||
{
|
||||
groups: [
|
||||
"external",
|
||||
"builtin",
|
||||
"internal",
|
||||
"sibling",
|
||||
"parent",
|
||||
"index",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
@ -31,7 +31,7 @@
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "14.2.5",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"postcss": "^8",
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"@types/node": "20.17.6",
|
||||
"@types/react": "link:@types/react@18.3.12",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "14.2.5",
|
||||
"rimraf": "^5.0.5",
|
||||
"typescript": "5.9.3"
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"@types/node": "20.17.6",
|
||||
"@types/react": "link:@types/react@18.3.12",
|
||||
"@types/react-dom": "^18",
|
||||
"eslint": "^8",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "14.2.3",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
|
||||
@ -72,14 +72,14 @@
|
||||
"@testing-library/react": "^15.0.7",
|
||||
"@types/node": "20.17.6",
|
||||
"@types/supertest": "^6.0.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||
"@typescript-eslint/parser": "^8.56.1",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"chokidar-cli": "^3.0.0",
|
||||
"codebuff": "^1.0.261",
|
||||
"concurrently": "^8.2.2",
|
||||
"esbuild": "^0.24.0",
|
||||
"eslint": "8.30.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-next": "^14.2.17",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
"version": "2.8.71",
|
||||
"repository": "https://github.com/stack-auth/stack-auth",
|
||||
"description": "The setup wizard for Stack. https://stack-auth.com",
|
||||
"main": "dist/index.js",
|
||||
"main": "dist/index.mjs",
|
||||
"type": "module",
|
||||
"bin": "./dist/index.js",
|
||||
"bin": "./dist/index.mjs",
|
||||
"scripts": {
|
||||
"clean": "rimraf test-run-output && rimraf node_modules && rimraf dist",
|
||||
"build": "tsdown",
|
||||
|
||||
750
pnpm-lock.yaml
750
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user