Skip to content

dartfmt removes empty lines in enums. #606

Closed
@peter-ahe-google

Description

@peter-ahe-google

I have this enum declaration:

enum ErrorKind {
  AbstractNotSync,
  AsciiControlCharacter,
  AsyncAsIdentifier,
  AwaitAsIdentifier,
  AwaitForNotAsync,
  AwaitNotAsync,
  BuiltInIdentifierAsType,
  BuiltInIdentifierInDeclaration,
  EmptyNamedParameterList,
  EmptyOptionalParameterList,
  Encoding,
  ExpectedBlockToSkip,
  ExpectedBody,
  ExpectedButGot,
  ExpectedClassBody,

  /// This error code can be used to support non-compliant (with respect to
  /// Dart Language Specification) Dart VM native clauses. See
  /// [dart_vm_native.dart].
  ExpectedClassBodyToSkip,

  ExpectedDeclaration,
  ExpectedExpression,
  ExpectedFunctionBody,
  ExpectedHexDigit,
  ExpectedIdentifier,
  ExpectedOpenParens,
  ExpectedString,
  ExpectedType,
  ExtraneousModifier,
  ExtraneousModifierReplace,
  FactoryNotSync,
  GeneratorReturnsValue,
  InvalidAwaitFor,
  InvalidInlineFunctionType,
  InvalidSyncModifier,
  InvalidVoid,
  MissingExponent,
  NonAsciiIdentifier,
  NonAsciiWhitespace,
  OnlyTry,
  PositionalParameterWithEquals,
  RequiredParameterWithDefault,
  SetterNotSync,
  StackOverflow,
  UnexpectedDollarInString,
  UnexpectedToken,
  UnmatchedToken,
  UnsupportedPrefixPlus,
  UnterminatedComment,
  UnterminatedString,
  UnterminatedToken,
  YieldAsIdentifier,
  YieldNotGenerator,

  Unspecified,
}

After running dartfmt, the the empty lines have been removed:

enum ErrorKind {
  AbstractNotSync,
  AsciiControlCharacter,
  AsyncAsIdentifier,
  AwaitAsIdentifier,
  AwaitForNotAsync,
  AwaitNotAsync,
  BuiltInIdentifierAsType,
  BuiltInIdentifierInDeclaration,
  EmptyNamedParameterList,
  EmptyOptionalParameterList,
  Encoding,
  ExpectedBlockToSkip,
  ExpectedBody,
  ExpectedButGot,
  ExpectedClassBody,

  /// This error code can be used to support non-compliant (with respect to
  /// Dart Language Specification) Dart VM native clauses. See
  /// [dart_vm_native.dart].
  ExpectedClassBodyToSkip,
  ExpectedDeclaration,
  ExpectedExpression,
  ExpectedFunctionBody,
  ExpectedHexDigit,
  ExpectedIdentifier,
  ExpectedOpenParens,
  ExpectedString,
  ExpectedType,
  ExtraneousModifier,
  ExtraneousModifierReplace,
  FactoryNotSync,
  GeneratorReturnsValue,
  InvalidAwaitFor,
  InvalidInlineFunctionType,
  InvalidSyncModifier,
  InvalidVoid,
  MissingExponent,
  NonAsciiIdentifier,
  NonAsciiWhitespace,
  OnlyTry,
  PositionalParameterWithEquals,
  RequiredParameterWithDefault,
  SetterNotSync,
  StackOverflow,
  UnexpectedDollarInString,
  UnexpectedToken,
  UnmatchedToken,
  UnsupportedPrefixPlus,
  UnterminatedComment,
  UnterminatedString,
  UnterminatedToken,
  YieldAsIdentifier,
  YieldNotGenerator,
  Unspecified,
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions