Skip to content

Treat .stylelintrc as YAML or JSON #10920

@SevenOutman

Description

@SevenOutman

Environments:

  • Prettier Version: 2.1.2
  • Running Prettier via: CLI
  • Runtime: Node.js 14.15.0
  • Operating System: macOS
  • Prettier plugins (if any):

Steps to reproduce:

$ prettier --write .eslintrc    
.eslintrc 32ms
$ prettier --write .stylelintrc 
[error] No parser could be inferred for file: .stylelintrc

Prettier treats .eslintrc (without extension) as JSON, but doesn't do the same to .stylelintrc or other cosmiconfig style config files.

Expected behavior

  • Option 1: Add some more popular *rc as built-in supported.
  • Option 2: Add a new cosmiconfig parser and use it as default for any *rc files without an extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:jsonIssues affecting JSONlang:yamlIssues affecting YAMLlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions