Skip to content

Support options in external plugins #3615

@azz

Description

@azz

#3433 moved the definition of options to our internal parsers but there's still a bit of work to support external plugins defining new options:

Use cases:

  • This should include the options contributed by plugins:

    prettier --plugin @prettier/plugin-python --help
  • CLI should work:

    prettier --plugin my-cool-prettier-plugin --my-custom-option
  • Remove unknown option warning for options contributed by external plugins.

    prettier.format('def foo(): pass', {
      parser: 'python',
      plugins: ['@prettier/plugin-python'],
      pythonVersion: '3.1.4'
    })
     Validation Warning:
    
     Unknown option "pythonVersion" with value "3.1.4" was found.
     This is probably a typing mistake. Fixing it will remove this message.

Metadata

Metadata

Assignees

Labels

area:apiIssues with Prettier's Application Programming Interfacearea:cliIssues with Prettier's Command Line Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions