Skip to content

Commit

Permalink
Remove unnecessary type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Mar 24, 2021
1 parent f6493d3 commit 904c9d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/babel-parser/src/parser/error-message.js
Expand Up @@ -9,7 +9,7 @@ import { makeErrorTemplates, type ErrorTemplates } from "../parser/error";
*/

// The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist
export const ErrorMessages: ErrorTemplates = makeErrorTemplates({
export const ErrorMessages = makeErrorTemplates({
AccessorIsGenerator: "A %0ter cannot be a generator",
ArgumentsInClass:
"'arguments' is only allowed in functions and class methods",
Expand Down
8 changes: 2 additions & 6 deletions packages/babel-parser/src/plugins/flow/index.js
Expand Up @@ -25,11 +25,7 @@ import {
SCOPE_OTHER,
} from "../../util/scopeflags";
import type { ExpressionErrors } from "../../parser/util";
import {
Errors,
type ErrorTemplates,
makeErrorTemplates,
} from "../../parser/error";
import { Errors, makeErrorTemplates } from "../../parser/error";

const reservedTypes = new Set([
"_",
Expand All @@ -52,7 +48,7 @@ const reservedTypes = new Set([

/* eslint sort-keys: "error" */
// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist
const FlowErrors: ErrorTemplates = makeErrorTemplates({
const FlowErrors = makeErrorTemplates({
AmbiguousConditionalArrow:
"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
AmbiguousDeclareModuleKind:
Expand Down
8 changes: 2 additions & 6 deletions packages/babel-parser/src/plugins/jsx/index.js
Expand Up @@ -14,17 +14,13 @@ import * as N from "../../types";
import { isIdentifierChar, isIdentifierStart } from "../../util/identifier";
import type { Position } from "../../util/location";
import { isNewLine } from "../../util/whitespace";
import {
Errors,
makeErrorTemplates,
type ErrorTemplates,
} from "../../parser/error";
import { Errors, makeErrorTemplates } from "../../parser/error";

const HEX_NUMBER = /^[\da-fA-F]+$/;
const DECIMAL_NUMBER = /^\d+$/;

/* eslint sort-keys: "error" */
const JsxErrors: ErrorTemplates = makeErrorTemplates({
const JsxErrors = makeErrorTemplates({
AttributeIsEmpty:
"JSX attributes must only be assigned a non-empty expression",
MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>",
Expand Down
3 changes: 1 addition & 2 deletions packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -33,7 +33,6 @@ import {
Errors,
makeErrorTemplates,
type ErrorTemplate,
type ErrorTemplates,
} from "../../parser/error";

type TsModifier =
Expand Down Expand Up @@ -65,7 +64,7 @@ type ParsingContext =
| "TypeParametersOrArguments";

/* eslint sort-keys: "error" */
const TSErrors: ErrorTemplates = makeErrorTemplates({
const TSErrors = makeErrorTemplates({
AbstractMethodHasImplementation:
"Method '%0' cannot have an implementation because it is marked abstract.",
ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier",
Expand Down

0 comments on commit 904c9d0

Please sign in to comment.