Skip to content

Commit 8464cf1

Browse files
authored
ENG-908 Make lint not fail on database, utils (#464)
* * Missing eslint.config in utils * Apply sqlruff lints * One valid lint on migrate.ts * Tweak lint rules to allow `while (true)` * Wrong lint base in @repo/database * remove eslint9-dependent setting. * declare eslint as module
1 parent 6dc6f36 commit 8464cf1

File tree

7 files changed

+32
-6
lines changed

7 files changed

+32
-6
lines changed

.zed/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"lsp": {
3+
"eslint": {
4+
"settings": {
5+
"experimental": {
6+
"useFlatConfig": true
7+
}
8+
}
9+
}
10+
}
11+
}

packages/database/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { config as base } from "@repo/eslint-config/react-internal";
1+
import { config as base } from "@repo/eslint-config/base";
22

33
export default [
44
...base,

packages/database/scripts/migrate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if (reapply) {
4444
const dir = opendirSync(join(projectRoot, "supabase", "migrations"));
4545
const files = [];
4646
const fre = /^\d{14}_.*/;
47+
/* eslint-disable-next-line no-constant-condition */
4748
while (true) {
4849
const f = dir.readSync();
4950
if (f === null) {
@@ -79,7 +80,7 @@ if (reapply) {
7980
process.exit(result.status);
8081
}
8182
}
82-
let migrationArgs = ["migration", "up", "--local"];
83+
const migrationArgs = ["migration", "up", "--local"];
8384
if (includeAll) migrationArgs.push("--include-all");
8485
const migrationResult = spawnSync("supabase", migrationArgs, {
8586
cwd: projectRoot,

packages/database/supabase/schemas/account.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ BEGIN
141141
END;
142142
$$;
143143

144-
CREATE OR REPLACE FUNCTION public.upsert_accounts_in_space (
145-
space_id_ BIGINT,
146-
accounts JSONB
144+
CREATE OR REPLACE FUNCTION public.upsert_accounts_in_space(
145+
space_id_ BIGINT,
146+
accounts JSONB
147147
) RETURNS SETOF BIGINT
148148
SECURITY DEFINER
149149
SET search_path = ''

packages/database/supabase/schemas/embedding.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ ALTER TABLE public."ContentEmbedding_openai_text_embedding_3_small_1536" ENABLE
106106

107107
DROP POLICY IF EXISTS embedding_openai_te3s_1536_policy ON public."ContentEmbedding_openai_text_embedding_3_small_1536" ;
108108
CREATE POLICY embedding_openai_te3s_1536_policy ON public."ContentEmbedding_openai_text_embedding_3_small_1536"
109-
FOR ALL USING (public.content_in_space (target_id)) ;
109+
FOR ALL USING (public.content_in_space (target_id)) ;

packages/eslint-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@repo/eslint-config",
33
"version": "0.0.0",
44
"license": "Apache-2.0",
5+
"type": "module",
56
"private": true,
67
"exports": {
78
"./base": "./base.js",

packages/utils/eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { config as base } from "@repo/eslint-config/base";
2+
3+
export default [
4+
...base,
5+
{
6+
languageOptions: {
7+
parserOptions: {
8+
project: true,
9+
tsconfigRootDir: ".",
10+
},
11+
},
12+
},
13+
];

0 commit comments

Comments
 (0)