diff --git a/src/common/lints/lintSettings.ml b/src/common/lints/lintSettings.ml index e281362f645..429434bbaae 100644 --- a/src/common/lints/lintSettings.ml +++ b/src/common/lints/lintSettings.ml @@ -26,7 +26,6 @@ type error = int * string let default_explicit_values = LintMap.empty |> LintMap.add Lints.(DeprecatedType DeprecatedBool) (Severity.Err, None) - |> LintMap.add Lints.(DeprecatedType DeprecatedDollarCall) (Severity.Err, None) |> LintMap.add Lints.(DeprecatedType DeprecatedPredicate) (Severity.Err, None) |> LintMap.add Lints.InternalType (Severity.Err, None) |> LintMap.add Lints.UntypedTypeImport (Severity.Err, None) diff --git a/src/common/lints/lints.ml b/src/common/lints/lints.ml index 80e88be8695..44ca22768fa 100644 --- a/src/common/lints/lints.ml +++ b/src/common/lints/lints.ml @@ -27,7 +27,6 @@ type property_assignment_kind = type deprecated_type_kind = | DeprecatedBool - | DeprecatedDollarCall | DeprecatedPredicate type lint_kind = @@ -76,7 +75,6 @@ let string_of_sketchy_number_kind = function let string_of_deprecated_type_kind = function | DeprecatedBool -> "deprecated-type-bool" - | DeprecatedDollarCall -> "deprecated-type-dollar-call" | DeprecatedPredicate -> "deprecated-type-predicate" let string_of_kind = function @@ -131,15 +129,8 @@ let kinds_of_string = function | "untyped-import" -> Some [UntypedImport] | "internal-type" -> Some [InternalType] | "unclear-type" -> Some [UnclearType] - | "deprecated-type" -> - Some - [ - DeprecatedType DeprecatedBool; - DeprecatedType DeprecatedDollarCall; - DeprecatedType DeprecatedPredicate; - ] + | "deprecated-type" -> Some [DeprecatedType DeprecatedBool; DeprecatedType DeprecatedPredicate] | "deprecated-type-bool" -> Some [DeprecatedType DeprecatedBool] - | "deprecated-type-dollar-call" -> Some [DeprecatedType DeprecatedDollarCall] | "deprecated-type-predicate" -> Some [DeprecatedType DeprecatedPredicate] | "unsafe-getters-setters" -> Some [UnsafeGettersSetters] | "unnecessary-optional-chain" -> Some [UnnecessaryOptionalChain] diff --git a/src/common/lints/lints.mli b/src/common/lints/lints.mli index cd15e599d5f..e734163ca7e 100644 --- a/src/common/lints/lints.mli +++ b/src/common/lints/lints.mli @@ -27,7 +27,6 @@ type property_assignment_kind = type deprecated_type_kind = | DeprecatedBool - | DeprecatedDollarCall | DeprecatedPredicate type lint_kind = diff --git a/src/typing/debug_js.ml b/src/typing/debug_js.ml index c074376d7b9..b1d6b3f60a4 100644 --- a/src/typing/debug_js.ml +++ b/src/typing/debug_js.ml @@ -1626,7 +1626,6 @@ let dump_error_message = | EInternalType (loc, _) -> spf "EInternalType (%s)" (string_of_aloc loc) | EUnclearType loc -> spf "EUnclearType (%s)" (string_of_aloc loc) | EDeprecatedBool loc -> spf "EDeprecatedBool (%s)" (string_of_aloc loc) - | EDeprecatedDollarCall loc -> spf "EDeprecatedDollarCall (%s)" (string_of_aloc loc) | EDeprecatedPredicate loc -> spf "EDeprecatedPredicate (%s)" (string_of_aloc loc) | EIncorrectTypeWithReplacement { loc; kind } -> let deprecated_name = Flow_intermediate_error_types.IncorrectType.incorrect_of_kind kind in diff --git a/src/typing/errors/error_message.ml b/src/typing/errors/error_message.ml index fc87db72686..13cb6eef2f5 100644 --- a/src/typing/errors/error_message.ml +++ b/src/typing/errors/error_message.ml @@ -349,7 +349,6 @@ and 'loc t' = | ENonstrictImport of 'loc | EUnclearType of 'loc | EDeprecatedBool of 'loc - | EDeprecatedDollarCall of 'loc | EDeprecatedPredicate of 'loc | EInternalType of 'loc * internal_type | EIncorrectTypeWithReplacement of { @@ -1139,7 +1138,6 @@ let rec map_loc_of_error_message (f : 'a -> 'b) : 'a t' -> 'b t' = | ENonstrictImport loc -> ENonstrictImport (f loc) | EUnclearType loc -> EUnclearType (f loc) | EDeprecatedBool loc -> EDeprecatedBool (f loc) - | EDeprecatedDollarCall loc -> EDeprecatedDollarCall (f loc) | EDeprecatedPredicate loc -> EDeprecatedPredicate (f loc) | EInternalType (loc, kind) -> EInternalType (f loc, kind) | EIncorrectTypeWithReplacement { loc; kind } -> @@ -1646,7 +1644,6 @@ let util_use_op_of_msg nope util = function | ENonstrictImport _ | EUnclearType _ | EDeprecatedBool _ - | EDeprecatedDollarCall _ | EDeprecatedPredicate _ | EInternalType _ | EIncorrectTypeWithReplacement _ @@ -1831,7 +1828,6 @@ let loc_of_msg : 'loc t' -> 'loc option = function | ENonstrictImport loc | EUnclearType loc | EDeprecatedBool loc - | EDeprecatedDollarCall loc | EDeprecatedPredicate loc | EInternalType (loc, _) | EIncorrectTypeWithReplacement { loc; _ } @@ -1988,7 +1984,6 @@ let kind_of_msg = | EInternalType _ -> LintError Lints.InternalType | EUnclearType _ -> LintError Lints.UnclearType | EDeprecatedBool _ -> LintError Lints.(DeprecatedType DeprecatedBool) - | EDeprecatedDollarCall _ -> LintError Lints.(DeprecatedType DeprecatedDollarCall) | EDeprecatedPredicate _ -> LintError Lints.(DeprecatedType DeprecatedPredicate) | EUnsafeGettersSetters _ -> LintError Lints.UnsafeGettersSetters | ESketchyNullLint { kind; _ } -> LintError (Lints.SketchyNull kind) @@ -2610,7 +2605,6 @@ let friendly_message_of_msg = function | ENonstrictImport _ -> Normal MessageNonStrictImport | EUnclearType _ -> Normal MessageUnclearType | EDeprecatedBool _ -> Normal MessageDeprecatedBool - | EDeprecatedDollarCall _ -> Normal MessageDeprecatedDollarCall | EDeprecatedPredicate _ -> Normal MessageDeprecatedPredicate | EInternalType (_, kind) -> Normal (MessageInternalType kind) | EIncorrectTypeWithReplacement { kind; _ } -> Normal (MessageIncorrectType kind) @@ -2907,7 +2901,6 @@ let defered_in_speculation = function | ENonstrictImport _ | EUnclearType _ | EDeprecatedBool _ - | EDeprecatedDollarCall _ | EDeprecatedPredicate _ | EInternalType _ | EUnsafeGettersSetters _ @@ -3218,7 +3211,6 @@ let error_code_of_message err : error_code option = | EInternalType _ | EUnclearType _ | EDeprecatedBool _ - | EDeprecatedDollarCall _ | EDeprecatedPredicate _ | EUnsafeGettersSetters _ | ESketchyNullLint _ diff --git a/src/typing/errors/flow_intermediate_error.ml b/src/typing/errors/flow_intermediate_error.ml index 1318db316d7..fe0e539a24d 100644 --- a/src/typing/errors/flow_intermediate_error.ml +++ b/src/typing/errors/flow_intermediate_error.ml @@ -2410,12 +2410,6 @@ let to_printable_error : @ tl_recur @ (text ". Please add an annotation to " :: annot_message) | MessageDeprecatedBool -> [text "Deprecated type. Use "; code "boolean"; text " instead."] - | MessageDeprecatedDollarCall -> - [ - text "Deprecated type. Use conditional types instead. "; - text - "See https://flow.org/en/docs/types/conditional/ for more information on conditional types."; - ] | MessageDeprecatedPredicate -> [ text "Deprecated type. Use type guards instead. "; diff --git a/src/typing/errors/flow_intermediate_error_types.ml b/src/typing/errors/flow_intermediate_error_types.ml index c29dac8b0e2..8371e95f3b0 100644 --- a/src/typing/errors/flow_intermediate_error_types.ml +++ b/src/typing/errors/flow_intermediate_error_types.ml @@ -545,7 +545,6 @@ type 'loc message = annot_locs: 'loc Env_api.annot_loc list; } | MessageDeprecatedBool - | MessageDeprecatedDollarCall | MessageDeprecatedPredicate | MessageDevOnlyRefinedLocInfo of { refining_locs: 'loc list } | MessageDevOnlyInvalidatedRefinementInfo of ('loc * Refinement_invalidation.reason) list diff --git a/tests/init_command/init_command.exp b/tests/init_command/init_command.exp index fae0ef59c47..8d13d104307 100644 --- a/tests/init_command/init_command.exp +++ b/tests/init_command/init_command.exp @@ -12,7 +12,6 @@ Default .flowconfig looks like this: untyped-type-import=error internal-type=error deprecated-type-bool=error -deprecated-type-dollar-call=error deprecated-type-predicate=error [options] diff --git a/tests/lti_implicit_instantiation/.flowconfig b/tests/lti_implicit_instantiation/.flowconfig index e62e1bbe125..4a70053d897 100644 --- a/tests/lti_implicit_instantiation/.flowconfig +++ b/tests/lti_implicit_instantiation/.flowconfig @@ -3,6 +3,3 @@ all=true exact_by_default=false no_flowlib=false component_syntax=true - -[lints] -deprecated-type-dollar-call=off diff --git a/tests/predicate_functions/.flowconfig b/tests/predicate_functions/.flowconfig index 4adca8a370e..5651cdfedcd 100644 --- a/tests/predicate_functions/.flowconfig +++ b/tests/predicate_functions/.flowconfig @@ -2,5 +2,4 @@ all=true [lints] -deprecated-type-dollar-call=off deprecated-type-predicate=off diff --git a/tests/predicates_inferred/.flowconfig b/tests/predicates_inferred/.flowconfig index 826abd41e26..5c808dfe9bb 100644 --- a/tests/predicates_inferred/.flowconfig +++ b/tests/predicates_inferred/.flowconfig @@ -3,5 +3,4 @@ all=true no_flowlib=false [lints] -deprecated-type-dollar-call=off deprecated-type-predicate=off