Showing the changes to scripts (5 of 265 files). Show all
Unified · Split
| @@ -61,11 +61,7 @@ const checkFile = (path: string): Violation[] => { · 60 unmodified lines | |||
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | const targets = process.argv.slice(2); | 63 | const targets = process.argv.slice(2); |
| 64 | const defaultTarget = resolve( | 64 | const defaultTarget = resolve(import.meta.dir, "..", "apps/cli/release-notes/next.md"); |
| 65 | import.meta.dir, | ||
| 66 | "..", | ||
| 67 | "apps/cli/release-notes/next.md", | ||
| 68 | ); | ||
| 69 | const paths = targets.length > 0 ? targets.map((p) => resolve(p)) : [defaultTarget]; | 65 | const paths = targets.length > 0 ? targets.map((p) => resolve(p)) : [defaultTarget]; |
| 70 | 66 | ||
| 71 | let failed = false; | 67 | let failed = false; |
| @@ -90,8 +86,6 @@ if (failed) { · 18 unmodified lines | |||
| 90 | console.error( | 86 | console.error( |
| 91 | `\nForbidden Thanks handles: ${FORBIDDEN_THANKS_HANDLES.map((h) => `@${h}`).join(", ")}`, | 87 | `\nForbidden Thanks handles: ${FORBIDDEN_THANKS_HANDLES.map((h) => `@${h}`).join(", ")}`, |
| 92 | ); | 88 | ); |
| 93 | console.error( | 89 | console.error("Use a credited external GitHub username, or omit the attribution entirely."); |
| 94 | "Use a credited external GitHub username, or omit the attribution entirely.", | ||
| 95 | ); | ||
| 96 | process.exit(1); | 90 | process.exit(1); |
| 97 | } | 91 | } |
| @@ -3,11 +3,7 @@ import { isConfigOrTooling, unwrapExpression } from "../utils.js"; · 2 unmodified lines | |||
| 3 | const message = | 3 | const message = |
| 4 | "Avoid primitive casts like value as string. Remove redundant casts, or normalize unknown data with Schema/a typed adapter before use. Skill: wrdn-effect-schema-boundaries."; | 4 | "Avoid primitive casts like value as string. Remove redundant casts, or normalize unknown data with Schema/a typed adapter before use. Skill: wrdn-effect-schema-boundaries."; |
| 5 | 5 | ||
| 6 | const primitiveTypes = new Set([ | 6 | const primitiveTypes = new Set(["TSStringKeyword", "TSNumberKeyword", "TSBooleanKeyword"]); |
| 7 | "TSStringKeyword", | ||
| 8 | "TSNumberKeyword", | ||
| 9 | "TSBooleanKeyword", | ||
| 10 | ]); | ||
| 11 | 7 | ||
| 12 | const isPrimitiveType = (node) => primitiveTypes.has(node?.type); | 8 | const isPrimitiveType = (node) => primitiveTypes.has(node?.type); |
| 13 | 9 | ||
| @@ -31,10 +27,7 @@ export default { · 17 unmodified lines | |||
| 31 | if (isConfigOrTooling(context.filename)) return {}; | 27 | if (isConfigOrTooling(context.filename)) return {}; |
| 32 | 28 | ||
| 33 | const check = (node) => { | 29 | const check = (node) => { |
| 34 | if ( | 30 | if (isPrimitiveType(node.typeAnnotation) && isPossiblyRedundantExpression(node.expression)) { |
| 35 | isPrimitiveType(node.typeAnnotation) && | ||
| 36 | isPossiblyRedundantExpression(node.expression) | ||
| 37 | ) { | ||
| 38 | context.report({ node, message }); | 31 | context.report({ node, message }); |
| 39 | } | 32 | } |
| 40 | }; | 33 | }; |
| @@ -15,8 +15,7 @@ const unsupported = new Map([ · 14 unmodified lines | |||
| 15 | ], | 15 | ], |
| 16 | ]); | 16 | ]); |
| 17 | 17 | ||
| 18 | const message = (name) => | 18 | const message = (name) => `${unsupported.get(name)} Skill: wrdn-effect-typed-errors.`; |
| 19 | `${unsupported.get(name)} Skill: wrdn-effect-typed-errors.`; | ||
| 20 | 19 | ||
| 21 | export default { | 20 | export default { |
| 22 | meta: { | 21 | meta: { |
| @@ -67,7 +67,8 @@ export function hasObjectProperty(node, name) { · 66 unmodified lines | |||
| 67 | 67 | ||
| 68 | export function getStringValue(node) { | 68 | export function getStringValue(node) { |
| 69 | const expression = unwrapExpression(node); | 69 | const expression = unwrapExpression(node); |
| 70 | if (expression?.type === "Literal" && typeof expression.value === "string") return expression.value; | 70 | if (expression?.type === "Literal" && typeof expression.value === "string") |
| 71 | return expression.value; | ||
| 71 | if (expression?.type === "StringLiteral") return expression.value; | 72 | if (expression?.type === "StringLiteral") return expression.value; |
| 72 | return undefined; | 73 | return undefined; |
| 73 | } | 74 | } |
| @@ -78,8 +79,7 @@ export function isIdentifier(node, name) { · 4 unmodified lines | |||
| 78 | 79 | ||
| 79 | export function isStringLiteral(node) { | 80 | export function isStringLiteral(node) { |
| 80 | return ( | 81 | return ( |
| 81 | (node?.type === "Literal" && typeof node.value === "string") || | 82 | (node?.type === "Literal" && typeof node.value === "string") || node?.type === "StringLiteral" |
| 82 | node?.type === "StringLiteral" | ||
| 83 | ); | 83 | ); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| @@ -44,9 +44,7 @@ const PUBLIC_PACKAGE_DIRS = [ · 43 unmodified lines | |||
| 44 | "packages/plugins/openapi", | 44 | "packages/plugins/openapi", |
| 45 | ] as const; | 45 | ] as const; |
| 46 | 46 | ||
| 47 | const parseArgs = ( | 47 | const parseArgs = (argv: ReadonlyArray<string>): { dryRun: boolean; prepareOnly: boolean } => { |
| 48 | argv: ReadonlyArray<string>, | ||
| 49 | ): { dryRun: boolean; prepareOnly: boolean } => { | ||
| 50 | let dryRun = false; | 48 | let dryRun = false; |
| 51 | let prepareOnly = false; | 49 | let prepareOnly = false; |
| 52 | for (const arg of argv) { | 50 | for (const arg of argv) { |
| @@ -151,9 +149,7 @@ const applyWorkspaceVersions = async ( · 98 unmodified lines | |||
| 151 | * `@effect-atom/*`, etc.) are real npm packages and pass through | 149 | * `@effect-atom/*`, etc.) are real npm packages and pass through |
| 152 | * unchanged. | 150 | * unchanged. |
| 153 | */ | 151 | */ |
| 154 | const renamePeerDepBlock = ( | 152 | const renamePeerDepBlock = (block: DependencyBlock | undefined): DependencyBlock | undefined => { |
| 155 | block: DependencyBlock | undefined, | ||
| 156 | ): DependencyBlock | undefined => { | ||
| 157 | if (!block) return block; | 153 | if (!block) return block; |
| 158 | const next: DependencyBlock = {}; | 154 | const next: DependencyBlock = {}; |
| 159 | let mutated = false; | 155 | let mutated = false; |