Skip to content

Commit

Permalink
[flow] Remove deprecated-type-dollar-call lint
Browse files Browse the repository at this point in the history
Summary: Changelog: [breaking] `deprecated-type-dollar-call` lint is removed, since the support for `$Call` is removed.

Reviewed By: gkz

Differential Revision: D62788681

fbshipit-source-id: c6f904cbba03122c68e236ff4578735a9aef7c7b
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Sep 17, 2024
1 parent 1ef676f commit 9071a7e
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 34 deletions.
1 change: 0 additions & 1 deletion src/common/lints/lintSettings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 1 addition & 10 deletions src/common/lints/lints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type property_assignment_kind =

type deprecated_type_kind =
| DeprecatedBool
| DeprecatedDollarCall
| DeprecatedPredicate

type lint_kind =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion src/common/lints/lints.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type property_assignment_kind =

type deprecated_type_kind =
| DeprecatedBool
| DeprecatedDollarCall
| DeprecatedPredicate

type lint_kind =
Expand Down
1 change: 0 additions & 1 deletion src/typing/debug_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/typing/errors/error_message.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 } ->
Expand Down Expand Up @@ -1646,7 +1644,6 @@ let util_use_op_of_msg nope util = function
| ENonstrictImport _
| EUnclearType _
| EDeprecatedBool _
| EDeprecatedDollarCall _
| EDeprecatedPredicate _
| EInternalType _
| EIncorrectTypeWithReplacement _
Expand Down Expand Up @@ -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; _ }
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -2907,7 +2901,6 @@ let defered_in_speculation = function
| ENonstrictImport _
| EUnclearType _
| EDeprecatedBool _
| EDeprecatedDollarCall _
| EDeprecatedPredicate _
| EInternalType _
| EUnsafeGettersSetters _
Expand Down Expand Up @@ -3218,7 +3211,6 @@ let error_code_of_message err : error_code option =
| EInternalType _
| EUnclearType _
| EDeprecatedBool _
| EDeprecatedDollarCall _
| EDeprecatedPredicate _
| EUnsafeGettersSetters _
| ESketchyNullLint _
Expand Down
6 changes: 0 additions & 6 deletions src/typing/errors/flow_intermediate_error.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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. ";
Expand Down
1 change: 0 additions & 1 deletion src/typing/errors/flow_intermediate_error_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/init_command/init_command.exp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions tests/lti_implicit_instantiation/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ all=true
exact_by_default=false
no_flowlib=false
component_syntax=true

[lints]
deprecated-type-dollar-call=off
1 change: 0 additions & 1 deletion tests/predicate_functions/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
all=true

[lints]
deprecated-type-dollar-call=off
deprecated-type-predicate=off
1 change: 0 additions & 1 deletion tests/predicates_inferred/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ all=true
no_flowlib=false

[lints]
deprecated-type-dollar-call=off
deprecated-type-predicate=off

0 comments on commit 9071a7e

Please sign in to comment.