Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
374 changes: 195 additions & 179 deletions .cursor/rules/convex_rules.mdc

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions commonjs.json

This file was deleted.

65 changes: 52 additions & 13 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,80 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import { dirname } from "path";
import { fileURLToPath } from "url";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";

export default [
{ files: ["src/**/*.{js,mjs,cjs,ts,tsx}"] },
{
ignores: [
"dist/**",
"eslint.config.js",
"**/_generated/",
"node10stubs.mjs",
"**/*.{mjs,cjs,js}",
"**/.next/**",
"**/.source/**",
"examples/**",
"docs/**",
],
},
{
files: ["src/**/*.{js,mjs,cjs,ts,tsx}"],
languageOptions: {
globals: globals.worker,
parser: tseslint.parser,

parserOptions: {
project: true,
// __dirname is not defined, so do not attempt to use it - AI WHY ARE
// YOU STILL AUTOCOMPLETINT WITH __dirname STOP IT
tsconfigRootDir: dirname(fileURLToPath(import.meta.url)),
project: ["./tsconfig.json"],
tsconfigRootDir: import.meta.dirname,
},
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
// Convex code - Worker environment
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/react/**"],
languageOptions: {
globals: globals.worker,
},
rules: {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "off",
"eslint-comments/no-unused-disable": "off",

// allow (_arg: number) => {} and const _foo = 1;
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
allowTaggedTemplates: true,
},
],
},
},
// React app code - Browser environment
{
files: ["src/react/**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-explicit-any": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
Expand Down
8 changes: 0 additions & 8 deletions esm.json

This file was deleted.

9 changes: 5 additions & 4 deletions examples/next/.env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
### Variables generated for cloud via npx convex dev
# CONVEX_DEPLOYMENT=dev:adjective-animal-123
# NEXT_PUBLIC_CONVEX_URL=https://adjective-animal-123.convex.cloud
CONVEX_DEPLOYMENT=dev:adjective-animal-123
NEXT_PUBLIC_CONVEX_URL=https://adjective-animal-123.convex.cloud


### Variables to be manually set for both cloud and self hosted
# NEXT_PUBLIC_SITE_URL=https://localhost:3000
NEXT_PUBLIC_SITE_URL=https://localhost:3000
SITE_URL=https://localhost:3000


### Variables to be manually set for cloud only
# NEXT_PUBLIC_CONVEX_SITE_URL=https://adjective-animal-123.convex.site
NEXT_PUBLIC_CONVEX_SITE_URL=https://adjective-animal-123.convex.site


### Variables to be manually set for self hosted only
Expand Down
2 changes: 1 addition & 1 deletion examples/next/app/(auth)/settings/EnableTwoFactor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function EnableTwoFactor() {
const accounts = await authClient.listAccounts();
if ("data" in accounts && accounts.data) {
const hasCredential = accounts.data.some(
(account) => account.provider === "credential",
(account) => account.providerId === "credential",
);
setStep(hasCredential ? "password" : "need-password");
}
Expand Down
6 changes: 6 additions & 0 deletions examples/next/convex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "./node_modules/convex/schemas/convex.schema.json",
"codegen": {
"legacyComponentApi": false
}
}
Loading