Skip to content

Unknown 'es5' option for 'trailingComma' #652

Closed
@ArLau

Description

@ArLau

Concerns Prettier-Java 2.6.0

Version 2.6.0 fails to format files if the trailingComma option is set to es5 in .prettierrc.yaml. According to https://prettier.io/docs/en/options.html#trailing-commas es5 is a valid option and it worked with version 2.5.0 of Prettier-Java.

Now we get:

$ prettier "**/*.(yaml|yml|md|ts|tsx|java)" --write
[error] Invalid trailingComma value. Expected "all" or "none", but received "es5".

Our configuration (.prettierrc.yaml) looks like this:

tabWidth: 4
trailingComma: 'es5'

plugins:
  - prettier-plugin-java

overrides:
  - files:
      - '*.yaml'
      - '*.yml'
    options:
      tabWidth: 2
  - files: '*.java'
    options:
      printWidth: 160
  - files: '*.md'
    options:
      printWidth: 80
      tabWidth: 2
  - files:
      - '*.ts'
      - '*.js'
      - '*.tsx'
      - '*.jsx'
    options:
      printWidth: 150

We also tried:

  • to use all globally and override with es5 for e.g. ts files
  • to override the trailingComma with all for java files

but this still fails with the same error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions