@venizia/dev-configs 0.5.0-7 → 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.
- package/README.md +15 -11
- package/dist/checks/purity/manifest.js +11 -3
- package/dist/checks/purity/manifest.js.map +1 -1
- package/dist/checks/purity/probe.js +19 -2
- package/dist/checks/purity/probe.js.map +1 -1
- package/dist/checks/split-report.js +2 -1
- package/dist/checks/split-report.js.map +1 -1
- package/dist/checks/test-controls.d.ts +9 -1
- package/dist/checks/test-controls.js +9 -3
- package/dist/checks/test-controls.js.map +1 -1
- package/dist/checks/test-dead-code.d.ts +9 -1
- package/dist/checks/test-dead-code.js +13 -2
- package/dist/checks/test-dead-code.js.map +1 -1
- package/dist/checks/test-mutate.d.ts +9 -1
- package/dist/checks/test-mutate.js +12 -6
- package/dist/checks/test-mutate.js.map +1 -1
- package/dist/cli/check.d.ts +0 -1
- package/dist/cli/check.js +42 -68
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/clean.js +3 -2
- package/dist/cli/clean.js.map +1 -1
- package/dist/cli/codemod/any-aliases.js +13 -12
- package/dist/cli/codemod/any-aliases.js.map +1 -1
- package/dist/cli/codemod/async-style.d.ts +1 -1
- package/dist/cli/codemod/async-style.js +17 -16
- package/dist/cli/codemod/async-style.js.map +1 -1
- package/dist/cli/codemod/binding-keys.js +14 -13
- package/dist/cli/codemod/binding-keys.js.map +1 -1
- package/dist/cli/codemod/class-renames.d.ts +1 -1
- package/dist/cli/codemod/class-renames.js +30 -11
- package/dist/cli/codemod/class-renames.js.map +1 -1
- package/dist/cli/codemod/connector-imports.js +12 -11
- package/dist/cli/codemod/connector-imports.js.map +1 -1
- package/dist/cli/codemod/const-classes.d.ts +1 -1
- package/dist/cli/codemod/const-classes.js +21 -20
- package/dist/cli/codemod/const-classes.js.map +1 -1
- package/dist/cli/codemod/drop-redundant-casts.d.ts +6 -1
- package/dist/cli/codemod/drop-redundant-casts.js +27 -19
- package/dist/cli/codemod/drop-redundant-casts.js.map +1 -1
- package/dist/cli/codemod/env-get.d.ts +3 -3
- package/dist/cli/codemod/env-get.js +18 -17
- package/dist/cli/codemod/env-get.js.map +1 -1
- package/dist/cli/codemod/files.js +2 -2
- package/dist/cli/codemod/files.js.map +1 -1
- package/dist/cli/codemod/function-to-arrow.d.ts +76 -0
- package/dist/cli/codemod/function-to-arrow.js +357 -0
- package/dist/cli/codemod/function-to-arrow.js.map +1 -0
- package/dist/cli/codemod/index.js +19 -4
- package/dist/cli/codemod/index.js.map +1 -1
- package/dist/cli/codemod/namespace-functions/index.js +13 -12
- package/dist/cli/codemod/namespace-functions/index.js.map +1 -1
- package/dist/cli/codemod/typed-route-context.d.ts +27 -0
- package/dist/cli/codemod/typed-route-context.js +570 -0
- package/dist/cli/codemod/typed-route-context.js.map +1 -0
- package/dist/cli/index.js +5 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/common/cli-output.d.ts +16 -0
- package/dist/common/cli-output.js +49 -0
- package/dist/common/cli-output.js.map +1 -0
- package/dist/compilers/bun.js +1 -1
- package/dist/compilers/bun.js.map +1 -1
- package/dist/linters/eslint.js +1 -1
- package/dist/linters/eslint.js.map +1 -1
- package/dist/linters/house/browser-api-patterns.d.ts +1 -3
- package/dist/linters/house/browser-api-patterns.js +1 -3
- package/dist/linters/house/browser-api-patterns.js.map +1 -1
- package/dist/linters/house/common.d.ts +8 -2
- package/dist/linters/house/common.js +8 -2
- package/dist/linters/house/common.js.map +1 -1
- package/dist/linters/house/configs.js +8 -6
- package/dist/linters/house/configs.js.map +1 -1
- package/dist/linters/house/const-class-values.rule.d.ts +2 -2
- package/dist/linters/house/const-class-values.rule.js +14 -5
- package/dist/linters/house/const-class-values.rule.js.map +1 -1
- package/dist/linters/house/effect-cleanup-consistency.rule.d.ts +2 -2
- package/dist/linters/house/effect-cleanup-consistency.rule.js +1 -1
- package/dist/linters/house/effect-cleanup-consistency.rule.js.map +1 -1
- package/dist/linters/house/framework-api-patterns.d.ts +54 -0
- package/dist/linters/house/framework-api-patterns.js +62 -0
- package/dist/linters/house/framework-api-patterns.js.map +1 -0
- package/dist/linters/house/framework-exports.d.ts +1 -1
- package/dist/linters/house/framework-exports.js +13 -13
- package/dist/linters/house/framework-exports.js.map +1 -1
- package/dist/linters/house/index.d.ts +3 -4
- package/dist/linters/house/index.js +4 -6
- package/dist/linters/house/index.js.map +1 -1
- package/dist/linters/house/max-params-own.rule.d.ts +2 -2
- package/dist/linters/house/max-params-own.rule.js +1 -1
- package/dist/linters/house/max-params-own.rule.js.map +1 -1
- package/dist/linters/house/no-async-hook-callback.rule.d.ts +2 -2
- package/dist/linters/house/no-async-hook-callback.rule.js +1 -1
- package/dist/linters/house/no-async-hook-callback.rule.js.map +1 -1
- package/dist/linters/house/no-await-new-chain.rule.d.ts +2 -2
- package/dist/linters/house/no-await-new-chain.rule.js +1 -1
- package/dist/linters/house/no-await-new-chain.rule.js.map +1 -1
- package/dist/linters/house/no-await-promise-chain.rule.d.ts +2 -2
- package/dist/linters/house/no-await-promise-chain.rule.js +5 -5
- package/dist/linters/house/no-await-promise-chain.rule.js.map +1 -1
- package/dist/linters/house/no-inline-await.rule.d.ts +2 -2
- package/dist/linters/house/no-inline-await.rule.js +1 -1
- package/dist/linters/house/no-inline-await.rule.js.map +1 -1
- package/dist/linters/house/no-leaked-render.rule.d.ts +2 -2
- package/dist/linters/house/no-leaked-render.rule.js +1 -1
- package/dist/linters/house/no-leaked-render.rule.js.map +1 -1
- package/dist/linters/house/no-new-error.rule.d.ts +2 -2
- package/dist/linters/house/no-new-error.rule.js +2 -2
- package/dist/linters/house/no-new-error.rule.js.map +1 -1
- package/dist/linters/house/no-parent-import.rule.d.ts +5 -2
- package/dist/linters/house/no-parent-import.rule.js +5 -2
- package/dist/linters/house/no-parent-import.rule.js.map +1 -1
- package/dist/linters/house/no-return-await.rule.d.ts +2 -2
- package/dist/linters/house/no-return-await.rule.js +1 -1
- package/dist/linters/house/no-return-await.rule.js.map +1 -1
- package/dist/linters/house/no-shadow-framework-type.rule.d.ts +2 -2
- package/dist/linters/house/no-shadow-framework-type.rule.js +2 -2
- package/dist/linters/house/no-shadow-framework-type.rule.js.map +1 -1
- package/dist/linters/house/no-silent-catch.rule.d.ts +2 -2
- package/dist/linters/house/no-silent-catch.rule.js +3 -3
- package/dist/linters/house/no-silent-catch.rule.js.map +1 -1
- package/dist/linters/house/no-unbraced-case.rule.d.ts +2 -2
- package/dist/linters/house/no-unbraced-case.rule.js +1 -1
- package/dist/linters/house/no-unbraced-case.rule.js.map +1 -1
- package/dist/linters/house/plugin.d.ts +1 -1
- package/dist/linters/house/plugin.js +6 -5
- package/dist/linters/house/plugin.js.map +1 -1
- package/dist/linters/house/prefer-framework-api.rule.d.ts +39 -7
- package/dist/linters/house/prefer-framework-api.rule.js +285 -12
- package/dist/linters/house/prefer-framework-api.rule.js.map +1 -1
- package/dist/linters/house/prefer-promise-sleep.rule.d.ts +2 -2
- package/dist/linters/house/prefer-promise-sleep.rule.js +3 -2
- package/dist/linters/house/prefer-promise-sleep.rule.js.map +1 -1
- package/dist/linters/house/prefer-tnullable.rule.d.ts +2 -2
- package/dist/linters/house/prefer-tnullable.rule.js +2 -2
- package/dist/linters/house/prefer-tnullable.rule.js.map +1 -1
- package/dist/linters/house/typed-route-context.rule.d.ts +19 -0
- package/dist/linters/house/typed-route-context.rule.js +322 -0
- package/dist/linters/house/typed-route-context.rule.js.map +1 -0
- package/dist/linters/house/zod-schema-convention.rule.d.ts +82 -0
- package/dist/linters/house/zod-schema-convention.rule.js +477 -0
- package/dist/linters/house/zod-schema-convention.rule.js.map +1 -0
- package/dist/linters/oxlint.js +11 -1
- package/dist/linters/oxlint.js.map +1 -1
- package/dist/linters/react-eslint.js.map +1 -1
- package/dist/linters/rules/naming-convention.rule.d.ts +4 -1
- package/dist/linters/rules/naming-convention.rule.js +30 -1
- package/dist/linters/rules/naming-convention.rule.js.map +1 -1
- package/dist/linters/rules/no-restricted-properties.rule.js +1 -1
- package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -1
- package/dist/testing/spawn.utility.js +1 -1
- package/dist/testing/spawn.utility.js.map +1 -1
- package/package.json +5 -5
- package/dist/checks/use-when-baseline.d.ts +0 -25
- package/dist/checks/use-when-baseline.js +0 -38
- package/dist/checks/use-when-baseline.js.map +0 -1
- package/dist/linters/house/framework-rule-apis.d.ts +0 -24
- package/dist/linters/house/framework-rule-apis.js +0 -48
- package/dist/linters/house/framework-rule-apis.js.map +0 -1
- package/dist/linters/house/public-surface.d.ts +0 -57
- package/dist/linters/house/public-surface.js +0 -174
- package/dist/linters/house/public-surface.js.map +0 -1
- package/dist/linters/house/published-package-configs.d.ts +0 -23
- package/dist/linters/house/published-package-configs.js +0 -42
- package/dist/linters/house/published-package-configs.js.map +0 -1
- package/dist/linters/house/require-use-when.rule.d.ts +0 -42
- package/dist/linters/house/require-use-when.rule.js +0 -175
- package/dist/linters/house/require-use-when.rule.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/linters/oxlint.ts"],"names":[],"mappings":";;;AACA,qCAAsC;AACtC,mCAMiB;AAEjB,0CAA0C;AAC1C,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,aAAa,GAAiB;IACzC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAClC,UAAU,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAC5B,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtB,cAAc,EAAE,CAAC,kBAAkB,EAAE,WAAW,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EAAE,KAAK,CAAC;gBACvB,CAAC,+BAAuB,CAAC,IAAI,CAAC,EAAE,+BAAuB,CAAC,KAAK,EAAE;gBAC/D,oCAAoC,EAAE,KAAK;gBAC3C,0BAA0B,EAAE,KAAK;gBACjC,iCAAiC,EAAE,KAAK;aACzC;SACF;KACF;CACF,CAAC;AAsBF;;;;;;;;;;GAUG;AACH,MAAa,aAAa;IACxB,MAAM,CAAC,MAAM,CAAC,OAA6B,EAAE;QAC3C,MAAM,MAAM,GAAiB,IAAI,CAAC,eAAe;YAC/C,CAAC,CAAC;gBACE,GAAG,qBAAa;gBAChB,KAAK,EAAE;oBACL,GAAG,qBAAa,CAAC,KAAK;oBACtB,CAAC,mCAA2B,CAAC,IAAI,CAAC,EAAE,mCAA2B,CAAC,KAAK,CAAC;wBACpE,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;qBACjD,CAAC;iBACH;aACF;YACH,CAAC,CAAC,qBAAa,CAAC;QAElB,OAAO,mBAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAhBD,sCAgBC","sourcesContent":["import type { OxlintConfig } from 'oxlint';\nimport { LintIgnore } from './ignore';\nimport {\n EqeqeqRule,\n NoRestrictedImportsRule,\n NoUnusedVarsRule,\n PreferNullishCoalescingRule,\n SwitchCaseBracesRule,\n} from './rules';\n\n/** File globs the rules are scoped to. */\nconst TS_FILES = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];\nconst JS_TS_FILES = ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', ...TS_FILES];\n\n/**\n * The oxlint port of `eslintConfigs`, generated with `@oxlint/migrate` and kept rule for rule.\n * Type-aware rules (`no-floating-promises`, `return-await`, ...) need `oxlint-tsgolint` installed.\n *\n * Not ported: `@typescript-eslint/naming-convention` (oxlint has no equivalent yet - keep it in\n * ESLint), `@typescript-eslint/prefer-optional-chain` (oxlint nursery), `no-invalid-this` (covered\n * by `noImplicitThis` in `tsconfig.base.json`). `n/prefer-node-protocol` maps to the unicorn rule.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { oxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(oxlintConfigs);\n * ```\n *\n * `prefer-nullish-coalescing` allows `||` on a string (`name?.trim() || 'guest'`) and reports it on\n * every other nullable type. `OxlintConfigs.create({ lenientFallback: true })` is the same preset\n * with `||` allowed on number operands too.\n */\nexport const oxlintConfigs: OxlintConfig = {\n plugins: ['typescript', 'unicorn'],\n categories: { correctness: 'off' },\n options: { typeAware: true },\n env: { builtin: true },\n ignorePatterns: ['**/node_modules/', '**/*.d.ts', '**/build/', '**/dist/', '**/release/'],\n rules: {\n // eslint:recommended\n 'constructor-super': 'error',\n 'for-direction': 'error',\n 'getter-return': 'error',\n 'no-async-promise-executor': 'error',\n 'no-case-declarations': 'error',\n 'no-class-assign': 'error',\n 'no-compare-neg-zero': 'error',\n 'no-cond-assign': 'error',\n 'no-const-assign': 'error',\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-control-regex': 'error',\n 'no-debugger': 'error',\n 'no-delete-var': 'error',\n 'no-dupe-else-if': 'error',\n 'no-dupe-keys': 'error',\n 'no-duplicate-case': 'error',\n 'no-empty': 'error',\n 'no-empty-character-class': 'error',\n 'no-empty-pattern': 'error',\n 'no-empty-static-block': 'error',\n 'no-ex-assign': 'error',\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': 'error',\n 'no-func-assign': 'error',\n 'no-global-assign': 'error',\n 'no-import-assign': 'error',\n 'no-invalid-regexp': 'error',\n 'no-irregular-whitespace': 'error',\n 'no-loss-of-precision': 'error',\n 'no-misleading-character-class': 'error',\n 'no-new-native-nonconstructor': 'error',\n 'no-nonoctal-decimal-escape': 'error',\n 'no-obj-calls': 'error',\n 'no-prototype-builtins': 'error',\n 'no-regex-spaces': 'error',\n 'no-self-assign': 'error',\n 'no-setter-return': 'error',\n 'no-shadow-restricted-names': 'error',\n 'no-sparse-arrays': 'error',\n 'no-this-before-super': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable': 'error',\n 'no-unsafe-finally': 'error',\n 'no-unsafe-negation': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-unused-labels': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-backreference': 'error',\n 'no-useless-catch': 'error',\n 'no-with': 'error',\n 'preserve-caught-error': 'error',\n 'require-yield': 'error',\n 'use-isnan': 'error',\n 'valid-typeof': 'error',\n 'no-array-constructor': 'error',\n\n // Strict rules on top\n [NoUnusedVarsRule.NAME]: NoUnusedVarsRule.build(),\n 'no-useless-escape': 'warn',\n 'no-unused-expressions': 'error',\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n [EqeqeqRule.NAME]: EqeqeqRule.build(),\n 'no-void': 'error',\n 'no-caller': 'error',\n 'no-shadow': 'error',\n 'no-use-before-define': 'error',\n [SwitchCaseBracesRule.NAME]: SwitchCaseBracesRule.build(),\n 'unicorn/prefer-node-protocol': 'error',\n\n // typescript-eslint\n 'typescript/ban-ts-comment': 'error',\n 'typescript/no-duplicate-enum-values': 'error',\n 'typescript/no-empty-object-type': 'error',\n 'typescript/no-extra-non-null-assertion': 'error',\n 'typescript/no-misused-new': 'error',\n 'typescript/no-namespace': 'error',\n 'typescript/no-non-null-asserted-optional-chain': 'error',\n 'typescript/no-this-alias': 'error',\n 'typescript/no-unnecessary-type-constraint': 'error',\n 'typescript/no-unsafe-declaration-merging': 'error',\n 'typescript/no-unsafe-function-type': 'error',\n 'typescript/no-wrapper-object-types': 'error',\n 'typescript/prefer-as-const': 'error',\n 'typescript/prefer-namespace-keyword': 'error',\n 'typescript/triple-slash-reference': 'error',\n 'typescript/adjacent-overload-signatures': 'error',\n 'typescript/prefer-for-of': 'error',\n 'typescript/unified-signatures': 'error',\n\n // typescript-eslint, type-aware\n 'typescript/await-thenable': 'error',\n 'typescript/no-floating-promises': 'error',\n // `||` on a string is mostly an intentional empty-string fallback (`value?.trim() || fallback`);\n // `??` keeps `''` and changes behaviour. Objects and numbers still report.\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true },\n }),\n 'typescript/return-await': 'error',\n },\n overrides: [\n {\n // TypeScript itself reports these.\n files: TS_FILES,\n rules: {\n 'constructor-super': 'off',\n 'getter-return': 'off',\n 'no-class-assign': 'off',\n 'no-const-assign': 'off',\n 'no-dupe-keys': 'off',\n 'no-func-assign': 'off',\n 'no-import-assign': 'off',\n 'no-new-native-nonconstructor': 'off',\n 'no-obj-calls': 'off',\n 'no-setter-return': 'off',\n 'no-this-before-super': 'off',\n 'no-unreachable': 'off',\n 'no-unsafe-negation': 'off',\n 'no-with': 'off',\n 'no-var': 'error',\n 'prefer-const': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n // A value import of a type becomes a runtime import when Bun runs a decorated class's source\n // (emitDecoratorMetadata) and fails with `Export named 'X' not found`. `import('pkg').T` type\n // annotations stay allowed: they are type-only by construction, and type an optional peer.\n 'typescript/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n },\n ],\n },\n },\n {\n files: JS_TS_FILES,\n rules: {\n 'no-constant-condition': 'off',\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build(),\n 'typescript/no-unsafe-function-type': 'off',\n 'typescript/no-this-alias': 'off',\n 'typescript/no-empty-object-type': 'off',\n },\n },\n ],\n};\n\n/** Options of `OxlintConfigs.create`. */\nexport interface IOxlintPresetOptions {\n /**\n * Also allow `||` / `||=` where the left side is a number, so `limit || 20` passes: `0` falls\n * back on purpose. A string is allowed by the base already. Left off, the base catches a real `0`\n * swallowed by `||`.\n *\n * @default false\n */\n lenientFallback?: boolean;\n /**\n * Project paths to skip - generated files, vendored code - as in `--ignore-pattern`: `src/gen/**`.\n * Every rule is turned off for them (oxlint cannot ignore a project path from `.configs/`).\n * Share the list with ESLint through `LintIgnore`.\n *\n * @default []\n */\n ignore?: string[];\n}\n\n/**\n * Builds `oxlintConfigs` with options. Without any it returns the base preset unchanged.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { OxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(OxlintConfigs.create({ lenientFallback: true }));\n * ```\n */\nexport class OxlintConfigs {\n static create(opts: IOxlintPresetOptions = {}): OxlintConfig {\n const config: OxlintConfig = opts.lenientFallback\n ? {\n ...oxlintConfigs,\n rules: {\n ...oxlintConfigs.rules,\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true, number: true },\n }),\n },\n }\n : oxlintConfigs;\n\n return LintIgnore.oxlint({ config, patterns: opts.ignore ?? [] });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/linters/oxlint.ts"],"names":[],"mappings":";;;AACA,qCAAsC;AACtC,mCAMiB;AAEjB,0CAA0C;AAC1C,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,aAAa,GAAiB;IACzC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAClC,UAAU,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAC5B,GA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import type { OxlintConfig } from 'oxlint';\nimport { LintIgnore } from './ignore';\nimport {\n EqeqeqRule,\n NoRestrictedImportsRule,\n NoUnusedVarsRule,\n PreferNullishCoalescingRule,\n SwitchCaseBracesRule,\n} from './rules';\n\n/** File globs the rules are scoped to. */\nconst TS_FILES = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];\nconst JS_TS_FILES = ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', ...TS_FILES];\n\n/**\n * The oxlint port of `eslintConfigs`, generated with `@oxlint/migrate` and kept rule for rule.\n * Type-aware rules (`no-floating-promises`, `return-await`, ...) need `oxlint-tsgolint` installed.\n *\n * Not ported: `@typescript-eslint/naming-convention` (oxlint has no equivalent yet - keep it in\n * ESLint), `@typescript-eslint/prefer-optional-chain` (oxlint nursery), `no-invalid-this` (covered\n * by `noImplicitThis` in `tsconfig.base.json`). `n/prefer-node-protocol` maps to the unicorn rule.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { oxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(oxlintConfigs);\n * ```\n *\n * `prefer-nullish-coalescing` allows `||` on a string (`name?.trim() || 'guest'`) and reports it on\n * every other nullable type. `OxlintConfigs.create({ lenientFallback: true })` is the same preset\n * with `||` allowed on number operands too.\n */\nexport const oxlintConfigs: OxlintConfig = {\n plugins: ['typescript', 'unicorn'],\n categories: { correctness: 'off' },\n options: { typeAware: true },\n env: { builtin: true },\n ignorePatterns: ['**/node_modules/', '**/*.d.ts', '**/build/', '**/dist/', '**/release/'],\n rules: {\n // eslint:recommended\n 'constructor-super': 'error',\n 'for-direction': 'error',\n 'getter-return': 'error',\n 'no-async-promise-executor': 'error',\n 'no-case-declarations': 'error',\n 'no-class-assign': 'error',\n 'no-compare-neg-zero': 'error',\n 'no-cond-assign': 'error',\n 'no-const-assign': 'error',\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-control-regex': 'error',\n 'no-debugger': 'error',\n 'no-delete-var': 'error',\n 'no-dupe-else-if': 'error',\n 'no-dupe-keys': 'error',\n 'no-duplicate-case': 'error',\n 'no-empty': 'error',\n 'no-empty-character-class': 'error',\n 'no-empty-pattern': 'error',\n 'no-empty-static-block': 'error',\n 'no-ex-assign': 'error',\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': 'error',\n 'no-func-assign': 'error',\n 'no-global-assign': 'error',\n 'no-import-assign': 'error',\n 'no-invalid-regexp': 'error',\n 'no-irregular-whitespace': 'error',\n 'no-loss-of-precision': 'error',\n 'no-misleading-character-class': 'error',\n 'no-new-native-nonconstructor': 'error',\n 'no-nonoctal-decimal-escape': 'error',\n 'no-obj-calls': 'error',\n 'no-prototype-builtins': 'error',\n 'no-regex-spaces': 'error',\n 'no-self-assign': 'error',\n 'no-setter-return': 'error',\n 'no-shadow-restricted-names': 'error',\n 'no-sparse-arrays': 'error',\n 'no-this-before-super': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable': 'error',\n 'no-unsafe-finally': 'error',\n 'no-unsafe-negation': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-unused-labels': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-backreference': 'error',\n 'no-useless-catch': 'error',\n 'no-with': 'error',\n 'preserve-caught-error': 'error',\n 'require-yield': 'error',\n 'use-isnan': 'error',\n 'valid-typeof': 'error',\n 'no-array-constructor': 'error',\n\n // Strict rules on top\n [NoUnusedVarsRule.NAME]: NoUnusedVarsRule.build(),\n 'no-useless-escape': 'warn',\n 'no-unused-expressions': 'error',\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n [EqeqeqRule.NAME]: EqeqeqRule.build(),\n 'no-void': 'error',\n 'no-caller': 'error',\n 'no-shadow': 'error',\n 'no-use-before-define': 'error',\n [SwitchCaseBracesRule.NAME]: SwitchCaseBracesRule.build(),\n 'unicorn/prefer-node-protocol': 'error',\n\n // typescript-eslint\n 'typescript/ban-ts-comment': 'error',\n 'typescript/no-duplicate-enum-values': 'error',\n 'typescript/no-empty-object-type': 'error',\n 'typescript/no-extra-non-null-assertion': 'error',\n 'typescript/no-misused-new': 'error',\n 'typescript/no-namespace': 'error',\n 'typescript/no-non-null-asserted-optional-chain': 'error',\n 'typescript/no-this-alias': 'error',\n 'typescript/no-unnecessary-type-constraint': 'error',\n 'typescript/no-unsafe-declaration-merging': 'error',\n 'typescript/no-unsafe-function-type': 'error',\n 'typescript/no-wrapper-object-types': 'error',\n 'typescript/prefer-as-const': 'error',\n 'typescript/prefer-namespace-keyword': 'error',\n 'typescript/triple-slash-reference': 'error',\n 'typescript/adjacent-overload-signatures': 'error',\n 'typescript/prefer-for-of': 'error',\n // An overload with TSDoc of its own is one on purpose.\n 'typescript/unified-signatures': ['error', { ignoreOverloadsWithDifferentJSDoc: true }],\n\n // The base code rules: arrows over `function`, a logger over `console`, a `default` in every `switch`.\n 'func-style': ['error', 'expression'],\n 'no-console': 'error',\n 'default-case': 'error',\n\n // typescript-eslint, type-aware\n 'typescript/await-thenable': 'error',\n 'typescript/no-floating-promises': 'error',\n // `||` on a string is mostly an intentional empty-string fallback (`value?.trim() || fallback`);\n // `??` keeps `''` and changes behaviour. Objects and numbers still report.\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true },\n }),\n 'typescript/return-await': 'error',\n },\n overrides: [\n {\n // A test writes what it needs to prove its subject.\n files: ['**/__tests__/**', '**/*.test.{ts,tsx,mts,cts}', '**/*.spec.{ts,tsx,mts,cts}'],\n rules: { 'func-style': 'off', 'no-console': 'off', 'default-case': 'off' },\n },\n {\n // TypeScript itself reports these.\n files: TS_FILES,\n rules: {\n 'constructor-super': 'off',\n 'getter-return': 'off',\n 'no-class-assign': 'off',\n 'no-const-assign': 'off',\n 'no-dupe-keys': 'off',\n 'no-func-assign': 'off',\n 'no-import-assign': 'off',\n 'no-new-native-nonconstructor': 'off',\n 'no-obj-calls': 'off',\n 'no-setter-return': 'off',\n 'no-this-before-super': 'off',\n 'no-unreachable': 'off',\n 'no-unsafe-negation': 'off',\n 'no-with': 'off',\n 'no-var': 'error',\n 'prefer-const': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n // A value import of a type becomes a runtime import when Bun runs a decorated class's source\n // (emitDecoratorMetadata) and fails with `Export named 'X' not found`. `import('pkg').T` type\n // annotations stay allowed: they are type-only by construction, and type an optional peer.\n 'typescript/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n },\n ],\n },\n },\n {\n files: JS_TS_FILES,\n rules: {\n 'no-constant-condition': 'off',\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build(),\n 'typescript/no-unsafe-function-type': 'off',\n 'typescript/no-this-alias': 'off',\n 'typescript/no-empty-object-type': 'off',\n },\n },\n ],\n};\n\n/** Options of `OxlintConfigs.create`. */\nexport interface IOxlintPresetOptions {\n /**\n * Also allow `||` / `||=` where the left side is a number, so `limit || 20` passes: `0` falls\n * back on purpose. A string is allowed by the base already. Left off, the base catches a real `0`\n * swallowed by `||`.\n *\n * @default false\n */\n lenientFallback?: boolean;\n /**\n * Project paths to skip - generated files, vendored code - as in `--ignore-pattern`: `src/gen/**`.\n * Every rule is turned off for them (oxlint cannot ignore a project path from `.configs/`).\n * Share the list with ESLint through `LintIgnore`.\n *\n * @default []\n */\n ignore?: string[];\n}\n\n/**\n * Builds `oxlintConfigs` with options. Without any it returns the base preset unchanged.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { OxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(OxlintConfigs.create({ lenientFallback: true }));\n * ```\n */\nexport class OxlintConfigs {\n static create(opts: IOxlintPresetOptions = {}): OxlintConfig {\n const config: OxlintConfig = opts.lenientFallback\n ? {\n ...oxlintConfigs,\n rules: {\n ...oxlintConfigs.rules,\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true, number: true },\n }),\n },\n }\n : oxlintConfigs;\n\n return LintIgnore.oxlint({ config, patterns: opts.ignore ?? [] });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-eslint.js","sourceRoot":"","sources":["../../src/linters/react-eslint.ts"],"names":[],"mappings":";;;;;;AACA,0EAAyC;AACzC,qCAAmD;AACnD,2CAAwC;AACxC,mCAA+C;AAE/C,uFAAuF;AACvF,MAAM,2BAA2B,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;AAElG;;;GAGG;AACU,QAAA,4BAA4B,GAAoB;IAC3D,GAAG,gCAAuB;IAC1B;QACE,KAAK,EAAE,qBAAS;QAChB,eAAe,EAAE,EAAE,MAAM,EAAE,2BAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"react-eslint.js","sourceRoot":"","sources":["../../src/linters/react-eslint.ts"],"names":[],"mappings":";;;;;;AACA,0EAAyC;AACzC,qCAAmD;AACnD,2CAAwC;AACxC,mCAA+C;AAE/C,uFAAuF;AACvF,MAAM,2BAA2B,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC;AAElG;;;GAGG;AACU,QAAA,4BAA4B,GAAoB;IAC3D,GAAG,gCAAuB;IAC1B;QACE,KAAK,EAAE,qBAAS;QAChB,eAAe,EAAE,EAAE,MAAM,EAAE,2BAAQ,CAAC,MAAM,EAAE;QAC5C,OAAO,EAAE,EAAE,oBAAoB,EAAE,2BAAQ,CAAC,MAAM,EAAE;QAClD,KAAK,EAAE;YACL,CAAC,4BAAoB,CAAC,IAAI,CAAC,EAAE,4BAAoB,CAAC,KAAK,CAAC;gBACtD,cAAc,EAAE,CAAC,2BAA2B,CAAC;aAC9C,CAAC;SACH;KACF;CACF,CAAC","sourcesContent":["import type { Linter } from 'eslint';\nimport tseslint from 'typescript-eslint';\nimport { namingConventionConfigs } from './eslint';\nimport { JSX_FILES } from './jsx-files';\nimport { NamingConventionRule } from './rules';\n\n/** A component is declared as `function App()`, so functions may be PascalCase too. */\nconst COMPONENT_FUNCTION_SELECTOR = { selector: 'function', format: ['camelCase', 'PascalCase'] };\n\n/**\n * `namingConventionConfigs` for a React project: the base rule plus PascalCase functions in .jsx and\n * .tsx files, where a component is declared as `function App()`.\n */\nexport const reactNamingConventionConfigs: Linter.Config[] = [\n ...namingConventionConfigs,\n {\n files: JSX_FILES,\n languageOptions: { parser: tseslint.parser },\n plugins: { '@typescript-eslint': tseslint.plugin },\n rules: {\n [NamingConventionRule.NAME]: NamingConventionRule.build({\n extraSelectors: [COMPONENT_FUNCTION_SELECTOR],\n }),\n },\n },\n];\n"]}
|
|
@@ -11,7 +11,10 @@ export type TNamingSelector = Record<string, unknown> & {
|
|
|
11
11
|
export declare class NamingConventionRule {
|
|
12
12
|
static readonly NAME = "@typescript-eslint/naming-convention";
|
|
13
13
|
static readonly SELECTORS: readonly TNamingSelector[];
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* `extraSelectors` are appended, but position decides nothing: typescript-eslint orders selectors by how specific
|
|
16
|
+
* they are. To let a name through the base type selectors, give a selector a `filter` and `format: null`.
|
|
17
|
+
*/
|
|
15
18
|
static build(opts?: {
|
|
16
19
|
severity?: TRuleSeverity;
|
|
17
20
|
extraSelectors?: TNamingSelector[];
|
|
@@ -45,6 +45,32 @@ class NamingConventionRule {
|
|
|
45
45
|
leadingUnderscore: 'allow',
|
|
46
46
|
},
|
|
47
47
|
{ selector: 'typeLike', format: ['PascalCase'] },
|
|
48
|
+
// A type alias starts with `T` or ends with `Type`; an interface starts with `I`.
|
|
49
|
+
{
|
|
50
|
+
selector: 'typeAlias',
|
|
51
|
+
format: ['PascalCase'],
|
|
52
|
+
custom: { regex: '^T[A-Z0-9]|Type$', match: true },
|
|
53
|
+
},
|
|
54
|
+
{ selector: 'interface', format: ['PascalCase'], prefix: ['I'] },
|
|
55
|
+
// Names that stay as they are: the framework's value helpers, and a type that shares its name with a class value.
|
|
56
|
+
{
|
|
57
|
+
selector: 'typeAlias',
|
|
58
|
+
filter: {
|
|
59
|
+
regex: '^(ValueOf|ValueOptional|ValueOptionalExcept|ValueOrPromise|PGliteCRUDRepository)$',
|
|
60
|
+
match: true,
|
|
61
|
+
},
|
|
62
|
+
format: null,
|
|
63
|
+
},
|
|
64
|
+
// Interfaces that `declare module` or `declare global` adds to: the name belongs to the library, and the rule
|
|
65
|
+
// cannot see where an interface is declared.
|
|
66
|
+
{
|
|
67
|
+
selector: 'interface',
|
|
68
|
+
filter: {
|
|
69
|
+
regex: '^(ContextRenderer|ContextVariableMap|ImportMeta|ImportMetaEnv|Matchers|ProcessEnv|Register|Window)$',
|
|
70
|
+
match: true,
|
|
71
|
+
},
|
|
72
|
+
format: null,
|
|
73
|
+
},
|
|
48
74
|
{
|
|
49
75
|
selector: [
|
|
50
76
|
'objectLiteralProperty',
|
|
@@ -61,7 +87,10 @@ class NamingConventionRule {
|
|
|
61
87
|
{ selector: 'import', format: ['camelCase', 'PascalCase'] },
|
|
62
88
|
{ selector: 'import', format: null, filter: '^_$' },
|
|
63
89
|
]; }
|
|
64
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* `extraSelectors` are appended, but position decides nothing: typescript-eslint orders selectors by how specific
|
|
92
|
+
* they are. To let a name through the base type selectors, give a selector a `filter` and `format: null`.
|
|
93
|
+
*/
|
|
65
94
|
static build(opts = {}) {
|
|
66
95
|
const { severity = 'error', extraSelectors = [] } = opts;
|
|
67
96
|
return [severity, ...NamingConventionRule.SELECTORS, ...extraSelectors];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-convention.rule.js","sourceRoot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,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE;QACtF;YACE,QAAQ,EAAE,YAAY;YACtB,SAAS,EAAE,CAAC,SAAS,CAAC;YACtB,MAAM,EAAE,CAAC,WAAW,CAAC;YACrB,iBAAiB,EAAE,OAAO;SAC3B;QACD;YACE,QAAQ,EAAE,YAAY;YACtB,SAAS,EAAE,CAAC,WAAW,CAAC;YACxB,MAAM,EAAE,CAAC,WAAW,CAAC;YACrB,iBAAiB,EAAE,OAAO;SAC3B;QACD,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE;QAChD;YACE,QAAQ,EAAE;gBACR,uBAAuB;gBACvB,qBAAqB;gBACrB,cAAc;gBACd,YAAY;gBACZ,eAAe;gBACf,aAAa;gBACb,YAAY;aACb;YACD,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,CAAC,gBAAgB,CAAC;SAC9B;QACD,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE;QAC3D,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;KACpD,CAAC;IAEF
|
|
1
|
+
{"version":3,"file":"naming-convention.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/naming-convention.rule.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,MAAa,oBAAoB;aACf,SAAI,GAAG,sCAAsC,CAAC;aAE9C,cAAS,GAA+B;QACtD,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE;QAC9C,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE;QAC3E,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE;QACrD,qGAAqG;QACrG;YAC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\n\n/** One selector of `@typescript-eslint/naming-convention`, as its documentation types it. */\nexport type TNamingSelector = Record<string, unknown> & { selector: string | string[] };\n\n/**\n * `@typescript-eslint/naming-convention`, owned here. oxlint has no port of it, so it runs in ESLint.\n * The selectors are the LoopBack 4 set the base preset carried, kept one for one.\n */\nexport class NamingConventionRule {\n static readonly NAME = '@typescript-eslint/naming-convention';\n\n static readonly SELECTORS: readonly TNamingSelector[] = [\n { selector: 'default', format: ['camelCase'] },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE', 'PascalCase'] },\n { selector: 'variable', format: null, filter: '^_$' },\n // A `_name` variable names an omitted value (`{ page: _page, ...rest }`); its case is still checked.\n {\n selector: 'variable',\n filter: { regex: '^_.', match: true },\n format: ['camelCase', 'UPPER_CASE', 'PascalCase'],\n leadingUnderscore: 'allow',\n },\n { selector: 'function', format: ['PascalCase'], filter: 'Mixin$' },\n { selector: 'parameter', format: ['camelCase'], leadingUnderscore: 'allow' },\n {\n selector: 'enumMember',\n format: ['camelCase', 'UPPER_CASE', 'PascalCase'],\n leadingUnderscore: 'allow',\n },\n {\n selector: 'property',\n format: ['camelCase', 'UPPER_CASE', 'PascalCase'],\n leadingUnderscore: 'allow',\n },\n { selector: 'method', format: ['camelCase'], leadingUnderscore: 'allow' },\n { selector: 'memberLike', modifiers: ['static'], format: ['camelCase', 'UPPER_CASE'] },\n {\n selector: 'memberLike',\n modifiers: ['private'],\n format: ['camelCase'],\n leadingUnderscore: 'allow',\n },\n {\n selector: 'memberLike',\n modifiers: ['protected'],\n format: ['camelCase'],\n leadingUnderscore: 'allow',\n },\n { selector: 'typeLike', format: ['PascalCase'] },\n // A type alias starts with `T` or ends with `Type`; an interface starts with `I`.\n {\n selector: 'typeAlias',\n format: ['PascalCase'],\n custom: { regex: '^T[A-Z0-9]|Type$', match: true },\n },\n { selector: 'interface', format: ['PascalCase'], prefix: ['I'] },\n // Names that stay as they are: the framework's value helpers, and a type that shares its name with a class value.\n {\n selector: 'typeAlias',\n filter: {\n regex: '^(ValueOf|ValueOptional|ValueOptionalExcept|ValueOrPromise|PGliteCRUDRepository)$',\n match: true,\n },\n format: null,\n },\n // Interfaces that `declare module` or `declare global` adds to: the name belongs to the library, and the rule\n // cannot see where an interface is declared.\n {\n selector: 'interface',\n filter: {\n regex:\n '^(ContextRenderer|ContextVariableMap|ImportMeta|ImportMetaEnv|Matchers|ProcessEnv|Register|Window)$',\n match: true,\n },\n format: null,\n },\n {\n selector: [\n 'objectLiteralProperty',\n 'objectLiteralMethod',\n 'typeProperty',\n 'typeMethod',\n 'classProperty',\n 'classMethod',\n 'enumMember',\n ],\n format: null,\n modifiers: ['requiresQuotes'],\n },\n { selector: 'import', format: ['camelCase', 'PascalCase'] },\n { selector: 'import', format: null, filter: '^_$' },\n ];\n\n /**\n * `extraSelectors` are appended, but position decides nothing: typescript-eslint orders selectors by how specific\n * they are. To let a name through the base type selectors, give a selector a `filter` and `format: null`.\n */\n static build(\n opts: { severity?: TRuleSeverity; extraSelectors?: TNamingSelector[] } = {},\n ): Linter.RuleEntry {\n const { severity = 'error', extraSelectors = [] } = opts;\n\n return [severity, ...NamingConventionRule.SELECTORS, ...extraSelectors];\n }\n}\n"]}
|
|
@@ -12,7 +12,7 @@ class NoRestrictedPropertiesRule {
|
|
|
12
12
|
static { this.SECURE_CONTEXT = [
|
|
13
13
|
{
|
|
14
14
|
property: 'randomUUID',
|
|
15
|
-
message:
|
|
15
|
+
message: "crypto.randomUUID exists only in a secure context (https, localhost) - on a plain-http origin it is undefined. Use `UuidV4Generator.generate()`: `import { UuidV4Generator } from '@venizia/ignis-helpers/uuid';`",
|
|
16
16
|
},
|
|
17
17
|
]; }
|
|
18
18
|
static build(opts = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-restricted-properties.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-properties.rule.ts"],"names":[],"mappings":";;;AASA;;;;;GAKG;AACH,MAAa,0BAA0B;aACrB,SAAI,GAAG,0BAA0B,CAAC;aAElC,mBAAc,GAAmC;QAC/D;YACE,QAAQ,EAAE,YAAY;YACtB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"no-restricted-properties.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-restricted-properties.rule.ts"],"names":[],"mappings":";;;AASA;;;;;GAKG;AACH,MAAa,0BAA0B;aACrB,SAAI,GAAG,0BAA0B,CAAC;aAElC,mBAAc,GAAmC;QAC/D;YACE,QAAQ,EAAE,YAAY;YACtB,OAAO,EACL,mNAAmN;SACtN;KACF,CAAC;IAEF,MAAM,CAAC,KAAK,CACV,OAA8E,EAAE;QAEhF,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QAE1D,OAAO,CAAC,QAAQ,EAAE,GAAG,0BAA0B,CAAC,cAAc,EAAE,GAAG,eAAe,CAAC,CAAC;IACtF,CAAC;;AAjBH,gEAkBC","sourcesContent":["import type { TOxlintRuleEntry, TRuleSeverity } from './common';\n\n/** One forbidden property access, with the message the author sees. */\nexport interface IRestrictedProperty {\n property: string;\n object?: string;\n message: string;\n}\n\n/**\n * `no-restricted-properties`. The default bans what exists only in a secure context (https,\n * localhost): on a plain-http LAN origin or in a WebView, `crypto.randomUUID` is `undefined` and the\n * first call throws. Catches the call, `globalThis.crypto.randomUUID`, the bracket form and\n * destructuring; leaves `getRandomValues` alone.\n */\nexport class NoRestrictedPropertiesRule {\n static readonly NAME = 'no-restricted-properties';\n\n static readonly SECURE_CONTEXT: readonly IRestrictedProperty[] = [\n {\n property: 'randomUUID',\n message:\n \"crypto.randomUUID exists only in a secure context (https, localhost) - on a plain-http origin it is undefined. Use `UuidV4Generator.generate()`: `import { UuidV4Generator } from '@venizia/ignis-helpers/uuid';`\",\n },\n ];\n\n static build(\n opts: { severity?: TRuleSeverity; extraProperties?: IRestrictedProperty[] } = {},\n ): TOxlintRuleEntry<'no-restricted-properties'> {\n const { severity = 'error', extraProperties = [] } = opts;\n\n return [severity, ...NoRestrictedPropertiesRule.SECURE_CONTEXT, ...extraProperties];\n }\n}\n"]}
|
|
@@ -19,7 +19,7 @@ class SpawnUtility {
|
|
|
19
19
|
killSignal: 'SIGKILL',
|
|
20
20
|
});
|
|
21
21
|
if (result.exitedDueToTimeout) {
|
|
22
|
-
// eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
|
|
22
|
+
// eslint-disable-next-line @venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
|
|
23
23
|
throw new Error(`[SpawnUtility.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`);
|
|
24
24
|
}
|
|
25
25
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.utility.js","sourceRoot":"","sources":["../../src/testing/spawn.utility.ts"],"names":[],"mappings":";;;AAAA,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC,6FAA6F;AAC7F,MAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAIrB,IAA6F;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;QACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe;YACzC,GAAG,IAAI;YACP,OAAO;YACP,UAAU,EAAE,SAAkB;SAC/B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC9B,
|
|
1
|
+
{"version":3,"file":"spawn.utility.js","sourceRoot":"","sources":["../../src/testing/spawn.utility.ts"],"names":[],"mappings":";;;AAAA,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC,6FAA6F;AAC7F,MAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAIrB,IAA6F;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;QACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe;YACzC,GAAG,IAAI;YACP,OAAO;YACP,UAAU,EAAE,SAAkB;SAC/B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC9B,uGAAuG;YACvG,MAAM,IAAI,KAAK,CACb,uDAAuD,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACvH,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5BD,oCA4BC","sourcesContent":["/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */\nexport const SPAWN_TIMEOUT_MS = 120_000;\n\n/** Bounded wrappers around `Bun.spawn*` for tests, so a stuck child cannot stall a suite. */\nexport class SpawnUtility {\n /**\n * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot\n * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be\n * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with\n * SIGKILL, and throws naming the command instead of returning a half-finished result.\n */\n static spawnSyncBounded<\n const In extends Bun.SpawnOptions.Writable = 'ignore',\n const Out extends Bun.SpawnOptions.Readable = 'pipe',\n const Err extends Bun.SpawnOptions.Readable = 'pipe',\n >(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined }) {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({\n ...opts,\n timeout,\n killSignal: 'SIGKILL' as const,\n });\n\n if (result.exitedDueToTimeout) {\n // eslint-disable-next-line @venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n `[SpawnUtility.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/dev-configs",
|
|
3
|
-
"version": "0.5.0-
|
|
3
|
+
"version": "0.5.0-9",
|
|
4
4
|
"description": "Shareable development configurations for TypeScript projects: oxlint presets with per-rule builders, the ESLint naming-convention rule, the legacy ESLint flat config, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build-tools",
|
|
@@ -109,13 +109,13 @@
|
|
|
109
109
|
"dependencies": {
|
|
110
110
|
"@eslint/js": "^10.0.1",
|
|
111
111
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
112
|
-
"typescript-eslint": "^8.
|
|
112
|
+
"typescript-eslint": "^8.74.0"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@types/bun": "^1.4.5",
|
|
116
|
-
"eslint": "^10.
|
|
117
|
-
"oxlint": "1.
|
|
118
|
-
"oxlint-tsgolint": "7.0.
|
|
116
|
+
"eslint": "^10.15.0",
|
|
117
|
+
"oxlint": "1.95.0",
|
|
118
|
+
"oxlint-tsgolint": "7.0.2009",
|
|
119
119
|
"typescript": "^6.0.3"
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** The baseline of `venizia/require-use-when`: the exports of a package that still lack a `@useWhen`. */
|
|
2
|
-
export declare class UseWhenBaseline {
|
|
3
|
-
/** Where a package keeps it, next to its lint config. */
|
|
4
|
-
static readonly DEFAULT_FILE = ".configs/use-when-baseline.json";
|
|
5
|
-
/**
|
|
6
|
-
* The baseline entries of the package at `directory` today: `<file from the package folder>#<export>` for every export
|
|
7
|
-
* the rule requires a `@useWhen` on and that has none, sorted. Writing them is how a package adopts the rule before its
|
|
8
|
-
* sweep; a package that is already swept has none.
|
|
9
|
-
*/
|
|
10
|
-
static entries(opts: {
|
|
11
|
-
directory: string;
|
|
12
|
-
entries?: ReadonlyArray<string>;
|
|
13
|
-
types?: ReadonlyArray<string>;
|
|
14
|
-
}): Array<string>;
|
|
15
|
-
/** The file text for `entries`: JSON, one entry per line, a trailing newline. */
|
|
16
|
-
static render(opts: {
|
|
17
|
-
entries: ReadonlyArray<string>;
|
|
18
|
-
}): string;
|
|
19
|
-
/** The path a `--out` argument names, from `root`. */
|
|
20
|
-
static pathOf(opts: {
|
|
21
|
-
root: string;
|
|
22
|
-
out?: string;
|
|
23
|
-
}): string;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=use-when-baseline.d.ts.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UseWhenBaseline = void 0;
|
|
4
|
-
const node_path_1 = require("node:path");
|
|
5
|
-
const house_1 = require("../linters/house");
|
|
6
|
-
/** The baseline of `venizia/require-use-when`: the exports of a package that still lack a `@useWhen`. */
|
|
7
|
-
class UseWhenBaseline {
|
|
8
|
-
/** Where a package keeps it, next to its lint config. */
|
|
9
|
-
static { this.DEFAULT_FILE = '.configs/use-when-baseline.json'; }
|
|
10
|
-
/**
|
|
11
|
-
* The baseline entries of the package at `directory` today: `<file from the package folder>#<export>` for every export
|
|
12
|
-
* the rule requires a `@useWhen` on and that has none, sorted. Writing them is how a package adopts the rule before its
|
|
13
|
-
* sweep; a package that is already swept has none.
|
|
14
|
-
*/
|
|
15
|
-
static entries(opts) {
|
|
16
|
-
const { directory, entries, types } = opts;
|
|
17
|
-
const surface = house_1.PublicSurface.of({ directory, entries });
|
|
18
|
-
const found = [];
|
|
19
|
-
for (const file of surface.values()) {
|
|
20
|
-
for (const item of file.exports) {
|
|
21
|
-
if (house_1.RequireUseWhenRule.isRequired({ item, types }) && !item.hasUseWhen) {
|
|
22
|
-
found.push(`${(0, node_path_1.relative)(directory, item.file).split(node_path_1.sep).join('/')}#${item.name}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return found.sort();
|
|
27
|
-
}
|
|
28
|
-
/** The file text for `entries`: JSON, one entry per line, a trailing newline. */
|
|
29
|
-
static render(opts) {
|
|
30
|
-
return `${JSON.stringify({ entries: opts.entries }, null, 2)}\n`;
|
|
31
|
-
}
|
|
32
|
-
/** The path a `--out` argument names, from `root`. */
|
|
33
|
-
static pathOf(opts) {
|
|
34
|
-
return (0, node_path_1.resolve)(opts.root, opts.out ?? UseWhenBaseline.DEFAULT_FILE);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.UseWhenBaseline = UseWhenBaseline;
|
|
38
|
-
//# sourceMappingURL=use-when-baseline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-when-baseline.js","sourceRoot":"","sources":["../../src/checks/use-when-baseline.ts"],"names":[],"mappings":";;;AAAA,yCAAmD;AACnD,4CAAqE;AAErE,yGAAyG;AACzG,MAAa,eAAe;IAC1B,yDAAyD;aACzC,iBAAY,GAAG,iCAAiC,CAAC;IAEjE;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,IAId;QACC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAC3C,MAAM,OAAO,GAAG,qBAAa,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;QACzD,MAAM,KAAK,GAAkB,EAAE,CAAC;QAEhC,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YACpC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChC,IAAI,0BAAkB,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;oBACvE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAA,oBAAQ,EAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBACpF,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,iFAAiF;IACjF,MAAM,CAAC,MAAM,CAAC,IAAwC;QACpD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;IAED,sDAAsD;IACtD,MAAM,CAAC,MAAM,CAAC,IAAoC;QAChD,OAAO,IAAA,mBAAO,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IACtE,CAAC;;AArCH,0CAsCC","sourcesContent":["import { relative, resolve, sep } from 'node:path';\nimport { PublicSurface, RequireUseWhenRule } from '../linters/house';\n\n/** The baseline of `venizia/require-use-when`: the exports of a package that still lack a `@useWhen`. */\nexport class UseWhenBaseline {\n /** Where a package keeps it, next to its lint config. */\n static readonly DEFAULT_FILE = '.configs/use-when-baseline.json';\n\n /**\n * The baseline entries of the package at `directory` today: `<file from the package folder>#<export>` for every export\n * the rule requires a `@useWhen` on and that has none, sorted. Writing them is how a package adopts the rule before its\n * sweep; a package that is already swept has none.\n */\n static entries(opts: {\n directory: string;\n entries?: ReadonlyArray<string>;\n types?: ReadonlyArray<string>;\n }): Array<string> {\n const { directory, entries, types } = opts;\n const surface = PublicSurface.of({ directory, entries });\n const found: Array<string> = [];\n\n for (const file of surface.values()) {\n for (const item of file.exports) {\n if (RequireUseWhenRule.isRequired({ item, types }) && !item.hasUseWhen) {\n found.push(`${relative(directory, item.file).split(sep).join('/')}#${item.name}`);\n }\n }\n }\n\n return found.sort();\n }\n\n /** The file text for `entries`: JSON, one entry per line, a trailing newline. */\n static render(opts: { entries: ReadonlyArray<string> }): string {\n return `${JSON.stringify({ entries: opts.entries }, null, 2)}\\n`;\n }\n\n /** The path a `--out` argument names, from `root`. */\n static pathOf(opts: { root: string; out?: string }): string {\n return resolve(opts.root, opts.out ?? UseWhenBaseline.DEFAULT_FILE);\n }\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** The framework API a rule steers code toward: what to use, where it is imported from, and one line to say it. */
|
|
2
|
-
export interface IFrameworkRuleApi {
|
|
3
|
-
/** The name to use (`TNullable`, `PromiseUtility.sleep`, `#src/...`). */
|
|
4
|
-
api: string;
|
|
5
|
-
/** What to import it from: a module (`@venizia/ignis-helpers/common`) or an import-map alias (`#src`). */
|
|
6
|
-
source: string;
|
|
7
|
-
/** The npm package that ships it, or `null` when it is no package (an import-map alias). */
|
|
8
|
-
package: string | null;
|
|
9
|
-
/** The replacement, in a short sentence an agent can act on. */
|
|
10
|
-
replacement: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The framework API of each house rule that points at one, keyed by the rule's name (`venizia/prefer-tnullable`). Tools that
|
|
14
|
-
* read a project's installed `@venizia/dev-configs` (VULCAN's write-time hook) use it to tell an author which API to use, so
|
|
15
|
-
* a rule that steers toward the framework has an entry here; `house-framework-rules.test.ts` fails when one does not.
|
|
16
|
-
*/
|
|
17
|
-
export declare class FrameworkRuleApis {
|
|
18
|
-
static readonly TABLE: Readonly<Record<string, IFrameworkRuleApi>>;
|
|
19
|
-
/** The entry for `rule` (`venizia/prefer-tnullable`), or `undefined` when the rule names no framework API. */
|
|
20
|
-
static of(opts: {
|
|
21
|
-
rule: string;
|
|
22
|
-
}): IFrameworkRuleApi | undefined;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=framework-rule-apis.d.ts.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FrameworkRuleApis = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The framework API of each house rule that points at one, keyed by the rule's name (`venizia/prefer-tnullable`). Tools that
|
|
6
|
-
* read a project's installed `@venizia/dev-configs` (VULCAN's write-time hook) use it to tell an author which API to use, so
|
|
7
|
-
* a rule that steers toward the framework has an entry here; `house-framework-rules.test.ts` fails when one does not.
|
|
8
|
-
*/
|
|
9
|
-
class FrameworkRuleApis {
|
|
10
|
-
static { this.TABLE = {
|
|
11
|
-
'venizia/prefer-tnullable': {
|
|
12
|
-
api: 'TNullable',
|
|
13
|
-
source: '@venizia/ignis-helpers/common',
|
|
14
|
-
package: '@venizia/ignis-helpers',
|
|
15
|
-
replacement: 'Write `TNullable<X>` for `X | null | undefined`.',
|
|
16
|
-
},
|
|
17
|
-
'venizia/prefer-promise-sleep': {
|
|
18
|
-
api: 'PromiseUtility.sleep',
|
|
19
|
-
source: '@venizia/ignis-helpers/core',
|
|
20
|
-
package: '@venizia/ignis-helpers',
|
|
21
|
-
replacement: 'Write `await PromiseUtility.sleep({ ms })`, not `new Promise(resolve => setTimeout(resolve, ms))`.',
|
|
22
|
-
},
|
|
23
|
-
'venizia/no-shadow-framework-type': {
|
|
24
|
-
api: 'the type the framework exports under that name',
|
|
25
|
-
source: '@venizia/ignis-helpers/common',
|
|
26
|
-
package: '@venizia/ignis-helpers',
|
|
27
|
-
replacement: 'Import `ValueOrPromise`, `TNullable`, `TConstValue` and the other framework types (from `@venizia/ignis-helpers/common`, or the entry the message names) instead of declaring your own.',
|
|
28
|
-
},
|
|
29
|
-
'venizia/prefer-framework-api': {
|
|
30
|
-
api: 'useMediaQuery, useBreakpoint, useWindowDimensions, useElementSize, useResizeEffect, useIntersection, useOnlineStatus, useDocumentVisibility, useBeforeUnload, useCopyToClipboard, useConfirm',
|
|
31
|
-
source: '@venizia/ardor-react',
|
|
32
|
-
package: '@venizia/ardor-react',
|
|
33
|
-
replacement: 'Use the `@venizia/ardor-react` hook for a browser API it wraps (matchMedia, window size, ResizeObserver, IntersectionObserver, online status, document visibility, beforeunload, clipboard write, confirm), not the browser API itself.',
|
|
34
|
-
},
|
|
35
|
-
'venizia/no-parent-import': {
|
|
36
|
-
api: '#src/...',
|
|
37
|
-
source: '#src',
|
|
38
|
-
package: null,
|
|
39
|
-
replacement: 'Import through the package import map (`#src/...`), not through `../`.',
|
|
40
|
-
},
|
|
41
|
-
}; }
|
|
42
|
-
/** The entry for `rule` (`venizia/prefer-tnullable`), or `undefined` when the rule names no framework API. */
|
|
43
|
-
static of(opts) {
|
|
44
|
-
return FrameworkRuleApis.TABLE[opts.rule];
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.FrameworkRuleApis = FrameworkRuleApis;
|
|
48
|
-
//# sourceMappingURL=framework-rule-apis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"framework-rule-apis.js","sourceRoot":"","sources":["../../../src/linters/house/framework-rule-apis.ts"],"names":[],"mappings":";;;AAYA;;;;GAIG;AACH,MAAa,iBAAiB;aACZ,UAAK,GAAgD;QACnE,0BAA0B,EAAE;YAC1B,GAAG,EAAE,WAAW;YAChB,MAAM,EAAE,+BAA+B;YACvC,OAAO,EAAE,wBAAwB;YACjC,WAAW,EAAE,kDAAkD;SAChE;QACD,8BAA8B,EAAE;YAC9B,GAAG,EAAE,sBAAsB;YAC3B,MAAM,EAAE,6BAA6B;YACrC,OAAO,EAAE,wBAAwB;YACjC,WAAW,EACT,oGAAoG;SACvG;QACD,kCAAkC,EAAE;YAClC,GAAG,EAAE,gDAAgD;YACrD,MAAM,EAAE,+BAA+B;YACvC,OAAO,EAAE,wBAAwB;YACjC,WAAW,EACT,yLAAyL;SAC5L;QACD,8BAA8B,EAAE;YAC9B,GAAG,EAAE,8LAA8L;YACnM,MAAM,EAAE,sBAAsB;YAC9B,OAAO,EAAE,sBAAsB;YAC/B,WAAW,EACT,yOAAyO;SAC5O;QACD,0BAA0B,EAAE;YAC1B,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,wEAAwE;SACtF;KACF,CAAC;IAEF,8GAA8G;IAC9G,MAAM,CAAC,EAAE,CAAC,IAAsB;QAC9B,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;;AAxCH,8CAyCC","sourcesContent":["/** The framework API a rule steers code toward: what to use, where it is imported from, and one line to say it. */\nexport interface IFrameworkRuleApi {\n /** The name to use (`TNullable`, `PromiseUtility.sleep`, `#src/...`). */\n api: string;\n /** What to import it from: a module (`@venizia/ignis-helpers/common`) or an import-map alias (`#src`). */\n source: string;\n /** The npm package that ships it, or `null` when it is no package (an import-map alias). */\n package: string | null;\n /** The replacement, in a short sentence an agent can act on. */\n replacement: string;\n}\n\n/**\n * The framework API of each house rule that points at one, keyed by the rule's name (`venizia/prefer-tnullable`). Tools that\n * read a project's installed `@venizia/dev-configs` (VULCAN's write-time hook) use it to tell an author which API to use, so\n * a rule that steers toward the framework has an entry here; `house-framework-rules.test.ts` fails when one does not.\n */\nexport class FrameworkRuleApis {\n static readonly TABLE: Readonly<Record<string, IFrameworkRuleApi>> = {\n 'venizia/prefer-tnullable': {\n api: 'TNullable',\n source: '@venizia/ignis-helpers/common',\n package: '@venizia/ignis-helpers',\n replacement: 'Write `TNullable<X>` for `X | null | undefined`.',\n },\n 'venizia/prefer-promise-sleep': {\n api: 'PromiseUtility.sleep',\n source: '@venizia/ignis-helpers/core',\n package: '@venizia/ignis-helpers',\n replacement:\n 'Write `await PromiseUtility.sleep({ ms })`, not `new Promise(resolve => setTimeout(resolve, ms))`.',\n },\n 'venizia/no-shadow-framework-type': {\n api: 'the type the framework exports under that name',\n source: '@venizia/ignis-helpers/common',\n package: '@venizia/ignis-helpers',\n replacement:\n 'Import `ValueOrPromise`, `TNullable`, `TConstValue` and the other framework types (from `@venizia/ignis-helpers/common`, or the entry the message names) instead of declaring your own.',\n },\n 'venizia/prefer-framework-api': {\n api: 'useMediaQuery, useBreakpoint, useWindowDimensions, useElementSize, useResizeEffect, useIntersection, useOnlineStatus, useDocumentVisibility, useBeforeUnload, useCopyToClipboard, useConfirm',\n source: '@venizia/ardor-react',\n package: '@venizia/ardor-react',\n replacement:\n 'Use the `@venizia/ardor-react` hook for a browser API it wraps (matchMedia, window size, ResizeObserver, IntersectionObserver, online status, document visibility, beforeunload, clipboard write, confirm), not the browser API itself.',\n },\n 'venizia/no-parent-import': {\n api: '#src/...',\n source: '#src',\n package: null,\n replacement: 'Import through the package import map (`#src/...`), not through `../`.',\n },\n };\n\n /** The entry for `rule` (`venizia/prefer-tnullable`), or `undefined` when the rule names no framework API. */\n static of(opts: { rule: string }): IFrameworkRuleApi | undefined {\n return FrameworkRuleApis.TABLE[opts.rule];\n }\n}\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/** One export of a package's public entry points, and what its TSDoc says. */
|
|
2
|
-
export interface IPublicExport {
|
|
3
|
-
/** The exported name. */
|
|
4
|
-
name: string;
|
|
5
|
-
/** Whether it is a value (class, function, const, enum, namespace) or a type (interface, type alias). */
|
|
6
|
-
isValue: boolean;
|
|
7
|
-
/** Absolute path of the file that declares it (for `export * as X`, the file that holds the statement). */
|
|
8
|
-
file: string;
|
|
9
|
-
/** Character offsets of the declaring name. */
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
/** `@useWhen` is there and says something. */
|
|
13
|
-
hasUseWhen: boolean;
|
|
14
|
-
/** `@insteadOf` is there and says nothing. */
|
|
15
|
-
hasEmptyInsteadOf: boolean;
|
|
16
|
-
}
|
|
17
|
-
/** What one source file contributes to the public surface, with the text the offsets are valid for. */
|
|
18
|
-
export interface IPublicFile {
|
|
19
|
-
/** The text the scan read: the offsets below mean nothing for any other text of the same file. */
|
|
20
|
-
text: string;
|
|
21
|
-
exports: Array<IPublicExport>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The public surface of one package: what its entry points export, read with the TypeScript checker over the entry files
|
|
25
|
-
* only (own symbols; what a package re-exports from another is that package's to document). Built once per package and
|
|
26
|
-
* memoized for the run, so a lint run pays for one program per package.
|
|
27
|
-
*
|
|
28
|
-
* Entries are the `exports` of package.json mapped back to source (`./dist/esm/x.d.ts` is `src/x.ts`), or the `entries`
|
|
29
|
-
* the project names.
|
|
30
|
-
*/
|
|
31
|
-
export declare class PublicSurface {
|
|
32
|
-
static readonly USE_WHEN = "useWhen";
|
|
33
|
-
static readonly INSTEAD_OF = "insteadOf";
|
|
34
|
-
private static readonly surfaces;
|
|
35
|
-
/** The source file an `exports` declaration path stands for: `./dist/esm/a/index.d.ts` is `src/a/index.ts` (or `.tsx`). */
|
|
36
|
-
private static sourceOf;
|
|
37
|
-
/** The strings in an `exports` value that name a declaration or a source file. */
|
|
38
|
-
private static pathsIn;
|
|
39
|
-
/** The entry source files of the package at `directory`. */
|
|
40
|
-
private static entriesOf;
|
|
41
|
-
/** The compiler options of the nearest tsconfig.json, for `paths` aliases. */
|
|
42
|
-
private static optionsFor;
|
|
43
|
-
/** The tag texts of `name` on `symbol`, read through the checker and, for an `export * as X` statement, from the statement. */
|
|
44
|
-
private static tagsOf;
|
|
45
|
-
/** Every export of the entries of the package at `directory`, each once, that the package itself declares. */
|
|
46
|
-
private static scan;
|
|
47
|
-
/** The exports of the package at `directory`, by the file that declares them. */
|
|
48
|
-
static of(opts: {
|
|
49
|
-
directory: string;
|
|
50
|
-
entries?: ReadonlyArray<string>;
|
|
51
|
-
}): Map<string, IPublicFile>;
|
|
52
|
-
/** The package folder of `file`: where the nearest package.json is. */
|
|
53
|
-
static packageOf(opts: {
|
|
54
|
-
file: string;
|
|
55
|
-
}): string | undefined;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=public-surface.d.ts.map
|