Skip to content

Problem with Docker*.json file #5351

@edahlseng

Description

@edahlseng

Environments:

  • Prettier Version: 1.14.3
  • Running Prettier via: CLI
  • Runtime: Node.js v10.13.0
  • Operating System: macOS 10.14.1

Steps to reproduce:

  • Create a file at the root level of a project named Docker.json (contents: {})
  • Run npx prettier --list-different '**/*.json' --loglevel debug

Expected behavior:
For Prettier to run properly.

Actual behavior:
Prettier returns an error with the following logs:

[debug] resolve config from 'Docker.json'
[debug] loaded options `{"useTabs":false,"tabWidth":"unset"}`
[error] Unable to expand glob patterns: **/*.json !**/node_modules/** !./node_modules/** !**/.{git,svn,hg}/** !./.{git,svn,hg}/**
[error] Invalid `"tabWidth"` value. Expected an integer, but received `null`.

What's odd is that the following files work: docker.json, Docke.json, Doccer.json. It appears somehow related to the Docker prefix. As far as I can tell, anything after Docker still causes an issue (I first noticed this on a Dockerrun.aws.json file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencystatus:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions