diff --git a/packages/babel-types/scripts/generators/flow.js b/packages/babel-types/scripts/generators/flow.js index d82ced365c66..f3d8a85233fd 100644 --- a/packages/babel-types/scripts/generators/flow.js +++ b/packages/babel-types/scripts/generators/flow.js @@ -146,7 +146,7 @@ lines.push( `declare function isLet(node: BabelNode): boolean`, `declare function isNode(node: ?Object): boolean`, `declare function isNodesEquivalent(a: any, b: any): boolean`, - `declare function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `declare function isPlaceholderType(placeholderType: string, targetType: string): boolean`, `declare function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, `declare function isScope(node: BabelNode, parent: BabelNode): boolean`, `declare function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, diff --git a/packages/babel-types/scripts/generators/typescript.js b/packages/babel-types/scripts/generators/typescript.js index 35696923e1ae..6666a277d37e 100644 --- a/packages/babel-types/scripts/generators/typescript.js +++ b/packages/babel-types/scripts/generators/typescript.js @@ -153,13 +153,13 @@ lines.push( `export function isBlockScoped(node: Node): boolean`, `export function isImmutable(node: Node): boolean`, `export function isLet(node: Node): boolean`, - `export function isNode(node: ?object): boolean`, + `export function isNode(node: object | null | undefined): boolean`, `export function isNodesEquivalent(a: any, b: any): boolean`, - `export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `export function isPlaceholderType(placeholderType: string, targetType: string): boolean`, `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, `export function isScope(node: Node, parent: Node): boolean`, `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, - `export function isType(nodetype: ?string, targetType: string): boolean`, + `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, `export function isValidES3Identifier(name: string): boolean`, `export function isValidES3Identifier(name: string): boolean`, `export function isValidIdentifier(name: string): boolean`, diff --git a/packages/babel-types/src/validators/isPlaceholderType.js b/packages/babel-types/src/validators/isPlaceholderType.js index fa775b7ed803..fac93b274532 100644 --- a/packages/babel-types/src/validators/isPlaceholderType.js +++ b/packages/babel-types/src/validators/isPlaceholderType.js @@ -5,7 +5,7 @@ import { PLACEHOLDERS_ALIAS } from "../definitions"; * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`. */ export default function isPlaceholderType( - placeholderType: ?string, + placeholderType: string, targetType: string, ): boolean { if (placeholderType === targetType) return true;