@conorroberts/utils 0.0.106 → 0.0.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ interface MigrateConnectionOptions {
13
13
  }
14
14
  interface MigrateSharedOptions<TSchema extends DrizzleSchema> extends MigrateConnectionOptions {
15
15
  deleteOrder?: SchemaTableName<TSchema>[];
16
+ migrationsTable?: string;
16
17
  }
17
18
  type CleanMigrateOptions<TSchema extends DrizzleSchema> = MigrateSharedOptions<TSchema> & {
18
19
  clean: true;
@@ -77,11 +77,12 @@ const cleanDatabase = async (db, options) => {
77
77
  process.exit(1);
78
78
  }
79
79
  const tableNames = listSchemaTables(options.schema);
80
- if (tableNames.length === 0) {
80
+ const allTableNames = options.migrationsTable ? [...tableNames, options.migrationsTable] : tableNames;
81
+ if (allTableNames.length === 0) {
81
82
  consola.log("Clean requested, but no tables were found in the provided Drizzle schema.");
82
83
  return;
83
84
  }
84
- const ordered = buildDeleteOrder(tableNames, options.deleteOrder ?? []);
85
+ const ordered = buildDeleteOrder(allTableNames, options.deleteOrder ?? []);
85
86
  consola.warn("WARNING: This will delete and drop ALL tables from the database.");
86
87
  consola.log(`Database host: ${db.$client.config.host}`);
87
88
  consola.log("");
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.mjs","names":["ordered: TTableName[]","tableNames: Set<SchemaTableName<TSchema>>","results: DeleteResult[]"],"sources":["../../src/db/migrate.ts"],"sourcesContent":["import { consola } from \"consola\";\nimport { sql } from \"drizzle-orm\";\nimport { DrizzleQueryError } from \"drizzle-orm/errors\";\nimport { drizzle } from \"drizzle-orm/planetscale-serverless\";\nimport { migrate } from \"drizzle-orm/planetscale-serverless/migrator\";\nimport { getTableName } from \"drizzle-orm/table\";\nimport { resolve } from \"node:path\";\nimport type { DrizzleSchema } from \"./types\";\n\ntype SchemaTableName<TSchema extends DrizzleSchema> = TSchema[keyof TSchema][\"_\"][\"name\"];\n\ninterface MigrateConnectionOptions {\n migrationsFolder: string;\n host: string;\n username: string;\n password: string;\n}\n\ninterface MigrateSharedOptions<TSchema extends DrizzleSchema> extends MigrateConnectionOptions {\n deleteOrder?: SchemaTableName<TSchema>[];\n}\n\ntype CleanMigrateOptions<TSchema extends DrizzleSchema> = MigrateSharedOptions<TSchema> & {\n clean: true;\n schema: TSchema;\n};\n\ntype StandardMigrateOptions<TSchema extends DrizzleSchema> = MigrateSharedOptions<TSchema> & {\n clean?: false;\n schema?: TSchema;\n};\n\ntype MigrateOptions<TSchema extends DrizzleSchema = DrizzleSchema> =\n | CleanMigrateOptions<TSchema>\n | StandardMigrateOptions<TSchema>;\n\ninterface DeleteResult {\n table: string;\n rowsDeleted: number;\n success: boolean;\n error?: string;\n}\n\nconst escapeIdentifier = (value: string): string => {\n return `\\`${value.replaceAll(\"`\", \"``\")}\\``;\n};\n\nconst parseError = (error: unknown): string => {\n if (error instanceof DrizzleQueryError) {\n if (error.cause instanceof Error) {\n return error.cause.message;\n }\n\n return error.message;\n }\n\n if (error instanceof Error) {\n return error.message;\n }\n\n return String(error);\n};\n\nconst buildDeleteOrder = <TTableName extends string>(tableNames: TTableName[], preferredOrder: TTableName[]) => {\n const seen = new Set<string>();\n const ordered: TTableName[] = [];\n\n for (const tableName of preferredOrder) {\n if (seen.has(tableName)) {\n continue;\n }\n\n seen.add(tableName);\n\n if (tableNames.includes(tableName)) {\n ordered.push(tableName);\n }\n }\n\n for (const tableName of tableNames) {\n if (!seen.has(tableName)) {\n ordered.push(tableName);\n }\n }\n\n return ordered;\n};\n\nconst listSchemaTables = <TSchema extends DrizzleSchema>(schema: TSchema): SchemaTableName<TSchema>[] => {\n const tableNames: Set<SchemaTableName<TSchema>> = new Set();\n const tables = Object.values(schema) as TSchema[keyof TSchema][];\n\n for (const table of tables) {\n const tableName = getTableName(table) as SchemaTableName<TSchema>;\n\n tableNames.add(tableName);\n }\n\n return Array.from(tableNames);\n};\n\nconst deleteTableRows = async (db: ReturnType<typeof drizzle>, tableNames: string[]): Promise<DeleteResult[]> => {\n const results: DeleteResult[] = [];\n\n for (const tableName of tableNames) {\n try {\n const rowsDeleted = await db.$count(sql.raw(tableName));\n\n await db.execute(sql.raw(`DELETE FROM ${tableName}`));\n\n results.push({\n table: tableName,\n rowsDeleted,\n success: true,\n });\n\n const status = rowsDeleted > 0 ? `[OK] Deleted ${rowsDeleted} rows` : \"[SKIP] Empty\";\n consola.log(`${status.padEnd(30)} from ${tableName}`);\n } catch (error) {\n const errorDetails = parseError(error) || String(error);\n\n results.push({\n table: tableName,\n rowsDeleted: 0,\n success: false,\n error: errorDetails,\n });\n\n consola.error(`[FAIL] Failed to delete from ${tableName}: ${errorDetails}`);\n }\n }\n\n return results;\n};\n\nconst dropTables = async (db: ReturnType<typeof drizzle>, tableNames: string[]): Promise<void> => {\n for (const tableName of tableNames) {\n try {\n await db.execute(sql.raw(`DROP TABLE IF EXISTS ${escapeIdentifier(tableName)}`));\n consola.log(`[OK] Dropped table ${tableName}`);\n } catch (error) {\n const errorDetails = parseError(error) || String(error);\n consola.error(`[FAIL] Failed to drop ${tableName}: ${errorDetails}`);\n }\n }\n};\n\nconst cleanDatabase = async (\n db: ReturnType<typeof drizzle>,\n options: CleanMigrateOptions<DrizzleSchema>,\n): Promise<void> => {\n if (process.env.UNSAFE_CONFIRM_DELETE !== \"true\") {\n consola.error('Refusing to clean database. Set UNSAFE_CONFIRM_DELETE=\"true\" to continue.');\n process.exit(1);\n }\n\n const tableNames = listSchemaTables(options.schema);\n\n if (tableNames.length === 0) {\n consola.log(\"Clean requested, but no tables were found in the provided Drizzle schema.\");\n return;\n }\n\n const ordered = buildDeleteOrder(tableNames, options.deleteOrder ?? []);\n\n consola.warn(\"WARNING: This will delete and drop ALL tables from the database.\");\n consola.log(`Database host: ${db.$client.config.host}`);\n\n consola.log(\"\");\n consola.log(\"Deleting table rows in order...\\n\");\n\n const results = await deleteTableRows(db, ordered);\n\n consola.log(\"\\nDropping tables in order...\\n\");\n await dropTables(db, ordered);\n\n const successCount = results.filter((result) => result.success).length;\n const totalRowsDeleted = results.reduce((sum, result) => sum + result.rowsDeleted, 0);\n\n consola.log(\"\");\n consola.log(\"=\".repeat(60));\n consola.log(\"SUMMARY\");\n consola.log(\"=\".repeat(60));\n consola.log(`Deletion phase: ${successCount} tables processed, ${totalRowsDeleted} rows deleted`);\n consola.success(\"Database is now empty and ready for migrations.\");\n};\n\nconst runMigrations = async <TSchema extends DrizzleSchema>(options: MigrateOptions<TSchema>) => {\n const db = drizzle({\n connection: {\n host: options.host,\n username: options.username,\n password: options.password,\n },\n });\n\n if (options.clean) {\n await cleanDatabase(db, options);\n }\n\n consola.log(\"Running database migrations...\");\n await migrate(db, { migrationsFolder: resolve(options.migrationsFolder) });\n consola.log(\"[OK] Migrations completed successfully!\");\n};\n\nexport { runMigrations };\nexport type { DrizzleSchema, MigrateOptions, SchemaTableName };\n"],"mappings":";;;;;;;;;AA2CA,MAAM,oBAAoB,UAA0B;AAClD,QAAO,KAAK,MAAM,WAAW,KAAK,KAAK,CAAC;;AAG1C,MAAM,cAAc,UAA2B;AAC7C,KAAI,iBAAiB,mBAAmB;AACtC,MAAI,MAAM,iBAAiB,MACzB,QAAO,MAAM,MAAM;AAGrB,SAAO,MAAM;;AAGf,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,QAAO,OAAO,MAAM;;AAGtB,MAAM,oBAA+C,YAA0B,mBAAiC;CAC9G,MAAM,uBAAO,IAAI,KAAa;CAC9B,MAAMA,UAAwB,EAAE;AAEhC,MAAK,MAAM,aAAa,gBAAgB;AACtC,MAAI,KAAK,IAAI,UAAU,CACrB;AAGF,OAAK,IAAI,UAAU;AAEnB,MAAI,WAAW,SAAS,UAAU,CAChC,SAAQ,KAAK,UAAU;;AAI3B,MAAK,MAAM,aAAa,WACtB,KAAI,CAAC,KAAK,IAAI,UAAU,CACtB,SAAQ,KAAK,UAAU;AAI3B,QAAO;;AAGT,MAAM,oBAAmD,WAAgD;CACvG,MAAMC,6B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,KAAI,WAAW,WAAW,GAAG;AAC3B,UAAQ,IAAI,4EAA4E;AACxF;;CAGF,MAAM,UAAU,iBAAiB,YAAY,QAAQ,eAAe,EAAE,CAAC;AAEvE,SAAQ,KAAK,mEAAmE;AAChF,SAAQ,IAAI,kBAAkB,GAAG,QAAQ,OAAO,OAAO;AAEvD,SAAQ,IAAI,GAAG;AACf,SAAQ,IAAI,oCAAoC;CAEhD,MAAM,UAAU,MAAM,gBAAgB,IAAI,QAAQ;AAElD,SAAQ,IAAI,kCAAkC;AAC9C,OAAM,WAAW,IAAI,QAAQ;CAE7B,MAAM,eAAe,QAAQ,QAAQ,WAAW,OAAO,QAAQ,CAAC;CAChE,MAAM,mBAAmB,QAAQ,QAAQ,KAAK,WAAW,MAAM,OAAO,aAAa,EAAE;AAErF,SAAQ,IAAI,GAAG;AACf,SAAQ,IAAI,IAAI,OAAO,GAAG,CAAC;AAC3B,SAAQ,IAAI,UAAU;AACtB,SAAQ,IAAI,IAAI,OAAO,GAAG,CAAC;AAC3B,SAAQ,IAAI,mBAAmB,aAAa,qBAAqB,iBAAiB,eAAe;AACjG,SAAQ,QAAQ,kDAAkD;;AAGpE,MAAM,gBAAgB,OAAsC,YAAqC;CAC/F,MAAM,KAAK,QAAQ,EACjB,YAAY;EACV,MAAM,QAAQ;EACd,UAAU,QAAQ;EAClB,UAAU,QAAQ;EACnB,EACF,CAAC;AAEF,KAAI,QAAQ,MACV,OAAM,cAAc,IAAI,QAAQ;AAGlC,SAAQ,IAAI,iCAAiC;AAC7C,OAAM,QAAQ,IAAI,EAAE,kBAAkB,QAAQ,QAAQ,iBAAiB,EAAE,CAAC;AAC1E,SAAQ,IAAI,0CAA0C"}
1
+ {"version":3,"file":"migrate.mjs","names":["ordered: TTableName[]","tableNames: Set<SchemaTableName<TSchema>>","results: DeleteResult[]"],"sources":["../../src/db/migrate.ts"],"sourcesContent":["import { consola } from \"consola\";\nimport { sql } from \"drizzle-orm\";\nimport { DrizzleQueryError } from \"drizzle-orm/errors\";\nimport { drizzle } from \"drizzle-orm/planetscale-serverless\";\nimport { migrate } from \"drizzle-orm/planetscale-serverless/migrator\";\nimport { getTableName } from \"drizzle-orm/table\";\nimport { resolve } from \"node:path\";\nimport type { DrizzleSchema } from \"./types\";\n\ntype SchemaTableName<TSchema extends DrizzleSchema> = TSchema[keyof TSchema][\"_\"][\"name\"];\n\ninterface MigrateConnectionOptions {\n migrationsFolder: string;\n host: string;\n username: string;\n password: string;\n}\n\ninterface MigrateSharedOptions<TSchema extends DrizzleSchema> extends MigrateConnectionOptions {\n deleteOrder?: SchemaTableName<TSchema>[];\n migrationsTable?: string;\n}\n\ntype CleanMigrateOptions<TSchema extends DrizzleSchema> = MigrateSharedOptions<TSchema> & {\n clean: true;\n schema: TSchema;\n};\n\ntype StandardMigrateOptions<TSchema extends DrizzleSchema> = MigrateSharedOptions<TSchema> & {\n clean?: false;\n schema?: TSchema;\n};\n\ntype MigrateOptions<TSchema extends DrizzleSchema = DrizzleSchema> =\n | CleanMigrateOptions<TSchema>\n | StandardMigrateOptions<TSchema>;\n\ninterface DeleteResult {\n table: string;\n rowsDeleted: number;\n success: boolean;\n error?: string;\n}\n\nconst escapeIdentifier = (value: string): string => {\n return `\\`${value.replaceAll(\"`\", \"``\")}\\``;\n};\n\nconst parseError = (error: unknown): string => {\n if (error instanceof DrizzleQueryError) {\n if (error.cause instanceof Error) {\n return error.cause.message;\n }\n\n return error.message;\n }\n\n if (error instanceof Error) {\n return error.message;\n }\n\n return String(error);\n};\n\nconst buildDeleteOrder = <TTableName extends string>(tableNames: TTableName[], preferredOrder: TTableName[]) => {\n const seen = new Set<string>();\n const ordered: TTableName[] = [];\n\n for (const tableName of preferredOrder) {\n if (seen.has(tableName)) {\n continue;\n }\n\n seen.add(tableName);\n\n if (tableNames.includes(tableName)) {\n ordered.push(tableName);\n }\n }\n\n for (const tableName of tableNames) {\n if (!seen.has(tableName)) {\n ordered.push(tableName);\n }\n }\n\n return ordered;\n};\n\nconst listSchemaTables = <TSchema extends DrizzleSchema>(schema: TSchema): SchemaTableName<TSchema>[] => {\n const tableNames: Set<SchemaTableName<TSchema>> = new Set();\n const tables = Object.values(schema) as TSchema[keyof TSchema][];\n\n for (const table of tables) {\n const tableName = getTableName(table) as SchemaTableName<TSchema>;\n\n tableNames.add(tableName);\n }\n\n return Array.from(tableNames);\n};\n\nconst deleteTableRows = async (db: ReturnType<typeof drizzle>, tableNames: string[]): Promise<DeleteResult[]> => {\n const results: DeleteResult[] = [];\n\n for (const tableName of tableNames) {\n try {\n const rowsDeleted = await db.$count(sql.raw(tableName));\n\n await db.execute(sql.raw(`DELETE FROM ${tableName}`));\n\n results.push({\n table: tableName,\n rowsDeleted,\n success: true,\n });\n\n const status = rowsDeleted > 0 ? `[OK] Deleted ${rowsDeleted} rows` : \"[SKIP] Empty\";\n consola.log(`${status.padEnd(30)} from ${tableName}`);\n } catch (error) {\n const errorDetails = parseError(error) || String(error);\n\n results.push({\n table: tableName,\n rowsDeleted: 0,\n success: false,\n error: errorDetails,\n });\n\n consola.error(`[FAIL] Failed to delete from ${tableName}: ${errorDetails}`);\n }\n }\n\n return results;\n};\n\nconst dropTables = async (db: ReturnType<typeof drizzle>, tableNames: string[]): Promise<void> => {\n for (const tableName of tableNames) {\n try {\n await db.execute(sql.raw(`DROP TABLE IF EXISTS ${escapeIdentifier(tableName)}`));\n consola.log(`[OK] Dropped table ${tableName}`);\n } catch (error) {\n const errorDetails = parseError(error) || String(error);\n consola.error(`[FAIL] Failed to drop ${tableName}: ${errorDetails}`);\n }\n }\n};\n\nconst cleanDatabase = async (\n db: ReturnType<typeof drizzle>,\n options: CleanMigrateOptions<DrizzleSchema>,\n): Promise<void> => {\n if (process.env.UNSAFE_CONFIRM_DELETE !== \"true\") {\n consola.error('Refusing to clean database. Set UNSAFE_CONFIRM_DELETE=\"true\" to continue.');\n process.exit(1);\n }\n\n const tableNames = listSchemaTables(options.schema);\n const allTableNames = options.migrationsTable ? [...tableNames, options.migrationsTable] : tableNames;\n\n if (allTableNames.length === 0) {\n consola.log(\"Clean requested, but no tables were found in the provided Drizzle schema.\");\n return;\n }\n\n const ordered = buildDeleteOrder(allTableNames, options.deleteOrder ?? []);\n\n consola.warn(\"WARNING: This will delete and drop ALL tables from the database.\");\n consola.log(`Database host: ${db.$client.config.host}`);\n\n consola.log(\"\");\n consola.log(\"Deleting table rows in order...\\n\");\n\n const results = await deleteTableRows(db, ordered);\n\n consola.log(\"\\nDropping tables in order...\\n\");\n await dropTables(db, ordered);\n\n const successCount = results.filter((result) => result.success).length;\n const totalRowsDeleted = results.reduce((sum, result) => sum + result.rowsDeleted, 0);\n\n consola.log(\"\");\n consola.log(\"=\".repeat(60));\n consola.log(\"SUMMARY\");\n consola.log(\"=\".repeat(60));\n consola.log(`Deletion phase: ${successCount} tables processed, ${totalRowsDeleted} rows deleted`);\n consola.success(\"Database is now empty and ready for migrations.\");\n};\n\nconst runMigrations = async <TSchema extends DrizzleSchema>(options: MigrateOptions<TSchema>) => {\n const db = drizzle({\n connection: {\n host: options.host,\n username: options.username,\n password: options.password,\n },\n });\n\n if (options.clean) {\n await cleanDatabase(db, options);\n }\n\n consola.log(\"Running database migrations...\");\n await migrate(db, { migrationsFolder: resolve(options.migrationsFolder) });\n consola.log(\"[OK] Migrations completed successfully!\");\n};\n\nexport { runMigrations };\nexport type { DrizzleSchema, MigrateOptions, SchemaTableName };\n"],"mappings":";;;;;;;;;AA4CA,MAAM,oBAAoB,UAA0B;AAClD,QAAO,KAAK,MAAM,WAAW,KAAK,KAAK,CAAC;;AAG1C,MAAM,cAAc,UAA2B;AAC7C,KAAI,iBAAiB,mBAAmB;AACtC,MAAI,MAAM,iBAAiB,MACzB,QAAO,MAAM,MAAM;AAGrB,SAAO,MAAM;;AAGf,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,QAAO,OAAO,MAAM;;AAGtB,MAAM,oBAA+C,YAA0B,mBAAiC;CAC9G,MAAM,uBAAO,IAAI,KAAa;CAC9B,MA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Q;EACnB,EACF,CAAC;AAEF,KAAI,QAAQ,MACV,OAAM,cAAc,IAAI,QAAQ;AAGlC,SAAQ,IAAI,iCAAiC;AAC7C,OAAM,QAAQ,IAAI,EAAE,kBAAkB,QAAQ,QAAQ,iBAAiB,EAAE,CAAC;AAC1E,SAAQ,IAAI,0CAA0C"}
@@ -26,6 +26,8 @@ import { readFileSync } from "node:fs";
26
26
  */
27
27
  const MAX_IDENTIFIER_LENGTH = 64;
28
28
  const MAX_CONSTRAINT_NAME_LENGTH = 64;
29
+ const MYSQL_MAX_INDEX_BYTES = 3072;
30
+ const UTF8MB4_BYTES_PER_CHAR = 4;
29
31
  const getLatestSnapshot = (metaDir) => {
30
32
  const resolvedMetaDir = resolve(metaDir);
31
33
  const journalPath = join(resolvedMetaDir, "_journal.json");
@@ -35,6 +37,32 @@ const getLatestSnapshot = (metaDir) => {
35
37
  const snapshotPath = join(resolvedMetaDir, `${latestEntry.idx.toString().padStart(4, "0")}_snapshot.json`);
36
38
  return JSON.parse(readFileSync(snapshotPath, "utf-8"));
37
39
  };
40
+ const getTypeByteLength = (columnType) => {
41
+ const normalizedType = columnType.toLowerCase().trim();
42
+ const varcharMatch = normalizedType.match(/^varchar\((\d+)\)$/);
43
+ if (varcharMatch) return Number(varcharMatch[1]) * UTF8MB4_BYTES_PER_CHAR;
44
+ const charMatch = normalizedType.match(/^char\((\d+)\)$/);
45
+ if (charMatch) return Number(charMatch[1]) * UTF8MB4_BYTES_PER_CHAR;
46
+ const varbinaryMatch = normalizedType.match(/^varbinary\((\d+)\)$/);
47
+ if (varbinaryMatch) return Number(varbinaryMatch[1]);
48
+ const binaryMatch = normalizedType.match(/^binary\((\d+)\)$/);
49
+ if (binaryMatch) return Number(binaryMatch[1]);
50
+ if (normalizedType.startsWith("tinyint")) return 1;
51
+ if (normalizedType.startsWith("smallint")) return 2;
52
+ if (normalizedType.startsWith("mediumint")) return 3;
53
+ if (normalizedType.startsWith("int")) return 4;
54
+ if (normalizedType.startsWith("bigint")) return 8;
55
+ if (normalizedType.startsWith("date")) return 3;
56
+ if (normalizedType.startsWith("datetime")) return 8;
57
+ if (normalizedType.startsWith("timestamp")) return 4;
58
+ if (normalizedType.includes("text") || normalizedType === "json" || normalizedType.includes("blob")) return Number.POSITIVE_INFINITY;
59
+ return 0;
60
+ };
61
+ const getKeyTypeLabel = (keyType) => {
62
+ if (keyType === "primary_key") return "Primary Keys";
63
+ if (keyType === "unique") return "Unique Indexes";
64
+ return "Indexes";
65
+ };
38
66
  const validateDatabaseSchema = (options) => {
39
67
  const { metaDir, verbose = false, exitOnComplete = false } = options;
40
68
  const issues = [];
@@ -45,6 +73,22 @@ const validateDatabaseSchema = (options) => {
45
73
  };
46
74
  const snapshot = getLatestSnapshot(metaDir);
47
75
  const tables = Object.values(snapshot.tables);
76
+ const validateIndexWidth = (table, args) => {
77
+ const actualBytes = args.columns.reduce((total, columnName) => {
78
+ const column = table.columns[columnName];
79
+ if (!column) return total;
80
+ return total + getTypeByteLength(column.type);
81
+ }, 0);
82
+ if (actualBytes > MYSQL_MAX_INDEX_BYTES || !Number.isFinite(actualBytes)) issues.push({
83
+ type: "index_width",
84
+ tableName: table.name,
85
+ name: args.name,
86
+ keyType: args.keyType,
87
+ actualBytes,
88
+ maxBytes: MYSQL_MAX_INDEX_BYTES,
89
+ columns: args.columns
90
+ });
91
+ };
48
92
  tables.forEach((table) => {
49
93
  if (table.name.length > MAX_IDENTIFIER_LENGTH) issues.push({
50
94
  type: "table",
@@ -94,6 +138,11 @@ const validateDatabaseSchema = (options) => {
94
138
  maxLength: MAX_CONSTRAINT_NAME_LENGTH,
95
139
  constraintType: "primary_key"
96
140
  });
141
+ validateIndexWidth(table, {
142
+ name: pk.name,
143
+ columns: pk.columns,
144
+ keyType: "primary_key"
145
+ });
97
146
  });
98
147
  Object.values(table.uniqueConstraints).forEach((unique) => {
99
148
  allConstraints.push({
@@ -110,6 +159,11 @@ const validateDatabaseSchema = (options) => {
110
159
  maxLength: MAX_CONSTRAINT_NAME_LENGTH,
111
160
  constraintType: "unique"
112
161
  });
162
+ validateIndexWidth(table, {
163
+ name: unique.name,
164
+ columns: unique.columns,
165
+ keyType: "unique"
166
+ });
113
167
  });
114
168
  Object.values(table.indexes).forEach((index) => {
115
169
  allConstraints.push({
@@ -126,6 +180,11 @@ const validateDatabaseSchema = (options) => {
126
180
  maxLength: MAX_CONSTRAINT_NAME_LENGTH,
127
181
  constraintType: "index"
128
182
  });
183
+ validateIndexWidth(table, {
184
+ name: index.name,
185
+ columns: index.columns,
186
+ keyType: index.isUnique ? "unique" : "index"
187
+ });
129
188
  });
130
189
  });
131
190
  if (verbose) {
@@ -138,9 +197,10 @@ const validateDatabaseSchema = (options) => {
138
197
  });
139
198
  consola.log("");
140
199
  }
141
- consola.box("MySQL Name Length Analysis");
200
+ consola.box("MySQL Schema Analysis");
142
201
  consola.info(`Maximum identifier length: ${MAX_IDENTIFIER_LENGTH} characters`);
143
202
  consola.info(`Maximum constraint name length: ${MAX_CONSTRAINT_NAME_LENGTH} characters`);
203
+ consola.info(`Maximum index key length: ${MYSQL_MAX_INDEX_BYTES} bytes`);
144
204
  consola.info(`Analyzed ${tables.length} tables`);
145
205
  consola.log("");
146
206
  consola.start("Tables analyzed:");
@@ -160,14 +220,15 @@ const validateDatabaseSchema = (options) => {
160
220
  });
161
221
  consola.log("");
162
222
  if (issues.length === 0) {
163
- consola.success("No name length issues found!");
223
+ consola.success("No schema validation issues found!");
164
224
  return finalize(0);
165
225
  }
166
- consola.warn(`Found ${issues.length} name length issue(s):`);
226
+ consola.warn(`Found ${issues.length} schema validation issue(s):`);
167
227
  consola.log("");
168
228
  const tableIssues = issues.filter((i) => i.type === "table");
169
229
  const columnIssues = issues.filter((i) => i.type === "column");
170
230
  const constraintIssues = issues.filter((i) => i.type === "constraint");
231
+ const indexWidthIssues = issues.filter((i) => i.type === "index_width");
171
232
  if (tableIssues.length > 0) {
172
233
  consola.error("Table Name Issues:");
173
234
  tableIssues.forEach((issue) => {
@@ -218,11 +279,33 @@ const validateDatabaseSchema = (options) => {
218
279
  }
219
280
  consola.log("");
220
281
  }
282
+ if (indexWidthIssues.length > 0) {
283
+ consola.error("Index Width Issues:");
284
+ const primaryKeyWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === "primary_key");
285
+ const uniqueWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === "unique");
286
+ const indexOnlyWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === "index");
287
+ for (const issueGroup of [
288
+ primaryKeyWidthIssues,
289
+ uniqueWidthIssues,
290
+ indexOnlyWidthIssues
291
+ ]) {
292
+ if (issueGroup.length === 0) continue;
293
+ consola.log(` ${getKeyTypeLabel(issueGroup[0].keyType)}:`);
294
+ issueGroup.forEach((issue) => {
295
+ const actualBytes = Number.isFinite(issue.actualBytes) ? issue.actualBytes.toString() : "unbounded";
296
+ consola.log(` - ${issue.name} (${actualBytes} bytes, exceeds max by ${Number.isFinite(issue.actualBytes) ? issue.actualBytes - issue.maxBytes : "unknown amount"})`);
297
+ consola.log(` Table: ${issue.tableName}`);
298
+ consola.log(` Columns: ${issue.columns.join(", ")}`);
299
+ });
300
+ }
301
+ consola.log("");
302
+ }
221
303
  consola.box("Summary");
222
304
  consola.info(`Total issues: ${issues.length}`);
223
305
  consola.info(` - Table names: ${tableIssues.length}`);
224
306
  consola.info(` - Column names: ${columnIssues.length}`);
225
307
  consola.info(` - Constraint names: ${constraintIssues.length}`);
308
+ consola.info(` - Index widths: ${indexWidthIssues.length}`);
226
309
  if (constraintIssues.length > 0) {
227
310
  const fkCount = constraintIssues.filter((i) => i.constraintType === "foreign_key").length;
228
311
  const pkCount = constraintIssues.filter((i) => i.constraintType === "primary_key").length;
@@ -233,16 +316,21 @@ const validateDatabaseSchema = (options) => {
233
316
  consola.info(` - Unique constraints: ${uniqueCount}`);
234
317
  consola.info(` - Indexes: ${indexCount}`);
235
318
  }
319
+ if (indexWidthIssues.length > 0) {
320
+ const pkWidthCount = indexWidthIssues.filter((i) => i.keyType === "primary_key").length;
321
+ const uniqueWidthCount = indexWidthIssues.filter((i) => i.keyType === "unique").length;
322
+ const indexWidthCount = indexWidthIssues.filter((i) => i.keyType === "index").length;
323
+ consola.info(` - Primary keys: ${pkWidthCount}`);
324
+ consola.info(` - Unique indexes: ${uniqueWidthCount}`);
325
+ consola.info(` - Indexes: ${indexWidthCount}`);
326
+ }
236
327
  consola.log("");
237
- consola.fail("MIGRATION BLOCKED: Name length violations detected!");
328
+ consola.fail("MIGRATION BLOCKED: Schema validation violations detected!");
238
329
  consola.log("");
239
330
  consola.start("Action required:");
240
331
  consola.log("1. Review the issues listed above");
241
- consola.log("2. Shorten table/column names in your schema definitions");
242
- consola.log("3. For foreign keys, consider:");
243
- consola.log(" - Shortening table names");
244
- consola.log(" - Shortening column names");
245
- consola.log(" - Using shorter referenced table names");
332
+ consola.log("2. Shorten table/column/constraint names where required");
333
+ consola.log("3. Reduce indexed column widths or introduce prefix/hash columns for oversized indexes");
246
334
  consola.log("4. Run 'pnpm generate' again after making changes");
247
335
  consola.log("5. Run this check with --verbose to see all constraint names");
248
336
  consola.log("");
@@ -1 +1 @@
1
- {"version":3,"file":"validate-schema.mjs","names":["entries: JournalEntry[]","issues: NameLengthIssue[]","allConstraints: Array<{ table: string; type: string; name: string; length: number }>","parts: string[]"],"sources":["../../src/db/validateSchema.ts"],"sourcesContent":["/**\r\n * Database Schema Validator\r\n *\r\n * This script validates the database schema by analyzing all MySQL table definitions\r\n * from Drizzle migration metadata and reports any table, column, or constraint names\r\n * that exceed MySQL's maximum length limits.\r\n *\r\n * MySQL Limits:\r\n * - Table/Column names: 64 characters\r\n * - Constraint names: 64 characters\r\n *\r\n * Usage:\r\n * - Basic: pnpm -F scripts validate:db-schema\r\n * - Verbose: pnpm -F scripts validate:db-schema -- --verbose\r\n *\r\n * The verbose mode shows all constraint names being checked, sorted by length.\r\n *\r\n * This validation runs automatically:\r\n * - After `pnpm generate` (blocks if violations found)\r\n * - In CI/CD as part of PR checks\r\n */\r\n\r\nimport { consola } from \"consola\";\r\nimport { readFileSync } from \"node:fs\";\r\nimport { join, resolve } from \"node:path\";\r\n\r\ninterface NameLengthIssue {\r\n type: \"table\" | \"column\" | \"constraint\";\r\n tableName: string;\r\n name: string;\r\n actualLength: number;\r\n maxLength: number;\r\n constraintType?: \"foreign_key\" | \"primary_key\" | \"unique\" | \"index\";\r\n}\r\n\r\ninterface DrizzleSnapshot {\r\n tables: Record<string, DrizzleTable>;\r\n}\r\n\r\ninterface DrizzleTable {\r\n name: string;\r\n columns: Record<string, DrizzleColumn>;\r\n indexes: Record<string, DrizzleIndex>;\r\n foreignKeys: Record<string, DrizzleForeignKey>;\r\n compositePrimaryKeys: Record<string, DrizzlePrimaryKey>;\r\n uniqueConstraints: Record<string, DrizzleUniqueConstraint>;\r\n}\r\n\r\ninterface DrizzleColumn {\r\n name: string;\r\n type: string;\r\n primaryKey: boolean;\r\n notNull: boolean;\r\n autoincrement: boolean;\r\n}\r\n\r\ninterface DrizzleIndex {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\ninterface DrizzleForeignKey {\r\n name: string;\r\n tableFrom: string;\r\n tableTo: string;\r\n columnsFrom: string[];\r\n columnsTo: string[];\r\n}\r\n\r\ninterface DrizzlePrimaryKey {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\ninterface DrizzleUniqueConstraint {\r\n name: string;\r\n columns: string[];\r\n}\r\n\r\nconst MAX_IDENTIFIER_LENGTH = 64;\r\nconst MAX_CONSTRAINT_NAME_LENGTH = 64;\r\n\r\nconst getLatestSnapshot = (metaDir: string): DrizzleSnapshot => {\r\n const resolvedMetaDir = resolve(metaDir);\r\n\r\n // Read the journal to find the latest migration\r\n const journalPath = join(resolvedMetaDir, \"_journal.json\");\r\n const parsedJournal = JSON.parse(readFileSync(journalPath, \"utf-8\"));\r\n\r\n interface JournalEntry {\r\n tag: string;\r\n idx: number;\r\n }\r\n\r\n const entries: JournalEntry[] = parsedJournal.entries;\r\n const latestEntry = entries[entries.length - 1];\r\n\r\n if (!latestEntry) {\r\n throw new Error(\"No migrations found in journal\");\r\n }\r\n\r\n // Read the latest snapshot\r\n const snapshotPath = join(resolvedMetaDir, `${latestEntry.idx.toString().padStart(4, \"0\")}_snapshot.json`);\r\n const parsedSnapshot = JSON.parse(readFileSync(snapshotPath, \"utf-8\"));\r\n const snapshot: DrizzleSnapshot = parsedSnapshot;\r\n\r\n return snapshot;\r\n};\r\n\r\ninterface ValidateDatabaseSchemaOptions {\n metaDir: string;\n verbose?: boolean;\n exitOnComplete?: boolean;\n}\n\nconst validateDatabaseSchema = (options: ValidateDatabaseSchemaOptions): number => {\n const { metaDir, verbose = false, exitOnComplete = false } = options;\n const issues: NameLengthIssue[] = [];\n const allConstraints: Array<{ table: string; type: string; name: string; length: number }> = [];\n const finalize = (exitCode: number): number => {\n if (exitOnComplete) {\n process.exit(exitCode);\n }\n\n return exitCode;\n };\n\r\n const snapshot = getLatestSnapshot(metaDir);\r\n const tables = Object.values(snapshot.tables);\r\n\r\n tables.forEach((table) => {\r\n // Check table name length\r\n if (table.name.length > MAX_IDENTIFIER_LENGTH) {\r\n issues.push({\r\n type: \"table\",\r\n tableName: table.name,\r\n name: table.name,\r\n actualLength: table.name.length,\r\n maxLength: MAX_IDENTIFIER_LENGTH,\r\n });\r\n }\r\n\r\n // Check column name lengths\r\n Object.values(table.columns).forEach((column) => {\r\n if (column.name.length > MAX_IDENTIFIER_LENGTH) {\r\n issues.push({\r\n type: \"column\",\r\n tableName: table.name,\r\n name: column.name,\r\n actualLength: column.name.length,\r\n maxLength: MAX_IDENTIFIER_LENGTH,\r\n });\r\n }\r\n });\r\n\r\n // Check foreign key constraint names\r\n Object.values(table.foreignKeys).forEach((fk) => {\r\n allConstraints.push({ table: table.name, type: \"FK\", name: fk.name, length: fk.name.length });\r\n if (fk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: fk.name,\r\n actualLength: fk.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"foreign_key\",\r\n });\r\n }\r\n });\r\n\r\n // Check primary key constraint names\r\n Object.values(table.compositePrimaryKeys).forEach((pk) => {\r\n const pkType = pk.columns.length > 1 ? \"PK (composite)\" : \"PK\";\r\n allConstraints.push({ table: table.name, type: pkType, name: pk.name, length: pk.name.length });\r\n if (pk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: pk.name,\r\n actualLength: pk.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"primary_key\",\r\n });\r\n }\r\n });\r\n\r\n // Check unique constraint names\r\n Object.values(table.uniqueConstraints).forEach((unique) => {\r\n allConstraints.push({ table: table.name, type: \"UNIQUE\", name: unique.name, length: unique.name.length });\r\n if (unique.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: unique.name,\r\n actualLength: unique.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"unique\",\r\n });\r\n }\r\n });\r\n\r\n // Check index names\r\n Object.values(table.indexes).forEach((index) => {\r\n allConstraints.push({ table: table.name, type: \"INDEX\", name: index.name, length: index.name.length });\r\n if (index.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\r\n issues.push({\r\n type: \"constraint\",\r\n tableName: table.name,\r\n name: index.name,\r\n actualLength: index.name.length,\r\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\r\n constraintType: \"index\",\r\n });\r\n }\r\n });\r\n });\r\n\r\n // Verbose mode: show all constraints checked\r\n if (verbose) {\r\n consola.box(\"All Constraints Checked\");\r\n const sortedConstraints = allConstraints.sort((a, b) => b.length - a.length);\r\n sortedConstraints.forEach((constraint) => {\r\n const exceeds = constraint.length > MAX_CONSTRAINT_NAME_LENGTH;\r\n const lengthStr = `[${constraint.length.toString().padStart(2)} chars]`;\r\n const typeStr = constraint.type.padEnd(15);\r\n const message = `${lengthStr} ${typeStr} ${constraint.name} (${constraint.table})`;\r\n if (exceeds) {\r\n consola.error(message);\r\n } else {\r\n consola.success(message);\r\n }\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n // Print report\r\n consola.box(\"MySQL Name Length Analysis\");\r\n consola.info(`Maximum identifier length: ${MAX_IDENTIFIER_LENGTH} characters`);\r\n consola.info(`Maximum constraint name length: ${MAX_CONSTRAINT_NAME_LENGTH} characters`);\r\n consola.info(`Analyzed ${tables.length} tables`);\r\n consola.log(\"\");\r\n\r\n // Show table summary\r\n consola.start(\"Tables analyzed:\");\r\n tables.forEach((table) => {\r\n const columnCount = Object.keys(table.columns).length;\r\n const fkCount = Object.keys(table.foreignKeys).length;\r\n const pkCount = Object.keys(table.compositePrimaryKeys).length;\r\n const uniqueCount = Object.keys(table.uniqueConstraints).length;\r\n const indexCount = Object.keys(table.indexes).length;\r\n\r\n const parts: string[] = [];\r\n parts.push(`${columnCount} columns`);\r\n if (fkCount > 0) {\r\n parts.push(`${fkCount} FKs`);\r\n }\r\n if (pkCount > 0) {\r\n parts.push(`${pkCount} PKs`);\r\n }\r\n if (uniqueCount > 0) {\r\n parts.push(`${uniqueCount} unique`);\r\n }\r\n if (indexCount > 0) {\r\n parts.push(`${indexCount} indexes`);\r\n }\r\n\r\n consola.log(` - ${table.name} (${parts.join(\", \")})`);\r\n });\r\n consola.log(\"\");\r\n\r\n if (issues.length === 0) {\n consola.success(\"No name length issues found!\");\n return finalize(0);\n }\n\r\n consola.warn(`Found ${issues.length} name length issue(s):`);\r\n consola.log(\"\");\r\n\r\n const tableIssues = issues.filter((i) => i.type === \"table\");\r\n const columnIssues = issues.filter((i) => i.type === \"column\");\r\n const constraintIssues = issues.filter((i) => i.type === \"constraint\");\r\n\r\n if (tableIssues.length > 0) {\r\n consola.error(\"Table Name Issues:\");\r\n tableIssues.forEach((issue) => {\r\n consola.log(\r\n ` - Table: ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n if (columnIssues.length > 0) {\r\n consola.error(\"Column Name Issues:\");\r\n columnIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.tableName}.${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n });\r\n consola.log(\"\");\r\n }\r\n\r\n if (constraintIssues.length > 0) {\r\n consola.error(\"Constraint Name Issues:\");\r\n const fkIssues = constraintIssues.filter((i) => i.constraintType === \"foreign_key\");\r\n const pkIssues = constraintIssues.filter((i) => i.constraintType === \"primary_key\");\r\n const uniqueIssues = constraintIssues.filter((i) => i.constraintType === \"unique\");\r\n const indexIssues = constraintIssues.filter((i) => i.constraintType === \"index\");\r\n\r\n if (fkIssues.length > 0) {\r\n consola.log(\" Foreign Keys:\");\r\n fkIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (pkIssues.length > 0) {\r\n consola.log(\" Primary Keys:\");\r\n pkIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (uniqueIssues.length > 0) {\r\n consola.log(\" Unique Constraints:\");\r\n uniqueIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n\r\n if (indexIssues.length > 0) {\r\n consola.log(\" Indexes:\");\r\n indexIssues.forEach((issue) => {\r\n consola.log(\r\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\r\n );\r\n consola.log(` Table: ${issue.tableName}`);\r\n });\r\n }\r\n consola.log(\"\");\r\n }\r\n\r\n consola.box(\"Summary\");\r\n consola.info(`Total issues: ${issues.length}`);\r\n consola.info(` - Table names: ${tableIssues.length}`);\r\n consola.info(` - Column names: ${columnIssues.length}`);\r\n consola.info(` - Constraint names: ${constraintIssues.length}`);\r\n if (constraintIssues.length > 0) {\r\n const fkCount = constraintIssues.filter((i) => i.constraintType === \"foreign_key\").length;\r\n const pkCount = constraintIssues.filter((i) => i.constraintType === \"primary_key\").length;\r\n const uniqueCount = constraintIssues.filter((i) => i.constraintType === \"unique\").length;\r\n const indexCount = constraintIssues.filter((i) => i.constraintType === \"index\").length;\r\n consola.info(` - Foreign keys: ${fkCount}`);\r\n consola.info(` - Primary keys: ${pkCount}`);\r\n consola.info(` - Unique constraints: ${uniqueCount}`);\r\n consola.info(` - Indexes: ${indexCount}`);\r\n }\r\n consola.log(\"\");\r\n\r\n // Print actionable feedback\r\n consola.fail(\"MIGRATION BLOCKED: Name length violations detected!\");\r\n consola.log(\"\");\r\n consola.start(\"Action required:\");\r\n consola.log(\"1. Review the issues listed above\");\r\n consola.log(\"2. Shorten table/column names in your schema definitions\");\r\n consola.log(\"3. For foreign keys, consider:\");\r\n consola.log(\" - Shortening table names\");\r\n consola.log(\" - Shortening column names\");\r\n consola.log(\" - Using shorter referenced table names\");\r\n consola.log(\"4. Run 'pnpm generate' again after making changes\");\r\n consola.log(\"5. Run this check with --verbose to see all constraint names\");\r\n consola.log(\"\");\r\n\r\n return finalize(1);\n};\n\r\nexport { validateDatabaseSchema };\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,MAAM,wBAAwB;AAC9B,MAAM,6BAA6B;AAEnC,MAAM,qBAAqB,YAAqC;CAC9D,MAAM,kBAAkB,QAAQ,QAAQ;CAGxC,MAAM,cAAc,KAAK,iBAAiB,gBAAgB;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AK,6BAA6B,cAAc;AACxD,UAAQ,KAAK,kBAAkB,aAAa;;AAE9C,SAAQ,IAAI,GAAG;AAGf,SAAQ,KAAK,sDAAsD;AACnE,SAAQ,IAAI,GAAG;AACf,SAAQ,MAAM,mBAAmB;AACjC,SAAQ,IAAI,oCAAoC;AAChD,SAAQ,IAAI,2DAA2D;AACvE,SAAQ,IAAI,iCAAiC;AAC7C,SAAQ,IAAI,8BAA8B;AAC1C,SAAQ,IAAI,+BAA+B;AAC3C,SAAQ,IAAI,4CAA4C;AACxD,SAAQ,IAAI,oDAAoD;AAChE,SAAQ,IAAI,+DAA+D;AAC3E,SAAQ,IAAI,GAAG;AAEf,QAAO,SAAS,EAAE"}
1
+ {"version":3,"file":"validate-schema.mjs","names":["entries: JournalEntry[]","issues: ValidationIssue[]","allConstraints: Array<{ table: string; type: string; name: string; length: number }>","parts: string[]"],"sources":["../../src/db/validateSchema.ts"],"sourcesContent":["/**\n * Database Schema Validator\n *\n * This script validates the database schema by analyzing all MySQL table definitions\n * from Drizzle migration metadata and reports any table, column, or constraint names\n * that exceed MySQL's maximum length limits.\n *\n * MySQL Limits:\n * - Table/Column names: 64 characters\n * - Constraint names: 64 characters\n *\n * Usage:\n * - Basic: pnpm -F scripts validate:db-schema\n * - Verbose: pnpm -F scripts validate:db-schema -- --verbose\n *\n * The verbose mode shows all constraint names being checked, sorted by length.\n *\n * This validation runs automatically:\n * - After `pnpm generate` (blocks if violations found)\n * - In CI/CD as part of PR checks\n */\n\nimport { consola } from \"consola\";\nimport { readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\n\ninterface NameLengthIssue {\n type: \"table\" | \"column\" | \"constraint\";\n tableName: string;\n name: string;\n actualLength: number;\n maxLength: number;\n constraintType?: \"foreign_key\" | \"primary_key\" | \"unique\" | \"index\";\n}\n\ninterface IndexWidthIssue {\n type: \"index_width\";\n tableName: string;\n name: string;\n keyType: \"primary_key\" | \"unique\" | \"index\";\n actualBytes: number;\n maxBytes: number;\n columns: string[];\n}\n\ntype ValidationIssue = NameLengthIssue | IndexWidthIssue;\n\ninterface DrizzleSnapshot {\n tables: Record<string, DrizzleTable>;\n}\n\ninterface DrizzleTable {\n name: string;\n columns: Record<string, DrizzleColumn>;\n indexes: Record<string, DrizzleIndex>;\n foreignKeys: Record<string, DrizzleForeignKey>;\n compositePrimaryKeys: Record<string, DrizzlePrimaryKey>;\n uniqueConstraints: Record<string, DrizzleUniqueConstraint>;\n}\n\ninterface DrizzleColumn {\n name: string;\n type: string;\n primaryKey: boolean;\n notNull: boolean;\n autoincrement: boolean;\n}\n\ninterface DrizzleIndex {\n name: string;\n columns: string[];\n isUnique?: boolean;\n}\n\ninterface DrizzleForeignKey {\n name: string;\n tableFrom: string;\n tableTo: string;\n columnsFrom: string[];\n columnsTo: string[];\n}\n\ninterface DrizzlePrimaryKey {\n name: string;\n columns: string[];\n}\n\ninterface DrizzleUniqueConstraint {\n name: string;\n columns: string[];\n}\n\nconst MAX_IDENTIFIER_LENGTH = 64;\nconst MAX_CONSTRAINT_NAME_LENGTH = 64;\nconst MYSQL_MAX_INDEX_BYTES = 3072;\nconst UTF8MB4_BYTES_PER_CHAR = 4;\n\nconst getLatestSnapshot = (metaDir: string): DrizzleSnapshot => {\n const resolvedMetaDir = resolve(metaDir);\n\n // Read the journal to find the latest migration\n const journalPath = join(resolvedMetaDir, \"_journal.json\");\n const parsedJournal = JSON.parse(readFileSync(journalPath, \"utf-8\"));\n\n interface JournalEntry {\n tag: string;\n idx: number;\n }\n\n const entries: JournalEntry[] = parsedJournal.entries;\n const latestEntry = entries[entries.length - 1];\n\n if (!latestEntry) {\n throw new Error(\"No migrations found in journal\");\n }\n\n // Read the latest snapshot\n const snapshotPath = join(resolvedMetaDir, `${latestEntry.idx.toString().padStart(4, \"0\")}_snapshot.json`);\n const parsedSnapshot = JSON.parse(readFileSync(snapshotPath, \"utf-8\"));\n const snapshot: DrizzleSnapshot = parsedSnapshot;\n\n return snapshot;\n};\n\ninterface ValidateDatabaseSchemaOptions {\n metaDir: string;\n verbose?: boolean;\n exitOnComplete?: boolean;\n}\n\nconst getTypeByteLength = (columnType: string): number => {\n const normalizedType = columnType.toLowerCase().trim();\n\n const varcharMatch = normalizedType.match(/^varchar\\((\\d+)\\)$/);\n if (varcharMatch) {\n return Number(varcharMatch[1]) * UTF8MB4_BYTES_PER_CHAR;\n }\n\n const charMatch = normalizedType.match(/^char\\((\\d+)\\)$/);\n if (charMatch) {\n return Number(charMatch[1]) * UTF8MB4_BYTES_PER_CHAR;\n }\n\n const varbinaryMatch = normalizedType.match(/^varbinary\\((\\d+)\\)$/);\n if (varbinaryMatch) {\n return Number(varbinaryMatch[1]);\n }\n\n const binaryMatch = normalizedType.match(/^binary\\((\\d+)\\)$/);\n if (binaryMatch) {\n return Number(binaryMatch[1]);\n }\n\n if (normalizedType.startsWith(\"tinyint\")) return 1;\n if (normalizedType.startsWith(\"smallint\")) return 2;\n if (normalizedType.startsWith(\"mediumint\")) return 3;\n if (normalizedType.startsWith(\"int\")) return 4;\n if (normalizedType.startsWith(\"bigint\")) return 8;\n if (normalizedType.startsWith(\"date\")) return 3;\n if (normalizedType.startsWith(\"datetime\")) return 8;\n if (normalizedType.startsWith(\"timestamp\")) return 4;\n\n if (normalizedType.includes(\"text\") || normalizedType === \"json\" || normalizedType.includes(\"blob\")) {\n return Number.POSITIVE_INFINITY;\n }\n\n return 0;\n};\n\nconst getKeyTypeLabel = (keyType: IndexWidthIssue[\"keyType\"]): string => {\n if (keyType === \"primary_key\") return \"Primary Keys\";\n if (keyType === \"unique\") return \"Unique Indexes\";\n return \"Indexes\";\n};\n\nconst validateDatabaseSchema = (options: ValidateDatabaseSchemaOptions): number => {\n const { metaDir, verbose = false, exitOnComplete = false } = options;\n const issues: ValidationIssue[] = [];\n const allConstraints: Array<{ table: string; type: string; name: string; length: number }> = [];\n const finalize = (exitCode: number): number => {\n if (exitOnComplete) {\n process.exit(exitCode);\n }\n\n return exitCode;\n };\n\n const snapshot = getLatestSnapshot(metaDir);\n const tables = Object.values(snapshot.tables);\n const validateIndexWidth = (\n table: DrizzleTable,\n args: {\n name: string;\n columns: string[];\n keyType: IndexWidthIssue[\"keyType\"];\n },\n ) => {\n const actualBytes = args.columns.reduce((total, columnName) => {\n const column = table.columns[columnName];\n\n if (!column) {\n return total;\n }\n\n return total + getTypeByteLength(column.type);\n }, 0);\n\n if (actualBytes > MYSQL_MAX_INDEX_BYTES || !Number.isFinite(actualBytes)) {\n issues.push({\n type: \"index_width\",\n tableName: table.name,\n name: args.name,\n keyType: args.keyType,\n actualBytes,\n maxBytes: MYSQL_MAX_INDEX_BYTES,\n columns: args.columns,\n });\n }\n };\n\n tables.forEach((table) => {\n // Check table name length\n if (table.name.length > MAX_IDENTIFIER_LENGTH) {\n issues.push({\n type: \"table\",\n tableName: table.name,\n name: table.name,\n actualLength: table.name.length,\n maxLength: MAX_IDENTIFIER_LENGTH,\n });\n }\n\n // Check column name lengths\n Object.values(table.columns).forEach((column) => {\n if (column.name.length > MAX_IDENTIFIER_LENGTH) {\n issues.push({\n type: \"column\",\n tableName: table.name,\n name: column.name,\n actualLength: column.name.length,\n maxLength: MAX_IDENTIFIER_LENGTH,\n });\n }\n });\n\n // Check foreign key constraint names\n Object.values(table.foreignKeys).forEach((fk) => {\n allConstraints.push({ table: table.name, type: \"FK\", name: fk.name, length: fk.name.length });\n if (fk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\n issues.push({\n type: \"constraint\",\n tableName: table.name,\n name: fk.name,\n actualLength: fk.name.length,\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\n constraintType: \"foreign_key\",\n });\n }\n });\n\n // Check primary key constraint names\n Object.values(table.compositePrimaryKeys).forEach((pk) => {\n const pkType = pk.columns.length > 1 ? \"PK (composite)\" : \"PK\";\n allConstraints.push({ table: table.name, type: pkType, name: pk.name, length: pk.name.length });\n if (pk.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\n issues.push({\n type: \"constraint\",\n tableName: table.name,\n name: pk.name,\n actualLength: pk.name.length,\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\n constraintType: \"primary_key\",\n });\n }\n\n validateIndexWidth(table, {\n name: pk.name,\n columns: pk.columns,\n keyType: \"primary_key\",\n });\n });\n\n // Check unique constraint names\n Object.values(table.uniqueConstraints).forEach((unique) => {\n allConstraints.push({ table: table.name, type: \"UNIQUE\", name: unique.name, length: unique.name.length });\n if (unique.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\n issues.push({\n type: \"constraint\",\n tableName: table.name,\n name: unique.name,\n actualLength: unique.name.length,\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\n constraintType: \"unique\",\n });\n }\n\n validateIndexWidth(table, {\n name: unique.name,\n columns: unique.columns,\n keyType: \"unique\",\n });\n });\n\n // Check index names\n Object.values(table.indexes).forEach((index) => {\n allConstraints.push({ table: table.name, type: \"INDEX\", name: index.name, length: index.name.length });\n if (index.name.length > MAX_CONSTRAINT_NAME_LENGTH) {\n issues.push({\n type: \"constraint\",\n tableName: table.name,\n name: index.name,\n actualLength: index.name.length,\n maxLength: MAX_CONSTRAINT_NAME_LENGTH,\n constraintType: \"index\",\n });\n }\n\n validateIndexWidth(table, {\n name: index.name,\n columns: index.columns,\n keyType: index.isUnique ? \"unique\" : \"index\",\n });\n });\n });\n\n // Verbose mode: show all constraints checked\n if (verbose) {\n consola.box(\"All Constraints Checked\");\n const sortedConstraints = allConstraints.sort((a, b) => b.length - a.length);\n sortedConstraints.forEach((constraint) => {\n const exceeds = constraint.length > MAX_CONSTRAINT_NAME_LENGTH;\n const lengthStr = `[${constraint.length.toString().padStart(2)} chars]`;\n const typeStr = constraint.type.padEnd(15);\n const message = `${lengthStr} ${typeStr} ${constraint.name} (${constraint.table})`;\n if (exceeds) {\n consola.error(message);\n } else {\n consola.success(message);\n }\n });\n consola.log(\"\");\n }\n\n // Print report\n consola.box(\"MySQL Schema Analysis\");\n consola.info(`Maximum identifier length: ${MAX_IDENTIFIER_LENGTH} characters`);\n consola.info(`Maximum constraint name length: ${MAX_CONSTRAINT_NAME_LENGTH} characters`);\n consola.info(`Maximum index key length: ${MYSQL_MAX_INDEX_BYTES} bytes`);\n consola.info(`Analyzed ${tables.length} tables`);\n consola.log(\"\");\n\n // Show table summary\n consola.start(\"Tables analyzed:\");\n tables.forEach((table) => {\n const columnCount = Object.keys(table.columns).length;\n const fkCount = Object.keys(table.foreignKeys).length;\n const pkCount = Object.keys(table.compositePrimaryKeys).length;\n const uniqueCount = Object.keys(table.uniqueConstraints).length;\n const indexCount = Object.keys(table.indexes).length;\n\n const parts: string[] = [];\n parts.push(`${columnCount} columns`);\n if (fkCount > 0) {\n parts.push(`${fkCount} FKs`);\n }\n if (pkCount > 0) {\n parts.push(`${pkCount} PKs`);\n }\n if (uniqueCount > 0) {\n parts.push(`${uniqueCount} unique`);\n }\n if (indexCount > 0) {\n parts.push(`${indexCount} indexes`);\n }\n\n consola.log(` - ${table.name} (${parts.join(\", \")})`);\n });\n consola.log(\"\");\n\n if (issues.length === 0) {\n consola.success(\"No schema validation issues found!\");\n return finalize(0);\n }\n\n consola.warn(`Found ${issues.length} schema validation issue(s):`);\n consola.log(\"\");\n\n const tableIssues = issues.filter((i): i is NameLengthIssue => i.type === \"table\");\n const columnIssues = issues.filter((i): i is NameLengthIssue => i.type === \"column\");\n const constraintIssues = issues.filter((i): i is NameLengthIssue => i.type === \"constraint\");\n const indexWidthIssues = issues.filter((i): i is IndexWidthIssue => i.type === \"index_width\");\n\n if (tableIssues.length > 0) {\n consola.error(\"Table Name Issues:\");\n tableIssues.forEach((issue) => {\n consola.log(\n ` - Table: ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n });\n consola.log(\"\");\n }\n\n if (columnIssues.length > 0) {\n consola.error(\"Column Name Issues:\");\n columnIssues.forEach((issue) => {\n consola.log(\n ` - ${issue.tableName}.${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n });\n consola.log(\"\");\n }\n\n if (constraintIssues.length > 0) {\n consola.error(\"Constraint Name Issues:\");\n const fkIssues = constraintIssues.filter((i) => i.constraintType === \"foreign_key\");\n const pkIssues = constraintIssues.filter((i) => i.constraintType === \"primary_key\");\n const uniqueIssues = constraintIssues.filter((i) => i.constraintType === \"unique\");\n const indexIssues = constraintIssues.filter((i) => i.constraintType === \"index\");\n\n if (fkIssues.length > 0) {\n consola.log(\" Foreign Keys:\");\n fkIssues.forEach((issue) => {\n consola.log(\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n consola.log(` Table: ${issue.tableName}`);\n });\n }\n\n if (pkIssues.length > 0) {\n consola.log(\" Primary Keys:\");\n pkIssues.forEach((issue) => {\n consola.log(\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n consola.log(` Table: ${issue.tableName}`);\n });\n }\n\n if (uniqueIssues.length > 0) {\n consola.log(\" Unique Constraints:\");\n uniqueIssues.forEach((issue) => {\n consola.log(\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n consola.log(` Table: ${issue.tableName}`);\n });\n }\n\n if (indexIssues.length > 0) {\n consola.log(\" Indexes:\");\n indexIssues.forEach((issue) => {\n consola.log(\n ` - ${issue.name} (${issue.actualLength} chars, exceeds max by ${issue.actualLength - issue.maxLength})`,\n );\n consola.log(` Table: ${issue.tableName}`);\n });\n }\n consola.log(\"\");\n }\n\n if (indexWidthIssues.length > 0) {\n consola.error(\"Index Width Issues:\");\n const primaryKeyWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === \"primary_key\");\n const uniqueWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === \"unique\");\n const indexOnlyWidthIssues = indexWidthIssues.filter((issue) => issue.keyType === \"index\");\n\n for (const issueGroup of [primaryKeyWidthIssues, uniqueWidthIssues, indexOnlyWidthIssues]) {\n if (issueGroup.length === 0) {\n continue;\n }\n\n consola.log(` ${getKeyTypeLabel(issueGroup[0]!.keyType)}:`);\n issueGroup.forEach((issue) => {\n const actualBytes = Number.isFinite(issue.actualBytes) ? issue.actualBytes.toString() : \"unbounded\";\n consola.log(\n ` - ${issue.name} (${actualBytes} bytes, exceeds max by ${\n Number.isFinite(issue.actualBytes) ? issue.actualBytes - issue.maxBytes : \"unknown amount\"\n })`,\n );\n consola.log(` Table: ${issue.tableName}`);\n consola.log(` Columns: ${issue.columns.join(\", \")}`);\n });\n }\n\n consola.log(\"\");\n }\n\n consola.box(\"Summary\");\n consola.info(`Total issues: ${issues.length}`);\n consola.info(` - Table names: ${tableIssues.length}`);\n consola.info(` - Column names: ${columnIssues.length}`);\n consola.info(` - Constraint names: ${constraintIssues.length}`);\n consola.info(` - Index widths: ${indexWidthIssues.length}`);\n if (constraintIssues.length > 0) {\n const fkCount = constraintIssues.filter((i) => i.constraintType === \"foreign_key\").length;\n const pkCount = constraintIssues.filter((i) => i.constraintType === \"primary_key\").length;\n const uniqueCount = constraintIssues.filter((i) => i.constraintType === \"unique\").length;\n const indexCount = constraintIssues.filter((i) => i.constraintType === \"index\").length;\n consola.info(` - Foreign keys: ${fkCount}`);\n consola.info(` - Primary keys: ${pkCount}`);\n consola.info(` - Unique constraints: ${uniqueCount}`);\n consola.info(` - Indexes: ${indexCount}`);\n }\n if (indexWidthIssues.length > 0) {\n const pkWidthCount = indexWidthIssues.filter((i) => i.keyType === \"primary_key\").length;\n const uniqueWidthCount = indexWidthIssues.filter((i) => i.keyType === \"unique\").length;\n const indexWidthCount = indexWidthIssues.filter((i) => i.keyType === \"index\").length;\n consola.info(` - Primary keys: ${pkWidthCount}`);\n consola.info(` - Unique indexes: ${uniqueWidthCount}`);\n consola.info(` - Indexes: ${indexWidthCount}`);\n }\n consola.log(\"\");\n\n // Print actionable feedback\n consola.fail(\"MIGRATION BLOCKED: Schema validation violations detected!\");\n consola.log(\"\");\n consola.start(\"Action required:\");\n consola.log(\"1. Review the issues listed above\");\n consola.log(\"2. Shorten table/column/constraint names where required\");\n consola.log(\"3. Reduce indexed column widths or introduce prefix/hash columns for oversized indexes\");\n consola.log(\"4. Run 'pnpm generate' again after making changes\");\n consola.log(\"5. Run this check with --verbose to see all constraint names\");\n consola.log(\"\");\n\n return finalize(1);\n};\n\nexport { validateDatabaseSchema };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,MAAM,wBAAwB;AAC9B,MAAM,6BAA6B;AACnC,MAAM,wBAAwB;AAC9B,MAAM,yBAAyB;AAE/B,MAAM,qBAAqB,YAAqC;CAC9D,MAAM,kBAAkB,QAAQ,QAAQ;CAGxC,MAAM,cAAc,KAAK,iBAAiB,gBAAgB;CAQ1D,MAAMA,UAPgB,KAAK,MAAM,aAAa,aAAa,QAAQ,CAAC,CAOtB;CAC9C,MAAM,cAAc,QAAQ,QAAQ,SAAS;AAE7C,KAAI,CAAC,YACH,OAAM,IAAI,MAAM,iCAAiC;CAInD,MAAM,eAAe,KAAK,iBAAiB,GAAG,YAAY,IAAI,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB;AAI1G,QAHuB,KAAK,MAAM,aAAa,cAAc,QAAQ,CAAC;;AAYxE,MAAM,qBAAqB,eAA+B;CACxD,MAAM,iBAAiB,WAAW,aAAa,CAAC,MAAM;CAEtD,MAAM,eAAe,eAAe,MAAM,qBAAqB;AAC/D,KAAI,aACF,QAAO,OAAO,aAAa,GAAG,GAAG;CAGnC,MAAM,YAAY,eAAe,MAAM,kBAAkB;AACzD,KAAI,UACF,QAAO,OAAO,UAAU,GAAG,GAAG;CAGhC,MAAM,iBAAiB,eAAe,MAAM,uBAAuB;AACnE,KAAI,eACF,QAAO,OAAO,eAAe,GAAG;CAGlC,MAAM,cAAc,eAAe,MAAM,oBAAoB;AAC7D,KAAI,YACF,QAAO,OAAO,YAAY,GAAG;AAG/B,KAAI,eAAe,WAAW,UAAU,CAAE,QAAO;AACjD,KAAI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[
15
- [
16
- "side-effect"
17
- ],
18
- [
19
- "builtin"
20
- ],
21
- [
22
- "external",
23
- "type-external"
24
- ],
25
- [
26
- "internal",
27
- "type-internal"
28
- ],
29
- [
30
- "parent",
31
- "type-parent"
32
- ],
33
- [
34
- "sibling",
35
- "type-sibling"
36
- ],
37
- [
38
- "index",
39
- "type-index"
40
- ]
15
+ ["side-effect"],
16
+ ["builtin"],
17
+ ["external", "type-external"],
18
+ ["internal", "type-internal"],
19
+ ["parent", "type-parent"],
20
+ ["sibling", "type-sibling"],
21
+ ["index", "type-index"]
41
22
  ]
42
23
  }
43
- }
24
+ }
@@ -1,78 +1,69 @@
1
1
  {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "plugins": [
4
- "import",
5
- "typescript",
6
- "unicorn",
7
- "react",
8
- "react-perf",
9
- "oxc",
10
- "node",
11
- "promise"
12
- ],
13
- "env": {
14
- "browser": true
15
- },
16
- "ignorePatterns": [
17
- "packages/*/src/routeTree.gen.ts",
18
- "packages/*/.output",
19
- "packages/*/vite-plugins",
20
- "packages/*/dist",
21
- "packages/common/src/oxlint-plugins",
22
- "**/node_modules"
23
- ],
24
- "settings": {},
25
- "rules": {
26
- "@typescript-eslint/ban-ts-comment": "error",
27
- "@typescript-eslint/no-floating-promises": "off",
28
- "@typescript-eslint/no-explicit-any": "error",
29
- "@typescript-eslint/no-non-null-assertion": "error",
30
- "react/button-has-type": "deny",
31
- "react/rules-of-hooks": "deny",
32
- "no-nested-ternary": "deny",
33
- "react/exhaustive-deps": "deny",
34
- "react/no-unstable-nested-components": "error",
35
- "typescript/no-floating-promises": "off",
36
- "no-unused-vars": "warn",
37
- "typescript/no-import-type-side-effects": "deny",
38
- "@typescript-eslint/consistent-type-imports": "deny",
39
- "conorroberts/no-inline-components": "error",
40
- "conorroberts/no-switch": "error",
41
- "conorroberts/no-delete": "error",
42
- "conorroberts/no-top-level-let": "error",
43
- "conorroberts/no-finally": "error",
44
- "conorroberts/no-react-namespace": "error",
45
- "conorroberts/no-type-cast": "warn",
46
- "conorroberts/no-emoji": "error",
47
- "conorroberts/no-component-date-instantiation": "warn",
48
- "conorroberts/no-component-pure-functions": "warn",
49
- "conorroberts/no-nested-conditionals": "error",
50
- "conorroberts/no-nested-pure-functions": "error",
51
- "conorroberts/jsx-component-pascal-case": "error",
52
- "conorroberts/pretty-props": "error",
53
- "conorroberts/no-array-type": "error",
54
- "conorroberts/no-iife": "error",
55
- "conorroberts/no-promise-then": "error",
56
- "react/self-closing-comp": [
57
- "deny",
58
- {
59
- "html": false
60
- }
61
- ]
62
- },
63
- "overrides": [
64
- {
65
- "files": [
66
- "packages/**/*.test.ts",
67
- "packages/**/*.test.tsx",
68
- "packages/**/*.spec.ts",
69
- "packages/**/*.spec.tsx",
70
- "packages/**/__tests__/**"
71
- ],
72
- "rules": {
73
- "@typescript-eslint/no-explicit-any": "off",
74
- "conorroberts/no-type-cast": "off"
75
- }
76
- }
77
- ]
78
- }
2
+ "$schema": "../node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["import", "typescript", "unicorn", "react", "react-perf", "oxc", "node", "promise"],
4
+ "env": {
5
+ "browser": true
6
+ },
7
+ "ignorePatterns": [
8
+ "packages/*/src/routeTree.gen.ts",
9
+ "packages/*/.output",
10
+ "packages/*/vite-plugins",
11
+ "packages/*/dist",
12
+ "packages/common/src/oxlint-plugins",
13
+ "**/node_modules"
14
+ ],
15
+ "settings": {},
16
+ "rules": {
17
+ "@typescript-eslint/ban-ts-comment": "error",
18
+ "@typescript-eslint/no-floating-promises": "off",
19
+ "@typescript-eslint/no-explicit-any": "error",
20
+ "@typescript-eslint/no-non-null-assertion": "error",
21
+ "react/button-has-type": "deny",
22
+ "react/rules-of-hooks": "deny",
23
+ "no-nested-ternary": "deny",
24
+ "react/exhaustive-deps": "deny",
25
+ "react/no-unstable-nested-components": "error",
26
+ "typescript/no-floating-promises": "off",
27
+ "no-unused-vars": "warn",
28
+ "typescript/no-import-type-side-effects": "deny",
29
+ "@typescript-eslint/consistent-type-imports": "deny",
30
+ "conorroberts/no-inline-components": "error",
31
+ "conorroberts/no-switch": "error",
32
+ "conorroberts/no-delete": "error",
33
+ "conorroberts/no-top-level-let": "error",
34
+ "conorroberts/no-finally": "error",
35
+ "conorroberts/no-react-namespace": "error",
36
+ "conorroberts/no-type-cast": "warn",
37
+ "conorroberts/no-emoji": "error",
38
+ "conorroberts/no-component-date-instantiation": "warn",
39
+ "conorroberts/no-component-pure-functions": "warn",
40
+ "conorroberts/no-nested-conditionals": "error",
41
+ "conorroberts/no-nested-pure-functions": "error",
42
+ "conorroberts/jsx-component-pascal-case": "error",
43
+ "conorroberts/pretty-props": "error",
44
+ "conorroberts/no-array-type": "error",
45
+ "conorroberts/no-iife": "error",
46
+ "conorroberts/no-promise-then": "error",
47
+ "react/self-closing-comp": [
48
+ "deny",
49
+ {
50
+ "html": false
51
+ }
52
+ ]
53
+ },
54
+ "overrides": [
55
+ {
56
+ "files": [
57
+ "packages/**/*.test.ts",
58
+ "packages/**/*.test.tsx",
59
+ "packages/**/*.spec.ts",
60
+ "packages/**/*.spec.tsx",
61
+ "packages/**/__tests__/**"
62
+ ],
63
+ "rules": {
64
+ "@typescript-eslint/no-explicit-any": "off",
65
+ "conorroberts/no-type-cast": "off"
66
+ }
67
+ }
68
+ ]
69
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["JSX_NODE_TYPES","FUNCTION_NODE_TYPES","isNode","isFunctionLike","getFunctionName","expressionContainsJsx","rule","rule","FUNCTION_NODE_TYPES","isNode","isFunctionLike","isComponentName","getFunctionName","rule","JSX_NODE_TYPES","FUNCTION_NODE_TYPES","isNode","isFunctionLike","expressionContainsJsx","rule","FUNCTION_NODE_TYPES","isNode","isFunctionLike","isReactHookCall","containsJSX","accessesEnclosingScope","checkExpressionForScopeAccess","checkNodeForScopeAccess","collectLocalNames","collectPatternNames","containsHooks","isWrappedInHook","isPureFunction","rule","rule","EMOJI_REGEX","VALIBOT_EMOJI_REGEX","rule","rule","rule","isNode","isFunctionLike","FUNCTION_NODE_TYPES","isNode","isFunctionLike","rule","rule","rule","rule","isNode","rule"],"sources":["../../src/oxlint-plugins/jsx-component-pascal-case.js","../../src/oxlint-plugins/no-array-type.js","../../src/oxlint-plugins/no-component-date-instantiation.js","../../src/oxlint-plugins/no-inline-components.js","../../src/oxlint-plugins/no-component-pure-functions.js","../../src/oxlint-plugins/no-delete.js","../../src/oxlint-plugins/no-emoji.js","../../src/oxlint-plugins/no-finally.js","../../src/oxlint-plugins/no-iife.js","../../src/oxlint-plugins/no-nested-conditionals.js","../../src/oxlint-plugins/no-nested-pure-functions.js","../../src/oxlint-plugins/no-promise-then.js","../../src/oxlint-plugins/no-react-namespace.js","../../src/oxlint-plugins/no-switch-plugin.js","../../src/oxlint-plugins/no-top-level-let.js","../../src/oxlint-plugins/no-type-cast.js","../../src/oxlint-plugins/pretty-props.js","../../src/oxlint-plugins/index.js"],"sourcesContent":["import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {string} name\n * @property {boolean} returnsJsx\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isPascalCase = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * Check if a name is a valid higher-order component name (starts with \"with\")\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isHOCName = (name) => typeof name === \"string\" && /^with[A-Z]/.test(name);\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n // Don't enforce naming for functions used as object property values or JSX props\n // These are often callbacks or configuration options, not standalone components\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return \"\";\n }\n\n // Handle functions passed as arguments to calls (e.g., useCallback, useMemo)\n if (parent.type === \"CallExpression\") {\n const callParent = parent.parent;\n if (callParent && isNode(callParent)) {\n if (callParent.type === \"VariableDeclarator\") {\n return callParent.id && callParent.id.type === \"Identifier\" ? callParent.id.name : \"\";\n }\n if (callParent.type === \"AssignmentExpression\") {\n return callParent.left && callParent.left.type === \"Identifier\" ? callParent.left.name : \"\";\n }\n }\n }\n\n return \"\";\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase naming for functions that return JSX elements (components).\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const name = getFunctionName(node);\n\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n name,\n returnsJsx: false,\n };\n\n functionStack.push(fnCtx);\n\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (expressionContainsJsx(node.body)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n // Allow PascalCase or HOC naming (withXxx)\n if (fnCtx.returnsJsx && fnCtx.name && !isPascalCase(fnCtx.name) && !isHOCName(fnCtx.name)) {\n context.report({\n node: fnCtx.node,\n message: `Function '${fnCtx.name}' returns JSX and should use PascalCase naming (e.g., '${fnCtx.name.charAt(0).toUpperCase()}${fnCtx.name.slice(1)}').`,\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument || isFunctionLike(argument)) return;\n\n if (expressionContainsJsx(argument)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n });\n },\n});\n\nexport const jsxComponentPascalCaseRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Array<T> type syntax in favor of T[] syntax\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TSTypeReference(node) {\n if (node.type !== \"TSTypeReference\") return;\n\n // Check if this is an Array type reference\n if (node.typeName?.type === \"Identifier\" && node.typeName.name === \"Array\" && node.typeParameters) {\n context.report({\n node,\n message: \"Use T[] syntax instead of Array<T>\",\n });\n }\n },\n };\n },\n});\n\nexport const noArrayTypeRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.NewExpression} NewExpressionNode\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {FunctionContext | null} parent\n * @property {string} name\n * @property {boolean} returnsJsx\n * @property {NewExpressionNode[]} dateInstantiations\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Check if a function name follows React component naming convention (PascalCase)\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isComponentName = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * Get the name of a function node\n * @param {FunctionLikeNode} node\n * @returns {string}\n */\nconst getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return parent.key && parent.key.type === \"Identifier\" ? parent.key.name : \"\";\n }\n\n return \"\";\n};\n\n/**\n * Check if a node is a JSX element or fragment\n * @param {ESTNode | null | undefined} node\n * @returns {boolean}\n */\nconst isJSXNode = (node) => {\n if (!node || !isNode(node)) return false;\n return node.type === \"JSXElement\" || node.type === \"JSXFragment\";\n};\n\n/**\n * Check if a NewExpression is creating a Date instance\n * @param {NewExpressionNode} node\n * @returns {boolean}\n */\nconst isDateInstantiation = (node) => {\n if (node.callee.type === \"Identifier\" && node.callee.name === \"Date\") {\n return true;\n }\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Date instantiation in the top scope of React components. Date instances declared on every render are bad because they change every render.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const parent = currentFunction();\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n parent,\n name: getFunctionName(node),\n returnsJsx: false,\n dateInstantiations: [],\n };\n\n functionStack.push(fnCtx);\n\n // Check for arrow functions with expression body that returns JSX\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (isJSXNode(node.body)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n // Only report if this is a React component (PascalCase name + returns JSX)\n if (!fnCtx.returnsJsx) return;\n if (!isComponentName(fnCtx.name)) return;\n\n // Report all Date instantiations in the top scope of this component\n for (const dateNode of fnCtx.dateInstantiations) {\n context.report({\n node: dateNode,\n message: `Avoid instantiating Date in the top scope of component '${fnCtx.name}'. Date instances change on every render. Move it inside an effect, event handler, or use useMemo/useCallback.`,\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument) return;\n\n if (isJSXNode(argument)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n /** @param {NewExpressionNode} node */\n const handleNewExpression = (node) => {\n if (!isDateInstantiation(node)) return;\n\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n // Record this Date instantiation - we'll check if it's in top scope when the function exits\n fnCtx.dateInstantiations.push(node);\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n NewExpression(node) {\n if (node.type === \"NewExpression\") handleNewExpression(node);\n },\n });\n },\n});\n\nexport const noComponentDateInstantiationRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.Pattern} ESTPattern\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n * @typedef {import(\"oxlint/plugins\").ESTree.AssignmentExpression} AssignmentExpressionNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} RecordedAssignment\n * @property {ESTExpression} node\n * @property {string[]} names\n */\n\n/**\n * @typedef {object} NestedFunctionRecord\n * @property {FunctionLikeNode} node\n * @property {string} name\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {FunctionContext | null} parent\n * @property {string} name\n * @property {boolean} returnsJsx\n * @property {Set<string>} jsxBindingNames\n * @property {RecordedAssignment[]} jsxAssignments\n * @property {NestedFunctionRecord[]} nestedJsxChildren\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nexport const isComponentName = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nexport const isHookName = (name) => typeof name === \"string\" && name.startsWith(\"use\");\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * @param {ESTNode | null | undefined} node\n * @returns {FunctionLikeNode | null}\n */\nexport const getEnclosingFunction = (node) => {\n const findFunction = (current) => {\n if (!current) return null;\n if (isFunctionLike(current)) {\n return current;\n }\n return findFunction(isNode(current) ? (current.parent ?? null) : null);\n };\n return findFunction(isNode(node) ? (node.parent ?? null) : null);\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst isFunctionUsedAsJsxProp = (node) => {\n const checkJsxProp = (current) => {\n if (!current) return false;\n if (current.type === \"JSXAttribute\") {\n return true;\n }\n if (isFunctionLike(current)) {\n return false;\n }\n return checkJsxProp(isNode(current) ? (current.parent ?? null) : null);\n };\n return checkJsxProp(isNode(node) ? (node.parent ?? null) : null);\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst isFunctionImmediatelyInvoked = (node) => {\n const parent = isNode(node) ? (node.parent ?? null) : null;\n if (!parent) return false;\n\n // Check if the function is the callee of a CallExpression (i.e., it's immediately invoked)\n if (parent.type === \"CallExpression\" && parent.callee === node) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n * @param {Set<string>} bindingNames\n */\nconst expressionProducesJsx = (root, bindingNames) => {\n if (!root) return false;\n if (expressionContainsJsx(root)) return true;\n\n if (!isNode(root)) return false;\n\n const type = root.type;\n\n if (type === \"Identifier\") {\n return bindingNames.has(root.name);\n }\n\n if (type === \"ConditionalExpression\") {\n return expressionProducesJsx(root.consequent, bindingNames) || expressionProducesJsx(root.alternate, bindingNames);\n }\n\n if (type === \"LogicalExpression\") {\n return expressionProducesJsx(root.left, bindingNames) || expressionProducesJsx(root.right, bindingNames);\n }\n\n if (type === \"SequenceExpression\") {\n const expressions = root.expressions ?? [];\n const last = expressions[expressions.length - 1] ?? null;\n return expressionProducesJsx(last, bindingNames);\n }\n\n if (type === \"ArrayExpression\") {\n return root.elements.some((element) => {\n if (!element) return false;\n if (element.type === \"SpreadElement\") {\n return expressionProducesJsx(element.argument, bindingNames);\n }\n return expressionProducesJsx(element, bindingNames);\n });\n }\n\n if (type === \"ParenthesizedExpression\") {\n return expressionProducesJsx(root.expression, bindingNames);\n }\n\n if (type === \"AwaitExpression\" || type === \"UnaryExpression\" || type === \"UpdateExpression\") {\n return expressionProducesJsx(root.argument, bindingNames);\n }\n\n if (\n type === \"TSAsExpression\" ||\n type === \"TSTypeAssertion\" ||\n type === \"TSNonNullExpression\" ||\n type === \"ChainExpression\"\n ) {\n return expressionProducesJsx(root.expression, bindingNames);\n }\n\n if (type === \"CallExpression\") {\n return expressionProducesJsx(root.callee, bindingNames);\n }\n\n if (type === \"MemberExpression\") {\n return expressionProducesJsx(root.object, bindingNames);\n }\n\n return false;\n};\n\n/**\n * @param {ESTPattern | null | undefined} pattern\n * @param {string[]} names\n */\nconst collectBindingNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n const type = pattern.type;\n\n if (type === \"Identifier\") {\n names.push(pattern.name);\n return;\n }\n\n if (type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectBindingNames(element.argument, names);\n } else {\n collectBindingNames(element, names);\n }\n }\n return;\n }\n\n if (type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectBindingNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectBindingNames(property.argument, names);\n }\n }\n return;\n }\n\n if (type === \"AssignmentPattern\") {\n collectBindingNames(pattern.left, names);\n return;\n }\n\n if (type === \"RestElement\") {\n collectBindingNames(pattern.argument, names);\n }\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nexport const getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return parent.key && parent.key.type === \"Identifier\" ? parent.key.name : \"\";\n }\n\n // Handle functions passed as arguments to calls (e.g., useCallback, useMemo)\n if (parent.type === \"CallExpression\") {\n const callParent = parent.parent;\n if (callParent && isNode(callParent)) {\n if (callParent.type === \"VariableDeclarator\") {\n return callParent.id && callParent.id.type === \"Identifier\" ? callParent.id.name : \"\";\n }\n if (callParent.type === \"AssignmentExpression\") {\n return callParent.left && callParent.left.type === \"Identifier\" ? callParent.left.name : \"\";\n }\n }\n }\n\n return \"\";\n};\n\n/**\n * @param {string} name\n */\nconst describeFunction = (name) => (name ? `function '${name}'` : \"this function\");\n\n/**\n * @param {string} name\n */\nconst describeNested = (name) => (name ? `function '${name}'` : \"an anonymous function\");\n\n/**\n * @param {string[]} names\n * @param {string} fnName\n */\nconst createAssignmentMessage = (names, fnName) => {\n const target =\n names.length === 0\n ? \"local variables\"\n : names.length === 1\n ? `local '${names[0]}'`\n : `locals ${names.map((name) => `'${name}'`).join(\", \")}`;\n\n return `Avoid storing JSX in ${target} inside ${describeFunction(fnName)}; return the JSX directly instead.`;\n};\n\n/**\n * @param {string} childName\n * @param {string} parentName\n */\nconst createNestedFunctionMessage = (childName, parentName) =>\n `JSX-returning ${describeNested(childName)} should not be declared inside ${describeFunction(parentName)}. Extract it to module scope.`;\n\n/**\n * @param {string} name\n */\nconst createIIFEMessage = (name) =>\n `JSX-returning ${describeNested(name)} should not be declared as an immediately invoked function expression (IIFE). Extract it to a named function at module scope.`;\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow JSX-returning functions and JSX-valued assignments within other functions that also return JSX.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const parent = currentFunction();\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n parent,\n name: getFunctionName(node),\n returnsJsx: false,\n jsxBindingNames: new Set(),\n jsxAssignments: [],\n nestedJsxChildren: [],\n };\n\n functionStack.push(fnCtx);\n\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (expressionProducesJsx(node.body, fnCtx.jsxBindingNames)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n if (fnCtx.returnsJsx && isFunctionImmediatelyInvoked(fnCtx.node)) {\n context.report({\n node: fnCtx.node,\n message: createIIFEMessage(fnCtx.name),\n });\n return;\n }\n\n if (fnCtx.parent && fnCtx.returnsJsx && fnCtx.name && !isFunctionUsedAsJsxProp(fnCtx.node)) {\n fnCtx.parent.nestedJsxChildren.push({ node: fnCtx.node, name: fnCtx.name });\n }\n\n if (!fnCtx.returnsJsx) return;\n\n for (const assignment of fnCtx.jsxAssignments) {\n context.report({\n node: assignment.node,\n message: createAssignmentMessage(assignment.names, fnCtx.name),\n });\n }\n\n for (const nested of fnCtx.nestedJsxChildren) {\n context.report({\n node: nested.node,\n message: createNestedFunctionMessage(nested.name, fnCtx.name),\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument || isFunctionLike(argument)) return;\n\n if (expressionProducesJsx(argument, fnCtx.jsxBindingNames)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n /** @param {VariableDeclaratorNode} node */\n const handleVariableDeclarator = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const init = node.init;\n if (!init || isFunctionLike(init)) return;\n if (!expressionContainsJsx(init)) return;\n\n const names = [];\n collectBindingNames(node.id, names);\n for (const name of names) {\n fnCtx.jsxBindingNames.add(name);\n }\n\n fnCtx.jsxAssignments.push({ node: init, names });\n };\n\n /** @param {AssignmentExpressionNode} node */\n const handleAssignmentExpression = (node) => {\n if (node.operator !== \"=\") return;\n\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const right = node.right;\n if (!right || isFunctionLike(right)) return;\n if (!expressionContainsJsx(right)) return;\n\n const names = [];\n if (node.left && node.left.type === \"Identifier\") {\n names.push(node.left.name);\n fnCtx.jsxBindingNames.add(node.left.name);\n }\n\n fnCtx.jsxAssignments.push({ node: right, names });\n };\n\n /**\n * @param {import(\"oxlint\").ESTree.CallExpression} node\n */\n const handleCallExpression = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n // Check for array.push(<JSX>)\n if (\n node.callee &&\n node.callee.type === \"MemberExpression\" &&\n node.callee.property &&\n node.callee.property.type === \"Identifier\" &&\n node.callee.property.name === \"push\"\n ) {\n const arrayObject = node.callee.object;\n if (arrayObject && arrayObject.type === \"Identifier\") {\n const arrayName = arrayObject.name;\n\n // Check if any argument contains JSX\n const hasJsxArgument = node.arguments.some((arg) => {\n if (!arg || arg.type === \"SpreadElement\") return false;\n return expressionContainsJsx(arg);\n });\n\n if (hasJsxArgument) {\n fnCtx.jsxBindingNames.add(arrayName);\n fnCtx.jsxAssignments.push({ node: node, names: [arrayName] });\n }\n }\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n AssignmentExpression(node) {\n if (node.type === \"AssignmentExpression\") handleAssignmentExpression(node);\n },\n CallExpression(node) {\n if (node.type === \"CallExpression\") handleCallExpression(node);\n },\n });\n },\n});\n\nexport const noInlineComponentsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\nimport { getFunctionName, getEnclosingFunction, isComponentName } from \"./no-inline-components.js\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Checks if a node is a React Hook call (e.g., useState, useEffect, useCallback)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactHookCall = (node) => {\n if (node.type !== \"CallExpression\") return false;\n\n const callee = node.callee;\n if (!callee) return false;\n\n // Direct hook calls like useState()\n if (callee.type === \"Identifier\" && callee.name.startsWith(\"use\")) {\n return true;\n }\n\n // React.useState(), React.useEffect(), etc.\n if (\n callee.type === \"MemberExpression\" &&\n callee.object &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"React\" &&\n callee.property &&\n callee.property.type === \"Identifier\" &&\n callee.property.name.startsWith(\"use\")\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a node contains JSX\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst containsJSX = (node) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"JSXElement\" || current.type === \"JSXFragment\") {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function accesses variables from its enclosing scope\n * (excluding function parameters and locally declared variables)\n * @param {FunctionLikeNode} node\n * @param {Set<string>} localNames - Names of local variables and parameters\n * @returns {boolean}\n */\nconst accessesEnclosingScope = (node, localNames) => {\n if (!node.body) return false;\n\n const body = node.body;\n\n // For arrow functions with expression bodies\n if (body.type !== \"BlockStatement\") {\n return checkExpressionForScopeAccess(body, localNames);\n }\n\n // For block statements\n return checkNodeForScopeAccess(body, localNames);\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkNodeForScopeAccess = (node, localNames) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n // If we find an identifier reference, check if it's external\n if (current.type === \"Identifier\") {\n const parent = current.parent;\n\n // Skip if this identifier is part of a declaration\n if (\n parent &&\n isNode(parent) &&\n (parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n (parent.type === \"Property\" && parent.key === current))\n ) {\n continue;\n }\n\n // If the identifier is not in our local names, it's from enclosing scope\n if (!localNames.has(current.name)) {\n // Exclude global objects and common globals\n const globalNames = new Set([\n \"console\",\n \"Math\",\n \"Date\",\n \"JSON\",\n \"Object\",\n \"Array\",\n \"String\",\n \"Number\",\n \"Boolean\",\n \"parseInt\",\n \"parseFloat\",\n \"isNaN\",\n \"isFinite\",\n \"undefined\",\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"Map\",\n \"Set\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Symbol\",\n \"Error\",\n \"TypeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n ]);\n\n if (!globalNames.has(current.name)) {\n return true;\n }\n }\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkExpressionForScopeAccess = (node, localNames) => {\n return checkNodeForScopeAccess(node, localNames);\n};\n\n/**\n * Collects all local variable names including parameters\n * @param {FunctionLikeNode} node\n * @returns {Set<string>}\n */\nconst collectLocalNames = (node) => {\n const names = new Set();\n\n // Add parameter names\n if (node.params) {\n for (const param of node.params) {\n collectPatternNames(param, names);\n }\n }\n\n // Add locally declared variables\n if (node.body && node.body.type === \"BlockStatement\") {\n for (const statement of node.body.body) {\n if (statement.type === \"VariableDeclaration\") {\n for (const declarator of statement.declarations) {\n collectPatternNames(declarator.id, names);\n }\n }\n }\n }\n\n return names;\n};\n\n/**\n * @param {import(\"oxlint\").ESTree.Pattern} pattern\n * @param {Set<string>} names\n */\nconst collectPatternNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n if (pattern.type === \"Identifier\") {\n names.add(pattern.name);\n return;\n }\n\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectPatternNames(element.argument, names);\n } else {\n collectPatternNames(element, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectPatternNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectPatternNames(property.argument, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n};\n\n/**\n * Checks if a function is likely a React component\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isReactComponent = (node) => {\n const name = getFunctionName(node);\n\n // Must start with capital letter\n if (!isComponentName(name)) {\n return false;\n }\n\n // Check if it returns JSX or uses hooks\n return containsJSX(node) || containsHooks(node);\n};\n\n/**\n * Checks if a function contains React Hook calls\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst containsHooks = (node) => {\n if (!node.body) return false;\n\n const stack = [node.body];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (isReactHookCall(current)) {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node.body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function is wrapped in a React Hook (useCallback, useMemo, etc.)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isWrappedInHook = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n\n if (parent.type === \"CallExpression\" && isReactHookCall(parent)) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a function is pure (doesn't access component scope, hooks, or JSX)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isPureFunction = (node) => {\n // Must not contain JSX\n if (containsJSX(node)) return false;\n\n // Must not contain hooks\n if (containsHooks(node)) return false;\n\n // Must not be wrapped in a hook like useCallback or useMemo\n if (isWrappedInHook(node)) return false;\n\n // Must not access variables from enclosing scope (except globals)\n const localNames = collectLocalNames(node);\n if (accessesEnclosingScope(node, localNames)) return false;\n\n return true;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Recommend extracting pure functions from React components to module scope for better performance and readability.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * @param {VariableDeclaratorNode} node\n */\n const handleVariableDeclarator = (node) => {\n // Only check arrow functions and function expressions\n const init = node.init;\n if (!init || !isFunctionLike(init)) return;\n\n // Get the enclosing function (should be a component)\n const enclosingFunction = getEnclosingFunction(node);\n if (!enclosingFunction) return;\n\n // The enclosing function must be a React component\n if (!isReactComponent(enclosingFunction)) return;\n\n // Check if the inner function is pure\n if (!isPureFunction(init)) return;\n\n const functionName = node.id && node.id.type === \"Identifier\" ? node.id.name : \"this function\";\n const componentName = getFunctionName(enclosingFunction);\n\n context.report({\n node: init,\n message: `Pure function '${functionName}' can be extracted outside of component '${componentName}' to improve performance and readability.`,\n });\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n });\n },\n});\n\nexport const noComponentPureFunctionsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the 'delete' operator\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n UnaryExpression(node) {\n if (node.type !== \"UnaryExpression\") return;\n\n if (node.operator === \"delete\") {\n context.report({\n node,\n message:\n \"Use of 'delete' operator is disallowed. Use object destructuring or set properties to undefined instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noDeleteRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\nimport { EMOJI_REGEX as VALIBOT_EMOJI_REGEX } from \"valibot\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\n/**\n * Regex pattern to match emojis within a string\n * Based on valibot's EMOJI_REGEX but without anchors and with global flag\n */\nconst EMOJI_REGEX = new RegExp(VALIBOT_EMOJI_REGEX.source.slice(1, -1), \"gu\");\n\n/**\n * Find emojis in a string\n * @param {string} text\n * @returns {RegExpMatchArray | null}\n */\nconst findEmojis = (text) => {\n return text.match(EMOJI_REGEX);\n};\n\n/**\n * Get a preview of the emoji found\n * @param {string} text\n * @returns {string}\n */\nconst getEmojiPreview = (text) => {\n const emojis = findEmojis(text);\n if (!emojis || emojis.length === 0) return \"\";\n\n const uniqueEmojis = [...new Set(emojis)];\n const preview = uniqueEmojis.slice(0, 3).join(\" \");\n\n return uniqueEmojis.length > 3 ? `${preview} ...` : preview;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the use of emojis in code. Use icons from a component library instead.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * Check string literals\n * @param {ESTNode} node\n */\n StringLiteral(node) {\n if (node.type !== \"StringLiteral\") return;\n\n const emojis = findEmojis(node.value);\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(node.value);\n context.report({\n node,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n },\n\n /**\n * Check template literals\n * @param {ESTNode} node\n */\n TemplateLiteral(node) {\n if (node.type !== \"TemplateLiteral\") return;\n\n // Check each quasi (template string part)\n for (const quasi of node.quasis) {\n if (quasi.type !== \"TemplateElement\") continue;\n\n const text = quasi.value.raw;\n const emojis = findEmojis(text);\n\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(text);\n context.report({\n node: quasi,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n }\n },\n\n /**\n * Check JSX text\n * @param {ESTNode} node\n */\n JSXText(node) {\n if (node.type !== \"JSXText\") return;\n\n const emojis = findEmojis(node.value);\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(node.value);\n context.report({\n node,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n },\n });\n },\n});\n\nexport const noEmojiRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow 'finally' blocks in try/catch/finally statements\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n TryStatement(node) {\n if (node.type !== \"TryStatement\") return;\n\n if (node.finalizer) {\n context.report({\n node: node.finalizer,\n message: \"Use of 'finally' blocks is disallowed. Handle cleanup explicitly in try/catch blocks instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noFinallyRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Immediately Invoked Function Expressions (IIFE)\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n CallExpression(node) {\n if (node.type !== \"CallExpression\") return;\n\n const { callee } = node;\n\n // Check if callee is a FunctionExpression or ArrowFunctionExpression\n if (callee.type === \"FunctionExpression\" || callee.type === \"ArrowFunctionExpression\") {\n context.report({\n node,\n message:\n \"Immediately Invoked Function Expressions (IIFE) are disallowed. Use a regular function declaration or block scope instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noIifeRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst DEFAULT_MAX_DEPTH = 2;\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isFunctionLike = (node) =>\n node.type === \"FunctionDeclaration\" || node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\";\n\n/**\n * Treat standalone blocks as separate scopes. Blocks used as conditional/loop bodies\n * do not reset nesting depth.\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isStandaloneBlock = (node) => {\n if (node.type !== \"BlockStatement\") return false;\n\n const parent = node.parent;\n if (!isNode(parent)) return false;\n\n return parent.type === \"Program\" || parent.type === \"BlockStatement\";\n};\n\n/**\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isElseIf = (node) => {\n if (node.type !== \"IfStatement\") return false;\n const parent = node.parent;\n if (!isNode(parent) || parent.type !== \"IfStatement\") return false;\n return parent.alternate === node;\n};\n\nexport const noNestedConditionalsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow nesting conditionals more than a configured depth within a single scope\",\n recommended: true,\n },\n schema: [\n {\n type: \"object\",\n properties: {\n maxDepth: {\n type: \"integer\",\n minimum: 1,\n },\n },\n additionalProperties: false,\n },\n ],\n },\n createOnce(context) {\n const maxDepth = DEFAULT_MAX_DEPTH;\n\n const scopeStack = [];\n\n const enterScope = () => {\n scopeStack.push({ depth: 0, increments: [] });\n };\n\n const exitScope = () => {\n scopeStack.pop();\n };\n\n const currentScope = () => scopeStack[scopeStack.length - 1];\n\n /** @param {ESTNode} node */\n const enterConditional = (node) => {\n const scope = currentScope();\n if (!scope) return;\n\n const increment = isElseIf(node) ? 0 : 1;\n const nextDepth = scope.depth + increment;\n\n if (nextDepth > maxDepth) {\n context.report({\n node,\n message: `Avoid nesting conditionals more than ${maxDepth} levels within the same scope. Prefer early returns or extract branches into separate functions.`,\n });\n }\n\n scope.depth = nextDepth;\n scope.increments.push(increment);\n };\n\n const exitConditional = () => {\n const scope = currentScope();\n if (!scope) return;\n\n const increment = scope.increments.pop();\n if (increment === undefined) return;\n\n scope.depth -= increment;\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n Program() {\n enterScope();\n },\n \"Program:exit\"() {\n exitScope();\n },\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"FunctionDeclaration:exit\"() {\n exitScope();\n },\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"FunctionExpression:exit\"() {\n exitScope();\n },\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"ArrowFunctionExpression:exit\"() {\n exitScope();\n },\n BlockStatement(node) {\n if (isStandaloneBlock(node)) enterScope();\n },\n \"BlockStatement:exit\"(node) {\n if (isStandaloneBlock(node)) exitScope();\n },\n IfStatement(node) {\n if (node.type === \"IfStatement\") enterConditional(node);\n },\n \"IfStatement:exit\"() {\n exitConditional();\n },\n ConditionalExpression(node) {\n if (node.type === \"ConditionalExpression\") enterConditional(node);\n },\n \"ConditionalExpression:exit\"() {\n exitConditional();\n },\n SwitchStatement(node) {\n if (node.type === \"SwitchStatement\") enterConditional(node);\n },\n \"SwitchStatement:exit\"() {\n exitConditional();\n },\n });\n },\n});\n","import { defineRule } from \"oxlint/plugins\";\nimport { getFunctionName, getEnclosingFunction } from \"./no-inline-components.js\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Checks if a node is a React Hook call (e.g., useState, useEffect, useCallback)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactHookCall = (node) => {\n if (node.type !== \"CallExpression\") return false;\n\n const callee = node.callee;\n if (!callee) return false;\n\n // Direct hook calls like useState()\n if (callee.type === \"Identifier\" && callee.name.startsWith(\"use\")) {\n return true;\n }\n\n // React.useState(), React.useEffect(), etc.\n if (\n callee.type === \"MemberExpression\" &&\n callee.object &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"React\" &&\n callee.property &&\n callee.property.type === \"Identifier\" &&\n callee.property.name.startsWith(\"use\")\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a node contains JSX\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst containsJSX = (node) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"JSXElement\" || current.type === \"JSXFragment\") {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function accesses variables from its enclosing scope\n * (excluding function parameters and locally declared variables)\n * @param {FunctionLikeNode} node\n * @param {Set<string>} localNames - Names of local variables and parameters\n * @returns {boolean}\n */\nconst accessesEnclosingScope = (node, localNames) => {\n if (!node.body) return false;\n\n const body = node.body;\n\n // For arrow functions with expression bodies\n if (body.type !== \"BlockStatement\") {\n return checkExpressionForScopeAccess(body, localNames);\n }\n\n // For block statements\n return checkNodeForScopeAccess(body, localNames);\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkNodeForScopeAccess = (node, localNames) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n // If we find an identifier reference, check if it's external\n if (current.type === \"Identifier\") {\n const parent = current.parent;\n\n // Skip if this identifier is part of a declaration\n if (\n parent &&\n isNode(parent) &&\n (parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n (parent.type === \"Property\" && parent.key === current))\n ) {\n continue;\n }\n\n // If the identifier is not in our local names, it's from enclosing scope\n if (!localNames.has(current.name)) {\n // Exclude global objects and common globals\n const globalNames = new Set([\n \"console\",\n \"Math\",\n \"Date\",\n \"JSON\",\n \"Object\",\n \"Array\",\n \"String\",\n \"Number\",\n \"Boolean\",\n \"parseInt\",\n \"parseFloat\",\n \"isNaN\",\n \"isFinite\",\n \"undefined\",\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"Map\",\n \"Set\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Symbol\",\n \"Error\",\n \"TypeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n ]);\n\n if (!globalNames.has(current.name)) {\n return true;\n }\n }\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkExpressionForScopeAccess = (node, localNames) => {\n return checkNodeForScopeAccess(node, localNames);\n};\n\n/**\n * Collects all local variable names including parameters\n * @param {FunctionLikeNode} node\n * @returns {Set<string>}\n */\nconst collectLocalNames = (node) => {\n const names = new Set();\n\n // Add parameter names\n if (node.params) {\n for (const param of node.params) {\n collectPatternNames(param, names);\n }\n }\n\n // Add locally declared variables\n if (node.body && node.body.type === \"BlockStatement\") {\n for (const statement of node.body.body) {\n if (statement.type === \"VariableDeclaration\") {\n for (const declarator of statement.declarations) {\n collectPatternNames(declarator.id, names);\n }\n }\n }\n }\n\n return names;\n};\n\n/**\n * @param {import(\"oxlint\").ESTree.Pattern} pattern\n * @param {Set<string>} names\n */\nconst collectPatternNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n if (pattern.type === \"Identifier\") {\n names.add(pattern.name);\n return;\n }\n\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectPatternNames(element.argument, names);\n } else {\n collectPatternNames(element, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectPatternNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectPatternNames(property.argument, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n};\n\n/**\n * Checks if a function contains React Hook calls\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst containsHooks = (node) => {\n if (!node.body) return false;\n\n const stack = [node.body];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (isReactHookCall(current)) {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node.body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function is wrapped in a React Hook (useCallback, useMemo, etc.)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isWrappedInHook = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n\n if (parent.type === \"CallExpression\" && isReactHookCall(parent)) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a function is pure (doesn't access enclosing scope, hooks, or JSX)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isPureFunction = (node) => {\n // Must not contain JSX\n if (containsJSX(node)) return false;\n\n // Must not contain hooks\n if (containsHooks(node)) return false;\n\n // Must not be wrapped in a hook like useCallback or useMemo\n if (isWrappedInHook(node)) return false;\n\n // Must not access variables from enclosing scope (except globals)\n const localNames = collectLocalNames(node);\n if (accessesEnclosingScope(node, localNames)) return false;\n\n return true;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Prevent declaring named pure functions inside other functions. Pure functions should be extracted to module scope for better performance and reusability.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * @param {VariableDeclaratorNode} node\n */\n const handleVariableDeclarator = (node) => {\n // Only check arrow functions and function expressions\n const init = node.init;\n if (!init || !isFunctionLike(init)) return;\n\n // Must be named\n if (!node.id || node.id.type !== \"Identifier\") return;\n const functionName = node.id.name;\n\n // Get the enclosing function\n const enclosingFunction = getEnclosingFunction(node);\n if (!enclosingFunction) return;\n\n // Check if the inner function is pure\n if (!isPureFunction(init)) return;\n\n const enclosingFunctionName = getFunctionName(enclosingFunction);\n\n context.report({\n node: init,\n message: `Named pure function '${functionName}' should not be declared inside '${enclosingFunctionName}'. Extract it to module scope.`,\n });\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n });\n },\n});\n\nexport const noNestedPureFunctionsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow using .then() and .catch() on promises. Use async/await instead.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n CallExpression(node) {\n if (node.type !== \"CallExpression\") return;\n\n // Check if this is a method call (e.g., promise.then())\n if (node.callee.type !== \"MemberExpression\") return;\n\n const memberExpression = node.callee;\n\n // Check if the property being called is \"then\" or \"catch\"\n if (memberExpression.property.type === \"Identifier\" && (memberExpression.property.name === \"then\" || memberExpression.property.name === \"catch\")) {\n context.report({\n node,\n message: `Avoid using .${memberExpression.property.name}() on promises. Use async/await instead.`,\n });\n }\n },\n });\n },\n});\n\nexport const noPromiseThenRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\n/**\n * Check if a MemberExpression is accessing the React namespace\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactNamespaceAccess = (node) => {\n if (node.type !== \"MemberExpression\") return false;\n\n const object = node.object;\n if (!object || object.type !== \"Identifier\" || object.name !== \"React\") {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if this is a type annotation context (TypeScript)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isTypeContext = (node) => {\n const checkParent = (current) => {\n if (!current) return false;\n\n // Type annotation contexts where React namespace is allowed\n const typeContextTypes = new Set([\n \"TSTypeReference\",\n \"TSTypeAnnotation\",\n \"TSTypeParameterInstantiation\",\n \"TSInterfaceHeritage\",\n \"TSTypeQuery\",\n \"TSTypeAliasDeclaration\",\n \"TSInterfaceDeclaration\",\n \"TSTypeLiteral\",\n \"TSPropertySignature\",\n \"TSIndexSignature\",\n \"TSMethodSignature\",\n \"TSCallSignatureDeclaration\",\n \"TSConstructSignatureDeclaration\",\n \"TSExpressionWithTypeArguments\",\n ]);\n\n if (typeContextTypes.has(current.type)) {\n return true;\n }\n\n // Stop at statement or expression boundaries\n if (\n current.type === \"ExpressionStatement\" ||\n current.type === \"VariableDeclarator\" ||\n current.type === \"CallExpression\" ||\n current.type === \"ReturnStatement\"\n ) {\n return false;\n }\n\n return checkParent(current.parent);\n };\n\n return checkParent(node.parent);\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow using the React namespace for accessing React APIs. Use destructured imports instead (e.g., import { useState } from 'react').\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n MemberExpression(node) {\n if (node.type !== \"MemberExpression\") return;\n\n if (!isReactNamespaceAccess(node)) return;\n\n // Allow React namespace in type annotations\n if (isTypeContext(node)) return;\n\n const propertyName = node.property && node.property.type === \"Identifier\" ? node.property.name : \"property\";\n\n context.report({\n node,\n message: `Avoid using 'React.${propertyName}'. Import '${propertyName}' directly from 'react' instead (e.g., import { ${propertyName} } from 'react').`,\n });\n },\n });\n },\n});\n\nexport const noReactNamespaceRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nexport const noSwitchRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow switch/case statements\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n SwitchStatement(node) {\n if (node.type !== \"SwitchStatement\") return;\n\n context.report({\n node,\n message: \"Use of switch/case is disallowed. Use object map or if/else instead.\",\n });\n },\n });\n },\n});\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow `let` keyword everywhere except at module scope and in for loop initializers.\",\n recommended: false,\n },\n schema: [],\n messages: {\n noLet: \"Avoid `let`. Use `const`, or limit `let` to module scope or `for` loop initializers.\",\n topLevelMutation:\n \"Do not mutate properties of top-level const `{{name}}`. Move the mutable state into a function or update immutably (create a new object/array).\",\n },\n },\n\n createOnce(context) {\n /** @type {Set<string>} */\n const topLevelMutableBindings = new Set();\n\n /**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\n const isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n /**\n * @param {ESTNode} node\n * @returns {boolean}\n */\n const isTopLevelVariableDeclaration = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n if (parent.type === \"Program\") return true;\n if (parent.type === \"ExportNamedDeclaration\" && parent.parent?.type === \"Program\") {\n return true;\n }\n return false;\n };\n\n /**\n * @param {ESTNode | null | undefined} node\n * @returns {boolean}\n */\n const isMutableObjectInit = (node) => {\n if (!node || !isNode(node)) return false;\n if (node.type === \"ObjectExpression\" || node.type === \"ArrayExpression\") {\n return true;\n }\n if (node.type === \"NewExpression\" && node.callee?.type === \"Identifier\") {\n return [\"Map\", \"Set\", \"WeakMap\", \"WeakSet\"].includes(node.callee.name);\n }\n return false;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {ESTNode | null}\n */\n const unwrapExpression = (node) => {\n let current = node;\n while (current && isNode(current)) {\n if (current.type === \"TSAsExpression\" || current.type === \"TSNonNullExpression\") {\n current = current.expression;\n continue;\n }\n return current;\n }\n return null;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {string | null}\n */\n const getMemberRootName = (node) => {\n let current = unwrapExpression(node);\n while (current && isNode(current)) {\n if (current.type === \"MemberExpression\") {\n current = unwrapExpression(current.object);\n continue;\n }\n if (current.type === \"Identifier\") {\n return current.name;\n }\n return null;\n }\n return null;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {string | null}\n */\n const getMemberPropertyName = (node) => {\n if (!isNode(node) || node.type !== \"MemberExpression\") return null;\n if (node.property?.type === \"Identifier\" && node.computed === false) {\n return node.property.name;\n }\n if (node.property?.type === \"Literal\" && typeof node.property.value === \"string\") {\n return node.property.value;\n }\n return null;\n };\n\n const mutatingMethods = new Set([\n \"push\",\n \"pop\",\n \"splice\",\n \"shift\",\n \"unshift\",\n \"sort\",\n \"reverse\",\n \"copyWithin\",\n \"fill\",\n \"set\",\n \"add\",\n \"delete\",\n \"clear\",\n ]);\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} rawNode\n */\n VariableDeclaration(rawNode) {\n if (rawNode.type !== \"VariableDeclaration\") return;\n const node = rawNode;\n\n if (node.kind !== \"let\") return;\n\n // Allow let at module scope\n if (isTopLevelVariableDeclaration(node)) return;\n\n // Allow let in for loop initializers\n const parent = node.parent;\n if (parent) {\n // For traditional for loops, check init property\n if (parent.type === \"ForStatement\" && parent.init === node) {\n return;\n }\n // For for-in and for-of loops, check left property\n if ((parent.type === \"ForInStatement\" || parent.type === \"ForOfStatement\") && parent.left === node) {\n return;\n }\n }\n\n context.report({\n node,\n messageId: \"noLet\",\n });\n },\n\n /**\n * Track top-level const bindings initialized with mutable objects.\n * @param {ESTNode} rawNode\n */\n VariableDeclarator(rawNode) {\n if (rawNode.type !== \"VariableDeclarator\") return;\n const declarator = rawNode;\n const declaration = declarator.parent;\n if (!declaration || !isNode(declaration) || declaration.type !== \"VariableDeclaration\") {\n return;\n }\n if (declaration.kind !== \"const\") return;\n if (!isTopLevelVariableDeclaration(declaration)) return;\n if (!isMutableObjectInit(declarator.init)) return;\n if (declarator.id?.type !== \"Identifier\") return;\n\n topLevelMutableBindings.add(declarator.id.name);\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n AssignmentExpression(rawNode) {\n if (rawNode.type !== \"AssignmentExpression\") return;\n const left = rawNode.left;\n if (!left || !isNode(left) || left.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(left);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n UpdateExpression(rawNode) {\n if (rawNode.type !== \"UpdateExpression\") return;\n const argument = rawNode.argument;\n if (!argument || !isNode(argument) || argument.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(argument);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n CallExpression(rawNode) {\n if (rawNode.type !== \"CallExpression\") return;\n const callee = rawNode.callee;\n if (!callee || !isNode(callee) || callee.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(callee);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n const methodName = getMemberPropertyName(callee);\n if (!methodName || !mutatingMethods.has(methodName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n });\n },\n});\n\nexport const noTopLevelLetRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow TypeScript type assertions (`as` and angle-bracket syntax) to prevent unsafe type casting.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} rawNode\n */\n TSAsExpression(rawNode) {\n if (rawNode.type !== \"TSAsExpression\") return;\n\n // Allow \"as const\" assertions\n if (\n rawNode.typeAnnotation.type === \"TSTypeReference\" &&\n rawNode.typeAnnotation.typeName.type === \"Identifier\" &&\n rawNode.typeAnnotation.typeName.name === \"const\"\n ) {\n return;\n }\n\n context.report({\n node: rawNode,\n message:\n \"Type casting with `as` is not permitted. Use runtime validation with valibot or refactor to avoid type casting.\",\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n TSTypeAssertion(rawNode) {\n if (rawNode.type !== \"TSTypeAssertion\") return;\n\n context.report({\n node: rawNode,\n message:\n \"Type casting with angle brackets `<Type>` is not permitted. Use runtime validation with valibot or refactor to avoid type casting.\",\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n TSNonNullExpression(rawNode) {\n if (rawNode.type !== \"TSNonNullExpression\") return;\n\n context.report({\n node: rawNode,\n message:\n \"Non-null assertion operator `!` is not permitted. Handle null/undefined cases explicitly or use optional chaining.\",\n });\n },\n });\n },\n});\n\nexport const noTypeCastRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Check if an expression contains JSX\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Check if a function returns JSX\n * @param {FunctionLikeNode} node\n */\nconst functionReturnsJsx = (node) => {\n // Check arrow functions with expression body\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n return expressionContainsJsx(node.body);\n }\n\n // Check for return statements in function body\n const body = node.body;\n if (!body || body.type !== \"BlockStatement\") return false;\n\n const stack = [body];\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"ReturnStatement\") {\n const argument = current.argument;\n if (argument && expressionContainsJsx(argument)) {\n return true;\n }\n }\n\n // Don't traverse into nested functions\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce consistent props parameter naming and disallow destructuring in component parameters.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * Check if a node is at the top level of the file (module scope)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\n const isTopLevel = (node) => {\n let current = node.parent;\n\n while (current && isNode(current)) {\n // If we hit a Program node, we're at the top level\n if (current.type === \"Program\") {\n return true;\n }\n\n // FunctionDeclarations at the Program level will have Program as parent\n if (node.type === \"FunctionDeclaration\" && current.type === \"Program\") {\n return true;\n }\n\n // For variable declarations: const MyComponent = () => {}\n // The hierarchy is: ArrowFunction -> VariableDeclarator -> VariableDeclaration -> Program\n if (current.type === \"VariableDeclaration\") {\n const parent = current.parent;\n if (parent && isNode(parent) && parent.type === \"Program\") {\n return true;\n }\n }\n\n // If we encounter a function, we're inside a nested function\n if (FUNCTION_NODE_TYPES.has(current.type)) {\n return false;\n }\n\n current = current.parent;\n }\n\n return false;\n };\n\n /**\n * Check if a function is a top-level React component (PascalCase naming at top level)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\n const isTopLevelReactComponent = (node) => {\n // First check if it's at the top level\n if (!isTopLevel(node)) {\n return false;\n }\n\n // Check for named functions (FunctionDeclaration, FunctionExpression with id)\n if (node.id?.name) {\n const firstChar = node.id.name.charAt(0);\n return firstChar === firstChar.toUpperCase();\n }\n\n // For arrow functions and anonymous function expressions, check the parent context\n // to see if they're assigned to a PascalCase variable\n const parent = node.parent;\n if (!parent || !isNode(parent)) {\n return false;\n }\n\n // Check for variable declarations: const MyComponent = () => {}\n if (parent.type === \"VariableDeclarator\" && parent.id && \"name\" in parent.id) {\n const name = parent.id.name;\n if (typeof name === \"string\") {\n const firstChar = name.charAt(0);\n return firstChar === firstChar.toUpperCase();\n }\n }\n\n return false;\n };\n\n /**\n * @param {FunctionLikeNode} node\n */\n const checkFunction = (node) => {\n // Only check functions that return JSX (React components)\n if (!functionReturnsJsx(node)) {\n return;\n }\n\n // Only check functions that are top-level React components (PascalCase naming at top level)\n if (!isTopLevelReactComponent(node)) {\n return;\n }\n\n const params = node.params;\n if (!params || params.length === 0) {\n return;\n }\n\n const firstParam = params[0];\n if (!firstParam || !isNode(firstParam)) {\n return;\n }\n\n // Check if the first parameter is destructured\n if (firstParam.type === \"ObjectPattern\" || firstParam.type === \"ArrayPattern\") {\n context.report({\n node: firstParam,\n message:\n \"Props should not be destructured in the component parameter. Use 'props' instead and destructure inside the component body.\",\n });\n return;\n }\n\n // Check if the first parameter is an Identifier and is named 'props'\n if (firstParam.type === \"Identifier\") {\n if (firstParam.name !== \"props\") {\n context.report({\n node: firstParam,\n message: `Props parameter should be named 'props', not '${firstParam.name}'.`,\n });\n }\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n FunctionExpression(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n });\n },\n});\n\nexport const prettyPropsRule = rule;\n","import { definePlugin } from \"oxlint/plugins\";\n\nimport { jsxComponentPascalCaseRule } from \"./jsx-component-pascal-case.js\";\nimport { noArrayTypeRule } from \"./no-array-type.js\";\nimport { noComponentDateInstantiationRule } from \"./no-component-date-instantiation.js\";\nimport { noComponentPureFunctionsRule } from \"./no-component-pure-functions.js\";\nimport { noDeleteRule } from \"./no-delete.js\";\nimport { noEmojiRule } from \"./no-emoji.js\";\nimport { noFinallyRule } from \"./no-finally.js\";\nimport { noIifeRule } from \"./no-iife.js\";\nimport { noInlineComponentsRule } from \"./no-inline-components.js\";\nimport { noNestedConditionalsRule } from \"./no-nested-conditionals.js\";\nimport { noNestedPureFunctionsRule } from \"./no-nested-pure-functions.js\";\nimport { noPromiseThenRule } from \"./no-promise-then.js\";\nimport { noReactNamespaceRule } from \"./no-react-namespace.js\";\nimport { noSwitchRule } from \"./no-switch-plugin.js\";\nimport { noTopLevelLetRule } from \"./no-top-level-let.js\";\nimport { noTypeCastRule } from \"./no-type-cast.js\";\nimport { prettyPropsRule } from \"./pretty-props.js\";\n\nconst plugin = definePlugin({\n meta: {\n name: \"conorroberts\",\n },\n rules: {\n \"jsx-component-pascal-case\": jsxComponentPascalCaseRule,\n \"no-array-type\": noArrayTypeRule,\n \"no-component-date-instantiation\": noComponentDateInstantiationRule,\n \"no-component-pure-functions\": noComponentPureFunctionsRule,\n \"no-delete\": noDeleteRule,\n \"no-emoji\": noEmojiRule,\n \"no-finally\": noFinallyRule,\n \"no-iife\": noIifeRule,\n \"no-inline-components\": noInlineComponentsRule,\n \"no-nested-conditionals\": noNestedConditionalsRule,\n \"no-nested-pure-functions\": noNestedPureFunctionsRule,\n \"no-promise-then\": noPromiseThenRule,\n \"no-react-namespace\": noReactNamespaceRule,\n \"no-switch\": noSwitchRule,\n \"no-top-level-let\": noTopLevelLetRule,\n \"no-type-cast\": noTypeCastRule,\n \"pretty-props\": prettyPropsRule,\n },\n});\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAMA,mBAAiB,IAAI,IAAI,CAAC,cAA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AAC;AAEF,6BAAe"}
1
+ {"version":3,"file":"index.mjs","names":["JSX_NODE_TYPES","FUNCTION_NODE_TYPES","isNode","isFunctionLike","getFunctionName","expressionContainsJsx","rule","rule","FUNCTION_NODE_TYPES","isNode","isFunctionLike","isComponentName","getFunctionName","rule","JSX_NODE_TYPES","FUNCTION_NODE_TYPES","isNode","isFunctionLike","expressionContainsJsx","rule","FUNCTION_NODE_TYPES","isNode","isFunctionLike","isReactHookCall","containsJSX","accessesEnclosingScope","checkExpressionForScopeAccess","checkNodeForScopeAccess","collectLocalNames","collectPatternNames","containsHooks","isWrappedInHook","isPureFunction","rule","rule","EMOJI_REGEX","VALIBOT_EMOJI_REGEX","rule","rule","rule","isNode","isFunctionLike","FUNCTION_NODE_TYPES","isNode","isFunctionLike","rule","rule","rule","rule","isNode","rule"],"sources":["../../src/oxlint-plugins/jsx-component-pascal-case.js","../../src/oxlint-plugins/no-array-type.js","../../src/oxlint-plugins/no-component-date-instantiation.js","../../src/oxlint-plugins/no-inline-components.js","../../src/oxlint-plugins/no-component-pure-functions.js","../../src/oxlint-plugins/no-delete.js","../../src/oxlint-plugins/no-emoji.js","../../src/oxlint-plugins/no-finally.js","../../src/oxlint-plugins/no-iife.js","../../src/oxlint-plugins/no-nested-conditionals.js","../../src/oxlint-plugins/no-nested-pure-functions.js","../../src/oxlint-plugins/no-promise-then.js","../../src/oxlint-plugins/no-react-namespace.js","../../src/oxlint-plugins/no-switch-plugin.js","../../src/oxlint-plugins/no-top-level-let.js","../../src/oxlint-plugins/no-type-cast.js","../../src/oxlint-plugins/pretty-props.js","../../src/oxlint-plugins/index.js"],"sourcesContent":["import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {string} name\n * @property {boolean} returnsJsx\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isPascalCase = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * Check if a name is a valid higher-order component name (starts with \"with\")\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isHOCName = (name) => typeof name === \"string\" && /^with[A-Z]/.test(name);\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n // Don't enforce naming for functions used as object property values or JSX props\n // These are often callbacks or configuration options, not standalone components\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return \"\";\n }\n\n // Handle functions passed as arguments to calls (e.g., useCallback, useMemo)\n if (parent.type === \"CallExpression\") {\n const callParent = parent.parent;\n if (callParent && isNode(callParent)) {\n if (callParent.type === \"VariableDeclarator\") {\n return callParent.id && callParent.id.type === \"Identifier\" ? callParent.id.name : \"\";\n }\n if (callParent.type === \"AssignmentExpression\") {\n return callParent.left && callParent.left.type === \"Identifier\" ? callParent.left.name : \"\";\n }\n }\n }\n\n return \"\";\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce PascalCase naming for functions that return JSX elements (components).\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const name = getFunctionName(node);\n\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n name,\n returnsJsx: false,\n };\n\n functionStack.push(fnCtx);\n\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (expressionContainsJsx(node.body)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n // Allow PascalCase or HOC naming (withXxx)\n if (fnCtx.returnsJsx && fnCtx.name && !isPascalCase(fnCtx.name) && !isHOCName(fnCtx.name)) {\n context.report({\n node: fnCtx.node,\n message: `Function '${fnCtx.name}' returns JSX and should use PascalCase naming (e.g., '${fnCtx.name.charAt(0).toUpperCase()}${fnCtx.name.slice(1)}').`,\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument || isFunctionLike(argument)) return;\n\n if (expressionContainsJsx(argument)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n });\n },\n});\n\nexport const jsxComponentPascalCaseRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Array<T> type syntax in favor of T[] syntax\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return {\n TSTypeReference(node) {\n if (node.type !== \"TSTypeReference\") return;\n\n // Check if this is an Array type reference\n if (node.typeName?.type === \"Identifier\" && node.typeName.name === \"Array\" && node.typeParameters) {\n context.report({\n node,\n message: \"Use T[] syntax instead of Array<T>\",\n });\n }\n },\n };\n },\n});\n\nexport const noArrayTypeRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.NewExpression} NewExpressionNode\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {FunctionContext | null} parent\n * @property {string} name\n * @property {boolean} returnsJsx\n * @property {NewExpressionNode[]} dateInstantiations\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Check if a function name follows React component naming convention (PascalCase)\n * @param {unknown} name\n * @returns {name is string}\n */\nconst isComponentName = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * Get the name of a function node\n * @param {FunctionLikeNode} node\n * @returns {string}\n */\nconst getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return parent.key && parent.key.type === \"Identifier\" ? parent.key.name : \"\";\n }\n\n return \"\";\n};\n\n/**\n * Check if a node is a JSX element or fragment\n * @param {ESTNode | null | undefined} node\n * @returns {boolean}\n */\nconst isJSXNode = (node) => {\n if (!node || !isNode(node)) return false;\n return node.type === \"JSXElement\" || node.type === \"JSXFragment\";\n};\n\n/**\n * Check if a NewExpression is creating a Date instance\n * @param {NewExpressionNode} node\n * @returns {boolean}\n */\nconst isDateInstantiation = (node) => {\n if (node.callee.type === \"Identifier\" && node.callee.name === \"Date\") {\n return true;\n }\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Date instantiation in the top scope of React components. Date instances declared on every render are bad because they change every render.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const parent = currentFunction();\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n parent,\n name: getFunctionName(node),\n returnsJsx: false,\n dateInstantiations: [],\n };\n\n functionStack.push(fnCtx);\n\n // Check for arrow functions with expression body that returns JSX\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (isJSXNode(node.body)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n // Only report if this is a React component (PascalCase name + returns JSX)\n if (!fnCtx.returnsJsx) return;\n if (!isComponentName(fnCtx.name)) return;\n\n // Report all Date instantiations in the top scope of this component\n for (const dateNode of fnCtx.dateInstantiations) {\n context.report({\n node: dateNode,\n message: `Avoid instantiating Date in the top scope of component '${fnCtx.name}'. Date instances change on every render. Move it inside an effect, event handler, or use useMemo/useCallback.`,\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument) return;\n\n if (isJSXNode(argument)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n /** @param {NewExpressionNode} node */\n const handleNewExpression = (node) => {\n if (!isDateInstantiation(node)) return;\n\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n // Record this Date instantiation - we'll check if it's in top scope when the function exits\n fnCtx.dateInstantiations.push(node);\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n NewExpression(node) {\n if (node.type === \"NewExpression\") handleNewExpression(node);\n },\n });\n },\n});\n\nexport const noComponentDateInstantiationRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.Pattern} ESTPattern\n * @typedef {import(\"oxlint/plugins\").ESTree.ReturnStatement} ReturnStatementNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n * @typedef {import(\"oxlint/plugins\").ESTree.AssignmentExpression} AssignmentExpressionNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\n/**\n * @typedef {object} RecordedAssignment\n * @property {ESTExpression} node\n * @property {string[]} names\n */\n\n/**\n * @typedef {object} NestedFunctionRecord\n * @property {FunctionLikeNode} node\n * @property {string} name\n */\n\n/**\n * @typedef {object} FunctionContext\n * @property {FunctionLikeNode} node\n * @property {FunctionContext | null} parent\n * @property {string} name\n * @property {boolean} returnsJsx\n * @property {Set<string>} jsxBindingNames\n * @property {RecordedAssignment[]} jsxAssignments\n * @property {NestedFunctionRecord[]} nestedJsxChildren\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nexport const isComponentName = (name) => typeof name === \"string\" && /^[A-Z]/.test(name);\n\n/**\n * @param {unknown} name\n * @returns {name is string}\n */\nexport const isHookName = (name) => typeof name === \"string\" && name.startsWith(\"use\");\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * @param {ESTNode | null | undefined} node\n * @returns {FunctionLikeNode | null}\n */\nexport const getEnclosingFunction = (node) => {\n const findFunction = (current) => {\n if (!current) return null;\n if (isFunctionLike(current)) {\n return current;\n }\n return findFunction(isNode(current) ? (current.parent ?? null) : null);\n };\n return findFunction(isNode(node) ? (node.parent ?? null) : null);\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst isFunctionUsedAsJsxProp = (node) => {\n const checkJsxProp = (current) => {\n if (!current) return false;\n if (current.type === \"JSXAttribute\") {\n return true;\n }\n if (isFunctionLike(current)) {\n return false;\n }\n return checkJsxProp(isNode(current) ? (current.parent ?? null) : null);\n };\n return checkJsxProp(isNode(node) ? (node.parent ?? null) : null);\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nconst isFunctionImmediatelyInvoked = (node) => {\n const parent = isNode(node) ? (node.parent ?? null) : null;\n if (!parent) return false;\n\n // Check if the function is the callee of a CallExpression (i.e., it's immediately invoked)\n if (parent.type === \"CallExpression\" && parent.callee === node) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTExpression | null | undefined} root\n * @param {Set<string>} bindingNames\n */\nconst expressionProducesJsx = (root, bindingNames) => {\n if (!root) return false;\n if (expressionContainsJsx(root)) return true;\n\n if (!isNode(root)) return false;\n\n const type = root.type;\n\n if (type === \"Identifier\") {\n return bindingNames.has(root.name);\n }\n\n if (type === \"ConditionalExpression\") {\n return expressionProducesJsx(root.consequent, bindingNames) || expressionProducesJsx(root.alternate, bindingNames);\n }\n\n if (type === \"LogicalExpression\") {\n return expressionProducesJsx(root.left, bindingNames) || expressionProducesJsx(root.right, bindingNames);\n }\n\n if (type === \"SequenceExpression\") {\n const expressions = root.expressions ?? [];\n const last = expressions[expressions.length - 1] ?? null;\n return expressionProducesJsx(last, bindingNames);\n }\n\n if (type === \"ArrayExpression\") {\n return root.elements.some((element) => {\n if (!element) return false;\n if (element.type === \"SpreadElement\") {\n return expressionProducesJsx(element.argument, bindingNames);\n }\n return expressionProducesJsx(element, bindingNames);\n });\n }\n\n if (type === \"ParenthesizedExpression\") {\n return expressionProducesJsx(root.expression, bindingNames);\n }\n\n if (type === \"AwaitExpression\" || type === \"UnaryExpression\" || type === \"UpdateExpression\") {\n return expressionProducesJsx(root.argument, bindingNames);\n }\n\n if (\n type === \"TSAsExpression\" ||\n type === \"TSTypeAssertion\" ||\n type === \"TSNonNullExpression\" ||\n type === \"ChainExpression\"\n ) {\n return expressionProducesJsx(root.expression, bindingNames);\n }\n\n if (type === \"CallExpression\") {\n return expressionProducesJsx(root.callee, bindingNames);\n }\n\n if (type === \"MemberExpression\") {\n return expressionProducesJsx(root.object, bindingNames);\n }\n\n return false;\n};\n\n/**\n * @param {ESTPattern | null | undefined} pattern\n * @param {string[]} names\n */\nconst collectBindingNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n const type = pattern.type;\n\n if (type === \"Identifier\") {\n names.push(pattern.name);\n return;\n }\n\n if (type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectBindingNames(element.argument, names);\n } else {\n collectBindingNames(element, names);\n }\n }\n return;\n }\n\n if (type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectBindingNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectBindingNames(property.argument, names);\n }\n }\n return;\n }\n\n if (type === \"AssignmentPattern\") {\n collectBindingNames(pattern.left, names);\n return;\n }\n\n if (type === \"RestElement\") {\n collectBindingNames(pattern.argument, names);\n }\n};\n\n/**\n * @param {FunctionLikeNode} node\n */\nexport const getFunctionName = (node) => {\n if (node.type === \"FunctionDeclaration\" && node.id && node.id.type === \"Identifier\") {\n return node.id.name;\n }\n\n if ((node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\") && node.id) {\n if (node.id.type === \"Identifier\") return node.id.name;\n }\n\n const parent = node.parent;\n if (!parent || !isNode(parent)) return \"\";\n\n if (parent.type === \"VariableDeclarator\") {\n return parent.id && parent.id.type === \"Identifier\" ? parent.id.name : \"\";\n }\n\n if (parent.type === \"AssignmentExpression\") {\n return parent.left && parent.left.type === \"Identifier\" ? parent.left.name : \"\";\n }\n\n if (parent.type === \"Property\" || parent.type === \"MethodDefinition\") {\n return parent.key && parent.key.type === \"Identifier\" ? parent.key.name : \"\";\n }\n\n // Handle functions passed as arguments to calls (e.g., useCallback, useMemo)\n if (parent.type === \"CallExpression\") {\n const callParent = parent.parent;\n if (callParent && isNode(callParent)) {\n if (callParent.type === \"VariableDeclarator\") {\n return callParent.id && callParent.id.type === \"Identifier\" ? callParent.id.name : \"\";\n }\n if (callParent.type === \"AssignmentExpression\") {\n return callParent.left && callParent.left.type === \"Identifier\" ? callParent.left.name : \"\";\n }\n }\n }\n\n return \"\";\n};\n\n/**\n * @param {string} name\n */\nconst describeFunction = (name) => (name ? `function '${name}'` : \"this function\");\n\n/**\n * @param {string} name\n */\nconst describeNested = (name) => (name ? `function '${name}'` : \"an anonymous function\");\n\n/**\n * @param {string[]} names\n * @param {string} fnName\n */\nconst createAssignmentMessage = (names, fnName) => {\n const target =\n names.length === 0\n ? \"local variables\"\n : names.length === 1\n ? `local '${names[0]}'`\n : `locals ${names.map((name) => `'${name}'`).join(\", \")}`;\n\n return `Avoid storing JSX in ${target} inside ${describeFunction(fnName)}; return the JSX directly instead.`;\n};\n\n/**\n * @param {string} childName\n * @param {string} parentName\n */\nconst createNestedFunctionMessage = (childName, parentName) =>\n `JSX-returning ${describeNested(childName)} should not be declared inside ${describeFunction(parentName)}. Extract it to module scope.`;\n\n/**\n * @param {string} name\n */\nconst createIIFEMessage = (name) =>\n `JSX-returning ${describeNested(name)} should not be declared as an immediately invoked function expression (IIFE). Extract it to a named function at module scope.`;\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow JSX-returning functions and JSX-valued assignments within other functions that also return JSX.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /** @type {FunctionContext[]} */\n const functionStack = [];\n\n const currentFunction = () => functionStack[functionStack.length - 1] ?? null;\n\n /**\n * @param {FunctionLikeNode} node\n */\n const enterFunction = (node) => {\n const parent = currentFunction();\n /** @type {FunctionContext} */\n const fnCtx = {\n node,\n parent,\n name: getFunctionName(node),\n returnsJsx: false,\n jsxBindingNames: new Set(),\n jsxAssignments: [],\n nestedJsxChildren: [],\n };\n\n functionStack.push(fnCtx);\n\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n if (expressionProducesJsx(node.body, fnCtx.jsxBindingNames)) {\n fnCtx.returnsJsx = true;\n }\n }\n };\n\n const exitFunction = () => {\n const fnCtx = functionStack.pop();\n if (!fnCtx) return;\n\n if (fnCtx.returnsJsx && isFunctionImmediatelyInvoked(fnCtx.node)) {\n context.report({\n node: fnCtx.node,\n message: createIIFEMessage(fnCtx.name),\n });\n return;\n }\n\n if (fnCtx.parent && fnCtx.returnsJsx && fnCtx.name && !isFunctionUsedAsJsxProp(fnCtx.node)) {\n fnCtx.parent.nestedJsxChildren.push({ node: fnCtx.node, name: fnCtx.name });\n }\n\n if (!fnCtx.returnsJsx) return;\n\n for (const assignment of fnCtx.jsxAssignments) {\n context.report({\n node: assignment.node,\n message: createAssignmentMessage(assignment.names, fnCtx.name),\n });\n }\n\n for (const nested of fnCtx.nestedJsxChildren) {\n context.report({\n node: nested.node,\n message: createNestedFunctionMessage(nested.name, fnCtx.name),\n });\n }\n };\n\n /** @param {ReturnStatementNode} node */\n const handleReturnStatement = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const argument = node.argument;\n if (!argument || isFunctionLike(argument)) return;\n\n if (expressionProducesJsx(argument, fnCtx.jsxBindingNames)) {\n fnCtx.returnsJsx = true;\n }\n };\n\n /** @param {VariableDeclaratorNode} node */\n const handleVariableDeclarator = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const init = node.init;\n if (!init || isFunctionLike(init)) return;\n if (!expressionContainsJsx(init)) return;\n\n const names = [];\n collectBindingNames(node.id, names);\n for (const name of names) {\n fnCtx.jsxBindingNames.add(name);\n }\n\n fnCtx.jsxAssignments.push({ node: init, names });\n };\n\n /** @param {AssignmentExpressionNode} node */\n const handleAssignmentExpression = (node) => {\n if (node.operator !== \"=\") return;\n\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n const right = node.right;\n if (!right || isFunctionLike(right)) return;\n if (!expressionContainsJsx(right)) return;\n\n const names = [];\n if (node.left && node.left.type === \"Identifier\") {\n names.push(node.left.name);\n fnCtx.jsxBindingNames.add(node.left.name);\n }\n\n fnCtx.jsxAssignments.push({ node: right, names });\n };\n\n /**\n * @param {import(\"oxlint\").ESTree.CallExpression} node\n */\n const handleCallExpression = (node) => {\n const fnCtx = currentFunction();\n if (!fnCtx) return;\n\n // Check for array.push(<JSX>)\n if (\n node.callee &&\n node.callee.type === \"MemberExpression\" &&\n node.callee.property &&\n node.callee.property.type === \"Identifier\" &&\n node.callee.property.name === \"push\"\n ) {\n const arrayObject = node.callee.object;\n if (arrayObject && arrayObject.type === \"Identifier\") {\n const arrayName = arrayObject.name;\n\n // Check if any argument contains JSX\n const hasJsxArgument = node.arguments.some((arg) => {\n if (!arg || arg.type === \"SpreadElement\") return false;\n return expressionContainsJsx(arg);\n });\n\n if (hasJsxArgument) {\n fnCtx.jsxBindingNames.add(arrayName);\n fnCtx.jsxAssignments.push({ node: node, names: [arrayName] });\n }\n }\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionDeclaration:exit\": exitFunction,\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"FunctionExpression:exit\": exitFunction,\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterFunction(node);\n },\n \"ArrowFunctionExpression:exit\": exitFunction,\n ReturnStatement(node) {\n if (node.type === \"ReturnStatement\") handleReturnStatement(node);\n },\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n AssignmentExpression(node) {\n if (node.type === \"AssignmentExpression\") handleAssignmentExpression(node);\n },\n CallExpression(node) {\n if (node.type === \"CallExpression\") handleCallExpression(node);\n },\n });\n },\n});\n\nexport const noInlineComponentsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\nimport { getFunctionName, getEnclosingFunction, isComponentName } from \"./no-inline-components.js\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Checks if a node is a React Hook call (e.g., useState, useEffect, useCallback)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactHookCall = (node) => {\n if (node.type !== \"CallExpression\") return false;\n\n const callee = node.callee;\n if (!callee) return false;\n\n // Direct hook calls like useState()\n if (callee.type === \"Identifier\" && callee.name.startsWith(\"use\")) {\n return true;\n }\n\n // React.useState(), React.useEffect(), etc.\n if (\n callee.type === \"MemberExpression\" &&\n callee.object &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"React\" &&\n callee.property &&\n callee.property.type === \"Identifier\" &&\n callee.property.name.startsWith(\"use\")\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a node contains JSX\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst containsJSX = (node) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"JSXElement\" || current.type === \"JSXFragment\") {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function accesses variables from its enclosing scope\n * (excluding function parameters and locally declared variables)\n * @param {FunctionLikeNode} node\n * @param {Set<string>} localNames - Names of local variables and parameters\n * @returns {boolean}\n */\nconst accessesEnclosingScope = (node, localNames) => {\n if (!node.body) return false;\n\n const body = node.body;\n\n // For arrow functions with expression bodies\n if (body.type !== \"BlockStatement\") {\n return checkExpressionForScopeAccess(body, localNames);\n }\n\n // For block statements\n return checkNodeForScopeAccess(body, localNames);\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkNodeForScopeAccess = (node, localNames) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n // If we find an identifier reference, check if it's external\n if (current.type === \"Identifier\") {\n const parent = current.parent;\n\n // Skip if this identifier is part of a declaration\n if (\n parent &&\n isNode(parent) &&\n (parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n (parent.type === \"Property\" && parent.key === current))\n ) {\n continue;\n }\n\n // If the identifier is not in our local names, it's from enclosing scope\n if (!localNames.has(current.name)) {\n // Exclude global objects and common globals\n const globalNames = new Set([\n \"console\",\n \"Math\",\n \"Date\",\n \"JSON\",\n \"Object\",\n \"Array\",\n \"String\",\n \"Number\",\n \"Boolean\",\n \"parseInt\",\n \"parseFloat\",\n \"isNaN\",\n \"isFinite\",\n \"undefined\",\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"Map\",\n \"Set\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Symbol\",\n \"Error\",\n \"TypeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n ]);\n\n if (!globalNames.has(current.name)) {\n return true;\n }\n }\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkExpressionForScopeAccess = (node, localNames) => {\n return checkNodeForScopeAccess(node, localNames);\n};\n\n/**\n * Collects all local variable names including parameters\n * @param {FunctionLikeNode} node\n * @returns {Set<string>}\n */\nconst collectLocalNames = (node) => {\n const names = new Set();\n\n // Add parameter names\n if (node.params) {\n for (const param of node.params) {\n collectPatternNames(param, names);\n }\n }\n\n // Add locally declared variables\n if (node.body && node.body.type === \"BlockStatement\") {\n for (const statement of node.body.body) {\n if (statement.type === \"VariableDeclaration\") {\n for (const declarator of statement.declarations) {\n collectPatternNames(declarator.id, names);\n }\n }\n }\n }\n\n return names;\n};\n\n/**\n * @param {import(\"oxlint\").ESTree.Pattern} pattern\n * @param {Set<string>} names\n */\nconst collectPatternNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n if (pattern.type === \"Identifier\") {\n names.add(pattern.name);\n return;\n }\n\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectPatternNames(element.argument, names);\n } else {\n collectPatternNames(element, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectPatternNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectPatternNames(property.argument, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n};\n\n/**\n * Checks if a function is likely a React component\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isReactComponent = (node) => {\n const name = getFunctionName(node);\n\n // Must start with capital letter\n if (!isComponentName(name)) {\n return false;\n }\n\n // Check if it returns JSX or uses hooks\n return containsJSX(node) || containsHooks(node);\n};\n\n/**\n * Checks if a function contains React Hook calls\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst containsHooks = (node) => {\n if (!node.body) return false;\n\n const stack = [node.body];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (isReactHookCall(current)) {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node.body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function is wrapped in a React Hook (useCallback, useMemo, etc.)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isWrappedInHook = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n\n if (parent.type === \"CallExpression\" && isReactHookCall(parent)) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a function is pure (doesn't access component scope, hooks, or JSX)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isPureFunction = (node) => {\n // Must not contain JSX\n if (containsJSX(node)) return false;\n\n // Must not contain hooks\n if (containsHooks(node)) return false;\n\n // Must not be wrapped in a hook like useCallback or useMemo\n if (isWrappedInHook(node)) return false;\n\n // Must not access variables from enclosing scope (except globals)\n const localNames = collectLocalNames(node);\n if (accessesEnclosingScope(node, localNames)) return false;\n\n return true;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Recommend extracting pure functions from React components to module scope for better performance and readability.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * @param {VariableDeclaratorNode} node\n */\n const handleVariableDeclarator = (node) => {\n // Only check arrow functions and function expressions\n const init = node.init;\n if (!init || !isFunctionLike(init)) return;\n\n // Get the enclosing function (should be a component)\n const enclosingFunction = getEnclosingFunction(node);\n if (!enclosingFunction) return;\n\n // The enclosing function must be a React component\n if (!isReactComponent(enclosingFunction)) return;\n\n // Check if the inner function is pure\n if (!isPureFunction(init)) return;\n\n const functionName = node.id && node.id.type === \"Identifier\" ? node.id.name : \"this function\";\n const componentName = getFunctionName(enclosingFunction);\n\n context.report({\n node: init,\n message: `Pure function '${functionName}' can be extracted outside of component '${componentName}' to improve performance and readability.`,\n });\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n });\n },\n});\n\nexport const noComponentPureFunctionsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the 'delete' operator\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n UnaryExpression(node) {\n if (node.type !== \"UnaryExpression\") return;\n\n if (node.operator === \"delete\") {\n context.report({\n node,\n message:\n \"Use of 'delete' operator is disallowed. Use object destructuring or set properties to undefined instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noDeleteRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\nimport { EMOJI_REGEX as VALIBOT_EMOJI_REGEX } from \"valibot\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\n/**\n * Regex pattern to match emojis within a string\n * Based on valibot's EMOJI_REGEX but without anchors and with global flag\n */\nconst EMOJI_REGEX = new RegExp(VALIBOT_EMOJI_REGEX.source.slice(1, -1), \"gu\");\n\n/**\n * Find emojis in a string\n * @param {string} text\n * @returns {RegExpMatchArray | null}\n */\nconst findEmojis = (text) => {\n return text.match(EMOJI_REGEX);\n};\n\n/**\n * Get a preview of the emoji found\n * @param {string} text\n * @returns {string}\n */\nconst getEmojiPreview = (text) => {\n const emojis = findEmojis(text);\n if (!emojis || emojis.length === 0) return \"\";\n\n const uniqueEmojis = [...new Set(emojis)];\n const preview = uniqueEmojis.slice(0, 3).join(\" \");\n\n return uniqueEmojis.length > 3 ? `${preview} ...` : preview;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow the use of emojis in code. Use icons from a component library instead.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * Check string literals\n * @param {ESTNode} node\n */\n StringLiteral(node) {\n if (node.type !== \"StringLiteral\") return;\n\n const emojis = findEmojis(node.value);\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(node.value);\n context.report({\n node,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n },\n\n /**\n * Check template literals\n * @param {ESTNode} node\n */\n TemplateLiteral(node) {\n if (node.type !== \"TemplateLiteral\") return;\n\n // Check each quasi (template string part)\n for (const quasi of node.quasis) {\n if (quasi.type !== \"TemplateElement\") continue;\n\n const text = quasi.value.raw;\n const emojis = findEmojis(text);\n\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(text);\n context.report({\n node: quasi,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n }\n },\n\n /**\n * Check JSX text\n * @param {ESTNode} node\n */\n JSXText(node) {\n if (node.type !== \"JSXText\") return;\n\n const emojis = findEmojis(node.value);\n if (emojis && emojis.length > 0) {\n const preview = getEmojiPreview(node.value);\n context.report({\n node,\n message: `Emojis are not allowed in code. Found: ${preview}. Use icons from a component library instead.`,\n });\n }\n },\n });\n },\n});\n\nexport const noEmojiRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow 'finally' blocks in try/catch/finally statements\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n TryStatement(node) {\n if (node.type !== \"TryStatement\") return;\n\n if (node.finalizer) {\n context.report({\n node: node.finalizer,\n message: \"Use of 'finally' blocks is disallowed. Handle cleanup explicitly in try/catch blocks instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noFinallyRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow Immediately Invoked Function Expressions (IIFE)\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n CallExpression(node) {\n if (node.type !== \"CallExpression\") return;\n\n const { callee } = node;\n\n // Check if callee is a FunctionExpression or ArrowFunctionExpression\n if (callee.type === \"FunctionExpression\" || callee.type === \"ArrowFunctionExpression\") {\n context.report({\n node,\n message:\n \"Immediately Invoked Function Expressions (IIFE) are disallowed. Use a regular function declaration or block scope instead.\",\n });\n }\n },\n });\n },\n});\n\nexport const noIifeRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst DEFAULT_MAX_DEPTH = 2;\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isFunctionLike = (node) =>\n node.type === \"FunctionDeclaration\" || node.type === \"FunctionExpression\" || node.type === \"ArrowFunctionExpression\";\n\n/**\n * Treat standalone blocks as separate scopes. Blocks used as conditional/loop bodies\n * do not reset nesting depth.\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isStandaloneBlock = (node) => {\n if (node.type !== \"BlockStatement\") return false;\n\n const parent = node.parent;\n if (!isNode(parent)) return false;\n\n return parent.type === \"Program\" || parent.type === \"BlockStatement\";\n};\n\n/**\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isElseIf = (node) => {\n if (node.type !== \"IfStatement\") return false;\n const parent = node.parent;\n if (!isNode(parent) || parent.type !== \"IfStatement\") return false;\n return parent.alternate === node;\n};\n\nexport const noNestedConditionalsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow nesting conditionals more than a configured depth within a single scope\",\n recommended: true,\n },\n schema: [\n {\n type: \"object\",\n properties: {\n maxDepth: {\n type: \"integer\",\n minimum: 1,\n },\n },\n additionalProperties: false,\n },\n ],\n },\n createOnce(context) {\n const maxDepth = DEFAULT_MAX_DEPTH;\n\n const scopeStack = [];\n\n const enterScope = () => {\n scopeStack.push({ depth: 0, increments: [] });\n };\n\n const exitScope = () => {\n scopeStack.pop();\n };\n\n const currentScope = () => scopeStack[scopeStack.length - 1];\n\n /** @param {ESTNode} node */\n const enterConditional = (node) => {\n const scope = currentScope();\n if (!scope) return;\n\n const increment = isElseIf(node) ? 0 : 1;\n const nextDepth = scope.depth + increment;\n\n if (nextDepth > maxDepth) {\n context.report({\n node,\n message: `Avoid nesting conditionals more than ${maxDepth} levels within the same scope. Prefer early returns or extract branches into separate functions.`,\n });\n }\n\n scope.depth = nextDepth;\n scope.increments.push(increment);\n };\n\n const exitConditional = () => {\n const scope = currentScope();\n if (!scope) return;\n\n const increment = scope.increments.pop();\n if (increment === undefined) return;\n\n scope.depth -= increment;\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n Program() {\n enterScope();\n },\n \"Program:exit\"() {\n exitScope();\n },\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"FunctionDeclaration:exit\"() {\n exitScope();\n },\n FunctionExpression(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"FunctionExpression:exit\"() {\n exitScope();\n },\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) enterScope();\n },\n \"ArrowFunctionExpression:exit\"() {\n exitScope();\n },\n BlockStatement(node) {\n if (isStandaloneBlock(node)) enterScope();\n },\n \"BlockStatement:exit\"(node) {\n if (isStandaloneBlock(node)) exitScope();\n },\n IfStatement(node) {\n if (node.type === \"IfStatement\") enterConditional(node);\n },\n \"IfStatement:exit\"() {\n exitConditional();\n },\n ConditionalExpression(node) {\n if (node.type === \"ConditionalExpression\") enterConditional(node);\n },\n \"ConditionalExpression:exit\"() {\n exitConditional();\n },\n SwitchStatement(node) {\n if (node.type === \"SwitchStatement\") enterConditional(node);\n },\n \"SwitchStatement:exit\"() {\n exitConditional();\n },\n });\n },\n});\n","import { defineRule } from \"oxlint/plugins\";\nimport { getFunctionName, getEnclosingFunction } from \"./no-inline-components.js\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n * @typedef {import(\"oxlint/plugins\").ESTree.VariableDeclarator} VariableDeclaratorNode\n */\n\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Checks if a node is a React Hook call (e.g., useState, useEffect, useCallback)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactHookCall = (node) => {\n if (node.type !== \"CallExpression\") return false;\n\n const callee = node.callee;\n if (!callee) return false;\n\n // Direct hook calls like useState()\n if (callee.type === \"Identifier\" && callee.name.startsWith(\"use\")) {\n return true;\n }\n\n // React.useState(), React.useEffect(), etc.\n if (\n callee.type === \"MemberExpression\" &&\n callee.object &&\n callee.object.type === \"Identifier\" &&\n callee.object.name === \"React\" &&\n callee.property &&\n callee.property.type === \"Identifier\" &&\n callee.property.name.startsWith(\"use\")\n ) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a node contains JSX\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst containsJSX = (node) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"JSXElement\" || current.type === \"JSXFragment\") {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function accesses variables from its enclosing scope\n * (excluding function parameters and locally declared variables)\n * @param {FunctionLikeNode} node\n * @param {Set<string>} localNames - Names of local variables and parameters\n * @returns {boolean}\n */\nconst accessesEnclosingScope = (node, localNames) => {\n if (!node.body) return false;\n\n const body = node.body;\n\n // For arrow functions with expression bodies\n if (body.type !== \"BlockStatement\") {\n return checkExpressionForScopeAccess(body, localNames);\n }\n\n // For block statements\n return checkNodeForScopeAccess(body, localNames);\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkNodeForScopeAccess = (node, localNames) => {\n if (!node || !isNode(node)) return false;\n\n const stack = [node];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n // If we find an identifier reference, check if it's external\n if (current.type === \"Identifier\") {\n const parent = current.parent;\n\n // Skip if this identifier is part of a declaration\n if (\n parent &&\n isNode(parent) &&\n (parent.type === \"VariableDeclarator\" ||\n parent.type === \"FunctionDeclaration\" ||\n (parent.type === \"Property\" && parent.key === current))\n ) {\n continue;\n }\n\n // If the identifier is not in our local names, it's from enclosing scope\n if (!localNames.has(current.name)) {\n // Exclude global objects and common globals\n const globalNames = new Set([\n \"console\",\n \"Math\",\n \"Date\",\n \"JSON\",\n \"Object\",\n \"Array\",\n \"String\",\n \"Number\",\n \"Boolean\",\n \"parseInt\",\n \"parseFloat\",\n \"isNaN\",\n \"isFinite\",\n \"undefined\",\n \"null\",\n \"true\",\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"Map\",\n \"Set\",\n \"WeakMap\",\n \"WeakSet\",\n \"Promise\",\n \"Symbol\",\n \"Error\",\n \"TypeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n ]);\n\n if (!globalNames.has(current.name)) {\n return true;\n }\n }\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * @param {ESTNode} node\n * @param {Set<string>} localNames\n * @returns {boolean}\n */\nconst checkExpressionForScopeAccess = (node, localNames) => {\n return checkNodeForScopeAccess(node, localNames);\n};\n\n/**\n * Collects all local variable names including parameters\n * @param {FunctionLikeNode} node\n * @returns {Set<string>}\n */\nconst collectLocalNames = (node) => {\n const names = new Set();\n\n // Add parameter names\n if (node.params) {\n for (const param of node.params) {\n collectPatternNames(param, names);\n }\n }\n\n // Add locally declared variables\n if (node.body && node.body.type === \"BlockStatement\") {\n for (const statement of node.body.body) {\n if (statement.type === \"VariableDeclaration\") {\n for (const declarator of statement.declarations) {\n collectPatternNames(declarator.id, names);\n }\n }\n }\n }\n\n return names;\n};\n\n/**\n * @param {import(\"oxlint\").ESTree.Pattern} pattern\n * @param {Set<string>} names\n */\nconst collectPatternNames = (pattern, names) => {\n if (!pattern || !isNode(pattern)) return;\n\n if (pattern.type === \"Identifier\") {\n names.add(pattern.name);\n return;\n }\n\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements) {\n if (!element) continue;\n if (element.type === \"RestElement\") {\n collectPatternNames(element.argument, names);\n } else {\n collectPatternNames(element, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties) {\n if (!property) continue;\n if (property.type === \"Property\") {\n collectPatternNames(property.value, names);\n } else if (property.type === \"RestElement\") {\n collectPatternNames(property.argument, names);\n }\n }\n return;\n }\n\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n};\n\n/**\n * Checks if a function contains React Hook calls\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst containsHooks = (node) => {\n if (!node.body) return false;\n\n const stack = [node.body];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (isReactHookCall(current)) {\n return true;\n }\n\n // Don't traverse into nested functions\n if (isFunctionLike(current) && current !== node.body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Checks if a function is wrapped in a React Hook (useCallback, useMemo, etc.)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isWrappedInHook = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n\n if (parent.type === \"CallExpression\" && isReactHookCall(parent)) {\n return true;\n }\n\n return false;\n};\n\n/**\n * Checks if a function is pure (doesn't access enclosing scope, hooks, or JSX)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\nconst isPureFunction = (node) => {\n // Must not contain JSX\n if (containsJSX(node)) return false;\n\n // Must not contain hooks\n if (containsHooks(node)) return false;\n\n // Must not be wrapped in a hook like useCallback or useMemo\n if (isWrappedInHook(node)) return false;\n\n // Must not access variables from enclosing scope (except globals)\n const localNames = collectLocalNames(node);\n if (accessesEnclosingScope(node, localNames)) return false;\n\n return true;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Prevent declaring named pure functions inside other functions. Pure functions should be extracted to module scope for better performance and reusability.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * @param {VariableDeclaratorNode} node\n */\n const handleVariableDeclarator = (node) => {\n // Only check arrow functions and function expressions\n const init = node.init;\n if (!init || !isFunctionLike(init)) return;\n\n // Must be named\n if (!node.id || node.id.type !== \"Identifier\") return;\n const functionName = node.id.name;\n\n // Get the enclosing function\n const enclosingFunction = getEnclosingFunction(node);\n if (!enclosingFunction) return;\n\n // Check if the inner function is pure\n if (!isPureFunction(init)) return;\n\n const enclosingFunctionName = getFunctionName(enclosingFunction);\n\n context.report({\n node: init,\n message: `Named pure function '${functionName}' should not be declared inside '${enclosingFunctionName}'. Extract it to module scope.`,\n });\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n VariableDeclarator(node) {\n if (node.type === \"VariableDeclarator\") handleVariableDeclarator(node);\n },\n });\n },\n});\n\nexport const noNestedPureFunctionsRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow using .then() and .catch() on promises. Use async/await instead.\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n CallExpression(node) {\n if (node.type !== \"CallExpression\") return;\n\n // Check if this is a method call (e.g., promise.then())\n if (node.callee.type !== \"MemberExpression\") return;\n\n const memberExpression = node.callee;\n\n // Check if the property being called is \"then\" or \"catch\"\n if (\n memberExpression.property.type === \"Identifier\" &&\n (memberExpression.property.name === \"then\" || memberExpression.property.name === \"catch\")\n ) {\n context.report({\n node,\n message: `Avoid using .${memberExpression.property.name}() on promises. Use async/await instead.`,\n });\n }\n },\n });\n },\n});\n\nexport const noPromiseThenRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\n/**\n * Check if a MemberExpression is accessing the React namespace\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isReactNamespaceAccess = (node) => {\n if (node.type !== \"MemberExpression\") return false;\n\n const object = node.object;\n if (!object || object.type !== \"Identifier\" || object.name !== \"React\") {\n return false;\n }\n\n return true;\n};\n\n/**\n * Check if this is a type annotation context (TypeScript)\n * @param {ESTNode} node\n * @returns {boolean}\n */\nconst isTypeContext = (node) => {\n const checkParent = (current) => {\n if (!current) return false;\n\n // Type annotation contexts where React namespace is allowed\n const typeContextTypes = new Set([\n \"TSTypeReference\",\n \"TSTypeAnnotation\",\n \"TSTypeParameterInstantiation\",\n \"TSInterfaceHeritage\",\n \"TSTypeQuery\",\n \"TSTypeAliasDeclaration\",\n \"TSInterfaceDeclaration\",\n \"TSTypeLiteral\",\n \"TSPropertySignature\",\n \"TSIndexSignature\",\n \"TSMethodSignature\",\n \"TSCallSignatureDeclaration\",\n \"TSConstructSignatureDeclaration\",\n \"TSExpressionWithTypeArguments\",\n ]);\n\n if (typeContextTypes.has(current.type)) {\n return true;\n }\n\n // Stop at statement or expression boundaries\n if (\n current.type === \"ExpressionStatement\" ||\n current.type === \"VariableDeclarator\" ||\n current.type === \"CallExpression\" ||\n current.type === \"ReturnStatement\"\n ) {\n return false;\n }\n\n return checkParent(current.parent);\n };\n\n return checkParent(node.parent);\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow using the React namespace for accessing React APIs. Use destructured imports instead (e.g., import { useState } from 'react').\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n MemberExpression(node) {\n if (node.type !== \"MemberExpression\") return;\n\n if (!isReactNamespaceAccess(node)) return;\n\n // Allow React namespace in type annotations\n if (isTypeContext(node)) return;\n\n const propertyName = node.property && node.property.type === \"Identifier\" ? node.property.name : \"property\";\n\n context.report({\n node,\n message: `Avoid using 'React.${propertyName}'. Import '${propertyName}' directly from 'react' instead (e.g., import { ${propertyName} } from 'react').`,\n });\n },\n });\n },\n});\n\nexport const noReactNamespaceRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nexport const noSwitchRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow switch/case statements\",\n recommended: true,\n },\n schema: [],\n },\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} node\n */\n SwitchStatement(node) {\n if (node.type !== \"SwitchStatement\") return;\n\n context.report({\n node,\n message: \"Use of switch/case is disallowed. Use object map or if/else instead.\",\n });\n },\n });\n },\n});\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow `let` keyword everywhere except at module scope and in for loop initializers.\",\n recommended: false,\n },\n schema: [],\n messages: {\n noLet: \"Avoid `let`. Use `const`, or limit `let` to module scope or `for` loop initializers.\",\n topLevelMutation:\n \"Do not mutate properties of top-level const `{{name}}`. Move the mutable state into a function or update immutably (create a new object/array).\",\n },\n },\n\n createOnce(context) {\n /** @type {Set<string>} */\n const topLevelMutableBindings = new Set();\n\n /**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\n const isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n /**\n * @param {ESTNode} node\n * @returns {boolean}\n */\n const isTopLevelVariableDeclaration = (node) => {\n const parent = node.parent;\n if (!parent || !isNode(parent)) return false;\n if (parent.type === \"Program\") return true;\n if (parent.type === \"ExportNamedDeclaration\" && parent.parent?.type === \"Program\") {\n return true;\n }\n return false;\n };\n\n /**\n * @param {ESTNode | null | undefined} node\n * @returns {boolean}\n */\n const isMutableObjectInit = (node) => {\n if (!node || !isNode(node)) return false;\n if (node.type === \"ObjectExpression\" || node.type === \"ArrayExpression\") {\n return true;\n }\n if (node.type === \"NewExpression\" && node.callee?.type === \"Identifier\") {\n return [\"Map\", \"Set\", \"WeakMap\", \"WeakSet\"].includes(node.callee.name);\n }\n return false;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {ESTNode | null}\n */\n const unwrapExpression = (node) => {\n let current = node;\n while (current && isNode(current)) {\n if (current.type === \"TSAsExpression\" || current.type === \"TSNonNullExpression\") {\n current = current.expression;\n continue;\n }\n return current;\n }\n return null;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {string | null}\n */\n const getMemberRootName = (node) => {\n let current = unwrapExpression(node);\n while (current && isNode(current)) {\n if (current.type === \"MemberExpression\") {\n current = unwrapExpression(current.object);\n continue;\n }\n if (current.type === \"Identifier\") {\n return current.name;\n }\n return null;\n }\n return null;\n };\n\n /**\n * @param {ESTNode} node\n * @returns {string | null}\n */\n const getMemberPropertyName = (node) => {\n if (!isNode(node) || node.type !== \"MemberExpression\") return null;\n if (node.property?.type === \"Identifier\" && node.computed === false) {\n return node.property.name;\n }\n if (node.property?.type === \"Literal\" && typeof node.property.value === \"string\") {\n return node.property.value;\n }\n return null;\n };\n\n const mutatingMethods = new Set([\n \"push\",\n \"pop\",\n \"splice\",\n \"shift\",\n \"unshift\",\n \"sort\",\n \"reverse\",\n \"copyWithin\",\n \"fill\",\n \"set\",\n \"add\",\n \"delete\",\n \"clear\",\n ]);\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} rawNode\n */\n VariableDeclaration(rawNode) {\n if (rawNode.type !== \"VariableDeclaration\") return;\n const node = rawNode;\n\n if (node.kind !== \"let\") return;\n\n // Allow let at module scope\n if (isTopLevelVariableDeclaration(node)) return;\n\n // Allow let in for loop initializers\n const parent = node.parent;\n if (parent) {\n // For traditional for loops, check init property\n if (parent.type === \"ForStatement\" && parent.init === node) {\n return;\n }\n // For for-in and for-of loops, check left property\n if ((parent.type === \"ForInStatement\" || parent.type === \"ForOfStatement\") && parent.left === node) {\n return;\n }\n }\n\n context.report({\n node,\n messageId: \"noLet\",\n });\n },\n\n /**\n * Track top-level const bindings initialized with mutable objects.\n * @param {ESTNode} rawNode\n */\n VariableDeclarator(rawNode) {\n if (rawNode.type !== \"VariableDeclarator\") return;\n const declarator = rawNode;\n const declaration = declarator.parent;\n if (!declaration || !isNode(declaration) || declaration.type !== \"VariableDeclaration\") {\n return;\n }\n if (declaration.kind !== \"const\") return;\n if (!isTopLevelVariableDeclaration(declaration)) return;\n if (!isMutableObjectInit(declarator.init)) return;\n if (declarator.id?.type !== \"Identifier\") return;\n\n topLevelMutableBindings.add(declarator.id.name);\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n AssignmentExpression(rawNode) {\n if (rawNode.type !== \"AssignmentExpression\") return;\n const left = rawNode.left;\n if (!left || !isNode(left) || left.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(left);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n UpdateExpression(rawNode) {\n if (rawNode.type !== \"UpdateExpression\") return;\n const argument = rawNode.argument;\n if (!argument || !isNode(argument) || argument.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(argument);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n CallExpression(rawNode) {\n if (rawNode.type !== \"CallExpression\") return;\n const callee = rawNode.callee;\n if (!callee || !isNode(callee) || callee.type !== \"MemberExpression\") return;\n\n const rootName = getMemberRootName(callee);\n if (!rootName || !topLevelMutableBindings.has(rootName)) return;\n\n const methodName = getMemberPropertyName(callee);\n if (!methodName || !mutatingMethods.has(methodName)) return;\n\n context.report({\n node: rawNode,\n messageId: \"topLevelMutation\",\n data: { name: rootName },\n });\n },\n });\n },\n});\n\nexport const noTopLevelLetRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/** @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode */\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow TypeScript type assertions (`as` and angle-bracket syntax) to prevent unsafe type casting.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n /**\n * @param {ESTNode} rawNode\n */\n TSAsExpression(rawNode) {\n if (rawNode.type !== \"TSAsExpression\") return;\n\n // Allow \"as const\" assertions\n if (\n rawNode.typeAnnotation.type === \"TSTypeReference\" &&\n rawNode.typeAnnotation.typeName.type === \"Identifier\" &&\n rawNode.typeAnnotation.typeName.name === \"const\"\n ) {\n return;\n }\n\n context.report({\n node: rawNode,\n message:\n \"Type casting with `as` is not permitted. Use runtime validation with valibot or refactor to avoid type casting.\",\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n TSTypeAssertion(rawNode) {\n if (rawNode.type !== \"TSTypeAssertion\") return;\n\n context.report({\n node: rawNode,\n message:\n \"Type casting with angle brackets `<Type>` is not permitted. Use runtime validation with valibot or refactor to avoid type casting.\",\n });\n },\n\n /**\n * @param {ESTNode} rawNode\n */\n TSNonNullExpression(rawNode) {\n if (rawNode.type !== \"TSNonNullExpression\") return;\n\n context.report({\n node: rawNode,\n message:\n \"Non-null assertion operator `!` is not permitted. Handle null/undefined cases explicitly or use optional chaining.\",\n });\n },\n });\n },\n});\n\nexport const noTypeCastRule = rule;\n","import { defineRule } from \"oxlint/plugins\";\n\n/**\n * @typedef {import(\"oxlint/plugins\").Context} RuleContext\n * @typedef {import(\"oxlint/plugins\").ESTree.Node} ESTNode\n * @typedef {import(\"oxlint/plugins\").ESTree.Expression} ESTExpression\n * @typedef {import(\"oxlint/plugins\").ESTree.Function | import(\"oxlint/plugins\").ESTree.ArrowFunctionExpression} FunctionLikeNode\n */\n\nconst JSX_NODE_TYPES = new Set([\"JSXElement\", \"JSXFragment\"]);\nconst FUNCTION_NODE_TYPES = new Set([\"FunctionDeclaration\", \"FunctionExpression\", \"ArrowFunctionExpression\"]);\n\n/**\n * @param {unknown} node\n * @returns {node is ESTNode & { type: string }}\n */\nconst isNode = (node) => Boolean(node && typeof node === \"object\" && \"type\" in node);\n\n/**\n * @param {unknown} node\n * @returns {node is FunctionLikeNode}\n */\nconst isFunctionLike = (node) => isNode(node) && FUNCTION_NODE_TYPES.has(node.type);\n\n/**\n * Check if an expression contains JSX\n * @param {ESTExpression | null | undefined} root\n */\nconst expressionContainsJsx = (root) => {\n if (!root || !isNode(root)) return false;\n\n const stack = [root];\n\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (JSX_NODE_TYPES.has(current.type)) {\n return true;\n }\n\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== root) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\n/**\n * Check if a function returns JSX\n * @param {FunctionLikeNode} node\n */\nconst functionReturnsJsx = (node) => {\n // Check arrow functions with expression body\n if (node.type === \"ArrowFunctionExpression\" && node.body && node.body.type !== \"BlockStatement\") {\n return expressionContainsJsx(node.body);\n }\n\n // Check for return statements in function body\n const body = node.body;\n if (!body || body.type !== \"BlockStatement\") return false;\n\n const stack = [body];\n while (stack.length > 0) {\n const current = stack.pop();\n if (!current || !isNode(current)) continue;\n\n if (current.type === \"ReturnStatement\") {\n const argument = current.argument;\n if (argument && expressionContainsJsx(argument)) {\n return true;\n }\n }\n\n // Don't traverse into nested functions\n if (FUNCTION_NODE_TYPES.has(current.type) && current !== body) {\n continue;\n }\n\n for (const key of Object.keys(current)) {\n if (key === \"parent\") continue;\n\n const value = current[key];\n if (!value) continue;\n\n if (Array.isArray(value)) {\n for (const element of value) {\n if (isNode(element)) {\n stack.push(element);\n }\n }\n } else if (isNode(value)) {\n stack.push(value);\n }\n }\n }\n\n return false;\n};\n\nconst rule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Enforce consistent props parameter naming and disallow destructuring in component parameters.\",\n recommended: false,\n },\n schema: [],\n },\n\n createOnce(context) {\n /**\n * Check if a node is at the top level of the file (module scope)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\n const isTopLevel = (node) => {\n let current = node.parent;\n\n while (current && isNode(current)) {\n // If we hit a Program node, we're at the top level\n if (current.type === \"Program\") {\n return true;\n }\n\n // FunctionDeclarations at the Program level will have Program as parent\n if (node.type === \"FunctionDeclaration\" && current.type === \"Program\") {\n return true;\n }\n\n // For variable declarations: const MyComponent = () => {}\n // The hierarchy is: ArrowFunction -> VariableDeclarator -> VariableDeclaration -> Program\n if (current.type === \"VariableDeclaration\") {\n const parent = current.parent;\n if (parent && isNode(parent) && parent.type === \"Program\") {\n return true;\n }\n }\n\n // If we encounter a function, we're inside a nested function\n if (FUNCTION_NODE_TYPES.has(current.type)) {\n return false;\n }\n\n current = current.parent;\n }\n\n return false;\n };\n\n /**\n * Check if a function is a top-level React component (PascalCase naming at top level)\n * @param {FunctionLikeNode} node\n * @returns {boolean}\n */\n const isTopLevelReactComponent = (node) => {\n // First check if it's at the top level\n if (!isTopLevel(node)) {\n return false;\n }\n\n // Check for named functions (FunctionDeclaration, FunctionExpression with id)\n if (node.id?.name) {\n const firstChar = node.id.name.charAt(0);\n return firstChar === firstChar.toUpperCase();\n }\n\n // For arrow functions and anonymous function expressions, check the parent context\n // to see if they're assigned to a PascalCase variable\n const parent = node.parent;\n if (!parent || !isNode(parent)) {\n return false;\n }\n\n // Check for variable declarations: const MyComponent = () => {}\n if (parent.type === \"VariableDeclarator\" && parent.id && \"name\" in parent.id) {\n const name = parent.id.name;\n if (typeof name === \"string\") {\n const firstChar = name.charAt(0);\n return firstChar === firstChar.toUpperCase();\n }\n }\n\n return false;\n };\n\n /**\n * @param {FunctionLikeNode} node\n */\n const checkFunction = (node) => {\n // Only check functions that return JSX (React components)\n if (!functionReturnsJsx(node)) {\n return;\n }\n\n // Only check functions that are top-level React components (PascalCase naming at top level)\n if (!isTopLevelReactComponent(node)) {\n return;\n }\n\n const params = node.params;\n if (!params || params.length === 0) {\n return;\n }\n\n const firstParam = params[0];\n if (!firstParam || !isNode(firstParam)) {\n return;\n }\n\n // Check if the first parameter is destructured\n if (firstParam.type === \"ObjectPattern\" || firstParam.type === \"ArrayPattern\") {\n context.report({\n node: firstParam,\n message:\n \"Props should not be destructured in the component parameter. Use 'props' instead and destructure inside the component body.\",\n });\n return;\n }\n\n // Check if the first parameter is an Identifier and is named 'props'\n if (firstParam.type === \"Identifier\") {\n if (firstParam.name !== \"props\") {\n context.report({\n node: firstParam,\n message: `Props parameter should be named 'props', not '${firstParam.name}'.`,\n });\n }\n }\n };\n\n return /** @type {import(\"oxlint\").VisitorWithHooks} */ ({\n FunctionDeclaration(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n FunctionExpression(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n ArrowFunctionExpression(node) {\n if (isFunctionLike(node)) checkFunction(node);\n },\n });\n },\n});\n\nexport const prettyPropsRule = rule;\n","import { definePlugin } from \"oxlint/plugins\";\n\nimport { jsxComponentPascalCaseRule } from \"./jsx-component-pascal-case.js\";\nimport { noArrayTypeRule } from \"./no-array-type.js\";\nimport { noComponentDateInstantiationRule } from \"./no-component-date-instantiation.js\";\nimport { noComponentPureFunctionsRule } from \"./no-component-pure-functions.js\";\nimport { noDeleteRule } from \"./no-delete.js\";\nimport { noEmojiRule } from \"./no-emoji.js\";\nimport { noFinallyRule } from \"./no-finally.js\";\nimport { noIifeRule } from \"./no-iife.js\";\nimport { noInlineComponentsRule } from \"./no-inline-components.js\";\nimport { noNestedConditionalsRule } from \"./no-nested-conditionals.js\";\nimport { noNestedPureFunctionsRule } from \"./no-nested-pure-functions.js\";\nimport { noPromiseThenRule } from \"./no-promise-then.js\";\nimport { noReactNamespaceRule } from \"./no-react-namespace.js\";\nimport { noSwitchRule } from \"./no-switch-plugin.js\";\nimport { noTopLevelLetRule } from \"./no-top-level-let.js\";\nimport { noTypeCastRule } from \"./no-type-cast.js\";\nimport { prettyPropsRule } from \"./pretty-props.js\";\n\nconst plugin = definePlugin({\n meta: {\n name: \"conorroberts\",\n },\n rules: {\n \"jsx-component-pascal-case\": jsxComponentPascalCaseRule,\n \"no-array-type\": noArrayTypeRule,\n \"no-component-date-instantiation\": noComponentDateInstantiationRule,\n \"no-component-pure-functions\": noComponentPureFunctionsRule,\n \"no-delete\": noDeleteRule,\n \"no-emoji\": noEmojiRule,\n \"no-finally\": noFinallyRule,\n \"no-iife\": noIifeRule,\n \"no-inline-components\": noInlineComponentsRule,\n \"no-nested-conditionals\": noNestedConditionalsRule,\n \"no-nested-pure-functions\": noNestedPureFunctionsRule,\n \"no-promise-then\": noPromiseThenRule,\n \"no-react-namespace\": noReactNamespaceRule,\n \"no-switch\": noSwitchRule,\n \"no-top-level-let\": noTopLevelLetRule,\n \"no-type-cast\": noTypeCastRule,\n \"pretty-props\": prettyPropsRule,\n },\n});\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAMA,mBAAiB,IAAI,IAAI,CAAC,cAAc,cAAc,CAAC;AAC7D,MAAMC,wBAAsB,IAAI,IAAI;CAAC;CAAuB;CAAsB;CAA0B,CAAC;;;;;AAM7G,MAAMC,YAAU,SAAS,QAAQ,QAAQ,OAAO,SAAS,YAAY,UAAU,KAAK;;;;;AAMpF,MAAMC,oBAAkB,SAASD,SAAO,KAAK,IAAID,sBAAoB,IAAI,KAAK,KAAK;;;;;AAMnF,MAAM,gBAAgB,SAAS,OAAO,SAAS,YAAY,SAAS,KAAK,KAAK;;;;;;AAO9E,MAAM,aAAa,SAAS,OAAO,SAAS,YAAY,aAAa,KAAK,KAAK;;;;AAK/E,MAAMG,qBAAmB,SAAS;AAChC,KAAI,KAAK,SAAS,yBAAyB,KAAK,MAAM,KAAK,GAAG,SAAS,aACrE,QAAO,KAAK,GAAG;AAGjB,MAAK,KAAK,SAAS,wBAAwB,KAAK,SAAS,8BAA8B,KAAK,IAC1F;MAAI,KAAK,GAAG,SAAS,aAAc,QAAO,KAAK,GAAG;;CAGpD,MAAM,SAAS,KAAK;AACpB,KAAI,CAAC,UAAU,CAACF,SAAO,OAAO,CAAE,QAAO;AAEvC,KAAI,OAAO,SAAS,qBAClB,QAAO,OAAO,MAAM,OAAO,GAAG,SAAS,eAAe,OAAO,GAAG,OAAO;AAGzE,KAAI,OAAO,S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AK;;GAE/C,wBAAwB,MAAM;AAC5B,QAAI,eAAe,KAAK,CAAE,eAAc,KAAK;;GAEhD;;CAEJ,CAAC;AAEF,MAAa,kBAAkB;;;;ACnP/B,MAAM,SAAS,aAAa;CAC1B,MAAM,EACJ,MAAM,gBACP;CACD,OAAO;EACL,6BAA6B;EAC7B,iBAAiB;EACjB,mCAAmC;EACnC,+BAA+B;EAC/B,aAAa;EACb,YAAY;EACZ,cAAc;EACd,WAAW;EACX,wBAAwB;EACxB,0BAA0B;EAC1B,4BAA4B;EAC5B,mBAAmB;EACnB,sBAAsB;EACtB,aAAa;EACb,oBAAoB;EACpB,gBAAgB;EAChB,gBAAgB;EACjB;CACF,CAAC;AAEF,6BAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conorroberts/utils",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "license": "ISC",