@venizia/dev-configs 0.5.0-8 → 0.5.0-9

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.
Files changed (165) hide show
  1. package/README.md +15 -11
  2. package/dist/checks/purity/manifest.js +11 -3
  3. package/dist/checks/purity/manifest.js.map +1 -1
  4. package/dist/checks/purity/probe.js +19 -2
  5. package/dist/checks/purity/probe.js.map +1 -1
  6. package/dist/checks/split-report.js +2 -1
  7. package/dist/checks/split-report.js.map +1 -1
  8. package/dist/checks/test-controls.d.ts +9 -1
  9. package/dist/checks/test-controls.js +9 -3
  10. package/dist/checks/test-controls.js.map +1 -1
  11. package/dist/checks/test-dead-code.d.ts +9 -1
  12. package/dist/checks/test-dead-code.js +13 -2
  13. package/dist/checks/test-dead-code.js.map +1 -1
  14. package/dist/checks/test-mutate.d.ts +9 -1
  15. package/dist/checks/test-mutate.js +12 -6
  16. package/dist/checks/test-mutate.js.map +1 -1
  17. package/dist/cli/check.d.ts +0 -1
  18. package/dist/cli/check.js +41 -67
  19. package/dist/cli/check.js.map +1 -1
  20. package/dist/cli/clean.js +3 -2
  21. package/dist/cli/clean.js.map +1 -1
  22. package/dist/cli/codemod/any-aliases.js +13 -12
  23. package/dist/cli/codemod/any-aliases.js.map +1 -1
  24. package/dist/cli/codemod/async-style.d.ts +1 -1
  25. package/dist/cli/codemod/async-style.js +17 -16
  26. package/dist/cli/codemod/async-style.js.map +1 -1
  27. package/dist/cli/codemod/binding-keys.js +14 -13
  28. package/dist/cli/codemod/binding-keys.js.map +1 -1
  29. package/dist/cli/codemod/class-renames.d.ts +1 -1
  30. package/dist/cli/codemod/class-renames.js +30 -11
  31. package/dist/cli/codemod/class-renames.js.map +1 -1
  32. package/dist/cli/codemod/connector-imports.js +12 -11
  33. package/dist/cli/codemod/connector-imports.js.map +1 -1
  34. package/dist/cli/codemod/const-classes.d.ts +1 -1
  35. package/dist/cli/codemod/const-classes.js +21 -20
  36. package/dist/cli/codemod/const-classes.js.map +1 -1
  37. package/dist/cli/codemod/drop-redundant-casts.d.ts +6 -1
  38. package/dist/cli/codemod/drop-redundant-casts.js +27 -19
  39. package/dist/cli/codemod/drop-redundant-casts.js.map +1 -1
  40. package/dist/cli/codemod/env-get.d.ts +3 -3
  41. package/dist/cli/codemod/env-get.js +18 -17
  42. package/dist/cli/codemod/env-get.js.map +1 -1
  43. package/dist/cli/codemod/files.js +2 -2
  44. package/dist/cli/codemod/files.js.map +1 -1
  45. package/dist/cli/codemod/function-to-arrow.d.ts +76 -0
  46. package/dist/cli/codemod/function-to-arrow.js +357 -0
  47. package/dist/cli/codemod/function-to-arrow.js.map +1 -0
  48. package/dist/cli/codemod/index.js +19 -4
  49. package/dist/cli/codemod/index.js.map +1 -1
  50. package/dist/cli/codemod/namespace-functions/index.js +13 -12
  51. package/dist/cli/codemod/namespace-functions/index.js.map +1 -1
  52. package/dist/cli/codemod/typed-route-context.d.ts +27 -0
  53. package/dist/cli/codemod/typed-route-context.js +570 -0
  54. package/dist/cli/codemod/typed-route-context.js.map +1 -0
  55. package/dist/cli/index.js +5 -5
  56. package/dist/cli/index.js.map +1 -1
  57. package/dist/common/cli-output.d.ts +16 -0
  58. package/dist/common/cli-output.js +49 -0
  59. package/dist/common/cli-output.js.map +1 -0
  60. package/dist/compilers/bun.js +1 -1
  61. package/dist/compilers/bun.js.map +1 -1
  62. package/dist/linters/eslint.js +1 -1
  63. package/dist/linters/eslint.js.map +1 -1
  64. package/dist/linters/house/browser-api-patterns.d.ts +1 -3
  65. package/dist/linters/house/browser-api-patterns.js +1 -3
  66. package/dist/linters/house/browser-api-patterns.js.map +1 -1
  67. package/dist/linters/house/common.d.ts +8 -2
  68. package/dist/linters/house/common.js +8 -2
  69. package/dist/linters/house/common.js.map +1 -1
  70. package/dist/linters/house/configs.js +8 -6
  71. package/dist/linters/house/configs.js.map +1 -1
  72. package/dist/linters/house/const-class-values.rule.d.ts +2 -2
  73. package/dist/linters/house/const-class-values.rule.js +14 -5
  74. package/dist/linters/house/const-class-values.rule.js.map +1 -1
  75. package/dist/linters/house/effect-cleanup-consistency.rule.d.ts +2 -2
  76. package/dist/linters/house/effect-cleanup-consistency.rule.js +1 -1
  77. package/dist/linters/house/effect-cleanup-consistency.rule.js.map +1 -1
  78. package/dist/linters/house/framework-api-patterns.d.ts +54 -0
  79. package/dist/linters/house/framework-api-patterns.js +62 -0
  80. package/dist/linters/house/framework-api-patterns.js.map +1 -0
  81. package/dist/linters/house/framework-exports.js +3 -3
  82. package/dist/linters/house/framework-exports.js.map +1 -1
  83. package/dist/linters/house/index.d.ts +3 -4
  84. package/dist/linters/house/index.js +4 -6
  85. package/dist/linters/house/index.js.map +1 -1
  86. package/dist/linters/house/max-params-own.rule.d.ts +2 -2
  87. package/dist/linters/house/max-params-own.rule.js +1 -1
  88. package/dist/linters/house/max-params-own.rule.js.map +1 -1
  89. package/dist/linters/house/no-async-hook-callback.rule.d.ts +2 -2
  90. package/dist/linters/house/no-async-hook-callback.rule.js +1 -1
  91. package/dist/linters/house/no-async-hook-callback.rule.js.map +1 -1
  92. package/dist/linters/house/no-await-new-chain.rule.d.ts +2 -2
  93. package/dist/linters/house/no-await-new-chain.rule.js +1 -1
  94. package/dist/linters/house/no-await-new-chain.rule.js.map +1 -1
  95. package/dist/linters/house/no-await-promise-chain.rule.d.ts +2 -2
  96. package/dist/linters/house/no-await-promise-chain.rule.js +1 -1
  97. package/dist/linters/house/no-await-promise-chain.rule.js.map +1 -1
  98. package/dist/linters/house/no-inline-await.rule.d.ts +2 -2
  99. package/dist/linters/house/no-inline-await.rule.js +1 -1
  100. package/dist/linters/house/no-inline-await.rule.js.map +1 -1
  101. package/dist/linters/house/no-leaked-render.rule.d.ts +2 -2
  102. package/dist/linters/house/no-leaked-render.rule.js +1 -1
  103. package/dist/linters/house/no-leaked-render.rule.js.map +1 -1
  104. package/dist/linters/house/no-new-error.rule.d.ts +2 -2
  105. package/dist/linters/house/no-new-error.rule.js +2 -2
  106. package/dist/linters/house/no-new-error.rule.js.map +1 -1
  107. package/dist/linters/house/no-parent-import.rule.d.ts +5 -2
  108. package/dist/linters/house/no-parent-import.rule.js +5 -2
  109. package/dist/linters/house/no-parent-import.rule.js.map +1 -1
  110. package/dist/linters/house/no-return-await.rule.d.ts +2 -2
  111. package/dist/linters/house/no-return-await.rule.js +1 -1
  112. package/dist/linters/house/no-return-await.rule.js.map +1 -1
  113. package/dist/linters/house/no-shadow-framework-type.rule.d.ts +2 -2
  114. package/dist/linters/house/no-shadow-framework-type.rule.js +2 -2
  115. package/dist/linters/house/no-shadow-framework-type.rule.js.map +1 -1
  116. package/dist/linters/house/no-silent-catch.rule.d.ts +2 -2
  117. package/dist/linters/house/no-silent-catch.rule.js +3 -3
  118. package/dist/linters/house/no-silent-catch.rule.js.map +1 -1
  119. package/dist/linters/house/no-unbraced-case.rule.d.ts +2 -2
  120. package/dist/linters/house/no-unbraced-case.rule.js +1 -1
  121. package/dist/linters/house/no-unbraced-case.rule.js.map +1 -1
  122. package/dist/linters/house/plugin.d.ts +1 -1
  123. package/dist/linters/house/plugin.js +6 -5
  124. package/dist/linters/house/plugin.js.map +1 -1
  125. package/dist/linters/house/prefer-framework-api.rule.d.ts +39 -7
  126. package/dist/linters/house/prefer-framework-api.rule.js +285 -12
  127. package/dist/linters/house/prefer-framework-api.rule.js.map +1 -1
  128. package/dist/linters/house/prefer-promise-sleep.rule.d.ts +2 -2
  129. package/dist/linters/house/prefer-promise-sleep.rule.js +3 -2
  130. package/dist/linters/house/prefer-promise-sleep.rule.js.map +1 -1
  131. package/dist/linters/house/prefer-tnullable.rule.d.ts +2 -2
  132. package/dist/linters/house/prefer-tnullable.rule.js +2 -2
  133. package/dist/linters/house/prefer-tnullable.rule.js.map +1 -1
  134. package/dist/linters/house/typed-route-context.rule.d.ts +19 -0
  135. package/dist/linters/house/typed-route-context.rule.js +322 -0
  136. package/dist/linters/house/typed-route-context.rule.js.map +1 -0
  137. package/dist/linters/house/zod-schema-convention.rule.d.ts +82 -0
  138. package/dist/linters/house/zod-schema-convention.rule.js +477 -0
  139. package/dist/linters/house/zod-schema-convention.rule.js.map +1 -0
  140. package/dist/linters/oxlint.js +11 -1
  141. package/dist/linters/oxlint.js.map +1 -1
  142. package/dist/linters/react-eslint.js.map +1 -1
  143. package/dist/linters/rules/naming-convention.rule.d.ts +4 -1
  144. package/dist/linters/rules/naming-convention.rule.js +30 -1
  145. package/dist/linters/rules/naming-convention.rule.js.map +1 -1
  146. package/dist/linters/rules/no-restricted-properties.rule.js +1 -1
  147. package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -1
  148. package/dist/testing/spawn.utility.js +1 -1
  149. package/dist/testing/spawn.utility.js.map +1 -1
  150. package/package.json +5 -5
  151. package/dist/checks/use-when-baseline.d.ts +0 -25
  152. package/dist/checks/use-when-baseline.js +0 -38
  153. package/dist/checks/use-when-baseline.js.map +0 -1
  154. package/dist/linters/house/framework-rule-apis.d.ts +0 -24
  155. package/dist/linters/house/framework-rule-apis.js +0 -48
  156. package/dist/linters/house/framework-rule-apis.js.map +0 -1
  157. package/dist/linters/house/public-surface.d.ts +0 -57
  158. package/dist/linters/house/public-surface.js +0 -174
  159. package/dist/linters/house/public-surface.js.map +0 -1
  160. package/dist/linters/house/published-package-configs.d.ts +0 -23
  161. package/dist/linters/house/published-package-configs.js +0 -42
  162. package/dist/linters/house/published-package-configs.js.map +0 -1
  163. package/dist/linters/house/require-use-when.rule.d.ts +0 -42
  164. package/dist/linters/house/require-use-when.rule.js +0 -175
  165. package/dist/linters/house/require-use-when.rule.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-route-context.js","sourceRoot":"","sources":["../../../src/cli/codemod/typed-route-context.ts"],"names":[],"mappings":";;;AAAA,qCAAsD;AACtD,yCAA8C;AAE9C,mCAAuC;AACvC,wDAAoD;AAEpD,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;qMAwBuL,CAAC;AAEtM,kDAAkD;AAClD,MAA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AC,CAAC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;QAED,sBAAS,CAAC,GAAG,CACX,qCAAqC,YAAY,YAAY,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,KAAK,cAAc,aAAa,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,EAAE;YAC7K,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CACxD,CAAC;QAEF,IAAI,CAAC,OAAO,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACjC,sBAAS,CAAC,GAAG,CACX,uCAAuC,sBAAsB,CAAC,KAAK,qCAAqC,CACzG,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,OAAO,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;;AAhIH,4DAiIC","sourcesContent":["import { readFileSync, writeFileSync } from 'node:fs';\nimport { relative, resolve } from 'node:path';\nimport type TypeScript from 'typescript';\nimport { CodemodFiles } from './files';\nimport { CliOutput } from '../../common/cli-output';\n\nconst USAGE = `Usage: devz codemod typed-route-context [paths...] [--write [--all] | --check]\n\nTypes route handlers from their route config (TContextOf). In a file that imports the types from @venizia/ignis or\n@venizia/ignis-kernel:\n\n- a decorated method (@api, @get, @post, @put, @patch, @del) whose configs is a name declared or imported in the\n file: its TRouteContext becomes TContextOf<typeof CONFIG>, and valid<T>() on it loses its type argument;\n- the same for a private method that only the handlers of one route config in its class pass their context to;\n- TRouteContext<Env, Body> drops the body, and TRouteHandler<Response, Env> drops the response.\n\nLeft as they are, for you: a handler of a CRUD override, a method that serves two routes or is also called another\nway, an inline or this.* config, and a context typed through an alias of yours. The typecheck then names each place\nwhere a type you wrote by hand differs from the schema.\n\nA config declared as IAuthRouteConfig, or in a Record of it, carries no schema type: change it to\n\"satisfies\" first (the lint rule @venizia/typed-route-context reports each one). A handler of such a config declared\nin the same file is left as it is; one imported from another file cannot be seen, so change those first.\n\n --write write the changed files (without it, nothing is written); it needs a path, or --all\n --all with --write and no path: rewrite every source file under the working directory\n --check dry run that exits 1 while a file would change (for CI)\n --help print this text and exit\n\nWith no flag it lists what would change and writes nothing. Inside a git repository it reads the files git\nknows (tracked, or untracked and not ignored), and --write refuses a file with local changes (changed since staged, or untracked): commit, stash or \"git add\" it first, so git can undo the codemod.`;\n\n/** A usage error: nothing was read or written. */\nconst USAGE_ERROR_CODE = 2;\n\nclass TypedRouteContextFlags {\n static readonly WRITE = '--write';\n static readonly ALL = '--all';\n static readonly CHECK = '--check';\n static readonly HELP = '--help';\n static readonly HELP_SHORT = '-h';\n\n static readonly SCHEME_SET = new Set<string>([\n this.WRITE,\n this.ALL,\n this.CHECK,\n this.HELP,\n this.HELP_SHORT,\n ]);\n\n static isValid(value: string): boolean {\n return this.SCHEME_SET.has(value);\n }\n}\n\nconst PACKAGES = ['@venizia/ignis', '@venizia/ignis-kernel'];\nconst DECORATORS = new Set(['api', 'get', 'post', 'put', 'patch', 'del']);\nconst CONTEXT = 'TRouteContext';\nconst HANDLER = 'TRouteHandler';\nconst TYPED = 'TContextOf';\n\nexport interface ITypedRouteContextResult {\n output: string;\n changed: boolean;\n /** How many places were rewritten. */\n rewritten: number;\n}\n\n/** One file's rewrite: the edits found so far, applied from the end of the file. */\nclass RouteContextFile {\n private static readonly IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n private readonly file: TypeScript.SourceFile;\n private readonly edits = new Map<number, { start: number; end: number; text: string }>();\n /** The local names the framework's types were imported under. */\n private readonly locals = new Map<string, string>();\n /** The names a `typeof` at the top of the file can read. */\n private readonly topLevel = new Set<string>();\n /** The configs this file declares as `IAuthRouteConfig`, as a name or `Class.member`: their type holds no schema. */\n private readonly wide = new Set<string>();\n\n constructor(\n private readonly options: {\n typescript: typeof TypeScript;\n fileName: string;\n source: string;\n },\n ) {\n const { typescript: ts, fileName, source } = options;\n const scriptKind = fileName.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS;\n this.file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true, scriptKind);\n }\n\n rewrite(): ITypedRouteContextResult {\n const { typescript: ts, source } = this.options;\n this.readTopLevel();\n\n if (this.locals.size === 0) {\n return { output: source, changed: false, rewritten: 0 };\n }\n\n const visit = (node: TypeScript.Node): void => {\n if (ts.isClassLike(node)) {\n this.typeClass(node);\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(this.file);\n this.dropRemovedArguments(this.file);\n const rewritten = this.edits.size;\n\n if (rewritten === 0) {\n return { output: source, changed: false, rewritten };\n }\n\n this.fixImport();\n let output = source;\n\n for (const edit of [...this.edits.values()].sort((a, b) => b.start - a.start)) {\n output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);\n }\n\n return { output, changed: output !== source, rewritten };\n }\n\n private replace(opts: { start: number; end: number; text: string }) {\n this.edits.set(opts.start, opts);\n }\n\n private readTopLevel() {\n const { typescript: ts } = this.options;\n\n for (const statement of this.file.statements) {\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n const name = declaration.name.getText(this.file);\n this.topLevel.add(name);\n\n if (this.isWideDeclaration(declaration)) {\n this.wide.add(name);\n }\n }\n }\n\n if (ts.isClassDeclaration(statement) && statement.name) {\n const owner = statement.name.text;\n this.topLevel.add(owner);\n\n for (const member of statement.members) {\n if (ts.isPropertyDeclaration(member) && this.isWideDeclaration(member)) {\n this.wide.add(`${owner}.${member.name.getText(this.file)}`);\n }\n }\n }\n\n if (!ts.isImportDeclaration(statement)) {\n continue;\n }\n\n const specifier = statement.moduleSpecifier.getText(this.file).slice(1, -1);\n const bindings = statement.importClause?.namedBindings;\n const defaultName = statement.importClause?.name;\n\n if (defaultName) {\n this.topLevel.add(defaultName.text);\n }\n\n if (!bindings) {\n continue;\n }\n\n if (ts.isNamespaceImport(bindings)) {\n this.topLevel.add(bindings.name.text);\n continue;\n }\n\n const isFramework = PACKAGES.some(\n (name) => specifier === name || specifier.startsWith(`${name}/`),\n );\n\n for (const element of bindings.elements) {\n this.topLevel.add(element.name.text);\n const imported = (element.propertyName ?? element.name).text;\n\n if (isFramework && (imported === CONTEXT || imported === HANDLER || imported === TYPED)) {\n this.locals.set(element.name.text, imported);\n }\n }\n }\n }\n\n /** Whether a declaration is typed `IAuthRouteConfig`, in an `Omit` or a `Record` too, by annotation or by `as`. */\n private isWideDeclaration(\n declaration: TypeScript.VariableDeclaration | TypeScript.PropertyDeclaration,\n ): boolean {\n const { typescript: ts } = this.options;\n const { initializer } = declaration;\n const asserted = initializer && ts.isAsExpression(initializer) ? initializer.type : undefined;\n\n const isWide = (type: TypeScript.TypeNode | undefined): boolean => {\n if (!type || !ts.isTypeReferenceNode(type)) {\n return false;\n }\n\n const name = type.typeName.getText(this.file);\n const [first, second] = type.typeArguments ?? [];\n\n if (name === 'Record') {\n return isWide(second);\n }\n\n return name === 'Omit' ? isWide(first) : name === 'IAuthRouteConfig';\n };\n\n return isWide(declaration.type) || isWide(asserted);\n }\n\n /** The framework type a type reference names. */\n private frameworkType(node: TypeScript.Node): string | undefined {\n const { typescript: ts } = this.options;\n\n return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName)\n ? this.locals.get(node.typeName.text)\n : undefined;\n }\n\n /**\n * The type of a `configs` expression a `typeof` can read here (`typeof Routes.CREATE`, `(typeof Routes)['/create']`);\n * `undefined` for anything else.\n */\n private configOf(options: TypeScript.Expression | undefined): string | undefined {\n const { typescript: ts } = this.options;\n\n if (!options || !ts.isObjectLiteralExpression(options)) {\n return undefined;\n }\n\n const property = options.properties.find((item) => item.name?.getText(this.file) === 'configs');\n\n if (!property || !ts.isPropertyAssignment(property)) {\n return undefined;\n }\n\n const keys: string[] = [];\n let current: TypeScript.Expression = property.initializer;\n\n while (ts.isPropertyAccessExpression(current) || ts.isElementAccessExpression(current)) {\n if (ts.isPropertyAccessExpression(current)) {\n keys.unshift(current.name.text);\n } else if (ts.isStringLiteralLike(current.argumentExpression)) {\n keys.unshift(current.argumentExpression.text);\n } else {\n return undefined;\n }\n\n current = current.expression;\n }\n\n if (!ts.isIdentifier(current) || !this.topLevel.has(current.text)) {\n return undefined;\n }\n\n if (this.wide.has(current.text) || this.wide.has(`${current.text}.${keys[0]}`)) {\n return undefined;\n }\n\n const firstQuoted = keys.findIndex((key) => !RouteContextFile.IDENTIFIER.test(key));\n const dotted = firstQuoted === -1 ? keys : keys.slice(0, firstQuoted);\n const query = `typeof ${[current.text, ...dotted].join('.')}`;\n\n if (firstQuoted === -1) {\n return query;\n }\n\n const indexed = keys\n .slice(firstQuoted)\n .map((key) => `['${key.replaceAll('\\\\', '\\\\\\\\').replaceAll(\"'\", \"\\\\'\")}']`);\n\n return `(${query})${indexed.join('')}`;\n }\n\n /** Types the decorated methods of a class, and the methods only one route's handlers pass their context to. */\n private typeClass(node: TypeScript.ClassLikeDeclaration) {\n const { typescript: ts } = this.options;\n const forwarded = this.forwardsOf(node);\n\n for (const member of node.members) {\n if (!ts.isMethodDeclaration(member)) {\n continue;\n }\n\n const decorated = (ts.getDecorators(member) ?? []).flatMap((decorator) => {\n const call = decorator.expression;\n\n return ts.isCallExpression(call) && DECORATORS.has(call.expression.getText(this.file))\n ? [this.configOf(call.arguments[0])]\n : [];\n });\n const isPrivate =\n ts.isPrivateIdentifier(member.name) ||\n member.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.PrivateKeyword) ===\n true;\n\n // Only a private method is known to be reached from this class alone.\n if (decorated.length === 0 && !isPrivate) {\n continue;\n }\n\n const routes = [...decorated, ...(forwarded.get(member.name.getText(this.file)) ?? [])];\n const [config] = routes;\n\n if (config !== undefined && routes.every((route) => route === config)) {\n this.typeMethod({ method: member, config });\n }\n }\n }\n\n /**\n * The routes whose handlers pass their context straight to each method of the class. A method also reached another\n * way gets an `undefined` route, which keeps it as it is.\n */\n private forwardsOf(node: TypeScript.ClassLikeDeclaration) {\n const { typescript: ts } = this.options;\n const routes = new Map<string, Array<string | undefined>>();\n const passed = new Set<TypeScript.Node>();\n\n const add = (method: string, route: string | undefined) => {\n routes.set(method, [...(routes.get(method) ?? []), route]);\n };\n\n const visit = (current: TypeScript.Node): void => {\n if (ts.isCallExpression(current) && ts.isPropertyAccessExpression(current.expression)) {\n const forward = this.forwardOf(current);\n\n if (forward) {\n passed.add(forward.access);\n add(forward.method, forward.config);\n }\n }\n\n if (\n ts.isPropertyAccessExpression(current) &&\n current.expression.kind === ts.SyntaxKind.ThisKeyword &&\n !passed.has(current)\n ) {\n add(current.name.text, undefined);\n }\n\n ts.forEachChild(current, visit);\n };\n\n ts.forEachChild(node, visit);\n\n return routes;\n }\n\n /** The method a `defineRoute`, `defineJSXRoute` or `bindRoute().to` call forwards its context to. */\n private forwardOf(call: TypeScript.CallExpression) {\n const { typescript: ts } = this.options;\n const callee = call.expression;\n\n if (!ts.isPropertyAccessExpression(callee)) {\n return undefined;\n }\n\n const name = callee.name.text;\n const [options] = call.arguments;\n let routeOptions: TypeScript.Expression | undefined;\n\n if (name === 'defineRoute' || name === 'defineJSXRoute') {\n routeOptions = options;\n } else if (\n name === 'to' &&\n ts.isCallExpression(callee.expression) &&\n ts.isPropertyAccessExpression(callee.expression.expression) &&\n callee.expression.expression.name.text === 'bindRoute'\n ) {\n routeOptions = callee.expression.arguments[0];\n }\n\n if (!routeOptions || !options || !ts.isObjectLiteralExpression(options)) {\n return undefined;\n }\n\n const handler = options.properties.find((item) => item.name?.getText(this.file) === 'handler');\n\n if (!handler || !ts.isPropertyAssignment(handler) || !ts.isArrowFunction(handler.initializer)) {\n return undefined;\n }\n\n const [parameter] = handler.initializer.parameters;\n let body: TypeScript.Node | undefined = handler.initializer.body;\n\n if (ts.isBlock(body)) {\n const [only, ...others] = body.statements;\n body =\n only && others.length === 0 && ts.isReturnStatement(only) ? only.expression : undefined;\n }\n\n if (body && ts.isAwaitExpression(body)) {\n body = body.expression;\n }\n\n if (\n !parameter ||\n !body ||\n !ts.isCallExpression(body) ||\n !ts.isPropertyAccessExpression(body.expression) ||\n body.expression.expression.kind !== ts.SyntaxKind.ThisKeyword\n ) {\n return undefined;\n }\n\n const context = parameter.name.getText(this.file);\n const passes = body.arguments.some((argument) => {\n if (!ts.isObjectLiteralExpression(argument)) {\n return argument.getText(this.file) === context;\n }\n\n return argument.properties.some(\n (item) =>\n item.name?.getText(this.file) === 'context' &&\n (ts.isShorthandPropertyAssignment(item)\n ? context === 'context'\n : ts.isPropertyAssignment(item) && item.initializer.getText(this.file) === context),\n );\n });\n\n return passes\n ? {\n access: body.expression,\n method: body.expression.name.text,\n config: this.configOf(routeOptions),\n }\n : undefined;\n }\n\n /** Writes `TContextOf<typeof config>` on the method's context, and drops the type arguments of its `valid()`. */\n private typeMethod(opts: { method: TypeScript.MethodDeclaration; config: string }) {\n const { typescript: ts } = this.options;\n const { method, config } = opts;\n /** The paths that hold the retyped context, as written: `context`, `opts.context`. */\n const holders = new Set<string>();\n\n for (const parameter of method.parameters) {\n let type = parameter.type;\n let path = parameter.name.getText(this.file);\n\n if (type && ts.isTypeLiteralNode(type)) {\n const member = type.members.find((item) => item.name?.getText(this.file) === 'context');\n type = member && ts.isPropertySignature(member) ? member.type : undefined;\n path = ts.isIdentifier(parameter.name) ? `${path}.context` : 'context';\n }\n\n if (!type || !ts.isTypeReferenceNode(type) || this.frameworkType(type) !== CONTEXT) {\n continue;\n }\n\n const environment = type.typeArguments?.[0]?.getText(this.file);\n const suffix = environment ? `, ${environment}` : '';\n this.replace({\n start: type.getStart(this.file),\n end: type.getEnd(),\n text: `${this.localName(TYPED)}<${config}${suffix}>`,\n });\n holders.add(path);\n }\n\n if (holders.size === 0 || !method.body) {\n return;\n }\n\n const visit = (node: TypeScript.Node): void => {\n if (\n ts.isVariableDeclaration(node) &&\n ts.isObjectBindingPattern(node.name) &&\n node.initializer &&\n holders.has(`${node.initializer.getText(this.file)}.context`)\n ) {\n holders.add('context');\n }\n\n if (\n ts.isCallExpression(node) &&\n node.typeArguments &&\n ts.isPropertyAccessExpression(node.expression) &&\n node.expression.name.text === 'valid' &&\n ts.isPropertyAccessExpression(node.expression.expression) &&\n node.expression.expression.name.text === 'req' &&\n holders.has(node.expression.expression.expression.getText(this.file))\n ) {\n this.replace({\n start: node.expression.getEnd(),\n end: node.typeArguments.end + 1,\n text: '',\n });\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(method.body);\n }\n\n /** Drops the response arguments the framework's types no longer take, outside the contexts already retyped. */\n private dropRemovedArguments(node: TypeScript.Node) {\n const { typescript: ts } = this.options;\n\n if (\n ts.isTypeReferenceNode(node) &&\n node.typeArguments?.length === 2 &&\n !this.edits.has(node.getStart(this.file))\n ) {\n const type = this.frameworkType(node);\n const [first, second] = node.typeArguments;\n const kept = type === CONTEXT ? first : type === HANDLER ? second : undefined;\n\n if (kept) {\n this.replace({\n start: node.getStart(this.file),\n end: node.getEnd(),\n text: `${node.typeName.getText(this.file)}<${kept.getText(this.file)}>`,\n });\n }\n }\n\n ts.forEachChild(node, (child) => this.dropRemovedArguments(child));\n }\n\n /** The local name of a framework type, or its own name when the file does not import it yet. */\n private localName(type: string): string {\n return [...this.locals].find(([, imported]) => imported === type)?.[0] ?? type;\n }\n\n /** Imports `TContextOf` beside the type it replaced, and drops `TRouteContext` when nothing reads it any more. */\n private fixImport() {\n const { typescript: ts } = this.options;\n /** Whether an edit takes this node away: one that writes the name back (`TRouteContext<Env>`) does not. */\n const isRemoved = (node: TypeScript.Node, name: string) =>\n [...this.edits.values()].some(\n (edit) =>\n edit.start <= node.getStart(this.file) &&\n edit.end >= node.getEnd() &&\n !edit.text.split(/[^\\w$]+/).includes(name),\n );\n const usesTyped = [...this.edits.values()].some((edit) =>\n edit.text.startsWith(`${this.localName(TYPED)}<`),\n );\n\n if (!usesTyped) {\n return;\n }\n\n const contextName = this.localName(CONTEXT);\n let isStillRead = false;\n\n const visit = (node: TypeScript.Node): void => {\n if (ts.isImportDeclaration(node)) {\n return;\n }\n\n if (\n ts.isIdentifier(node) &&\n node.text === contextName &&\n !isRemoved(node.parent, contextName)\n ) {\n isStillRead = true;\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(this.file);\n const needsImport = ![...this.locals.values()].includes(TYPED);\n\n for (const statement of this.file.statements) {\n if (!ts.isImportDeclaration(statement)) {\n continue;\n }\n\n const bindings = statement.importClause?.namedBindings;\n\n if (!bindings || !ts.isNamedImports(bindings)) {\n continue;\n }\n\n const old = bindings.elements.find((element) => element.name.text === contextName);\n\n if (!old) {\n continue;\n }\n\n const isTypeOnly = statement.importClause?.isTypeOnly === true;\n const added = isTypeOnly ? TYPED : `type ${TYPED}`;\n const names = [\n ...(isStillRead ? [old.getText(this.file)] : []),\n ...(needsImport ? [added] : []),\n ];\n\n if (names.length > 0) {\n this.replace({\n start: old.getStart(this.file),\n end: old.getEnd(),\n text: names.join(', '),\n });\n\n return;\n }\n\n const others = bindings.elements.filter((element) => element !== old);\n this.replace({\n start: bindings.getStart(this.file),\n end: bindings.getEnd(),\n text: `{ ${others.map((element) => element.getText(this.file)).join(', ')} }`,\n });\n\n return;\n }\n }\n}\n\n/** Types route handlers from their route configs. */\nexport class TypedRouteContext {\n static rewrite(opts: {\n typescript: typeof TypeScript;\n fileName: string;\n source: string;\n }): ITypedRouteContextResult {\n return new RouteContextFile(opts).rewrite();\n }\n}\n\n/**\n * `devz codemod typed-route-context [paths...] [--write [--all] | --check]`. It is a dry run unless `--write` is\n * given. `--check` is the same dry run, and exits 1 while a file would change.\n */\nexport class TypedRouteContextCommand {\n static readonly USAGE = USAGE;\n\n static async run(opts: { root: string; args: string[] }): Promise<number> {\n const { root, args } = opts;\n\n if (\n args.includes(TypedRouteContextFlags.HELP) ||\n args.includes(TypedRouteContextFlags.HELP_SHORT)\n ) {\n CliOutput.log(USAGE);\n\n return 0;\n }\n\n const flags = args.filter((argument) => argument.startsWith('-'));\n const paths = args.filter((argument) => !argument.startsWith('-'));\n const unknown = flags.filter((flag) => !TypedRouteContextFlags.isValid(flag));\n\n if (unknown.length > 0) {\n CliOutput.error(\n `devz codemod: unknown option ${unknown.map((flag) => `\"${flag}\"`).join(', ')}\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n\n const isWrite = flags.includes(TypedRouteContextFlags.WRITE);\n const isCheck = flags.includes(TypedRouteContextFlags.CHECK);\n\n if (isWrite && isCheck) {\n CliOutput.error(\n `devz codemod: ${TypedRouteContextFlags.WRITE} and ${TypedRouteContextFlags.CHECK} contradict each other\\n${USAGE}`,\n );\n\n return USAGE_ERROR_CODE;\n }\n\n const refusal = CodemodFiles.refusal({\n command: 'typed-route-context',\n isWrite,\n isAll: flags.includes(TypedRouteContextFlags.ALL),\n paths,\n });\n\n if (refusal) {\n CliOutput.error(`${refusal}\\n${USAGE}`);\n\n return USAGE_ERROR_CODE;\n }\n\n let typescript: typeof TypeScript;\n\n try {\n const loaded = await import('typescript');\n typescript = loaded.default;\n } catch {\n CliOutput.error('devz codemod: the \"typescript\" package is required to read your sources');\n\n return 1;\n }\n\n const targets = (paths.length > 0 ? paths : ['.']).map((path) => resolve(root, path));\n let changedCount = 0;\n let rewrittenCount = 0;\n let refusedCount = 0;\n\n for (const target of targets) {\n const files = CodemodFiles.collect({ target });\n const dirty = isWrite ? CodemodFiles.dirty({ target }) : undefined;\n\n if (files.length === 0 && paths.length > 0) {\n CliOutput.warn(\n `devz codemod: no source files under \"${relative(root, target) || target}\" (git ignores the path, or it holds none): nothing was read`,\n );\n }\n\n for (const file of files) {\n const source = readFileSync(file, 'utf8');\n\n if (!source.includes(CONTEXT) && !source.includes(HANDLER)) {\n continue;\n }\n\n const result = TypedRouteContext.rewrite({ typescript, fileName: file, source });\n\n if (!result.changed) {\n continue;\n }\n\n const shown = relative(root, file).split('\\\\').join('/') || file;\n\n if (dirty?.has(file)) {\n refusedCount += 1;\n CliOutput.warn(\n `refused ${shown} has local changes (commit, stash or \"git add\" them, then run again)`,\n );\n continue;\n }\n\n changedCount += 1;\n rewrittenCount += result.rewritten;\n CliOutput.log(\n `${isWrite ? 'changed' : 'would change'} ${shown} (${result.rewritten} place(s))`,\n );\n\n if (isWrite) {\n writeFileSync(file, result.output);\n }\n }\n }\n\n CliOutput.log(\n `devz codemod typed-route-context: ${changedCount} file(s) ${isWrite ? 'changed' : 'would change'}, ${rewrittenCount} place(s) ${isWrite ? 'rewritten' : 'would be rewritten'}` +\n (refusedCount > 0 ? `, ${refusedCount} refused` : ''),\n );\n\n if (!isWrite && changedCount > 0) {\n CliOutput.log(\n `Nothing was written. Run again with ${TypedRouteContextFlags.WRITE} to apply, then run your typecheck.`,\n );\n }\n\n if (isWrite && refusedCount > 0) {\n return 1;\n }\n\n return isCheck && changedCount > 0 ? 1 : 0;\n }\n}\n"]}
package/dist/cli/index.js CHANGED
@@ -5,27 +5,27 @@ const check_1 = require("./check");
5
5
  const clean_1 = require("./clean");
6
6
  const codemod_1 = require("./codemod");
7
7
  const lint_1 = require("./lint");
8
+ const cli_output_1 = require("../common/cli-output");
8
9
  const USAGE = `Usage: devz <command> [options]
9
10
 
10
11
  Commands:
11
12
  lint [--fix] [files] oxlint, ESLint and the formatter; --fix writes
12
13
  check purity --claims <file> [package] [--json] probe every entry claimed browser-pure (needs a build)
13
14
  check module-cycles | split-report | catalog shared repository gates; devz check --help lists their options
14
- check use-when-baseline [--write] the exports of this package that still lack a @useWhen (the baseline of require-use-when)
15
15
  clean remove dist, node_modules/.cache and *.tsbuildinfo
16
16
  codemod drop-redundant-casts [paths...] remove \`as X\` casts the compiler no longer needs (dry run unless --write)
17
17
  codemod const-classes [paths...] turn a string-literal union into a const class (dry run unless --write)
18
18
  codemod async-style [paths...] apply the async-style lint fixers and list the rest (dry run unless --write)
19
19
  codemod namespace-functions [paths...] move calls of a function that moved into a class to the class form (dry run unless --write)
20
20
  codemod connector-imports [paths...] move @venizia/ignis/<connector sub-path> imports to @venizia/ignis-connectors (dry run unless --write)
21
- codemod env-get [paths...] strip the type arguments of applicationEnvironment.get() for the string-reading get() (dry run unless --write)
21
+ codemod env-get [paths...] strip the type arguments of AppEnvs.get() for the string-reading get() (dry run unless --write)
22
22
  codemod any-aliases [paths...] replace the removed AnyType and AnyObject aliases by what they stood for, any (--strict: unknown and Record<string, unknown>; dry run unless --write)
23
23
 
24
24
  Run \`devz clean --help\` or \`devz codemod --help\` for a command's options.`;
25
25
  const main = async (opts) => {
26
26
  const [command, ...args] = opts.argv;
27
27
  if (command === undefined || command === '--help' || command === '-h') {
28
- console.log(USAGE);
28
+ cli_output_1.CliOutput.log(USAGE);
29
29
  return 0;
30
30
  }
31
31
  if (command === 'lint') {
@@ -40,11 +40,11 @@ const main = async (opts) => {
40
40
  if (command === 'codemod') {
41
41
  return codemod_1.CodemodCommand.run({ root: process.cwd(), args });
42
42
  }
43
- console.error(`devz: unknown command "${command ?? ''}"\n${USAGE}`);
43
+ cli_output_1.CliOutput.error(`devz: unknown command "${command ?? ''}"\n${USAGE}`);
44
44
  return 1;
45
45
  };
46
46
  main({ argv: process.argv.slice(2) }).then((exitCode) => process.exit(exitCode), (error) => {
47
- console.error(error);
47
+ cli_output_1.CliOutput.error(error);
48
48
  process.exit(1);
49
49
  });
50
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AACA,mCAAuC;AACvC,mCAAuC;AACvC,uCAA2C;AAC3C,iCAAqC;AAErC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;8EAgBgE,CAAC;AAE/E,MAAM,IAAI,GAAG,KAAK,EAAE,IAAwB,EAAmB,EAAE;IAC/D,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;IAErC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAA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ACF,CAAC","sourcesContent":["#!/usr/bin/env bun\nimport { CheckCommand } from './check';\nimport { CleanCommand } from './clean';\nimport { CodemodCommand } from './codemod';\nimport { LintCommand } from './lint';\n\nconst USAGE = `Usage: devz <command> [options]\n\nCommands:\n lint [--fix] [files] oxlint, ESLint and the formatter; --fix writes\n check purity --claims <file> [package] [--json] probe every entry claimed browser-pure (needs a build)\n check module-cycles | split-report | catalog shared repository gates; devz check --help lists their options\n check use-when-baseline [--write] the exports of this package that still lack a @useWhen (the baseline of require-use-when)\n clean remove dist, node_modules/.cache and *.tsbuildinfo\n codemod drop-redundant-casts [paths...] remove \\`as X\\` casts the compiler no longer needs (dry run unless --write)\n codemod const-classes [paths...] turn a string-literal union into a const class (dry run unless --write)\n codemod async-style [paths...] apply the async-style lint fixers and list the rest (dry run unless --write)\n codemod namespace-functions [paths...] move calls of a function that moved into a class to the class form (dry run unless --write)\n codemod connector-imports [paths...] move @venizia/ignis/<connector sub-path> imports to @venizia/ignis-connectors (dry run unless --write)\n codemod env-get [paths...] strip the type arguments of applicationEnvironment.get() for the string-reading get() (dry run unless --write)\n codemod any-aliases [paths...] replace the removed AnyType and AnyObject aliases by what they stood for, any (--strict: unknown and Record<string, unknown>; dry run unless --write)\n\nRun \\`devz clean --help\\` or \\`devz codemod --help\\` for a command's options.`;\n\nconst main = async (opts: { argv: string[] }): Promise<number> => {\n const [command, ...args] = opts.argv;\n\n if (command === undefined || command === '--help' || command === '-h') {\n console.log(USAGE);\n\n return 0;\n }\n\n if (command === 'lint') {\n return LintCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'check') {\n return CheckCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'clean') {\n return CleanCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'codemod') {\n return CodemodCommand.run({ root: process.cwd(), args });\n }\n\n console.error(`devz: unknown command \"${command ?? ''}\"\\n${USAGE}`);\n\n return 1;\n};\n\nmain({ argv: process.argv.slice(2) }).then(\n (exitCode) => process.exit(exitCode),\n (error: unknown) => {\n console.error(error);\n process.exit(1);\n },\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AACA,mCAAuC;AACvC,mCAAuC;AACvC,uCAA2C;AAC3C,iCAAqC;AACrC,qDAAiD;AAEjD,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;8EAegE,CAAC;AAE/E,MAAM,IAAI,GAAG,KAAK,EAAE,IAAwB,EAAmB,EAAE;IAC/D,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;IAErC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACtE,sBAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAErB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QACvB,OAAO,kBAAW,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,oBAAY,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,OAAO,oBAAY,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,wBAAc,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,sBAAS,CAAC,KAAK,CAAC,0BAA0B,OAAO,IAAI,EAAE,MAAM,KAAK,EAAE,CAAC,CAAC;IAEtE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CACxC,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EACpC,CAAC,KAAc,EAAE,EAAE;IACjB,sBAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF,CAAC","sourcesContent":["#!/usr/bin/env bun\nimport { CheckCommand } from './check';\nimport { CleanCommand } from './clean';\nimport { CodemodCommand } from './codemod';\nimport { LintCommand } from './lint';\nimport { CliOutput } from '../common/cli-output';\n\nconst USAGE = `Usage: devz <command> [options]\n\nCommands:\n lint [--fix] [files] oxlint, ESLint and the formatter; --fix writes\n check purity --claims <file> [package] [--json] probe every entry claimed browser-pure (needs a build)\n check module-cycles | split-report | catalog shared repository gates; devz check --help lists their options\n clean remove dist, node_modules/.cache and *.tsbuildinfo\n codemod drop-redundant-casts [paths...] remove \\`as X\\` casts the compiler no longer needs (dry run unless --write)\n codemod const-classes [paths...] turn a string-literal union into a const class (dry run unless --write)\n codemod async-style [paths...] apply the async-style lint fixers and list the rest (dry run unless --write)\n codemod namespace-functions [paths...] move calls of a function that moved into a class to the class form (dry run unless --write)\n codemod connector-imports [paths...] move @venizia/ignis/<connector sub-path> imports to @venizia/ignis-connectors (dry run unless --write)\n codemod env-get [paths...] strip the type arguments of AppEnvs.get() for the string-reading get() (dry run unless --write)\n codemod any-aliases [paths...] replace the removed AnyType and AnyObject aliases by what they stood for, any (--strict: unknown and Record<string, unknown>; dry run unless --write)\n\nRun \\`devz clean --help\\` or \\`devz codemod --help\\` for a command's options.`;\n\nconst main = async (opts: { argv: string[] }): Promise<number> => {\n const [command, ...args] = opts.argv;\n\n if (command === undefined || command === '--help' || command === '-h') {\n CliOutput.log(USAGE);\n\n return 0;\n }\n\n if (command === 'lint') {\n return LintCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'check') {\n return CheckCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'clean') {\n return CleanCommand.run({ root: process.cwd(), args });\n }\n\n if (command === 'codemod') {\n return CodemodCommand.run({ root: process.cwd(), args });\n }\n\n CliOutput.error(`devz: unknown command \"${command ?? ''}\"\\n${USAGE}`);\n\n return 1;\n};\n\nmain({ argv: process.argv.slice(2) }).then(\n (exitCode) => process.exit(exitCode),\n (error: unknown) => {\n CliOutput.error(error);\n process.exit(1);\n },\n);\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * What a `devz` command prints: its result on stdout, its warnings and errors on stderr, formatted as `console` does.
3
+ *
4
+ * The writes are synchronous and complete before the call returns. `process.stdout.write` queues on a pipe in Bun, and
5
+ * what is still queued when the process exits is lost.
6
+ */
7
+ export declare class CliOutput {
8
+ private static readonly STDOUT;
9
+ private static readonly STDERR;
10
+ private static readonly pause;
11
+ private static write;
12
+ static log(...parts: Array<unknown>): void;
13
+ static warn(...parts: Array<unknown>): void;
14
+ static error(...parts: Array<unknown>): void;
15
+ }
16
+ //# sourceMappingURL=cli-output.d.ts.map
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CliOutput = void 0;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_util_1 = require("node:util");
6
+ /**
7
+ * What a `devz` command prints: its result on stdout, its warnings and errors on stderr, formatted as `console` does.
8
+ *
9
+ * The writes are synchronous and complete before the call returns. `process.stdout.write` queues on a pipe in Bun, and
10
+ * what is still queued when the process exits is lost.
11
+ */
12
+ class CliOutput {
13
+ static { this.STDOUT = 1; }
14
+ static { this.STDERR = 2; }
15
+ static { this.pause = new Int32Array(new SharedArrayBuffer(4)); }
16
+ static write(opts) {
17
+ const bytes = Buffer.from(`${(0, node_util_1.format)(...opts.parts)}\n`);
18
+ let written = 0;
19
+ while (written < bytes.length) {
20
+ try {
21
+ // A pipe another writer made non-blocking takes only what fits its buffer.
22
+ written += (0, node_fs_1.writeSync)(opts.fd, bytes, written);
23
+ }
24
+ catch (error) {
25
+ const code = error instanceof Error && 'code' in error ? error.code : undefined;
26
+ // The reader closed the pipe (`devz ... | head`): there is nobody left to tell.
27
+ if (code === 'EPIPE') {
28
+ return;
29
+ }
30
+ if (code !== 'EAGAIN') {
31
+ throw error;
32
+ }
33
+ // The buffer is full: wait a millisecond for the reader.
34
+ Atomics.wait(CliOutput.pause, 0, 0, 1);
35
+ }
36
+ }
37
+ }
38
+ static log(...parts) {
39
+ CliOutput.write({ fd: CliOutput.STDOUT, parts });
40
+ }
41
+ static warn(...parts) {
42
+ CliOutput.write({ fd: CliOutput.STDERR, parts });
43
+ }
44
+ static error(...parts) {
45
+ CliOutput.write({ fd: CliOutput.STDERR, parts });
46
+ }
47
+ }
48
+ exports.CliOutput = CliOutput;
49
+ //# sourceMappingURL=cli-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-output.js","sourceRoot":"","sources":["../../src/common/cli-output.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AACpC,yCAAmC;AAEnC;;;;;GAKG;AACH,MAAa,SAAS;aACI,WAAM,GAAG,CAAC,CAAC;aACX,WAAM,GAAG,CAAC,CAAC;aACX,UAAK,GAAG,IAAI,UAAU,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjE,MAAM,CAAC,KAAK,CAAC,IAA2C;QAC9D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,IAAA,kBAAM,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,OAAO,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACH,2EAA2E;gBAC3E,OAAO,IAAI,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBAEhF,gFAAgF;gBAChF,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;oBACrB,OAAO;gBACT,CAAC;gBAED,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACtB,MAAM,KAAK,CAAC;gBACd,CAAC;gBAED,yDAAyD;gBACzD,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,GAAG,KAAqB;QACjC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,KAAqB;QAClC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,KAAqB;QACnC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;;AAzCH,8BA0CC","sourcesContent":["import { writeSync } from 'node:fs';\nimport { format } from 'node:util';\n\n/**\n * What a `devz` command prints: its result on stdout, its warnings and errors on stderr, formatted as `console` does.\n *\n * The writes are synchronous and complete before the call returns. `process.stdout.write` queues on a pipe in Bun, and\n * what is still queued when the process exits is lost.\n */\nexport class CliOutput {\n private static readonly STDOUT = 1;\n private static readonly STDERR = 2;\n private static readonly pause = new Int32Array(new SharedArrayBuffer(4));\n\n private static write(opts: { fd: number; parts: Array<unknown> }): void {\n const bytes = Buffer.from(`${format(...opts.parts)}\\n`);\n let written = 0;\n\n while (written < bytes.length) {\n try {\n // A pipe another writer made non-blocking takes only what fits its buffer.\n written += writeSync(opts.fd, bytes, written);\n } catch (error) {\n const code = error instanceof Error && 'code' in error ? error.code : undefined;\n\n // The reader closed the pipe (`devz ... | head`): there is nobody left to tell.\n if (code === 'EPIPE') {\n return;\n }\n\n if (code !== 'EAGAIN') {\n throw error;\n }\n\n // The buffer is full: wait a millisecond for the reader.\n Atomics.wait(CliOutput.pause, 0, 0, 1);\n }\n }\n }\n\n static log(...parts: Array<unknown>): void {\n CliOutput.write({ fd: CliOutput.STDOUT, parts });\n }\n\n static warn(...parts: Array<unknown>): void {\n CliOutput.write({ fd: CliOutput.STDERR, parts });\n }\n\n static error(...parts: Array<unknown>): void {\n CliOutput.write({ fd: CliOutput.STDERR, parts });\n }\n}\n"]}
@@ -30,7 +30,7 @@ class BunCompiler {
30
30
  if (!built.success) {
31
31
  // `getError` lives in `inversion`, which depends on `dev-configs` - importing it here would
32
32
  // create a circular workspace dependency, so a failed compile throws a plain `Error` instead.
33
- // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
33
+ // eslint-disable-next-line @venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
34
34
  throw new Error([
35
35
  `[BunCompiler] compile failed for entrypoint "${entrypoint}":`,
36
36
  ...built.logs.map((log) => `[${log.level}] ${log.message}`),
@@ -1 +1 @@
1
- {"version":3,"file":"bun.js","sourceRoot":"","sources":["../../src/compilers/bun.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,eAAe,GAAG,YAAY,CAAC;AACr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ux-x64';\n\n/** Bundles and compiles a single Bun executable: minified, linked sourcemaps, target read from `BUN_TARGET`. */\nexport class BunCompiler {\n /**\n * `plugins` is a parameter, never resolved here - `dev-configs` sits below every other IGNIS\n * package (see the Makefile chain) and must not import a plugin factory such as\n * `PlatformaticKafkaPlugins.build()` from `helpers`, which would invert that chain.\n */\n static async compile(\n opts: {\n entrypoint?: string;\n /** Bun Worker files the entrypoint starts (`new Worker('./x.worker.ts')`): compiled into the same binary. */\n workers?: string[];\n outfile?: string;\n target?: string;\n plugins?: Bun.BunPlugin[];\n /** Compile-time constants: each key is replaced by its value, a JSON-encoded expression, wherever the bundle reads it. */\n define?: Record<string, string>;\n /** Type-check the bundle first; a type error stops the compile. */\n check?: boolean;\n } = {},\n ): Promise<void> {\n const {\n entrypoint = DEFAULT_ENTRYPOINT,\n workers = [],\n outfile = DEFAULT_OUTFILE,\n target = Bun.env.BUN_TARGET ?? DEFAULT_COMPILE_TARGET,\n plugins = [],\n define = {},\n check = false,\n } = opts;\n\n const built = await Bun.build({\n entrypoints: [entrypoint, ...workers],\n target: 'bun',\n minify: { whitespace: true, syntax: true },\n sourcemap: 'linked',\n throw: false,\n compile: {\n target: target as Bun.Build.CompileTarget,\n outfile,\n },\n define,\n plugins,\n check,\n });\n\n if (!built.success) {\n // `getError` lives in `inversion`, which depends on `dev-configs` - importing it here would\n // create a circular workspace dependency, so a failed compile throws a plain `Error` instead.\n // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n [\n `[BunCompiler] compile failed for entrypoint \"${entrypoint}\":`,\n ...built.logs.map((log) => `[${log.level}] ${log.message}`),\n ].join('\\n'),\n );\n }\n }\n}\n"]}
1
+ {"version":3,"file":"bun.js","sourceRoot":"","sources":["../../src/compilers/bun.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,eAAe,GAAG,YAAY,CAAC;AACrC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAE/C,gHAAgH;AAChH,MAAa,WAAW;IACtB;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAClB,OAWI,EAAE;QAEN,MAAM,EACJ,UAAU,GAAG,kBAAkB,EAC/B,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,eAAe,EACzB,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,IAAI,sBAAsB,EACrD,OAAO,GAAG,EAAE,EACZ,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,KAAK,GACd,GAAG,IAAI,CAAC;QAET,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC;YAC5B,WAAW,EAAE,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC;YACrC,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1C,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,MAAM,EAAE,MAAiC;gBACzC,OAAO;aACR;YACD,MAAM;YACN,OAAO;YACP,KAAK;SACN,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,4FAA4F;YAC5F,8FAA8F;YAC9F,uGAAuG;YACvG,MAAM,IAAI,KAAK,CACb;gBACE,gDAAgD,UAAU,IAAI;gBAC9D,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC;aAC5D,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAzDD,kCAyDC","sourcesContent":["const DEFAULT_ENTRYPOINT = './dist/index.js';\nconst DEFAULT_OUTFILE = './dist/bin';\nconst DEFAULT_COMPILE_TARGET = 'bun-linux-x64';\n\n/** Bundles and compiles a single Bun executable: minified, linked sourcemaps, target read from `BUN_TARGET`. */\nexport class BunCompiler {\n /**\n * `plugins` is a parameter, never resolved here - `dev-configs` sits below every other IGNIS\n * package (see the Makefile chain) and must not import a plugin factory such as\n * `PlatformaticKafkaPlugins.build()` from `helpers`, which would invert that chain.\n */\n static async compile(\n opts: {\n entrypoint?: string;\n /** Bun Worker files the entrypoint starts (`new Worker('./x.worker.ts')`): compiled into the same binary. */\n workers?: string[];\n outfile?: string;\n target?: string;\n plugins?: Bun.BunPlugin[];\n /** Compile-time constants: each key is replaced by its value, a JSON-encoded expression, wherever the bundle reads it. */\n define?: Record<string, string>;\n /** Type-check the bundle first; a type error stops the compile. */\n check?: boolean;\n } = {},\n ): Promise<void> {\n const {\n entrypoint = DEFAULT_ENTRYPOINT,\n workers = [],\n outfile = DEFAULT_OUTFILE,\n target = Bun.env.BUN_TARGET ?? DEFAULT_COMPILE_TARGET,\n plugins = [],\n define = {},\n check = false,\n } = opts;\n\n const built = await Bun.build({\n entrypoints: [entrypoint, ...workers],\n target: 'bun',\n minify: { whitespace: true, syntax: true },\n sourcemap: 'linked',\n throw: false,\n compile: {\n target: target as Bun.Build.CompileTarget,\n outfile,\n },\n define,\n plugins,\n check,\n });\n\n if (!built.success) {\n // `getError` lives in `inversion`, which depends on `dev-configs` - importing it here would\n // create a circular workspace dependency, so a failed compile throws a plain `Error` instead.\n // eslint-disable-next-line @venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n [\n `[BunCompiler] compile failed for entrypoint \"${entrypoint}\":`,\n ...built.logs.map((log) => `[${log.level}] ${log.message}`),\n ].join('\\n'),\n );\n }\n }\n}\n"]}
@@ -68,7 +68,7 @@ const STRICT_RULES = {
68
68
  'no-caller': 'error',
69
69
  '@typescript-eslint/adjacent-overload-signatures': 'error',
70
70
  '@typescript-eslint/prefer-for-of': 'error',
71
- '@typescript-eslint/unified-signatures': 'error',
71
+ '@typescript-eslint/unified-signatures': ['error', { ignoreOverloadsWithDifferentJSDoc: true }],
72
72
  '@typescript-eslint/no-invalid-this': ['error'],
73
73
  '@typescript-eslint/no-use-before-define': 'error',
74
74
  '@typescript-eslint/no-shadow': 'error',
@@ -1 +1 @@
1
- {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/linters/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,0CAA6C;AAC7C,0EAAyC;AACzC,2CAAwD;AACxD,yEAAmE;AACnE,2CAAmD;AACnD,uCAA2C;AAC3C,mCAA0F;AAE1F,mCAAmC;AACnC,MAAM,YAAY,GAAG;IACnB,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC;AAEF,qGAAqG;AACrG,MAAM,SAAS,GAAuB;IACpC,uBAAuB,EAAE,KAAK;IAC9B,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,KAAK;IACvB,oBAAoB,EAAE,KAAK;IAC3B,uBAAuB,EAAE,KAAK;IAC9B,uBAAuB,EAAE,KAAK;IAC9B,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,KAAK;IACxB,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK;IACxB,SAAS,EAAE,KAAK;IAChB,oCAAoC,EAAE,KAAK;IAC3C,4CAA4C,EAAE,KAAK;IACnD,kCAAkC,EAAE,KAAK;IACzC,yCAAyC,EAAE,KAAK;IAChD,yCAAyC,EAAE,KAAK;IAChD,iDAAiD,EAAE,KAAK;IACxD,wCAAwC,EAAE,KAAK;IAC/C,uCAAuC,EAAE,KAAK;IAC9C,+CAA+C,EAAE,KAAK;IACtD,kDAAkD,EAAE,KAAK;IACzD,kDAAkD,EAAE,KAAK;IACzD,mDAAmD,EAAE,KAAK;IAC1D,+BAA+B,EAAE,KAAK;IACtC,0CAA0C,EAAE,KAAK;IACjD,sCAAsC,EAAE,KAAK;IAC7C,+CAA+C,EAAE,KAAK;IACtD,wCAAwC,E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,CAAC,EAAE,0BAAiB,EAAE;QACxD,KAAK,EAAE;YACL,GAAG,SAAS;YACZ,GAAG,YAAY;YACf,CAAC,0CAAkB,CAAC,IAAI,CAAC,EAAE,0CAAkB,CAAC,KAAK,EAAE;YACrD,mCAAmC,EAAE,wBAAgB,CAAC,KAAK,EAAsB;YACjF,CAAC,+BAAuB,CAAC,IAAI,CAAC,EAAE,+BAAuB,CAAC,KAAK,EAAsB;YACnF,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAoB,CAAC,KAAK,EAAE;SAC1D;KACF;IACD,GAAG,wBAAc;IACjB;QACE,OAAO,EAAE;YACP,kBAAkB;YAClB,WAAW;YACX,WAAW;YACX,UAAU;YACV,aAAa;YACb,mBAAmB;YACnB,eAAe;YACf,oBAAoB;YACpB,gBAAgB;SACjB;KACF;CACF,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACU,QAAA,uBAAuB,GAAoB;IACtD,6FAA6F;IAC7F,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE;IAC9F;QACE,KAAK,EAAE,CAAC,uBAAuB,CAAC;QAChC,eAAe,EAAE,EAAE,MAAM,EAAE,2BAAQ,CAAC,MAAuB,EAAE;QAC7D,OAAO,EAAE,EAAE,oBAAoB,EAAE,2BAAQ,CAAC,MAAe,EAAE;QAC3D,4FAA4F;QAC5F,aAAa,EAAE,EAAE,6BAA6B,EAAE,KAAK,EAAE;QACvD,KAAK,EAAE,EAAE,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAoB,CAAC,KAAK,EAAE,EAAE;KACrE;CACF,CAAC","sourcesContent":["import js from '@eslint/js';\nimport type { Linter } from 'eslint';\nimport { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\nimport { HOUSE_PLUGIN_NAMESPACE } from './house/common';\nimport { NoUnbracedCaseRule } from './house/no-unbraced-case.rule';\nimport { houseEslintPlugin } from './house/plugin';\nimport { paddingConfigs } from './padding';\nimport { NamingConventionRule, NoRestrictedImportsRule, NoUnusedVarsRule } from './rules';\n\n/** Every file the preset lints. */\nconst SOURCE_FILES = [\n '**/*.js',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.jsx',\n '**/*.ts',\n '**/*.cts',\n '**/*.mts',\n '**/*.tsx',\n];\n\n/** Rules that stay off: the type checker, the formatter or the framework's own style covers them. */\nconst OFF_RULES: Linter.RulesRecord = {\n 'no-constant-condition': 'off',\n 'no-undef': 'off',\n 'no-unused-vars': 'off',\n 'no-mixed-operators': 'off',\n 'no-inner-declarations': 'off',\n 'no-dupe-class-members': 'off',\n 'no-redeclare': 'off',\n 'no-invalid-this': 'off',\n 'no-shadow': 'off',\n 'no-return-await': 'off',\n camelcase: 'off',\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-unsafe-function-type': 'off',\n '@typescript-eslint/no-this-alias': 'off',\n '@typescript-eslint/no-empty-object-type': 'off',\n '@typescript-eslint/no-invalid-void-type': 'off',\n '@typescript-eslint/no-confusing-void-expression': 'off',\n '@typescript-eslint/no-extraneous-class': 'off',\n '@typescript-eslint/no-require-imports': 'off',\n '@typescript-eslint/strict-boolean-expressions': 'off',\n '@typescript-eslint/explicit-function-return-type': 'off',\n '@typescript-eslint/explicit-member-accessibility': 'off',\n '@typescript-eslint/explicit-module-boundary-types': 'off',\n '@typescript-eslint/array-type': 'off',\n '@typescript-eslint/no-non-null-assertion': 'off',\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/no-misused-promises': 'off',\n};\n\n/** The LoopBack 4 rule set, on top of the recommended presets. */\nconst STRICT_RULES: Linter.RulesRecord = {\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n 'no-unused-expressions': 'error',\n eqeqeq: ['error', 'smart'],\n 'no-void': 'error',\n 'no-useless-escape': 'warn',\n 'no-caller': 'error',\n '@typescript-eslint/adjacent-overload-signatures': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/no-invalid-this': ['error'],\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/ban-ts-comment': 'error',\n '@typescript-eslint/no-namespace': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-floating-promises': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n // `||` on a string is mostly an intentional empty-string fallback (`value?.trim() || fallback`); `??` keeps `''`.\n // The same exception as the oxlint preset: objects, numbers and booleans still report.\n '@typescript-eslint/prefer-nullish-coalescing': [\n 'error',\n {\n allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: true,\n ignorePrimitives: { string: true },\n },\n ],\n '@typescript-eslint/return-await': 'error',\n};\n\n/**\n * The full ESLint preset, owned here: the LoopBack 4 rule set on the ESLint and typescript-eslint\n * recommended presets, type-aware through the project service. A project on oxlint uses\n * `oxlintConfigs` + `namingConventionConfigs` instead.\n */\nexport const eslintConfigs: Linter.Config[] = defineConfig([\n js.configs.recommended,\n tseslint.configs.recommended,\n {\n files: SOURCE_FILES,\n languageOptions: {\n parserOptions: {\n // Finds each file's tsconfig; the default project covers root-level scripts and configs.\n projectService: { allowDefaultProject: ['*.js', '*.cjs', '*.mjs', '.*.js'] },\n },\n },\n plugins: { [HOUSE_PLUGIN_NAMESPACE]: houseEslintPlugin },\n rules: {\n ...OFF_RULES,\n ...STRICT_RULES,\n [NoUnbracedCaseRule.NAME]: NoUnbracedCaseRule.build(),\n '@typescript-eslint/no-unused-vars': NoUnusedVarsRule.build() as Linter.RuleEntry,\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build() as Linter.RuleEntry,\n [NamingConventionRule.NAME]: NamingConventionRule.build(),\n },\n },\n ...paddingConfigs,\n {\n ignores: [\n '**/node_modules/',\n '**/*.d.ts',\n '**/build/',\n '**/dist/',\n '**/release/',\n '**/babel.config.*',\n '**/.babelrc.*',\n '**/eslint.config.*',\n '**/.eslintrc.*',\n ],\n },\n]);\n\n/**\n * The one rule of `eslintConfigs` that oxlint cannot run yet, as a standalone ESLint preset to run\n * next to `oxlintConfigs`. It needs no type information, so ESLint stays fast.\n *\n * ```js\n * // .configs/lints/eslint.config.mjs\n * import { namingConventionConfigs } from '@venizia/dev-configs/linters';\n *\n * export default namingConventionConfigs;\n * ```\n */\nexport const namingConventionConfigs: Linter.Config[] = [\n // Global: ESLint does not read .gitignore, and still walks plain .js files no config claims.\n { ignores: ['**/dist/**', '**/build/**', '**/coverage/**', '**/*.d.ts', '**/*.{js,cjs,mjs}'] },\n {\n files: ['**/*.{ts,tsx,mts,cts}'],\n languageOptions: { parser: tseslint.parser as Linter.Parser },\n plugins: { '@typescript-eslint': tseslint.plugin as never },\n // oxlint owns every other rule, so the disable comments for them are not ESLint's to judge.\n linterOptions: { reportUnusedDisableDirectives: 'off' },\n rules: { [NamingConventionRule.NAME]: NamingConventionRule.build() },\n },\n];\n"]}
1
+ {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../src/linters/eslint.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,0CAA6C;AAC7C,0EAAyC;AACzC,2CAAwD;AACxD,yEAAmE;AACnE,2CAAmD;AACnD,uCAA2C;AAC3C,mCAA0F;AAE1F,mCAAmC;AACnC,MAAM,YAAY,GAAG;IACnB,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC;AAEF,qGAAqG;AACrG,MAAM,SAAS,GAAuB;IACpC,uBAAuB,EAAE,KAAK;IAC9B,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,KAAK;IACvB,oBAAoB,EAAE,KAAK;IAC3B,uBAAuB,EAAE,KAAK;IAC9B,uBAAuB,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IAC7F,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,CAAC,EAAE;IAC9F;QACE,KAAK,EAAE,CAAC,uBAAuB,CAAC;QAChC,eAAe,EAAE,EAAE,MAAM,EAAE,2BAAQ,CAAC,MAAM,EAAE;QAC5C,OAAO,EAAE,EAAE,oBAAoB,EAAE,2BAAQ,CAAC,MAAM,EAAE;QAClD,4FAA4F;QAC5F,aAAa,EAAE,EAAE,6BAA6B,EAAE,KAAK,EAAE;QACvD,KAAK,EAAE,EAAE,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAoB,CAAC,KAAK,EAAE,EAAE;KACrE;CACF,CAAC","sourcesContent":["import js from '@eslint/js';\nimport type { Linter } from 'eslint';\nimport { defineConfig } from 'eslint/config';\nimport tseslint from 'typescript-eslint';\nimport { HOUSE_PLUGIN_NAMESPACE } from './house/common';\nimport { NoUnbracedCaseRule } from './house/no-unbraced-case.rule';\nimport { houseEslintPlugin } from './house/plugin';\nimport { paddingConfigs } from './padding';\nimport { NamingConventionRule, NoRestrictedImportsRule, NoUnusedVarsRule } from './rules';\n\n/** Every file the preset lints. */\nconst SOURCE_FILES = [\n '**/*.js',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.jsx',\n '**/*.ts',\n '**/*.cts',\n '**/*.mts',\n '**/*.tsx',\n];\n\n/** Rules that stay off: the type checker, the formatter or the framework's own style covers them. */\nconst OFF_RULES: Linter.RulesRecord = {\n 'no-constant-condition': 'off',\n 'no-undef': 'off',\n 'no-unused-vars': 'off',\n 'no-mixed-operators': 'off',\n 'no-inner-declarations': 'off',\n 'no-dupe-class-members': 'off',\n 'no-redeclare': 'off',\n 'no-invalid-this': 'off',\n 'no-shadow': 'off',\n 'no-return-await': 'off',\n camelcase: 'off',\n '@typescript-eslint/no-explicit-any': 'off',\n '@typescript-eslint/no-unsafe-function-type': 'off',\n '@typescript-eslint/no-this-alias': 'off',\n '@typescript-eslint/no-empty-object-type': 'off',\n '@typescript-eslint/no-invalid-void-type': 'off',\n '@typescript-eslint/no-confusing-void-expression': 'off',\n '@typescript-eslint/no-extraneous-class': 'off',\n '@typescript-eslint/no-require-imports': 'off',\n '@typescript-eslint/strict-boolean-expressions': 'off',\n '@typescript-eslint/explicit-function-return-type': 'off',\n '@typescript-eslint/explicit-member-accessibility': 'off',\n '@typescript-eslint/explicit-module-boundary-types': 'off',\n '@typescript-eslint/array-type': 'off',\n '@typescript-eslint/no-non-null-assertion': 'off',\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/no-misused-promises': 'off',\n};\n\n/** The LoopBack 4 rule set, on top of the recommended presets. */\nconst STRICT_RULES: Linter.RulesRecord = {\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n 'no-unused-expressions': 'error',\n eqeqeq: ['error', 'smart'],\n 'no-void': 'error',\n 'no-useless-escape': 'warn',\n 'no-caller': 'error',\n '@typescript-eslint/adjacent-overload-signatures': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/unified-signatures': ['error', { ignoreOverloadsWithDifferentJSDoc: true }],\n '@typescript-eslint/no-invalid-this': ['error'],\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/ban-ts-comment': 'error',\n '@typescript-eslint/no-namespace': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-floating-promises': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n // `||` on a string is mostly an intentional empty-string fallback (`value?.trim() || fallback`); `??` keeps `''`.\n // The same exception as the oxlint preset: objects, numbers and booleans still report.\n '@typescript-eslint/prefer-nullish-coalescing': [\n 'error',\n {\n allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: true,\n ignorePrimitives: { string: true },\n },\n ],\n '@typescript-eslint/return-await': 'error',\n};\n\n/**\n * The full ESLint preset, owned here: the LoopBack 4 rule set on the ESLint and typescript-eslint\n * recommended presets, type-aware through the project service. A project on oxlint uses\n * `oxlintConfigs` + `namingConventionConfigs` instead.\n */\nexport const eslintConfigs: Linter.Config[] = defineConfig([\n js.configs.recommended,\n tseslint.configs.recommended,\n {\n files: SOURCE_FILES,\n languageOptions: {\n parserOptions: {\n // Finds each file's tsconfig; the default project covers root-level scripts and configs.\n projectService: { allowDefaultProject: ['*.js', '*.cjs', '*.mjs', '.*.js'] },\n },\n },\n plugins: { [HOUSE_PLUGIN_NAMESPACE]: houseEslintPlugin },\n rules: {\n ...OFF_RULES,\n ...STRICT_RULES,\n [NoUnbracedCaseRule.NAME]: NoUnbracedCaseRule.build(),\n '@typescript-eslint/no-unused-vars': NoUnusedVarsRule.build() as Linter.RuleEntry,\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build() as Linter.RuleEntry,\n [NamingConventionRule.NAME]: NamingConventionRule.build(),\n },\n },\n ...paddingConfigs,\n {\n ignores: [\n '**/node_modules/',\n '**/*.d.ts',\n '**/build/',\n '**/dist/',\n '**/release/',\n '**/babel.config.*',\n '**/.babelrc.*',\n '**/eslint.config.*',\n '**/.eslintrc.*',\n ],\n },\n]);\n\n/**\n * The one rule of `eslintConfigs` that oxlint cannot run yet, as a standalone ESLint preset to run\n * next to `oxlintConfigs`. It needs no type information, so ESLint stays fast.\n *\n * ```js\n * // .configs/lints/eslint.config.mjs\n * import { namingConventionConfigs } from '@venizia/dev-configs/linters';\n *\n * export default namingConventionConfigs;\n * ```\n */\nexport const namingConventionConfigs: Linter.Config[] = [\n // Global: ESLint does not read .gitignore, and still walks plain .js files no config claims.\n { ignores: ['**/dist/**', '**/build/**', '**/coverage/**', '**/*.d.ts', '**/*.{js,cjs,mjs}'] },\n {\n files: ['**/*.{ts,tsx,mts,cts}'],\n languageOptions: { parser: tseslint.parser },\n plugins: { '@typescript-eslint': tseslint.plugin },\n // oxlint owns every other rule, so the disable comments for them are not ESLint's to judge.\n linterOptions: { reportUnusedDisableDirectives: 'off' },\n rules: { [NamingConventionRule.NAME]: NamingConventionRule.build() },\n },\n];\n"]}
@@ -32,11 +32,9 @@ export interface IBrowserApiPattern {
32
32
  written: string;
33
33
  }
34
34
  /**
35
- * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `venizia/prefer-framework-api` reads this
35
+ * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `@venizia/prefer-framework-api` reads this
36
36
  * table, so adding a pattern is adding a row here. Only forms a rule can tell apart reliably are rows: a hand-rolled
37
37
  * debounce or a draft-saving timer is not.
38
- *
39
- * @useWhen you add or read a browser API that a framework hook replaces, for the rule or for a tool that tells an author which hook to use
40
38
  */
41
39
  export declare class BrowserApiPatterns {
42
40
  static readonly PACKAGE = "@venizia/ardor-react";
@@ -2,11 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BrowserApiPatterns = void 0;
4
4
  /**
5
- * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `venizia/prefer-framework-api` reads this
5
+ * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `@venizia/prefer-framework-api` reads this
6
6
  * table, so adding a pattern is adding a row here. Only forms a rule can tell apart reliably are rows: a hand-rolled
7
7
  * debounce or a draft-saving timer is not.
8
- *
9
- * @useWhen you add or read a browser API that a framework hook replaces, for the rule or for a tool that tells an author which hook to use
10
8
  */
11
9
  class BrowserApiPatterns {
12
10
  static { this.PACKAGE = '@venizia/ardor-react'; }
@@ -1 +1 @@
1
- {"version":3,"file":"browser-api-patterns.js","sourceRoot":"","sources":["../../../src/linters/house/browser-api-patterns.ts"],"names":[],"mappings":";;;AAsBA;;;;;;GAMG;AACH,MAAa,kBAAkB;aACb,YAAO,GAAG,sBAAsB,CAAC;aAEjC,UAAK,GAAsC;QACzD;YACE,EAAE,EAAE,aAAa;Y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,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,4CAA4C;SACtD;QACD;YACE,EAAE,EAAE,qBAAqB;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,EAAE;YAC/E,KAAK,EAAE,yBAAyB;YAChC,OAAO,EAAE,4BAA4B;SACtC;QACD;YACE,EAAE,EAAE,qBAAqB;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,kBAAkB,CAAC,EAAE;YACzD,KAAK,EAAE,yBAAyB;YAChC,OAAO,EAAE,yCAAyC;SACnD;QACD;YACE,EAAE,EAAE,eAAe;YACnB,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,cAAc,CAAC,EAAE;YACrD,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,qCAAqC;SAC/C;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,+BAA+B,CAAC,EAAE;YACjE,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,iCAAiC;SAC3C;QACD;YACE,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;YAC7C,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,kBAAkB;SAC5B;KACF,CAAC;;AA5EJ,gDA6EC","sourcesContent":["/** How a hand-written browser API shows up in code. */\nexport type TBrowserApiMatch =\n /** A property of the global object read or called: `window.matchMedia(...)`, `matchMedia(...)`. */\n | { type: 'global'; names: ReadonlyArray<string> }\n /** A member path under a global: `navigator.onLine`, `navigator.clipboard.writeText`. */\n | { type: 'path'; paths: ReadonlyArray<string> }\n /** `new X(...)` of a global class. */\n | { type: 'new'; callees: ReadonlyArray<string> }\n /** `<object>.addEventListener('<event>', ...)`; `objects` names the objects it counts for (the globals `window`, `document`, `self` and `globalThis` when absent). */\n | { type: 'listener'; events: ReadonlyArray<string>; objects?: ReadonlyArray<string> };\n\n/** One browser API the framework already wraps, and what to use instead. */\nexport interface IBrowserApiPattern {\n /** The name `ignore` takes to switch the pattern off. */\n id: string;\n match: TBrowserApiMatch;\n /** What to use: the hooks, named as the message prints them. */\n hooks: string;\n /** The hand-written form, as the message prints it. */\n written: string;\n}\n\n/**\n * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `venizia/prefer-framework-api` reads this\n * table, so adding a pattern is adding a row here. Only forms a rule can tell apart reliably are rows: a hand-rolled\n * debounce or a draft-saving timer is not.\n *\n * @useWhen you add or read a browser API that a framework hook replaces, for the rule or for a tool that tells an author which hook to use\n */\nexport class BrowserApiPatterns {\n static readonly PACKAGE = '@venizia/ardor-react';\n\n static readonly TABLE: ReadonlyArray<IBrowserApiPattern> = [\n {\n id: 'match-media',\n match: { type: 'global', names: ['matchMedia'] },\n hooks: '`useMediaQuery` (a media query) or `useBreakpoint` (a screen size)',\n written: '`window.matchMedia`',\n },\n {\n id: 'window-size',\n match: { type: 'global', names: ['innerWidth', 'innerHeight'] },\n hooks: '`useWindowDimensions`',\n written: '`window.innerWidth` / `window.innerHeight`',\n },\n {\n id: 'window-resize',\n match: { type: 'listener', events: ['resize'], objects: ['window', 'self', 'globalThis'] },\n hooks: '`useWindowDimensions`',\n written: \"a window `addEventListener('resize', ...)`\",\n },\n {\n id: 'resize-observer',\n match: { type: 'new', callees: ['ResizeObserver'] },\n hooks: '`useElementSize` (measure an element) or `useResizeEffect` (react to its resize)',\n written: '`new ResizeObserver(...)`',\n },\n {\n id: 'intersection-observer',\n match: { type: 'new', callees: ['IntersectionObserver'] },\n hooks: '`useIntersection`',\n written: '`new IntersectionObserver(...)`',\n },\n {\n id: 'online-status',\n match: { type: 'path', paths: ['navigator.onLine'] },\n hooks: '`useOnlineStatus`',\n written: '`navigator.onLine`',\n },\n {\n id: 'online-listener',\n match: { type: 'listener', events: ['online', 'offline'] },\n hooks: '`useOnlineStatus`',\n written: 'an `online` / `offline` `addEventListener`',\n },\n {\n id: 'document-visibility',\n match: { type: 'path', paths: ['document.visibilityState', 'document.hidden'] },\n hooks: '`useDocumentVisibility`',\n written: '`document.visibilityState`',\n },\n {\n id: 'visibility-listener',\n match: { type: 'listener', events: ['visibilitychange'] },\n hooks: '`useDocumentVisibility`',\n written: 'a `visibilitychange` `addEventListener`',\n },\n {\n id: 'before-unload',\n match: { type: 'listener', events: ['beforeunload'] },\n hooks: '`useBeforeUnload`',\n written: 'a `beforeunload` `addEventListener`',\n },\n {\n id: 'clipboard-write',\n match: { type: 'path', paths: ['navigator.clipboard.writeText'] },\n hooks: '`useCopyToClipboard`',\n written: '`navigator.clipboard.writeText`',\n },\n {\n id: 'confirm',\n match: { type: 'global', names: ['confirm'] },\n hooks: '`useConfirm`',\n written: '`window.confirm`',\n },\n ];\n}\n"]}
1
+ {"version":3,"file":"browser-api-patterns.js","sourceRoot":"","sources":["../../../src/linters/house/browser-api-patterns.ts"],"names":[],"mappings":";;;AAsBA;;;;GAIG;AACH,MAAa,kBAAkB;aACb,YAAO,GAAG,sBAAsB,CAAC;aAEjC,UAAK,GAAsC;QACzD;YACE,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE;YAChD,KAAK,EAAE,oEAAoE;YAC3E,OAAO,EAAE,qBAAqB;SAC/B;QACD;YACE,EAAE,EAAE,aAAa;YACjB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE;YAC/D,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,4CAA4C;SACtD;QACD;YACE,EAAE,EAAE,eAAe;YACnB,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,E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AAE,yCAAyC;SACnD;QACD;YACE,EAAE,EAAE,eAAe;YACnB,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,cAAc,CAAC,EAAE;YACrD,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE,qCAAqC;SAC/C;QACD;YACE,EAAE,EAAE,iBAAiB;YACrB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,+BAA+B,CAAC,EAAE;YACjE,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,iCAAiC;SAC3C;QACD;YACE,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;YAC7C,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,kBAAkB;SAC5B;KACF,CAAC;;AA5EJ,gDA6EC","sourcesContent":["/** How a hand-written browser API shows up in code. */\nexport type TBrowserApiMatch =\n /** A property of the global object read or called: `window.matchMedia(...)`, `matchMedia(...)`. */\n | { type: 'global'; names: ReadonlyArray<string> }\n /** A member path under a global: `navigator.onLine`, `navigator.clipboard.writeText`. */\n | { type: 'path'; paths: ReadonlyArray<string> }\n /** `new X(...)` of a global class. */\n | { type: 'new'; callees: ReadonlyArray<string> }\n /** `<object>.addEventListener('<event>', ...)`; `objects` names the objects it counts for (the globals `window`, `document`, `self` and `globalThis` when absent). */\n | { type: 'listener'; events: ReadonlyArray<string>; objects?: ReadonlyArray<string> };\n\n/** One browser API the framework already wraps, and what to use instead. */\nexport interface IBrowserApiPattern {\n /** The name `ignore` takes to switch the pattern off. */\n id: string;\n match: TBrowserApiMatch;\n /** What to use: the hooks, named as the message prints them. */\n hooks: string;\n /** The hand-written form, as the message prints it. */\n written: string;\n}\n\n/**\n * The browser APIs ARDOR (`@venizia/ardor-react`) wraps in a hook, one row each. `@venizia/prefer-framework-api` reads this\n * table, so adding a pattern is adding a row here. Only forms a rule can tell apart reliably are rows: a hand-rolled\n * debounce or a draft-saving timer is not.\n */\nexport class BrowserApiPatterns {\n static readonly PACKAGE = '@venizia/ardor-react';\n\n static readonly TABLE: ReadonlyArray<IBrowserApiPattern> = [\n {\n id: 'match-media',\n match: { type: 'global', names: ['matchMedia'] },\n hooks: '`useMediaQuery` (a media query) or `useBreakpoint` (a screen size)',\n written: '`window.matchMedia`',\n },\n {\n id: 'window-size',\n match: { type: 'global', names: ['innerWidth', 'innerHeight'] },\n hooks: '`useWindowDimensions`',\n written: '`window.innerWidth` / `window.innerHeight`',\n },\n {\n id: 'window-resize',\n match: { type: 'listener', events: ['resize'], objects: ['window', 'self', 'globalThis'] },\n hooks: '`useWindowDimensions`',\n written: \"a window `addEventListener('resize', ...)`\",\n },\n {\n id: 'resize-observer',\n match: { type: 'new', callees: ['ResizeObserver'] },\n hooks: '`useElementSize` (measure an element) or `useResizeEffect` (react to its resize)',\n written: '`new ResizeObserver(...)`',\n },\n {\n id: 'intersection-observer',\n match: { type: 'new', callees: ['IntersectionObserver'] },\n hooks: '`useIntersection`',\n written: '`new IntersectionObserver(...)`',\n },\n {\n id: 'online-status',\n match: { type: 'path', paths: ['navigator.onLine'] },\n hooks: '`useOnlineStatus`',\n written: '`navigator.onLine`',\n },\n {\n id: 'online-listener',\n match: { type: 'listener', events: ['online', 'offline'] },\n hooks: '`useOnlineStatus`',\n written: 'an `online` / `offline` `addEventListener`',\n },\n {\n id: 'document-visibility',\n match: { type: 'path', paths: ['document.visibilityState', 'document.hidden'] },\n hooks: '`useDocumentVisibility`',\n written: '`document.visibilityState`',\n },\n {\n id: 'visibility-listener',\n match: { type: 'listener', events: ['visibilitychange'] },\n hooks: '`useDocumentVisibility`',\n written: 'a `visibilitychange` `addEventListener`',\n },\n {\n id: 'before-unload',\n match: { type: 'listener', events: ['beforeunload'] },\n hooks: '`useBeforeUnload`',\n written: 'a `beforeunload` `addEventListener`',\n },\n {\n id: 'clipboard-write',\n match: { type: 'path', paths: ['navigator.clipboard.writeText'] },\n hooks: '`useCopyToClipboard`',\n written: '`navigator.clipboard.writeText`',\n },\n {\n id: 'confirm',\n match: { type: 'global', names: ['confirm'] },\n hooks: '`useConfirm`',\n written: '`window.confirm`',\n },\n ];\n}\n"]}
@@ -12,6 +12,7 @@ export declare class AstNodeTypes {
12
12
  static readonly IMPORT_SPECIFIER = "ImportSpecifier";
13
13
  static readonly IMPORT_EXPRESSION = "ImportExpression";
14
14
  static readonly CLASS_DECLARATION = "ClassDeclaration";
15
+ static readonly CLASS_BODY = "ClassBody";
15
16
  static readonly INTERFACE_DECLARATION = "TSInterfaceDeclaration";
16
17
  static readonly UNION_TYPE = "TSUnionType";
17
18
  static readonly AWAIT_EXPRESSION = "AwaitExpression";
@@ -22,14 +23,17 @@ export declare class AstNodeTypes {
22
23
  static readonly ARRAY_EXPRESSION = "ArrayExpression";
23
24
  static readonly AS_EXPRESSION = "TSAsExpression";
24
25
  static readonly ASSIGNMENT_EXPRESSION = "AssignmentExpression";
26
+ static readonly ASSIGNMENT_PATTERN = "AssignmentPattern";
25
27
  static readonly BINARY_EXPRESSION = "BinaryExpression";
26
28
  static readonly CHAIN_EXPRESSION = "ChainExpression";
29
+ static readonly CLASS_IMPLEMENTS = "TSClassImplements";
27
30
  static readonly CONDITIONAL_EXPRESSION = "ConditionalExpression";
28
31
  static readonly EMPTY_STATEMENT = "EmptyStatement";
29
32
  static readonly EXPORT_DEFAULT_DECLARATION = "ExportDefaultDeclaration";
30
33
  static readonly EXPORT_SPECIFIER = "ExportSpecifier";
31
34
  static readonly EXPRESSION_STATEMENT = "ExpressionStatement";
32
35
  static readonly IDENTIFIER = "Identifier";
36
+ static readonly INTERFACE_HERITAGE = "TSInterfaceHeritage";
33
37
  static readonly JSX_ATTRIBUTE = "JSXAttribute";
34
38
  static readonly JSX_ELEMENT = "JSXElement";
35
39
  static readonly JSX_EXPRESSION_CONTAINER = "JSXExpressionContainer";
@@ -46,10 +50,12 @@ export declare class AstNodeTypes {
46
50
  static readonly PRIVATE_IDENTIFIER = "PrivateIdentifier";
47
51
  static readonly PROGRAM = "Program";
48
52
  static readonly PROPERTY = "Property";
53
+ static readonly PROPERTY_DEFINITION = "PropertyDefinition";
49
54
  static readonly SATISFIES_EXPRESSION = "TSSatisfiesExpression";
50
55
  static readonly SEQUENCE_EXPRESSION = "SequenceExpression";
51
56
  static readonly SPREAD_ELEMENT = "SpreadElement";
52
57
  static readonly STATIC_BLOCK = "StaticBlock";
58
+ static readonly TEMPLATE_ELEMENT = "TemplateElement";
53
59
  static readonly TEMPLATE_LITERAL = "TemplateLiteral";
54
60
  static readonly THIS_EXPRESSION = "ThisExpression";
55
61
  static readonly TRY_STATEMENT = "TryStatement";
@@ -63,8 +69,8 @@ export declare class AstNodeTypes {
63
69
  static readonly VARIABLE_DECLARATION = "VariableDeclaration";
64
70
  static readonly VARIABLE_DECLARATOR = "VariableDeclarator";
65
71
  }
66
- /** The ESLint namespace the house rules live under: `venizia/<rule>`. */
67
- export declare const HOUSE_PLUGIN_NAMESPACE = "venizia";
72
+ /** The ESLint namespace the house rules live under: `@venizia/<rule>`. */
73
+ export declare const HOUSE_PLUGIN_NAMESPACE = "@venizia";
68
74
  /** Reads an AST node without trusting its type: TypeScript nodes carry fields estree does not declare. */
69
75
  export declare class AstNode {
70
76
  /** A field of an AST node. */
@@ -14,6 +14,7 @@ class AstNodeTypes {
14
14
  static { this.IMPORT_SPECIFIER = 'ImportSpecifier'; }
15
15
  static { this.IMPORT_EXPRESSION = 'ImportExpression'; }
16
16
  static { this.CLASS_DECLARATION = 'ClassDeclaration'; }
17
+ static { this.CLASS_BODY = 'ClassBody'; }
17
18
  static { this.INTERFACE_DECLARATION = 'TSInterfaceDeclaration'; }
18
19
  static { this.UNION_TYPE = 'TSUnionType'; }
19
20
  static { this.AWAIT_EXPRESSION = 'AwaitExpression'; }
@@ -24,14 +25,17 @@ class AstNodeTypes {
24
25
  static { this.ARRAY_EXPRESSION = 'ArrayExpression'; }
25
26
  static { this.AS_EXPRESSION = 'TSAsExpression'; }
26
27
  static { this.ASSIGNMENT_EXPRESSION = 'AssignmentExpression'; }
28
+ static { this.ASSIGNMENT_PATTERN = 'AssignmentPattern'; }
27
29
  static { this.BINARY_EXPRESSION = 'BinaryExpression'; }
28
30
  static { this.CHAIN_EXPRESSION = 'ChainExpression'; }
31
+ static { this.CLASS_IMPLEMENTS = 'TSClassImplements'; }
29
32
  static { this.CONDITIONAL_EXPRESSION = 'ConditionalExpression'; }
30
33
  static { this.EMPTY_STATEMENT = 'EmptyStatement'; }
31
34
  static { this.EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration'; }
32
35
  static { this.EXPORT_SPECIFIER = 'ExportSpecifier'; }
33
36
  static { this.EXPRESSION_STATEMENT = 'ExpressionStatement'; }
34
37
  static { this.IDENTIFIER = 'Identifier'; }
38
+ static { this.INTERFACE_HERITAGE = 'TSInterfaceHeritage'; }
35
39
  static { this.JSX_ATTRIBUTE = 'JSXAttribute'; }
36
40
  static { this.JSX_ELEMENT = 'JSXElement'; }
37
41
  static { this.JSX_EXPRESSION_CONTAINER = 'JSXExpressionContainer'; }
@@ -48,10 +52,12 @@ class AstNodeTypes {
48
52
  static { this.PRIVATE_IDENTIFIER = 'PrivateIdentifier'; }
49
53
  static { this.PROGRAM = 'Program'; }
50
54
  static { this.PROPERTY = 'Property'; }
55
+ static { this.PROPERTY_DEFINITION = 'PropertyDefinition'; }
51
56
  static { this.SATISFIES_EXPRESSION = 'TSSatisfiesExpression'; }
52
57
  static { this.SEQUENCE_EXPRESSION = 'SequenceExpression'; }
53
58
  static { this.SPREAD_ELEMENT = 'SpreadElement'; }
54
59
  static { this.STATIC_BLOCK = 'StaticBlock'; }
60
+ static { this.TEMPLATE_ELEMENT = 'TemplateElement'; }
55
61
  static { this.TEMPLATE_LITERAL = 'TemplateLiteral'; }
56
62
  static { this.THIS_EXPRESSION = 'ThisExpression'; }
57
63
  static { this.TRY_STATEMENT = 'TryStatement'; }
@@ -66,8 +72,8 @@ class AstNodeTypes {
66
72
  static { this.VARIABLE_DECLARATOR = 'VariableDeclarator'; }
67
73
  }
68
74
  exports.AstNodeTypes = AstNodeTypes;
69
- /** The ESLint namespace the house rules live under: `venizia/<rule>`. */
70
- exports.HOUSE_PLUGIN_NAMESPACE = 'venizia';
75
+ /** The ESLint namespace the house rules live under: `@venizia/<rule>`. */
76
+ exports.HOUSE_PLUGIN_NAMESPACE = '@venizia';
71
77
  /** Reads an AST node without trusting its type: TypeScript nodes carry fields estree does not declare. */
72
78
  class AstNode {
73
79
  /** A field of an AST node. */
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/linters/house/common.ts"],"names":[],"mappings":";;;AAEA,8HAA8H;AAC9H,MAAa,YAAY;aACP,mBAAc,GAAG,eAAe,CAAC;aACjC,oBAAe,GAAG,gBAAgB,CAAC;aACnC,yBAAoB,GAAG,qBAAqB,CAAC;aAC7C,wBAAmB,GAAG,oBAAoB,CAAC;aAC3C,8BAAyB,GAAG,yBAAyB,CAAC;aACtD,6BAAwB,GAAG,wBAAwB,CAAC;aACpD,2BAAsB,GAAG,sBAAsB,CAAC;aAChD,uBAAkB,GAAG,mBAAmB,CAAC;aACzC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,sBAAiB,GAAG,kBAAkB,CAAC;aACvC,sBAAiB,GAAG,kBAAkB,CAAC;aACvC,0BAAqB,GAAG,wBAAwB,CAAC;aACjD,eAAU,GAAG,aAAa,CAAC;aAC3B,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,iBAAY,GAAG,aAAa,CAAC;aAC7B,gBAAW,GAAG,YAAY,CAAC;aAC3B,oBAAe,GAAG,gBAAgB,CAAC;aACnC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,kBAAa,GAAG,gBAAgB,CAAC;aACjC,0BAAqB,GAAG,sBAAsB,CAAC;aAC/C,sBAAiB,GAAG,kBAAkB,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B,GAAG,oBAAoB,CAAC;aACzC,yBAAoB,GAAG,qBAAqB,CAAC;aAC7C,wBAAmB,GAAG,oBAAoB,CAAC;;AA7D7D,oCA8DC;AAED,yEAAyE;AAC5D,QAAA,sBAAsB,GAAG,SAAS,CAAC;AAEhD,0GAA0G;AAC1G,MAAa,OAAO;IAClB,8BAA8B;IAC9B,MAAM,CAAC,SAAS,CAAC,IAAoC;QACnD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAE3B,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI;YAC7D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC;YACxB,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAED,sEAAsE;IACtE,MAAM,CAAC,MAAM,CAAC,KAAc;QAC1B,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;IACxD,CAAC;IAED,8EAA8E;IAC9E,MAAM,CAAC,OAAO,CAAC,IAAuB;QACpC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjE,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;CACF;AArBD,0BAqBC","sourcesContent":["import type { Rule } from 'eslint';\n\n/** The estree node types the house rules visit - computed visitor keys, so the names stay PascalCase as ESLint needs them. */\nexport class AstNodeTypes {\n static readonly NEW_EXPRESSION = 'NewExpression';\n static readonly CALL_EXPRESSION = 'CallExpression';\n static readonly FUNCTION_DECLARATION = 'FunctionDeclaration';\n static readonly FUNCTION_EXPRESSION = 'FunctionExpression';\n static readonly ARROW_FUNCTION_EXPRESSION = 'ArrowFunctionExpression';\n static readonly EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration';\n static readonly EXPORT_ALL_DECLARATION = 'ExportAllDeclaration';\n static readonly IMPORT_DECLARATION = 'ImportDeclaration';\n static readonly IMPORT_SPECIFIER = 'ImportSpecifier';\n static readonly IMPORT_EXPRESSION = 'ImportExpression';\n static readonly CLASS_DECLARATION = 'ClassDeclaration';\n static readonly INTERFACE_DECLARATION = 'TSInterfaceDeclaration';\n static readonly UNION_TYPE = 'TSUnionType';\n static readonly AWAIT_EXPRESSION = 'AwaitExpression';\n static readonly RETURN_STATEMENT = 'ReturnStatement';\n static readonly CATCH_CLAUSE = 'CatchClause';\n static readonly SWITCH_CASE = 'SwitchCase';\n static readonly BLOCK_STATEMENT = 'BlockStatement';\n static readonly ARRAY_EXPRESSION = 'ArrayExpression';\n static readonly AS_EXPRESSION = 'TSAsExpression';\n static readonly ASSIGNMENT_EXPRESSION = 'AssignmentExpression';\n static readonly BINARY_EXPRESSION = 'BinaryExpression';\n static readonly CHAIN_EXPRESSION = 'ChainExpression';\n static readonly CONDITIONAL_EXPRESSION = 'ConditionalExpression';\n static readonly EMPTY_STATEMENT = 'EmptyStatement';\n static readonly EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration';\n static readonly EXPORT_SPECIFIER = 'ExportSpecifier';\n static readonly EXPRESSION_STATEMENT = 'ExpressionStatement';\n static readonly IDENTIFIER = 'Identifier';\n static readonly JSX_ATTRIBUTE = 'JSXAttribute';\n static readonly JSX_ELEMENT = 'JSXElement';\n static readonly JSX_EXPRESSION_CONTAINER = 'JSXExpressionContainer';\n static readonly JSX_FRAGMENT = 'JSXFragment';\n static readonly LITERAL = 'Literal';\n static readonly LITERAL_TYPE = 'TSLiteralType';\n static readonly LOGICAL_EXPRESSION = 'LogicalExpression';\n static readonly MAPPED_TYPE = 'TSMappedType';\n static readonly MEMBER_EXPRESSION = 'MemberExpression';\n static readonly METHOD_DEFINITION = 'MethodDefinition';\n static readonly NON_NULL_EXPRESSION = 'TSNonNullExpression';\n static readonly NULL_KEYWORD = 'TSNullKeyword';\n static readonly OBJECT_EXPRESSION = 'ObjectExpression';\n static readonly PRIVATE_IDENTIFIER = 'PrivateIdentifier';\n static readonly PROGRAM = 'Program';\n static readonly PROPERTY = 'Property';\n static readonly SATISFIES_EXPRESSION = 'TSSatisfiesExpression';\n static readonly SEQUENCE_EXPRESSION = 'SequenceExpression';\n static readonly SPREAD_ELEMENT = 'SpreadElement';\n static readonly STATIC_BLOCK = 'StaticBlock';\n static readonly TEMPLATE_LITERAL = 'TemplateLiteral';\n static readonly THIS_EXPRESSION = 'ThisExpression';\n static readonly TRY_STATEMENT = 'TryStatement';\n static readonly TYPE_ALIAS_DECLARATION = 'TSTypeAliasDeclaration';\n static readonly TYPE_ASSERTION = 'TSTypeAssertion';\n static readonly TYPE_PARAMETER_INSTANTIATION = 'TSTypeParameterInstantiation';\n static readonly TYPE_QUERY = 'TSTypeQuery';\n static readonly TYPE_REFERENCE = 'TSTypeReference';\n static readonly UNARY_EXPRESSION = 'UnaryExpression';\n static readonly UNDEFINED_KEYWORD = 'TSUndefinedKeyword';\n static readonly VARIABLE_DECLARATION = 'VariableDeclaration';\n static readonly VARIABLE_DECLARATOR = 'VariableDeclarator';\n}\n\n/** The ESLint namespace the house rules live under: `venizia/<rule>`. */\nexport const HOUSE_PLUGIN_NAMESPACE = 'venizia';\n\n/** Reads an AST node without trusting its type: TypeScript nodes carry fields estree does not declare. */\nexport class AstNode {\n /** A field of an AST node. */\n static readField(opts: { node: unknown; key: string }): unknown {\n const { node, key } = opts;\n\n return typeof node === 'object' && node !== null && key in node\n ? Reflect.get(node, key)\n : undefined;\n }\n\n /** Whether `value` is an AST node: an object with a string `type`. */\n static isNode(value: unknown): value is Rule.Node {\n return AstNode.getType({ node: value }) !== undefined;\n }\n\n /** The node's `type`, or `undefined` for anything that is not an AST node. */\n static getType(opts: { node: unknown }): string | undefined {\n const type = AstNode.readField({ node: opts.node, key: 'type' });\n\n return typeof type === 'string' ? type : undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/linters/house/common.ts"],"names":[],"mappings":";;;AAEA,8HAA8H;AAC9H,MAAa,YAAY;aACP,mBAAc,GAAG,eAAe,CAAC;aACjC,oBAAe,GAAG,gBAAgB,CAAC;aACnC,yBAAoB,GAAG,qBAAqB,CAAC;aAC7C,wBAAmB,GAAG,oBAAoB,CAAC;aAC3C,8BAAyB,GAAG,yBAAyB,CAAC;aACtD,6BAAwB,GAAG,wBAAwB,CAAC;aACpD,2BAAsB,GAAG,sBAAsB,CAAC;aAChD,uBAAkB,GAAG,mBAAmB,CAAC;aACzC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,sBAAiB,GAAG,kBAAkB,CAAC;aACvC,sBAAiB,GAAG,kBAAkB,CAAC;aACvC,eAAU,GAAG,WAAW,CAAC;aACzB,0BAAqB,GAAG,wBAAwB,CAAC;aACjD,eAAU,GAAG,aAAa,CAAC;aAC3B,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,iBAAY,GAAG,aAAa,CAAC;aAC7B,gBAAW,GAAG,YAAY,CAAC;aAC3B,oBAAe,GAAG,gBAAgB,CAAC;aACnC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,kBAAa,GAAG,gBAAgB,CAAC;aACjC,0BAAqB,GAAG,sBAAsB,CAAC;aAC/C,uBAAkB,GAAG,mBAAmB,CAAC;aACzC,sBAAiB,GAAG,kBAAkB,CAAC;aACvC,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,qBAAgB,GAAG,mBAAmB,CAAC;aACvC,2BAAsB,GAAG,uBAAuB,CAAC;aACjD,oBAAe,GAAG,gBAAgB,CAAC;aACnC,+BAA0B,GAAG,0BAA0B,CAAC;aACxD,qBAAgB,GAAG,iBAAiB,CAAC;aACrC,yBAAoB,GAAG,qBAAqB,CAAC;aAC7C,eAAU,G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0E;AAC7D,QAAA,sBAAsB,GAAG,UAAU,CAAC;AAEjD,0GAA0G;AAC1G,MAAa,OAAO;IAClB,8BAA8B;IAC9B,MAAM,CAAC,SAAS,CAAC,IAAoC;QACnD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAE3B,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI;YAC7D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC;YACxB,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAED,sEAAsE;IACtE,MAAM,CAAC,MAAM,CAAC,KAAc;QAC1B,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;IACxD,CAAC;IAED,8EAA8E;IAC9E,MAAM,CAAC,OAAO,CAAC,IAAuB;QACpC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjE,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,CAAC;CACF;AArBD,0BAqBC","sourcesContent":["import type { Rule } from 'eslint';\n\n/** The estree node types the house rules visit - computed visitor keys, so the names stay PascalCase as ESLint needs them. */\nexport class AstNodeTypes {\n static readonly NEW_EXPRESSION = 'NewExpression';\n static readonly CALL_EXPRESSION = 'CallExpression';\n static readonly FUNCTION_DECLARATION = 'FunctionDeclaration';\n static readonly FUNCTION_EXPRESSION = 'FunctionExpression';\n static readonly ARROW_FUNCTION_EXPRESSION = 'ArrowFunctionExpression';\n static readonly EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration';\n static readonly EXPORT_ALL_DECLARATION = 'ExportAllDeclaration';\n static readonly IMPORT_DECLARATION = 'ImportDeclaration';\n static readonly IMPORT_SPECIFIER = 'ImportSpecifier';\n static readonly IMPORT_EXPRESSION = 'ImportExpression';\n static readonly CLASS_DECLARATION = 'ClassDeclaration';\n static readonly CLASS_BODY = 'ClassBody';\n static readonly INTERFACE_DECLARATION = 'TSInterfaceDeclaration';\n static readonly UNION_TYPE = 'TSUnionType';\n static readonly AWAIT_EXPRESSION = 'AwaitExpression';\n static readonly RETURN_STATEMENT = 'ReturnStatement';\n static readonly CATCH_CLAUSE = 'CatchClause';\n static readonly SWITCH_CASE = 'SwitchCase';\n static readonly BLOCK_STATEMENT = 'BlockStatement';\n static readonly ARRAY_EXPRESSION = 'ArrayExpression';\n static readonly AS_EXPRESSION = 'TSAsExpression';\n static readonly ASSIGNMENT_EXPRESSION = 'AssignmentExpression';\n static readonly ASSIGNMENT_PATTERN = 'AssignmentPattern';\n static readonly BINARY_EXPRESSION = 'BinaryExpression';\n static readonly CHAIN_EXPRESSION = 'ChainExpression';\n static readonly CLASS_IMPLEMENTS = 'TSClassImplements';\n static readonly CONDITIONAL_EXPRESSION = 'ConditionalExpression';\n static readonly EMPTY_STATEMENT = 'EmptyStatement';\n static readonly EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration';\n static readonly EXPORT_SPECIFIER = 'ExportSpecifier';\n static readonly EXPRESSION_STATEMENT = 'ExpressionStatement';\n static readonly IDENTIFIER = 'Identifier';\n static readonly INTERFACE_HERITAGE = 'TSInterfaceHeritage';\n static readonly JSX_ATTRIBUTE = 'JSXAttribute';\n static readonly JSX_ELEMENT = 'JSXElement';\n static readonly JSX_EXPRESSION_CONTAINER = 'JSXExpressionContainer';\n static readonly JSX_FRAGMENT = 'JSXFragment';\n static readonly LITERAL = 'Literal';\n static readonly LITERAL_TYPE = 'TSLiteralType';\n static readonly LOGICAL_EXPRESSION = 'LogicalExpression';\n static readonly MAPPED_TYPE = 'TSMappedType';\n static readonly MEMBER_EXPRESSION = 'MemberExpression';\n static readonly METHOD_DEFINITION = 'MethodDefinition';\n static readonly NON_NULL_EXPRESSION = 'TSNonNullExpression';\n static readonly NULL_KEYWORD = 'TSNullKeyword';\n static readonly OBJECT_EXPRESSION = 'ObjectExpression';\n static readonly PRIVATE_IDENTIFIER = 'PrivateIdentifier';\n static readonly PROGRAM = 'Program';\n static readonly PROPERTY = 'Property';\n static readonly PROPERTY_DEFINITION = 'PropertyDefinition';\n static readonly SATISFIES_EXPRESSION = 'TSSatisfiesExpression';\n static readonly SEQUENCE_EXPRESSION = 'SequenceExpression';\n static readonly SPREAD_ELEMENT = 'SpreadElement';\n static readonly STATIC_BLOCK = 'StaticBlock';\n static readonly TEMPLATE_ELEMENT = 'TemplateElement';\n static readonly TEMPLATE_LITERAL = 'TemplateLiteral';\n static readonly THIS_EXPRESSION = 'ThisExpression';\n static readonly TRY_STATEMENT = 'TryStatement';\n static readonly TYPE_ALIAS_DECLARATION = 'TSTypeAliasDeclaration';\n static readonly TYPE_ASSERTION = 'TSTypeAssertion';\n static readonly TYPE_PARAMETER_INSTANTIATION = 'TSTypeParameterInstantiation';\n static readonly TYPE_QUERY = 'TSTypeQuery';\n static readonly TYPE_REFERENCE = 'TSTypeReference';\n static readonly UNARY_EXPRESSION = 'UnaryExpression';\n static readonly UNDEFINED_KEYWORD = 'TSUndefinedKeyword';\n static readonly VARIABLE_DECLARATION = 'VariableDeclaration';\n static readonly VARIABLE_DECLARATOR = 'VariableDeclarator';\n}\n\n/** The ESLint namespace the house rules live under: `@venizia/<rule>`. */\nexport const HOUSE_PLUGIN_NAMESPACE = '@venizia';\n\n/** Reads an AST node without trusting its type: TypeScript nodes carry fields estree does not declare. */\nexport class AstNode {\n /** A field of an AST node. */\n static readField(opts: { node: unknown; key: string }): unknown {\n const { node, key } = opts;\n\n return typeof node === 'object' && node !== null && key in node\n ? Reflect.get(node, key)\n : undefined;\n }\n\n /** Whether `value` is an AST node: an object with a string `type`. */\n static isNode(value: unknown): value is Rule.Node {\n return AstNode.getType({ node: value }) !== undefined;\n }\n\n /** The node's `type`, or `undefined` for anything that is not an AST node. */\n static getType(opts: { node: unknown }): string | undefined {\n const type = AstNode.readField({ node: opts.node, key: 'type' });\n\n return typeof type === 'string' ? type : undefined;\n }\n}\n"]}