Prettier-atom: Configuration options not read from .prettierrc since v0.55.0 release

Created on 21 Aug 2018  ยท  4Comments  ยท  Source: prettier/prettier-atom


Hi! I just upgraded prettier-atom to v0.55.0 and prettier to v1.14.2. It seems that prettier-atom no longer reads the configuration options from .prettierrc.

I have this in my project root folder in file .prettierrc:

{
  "singleQuote": true
}

And when I run Prettier: Format on a file in:

cypress/integration/inquiries/from-list.spec.js

With this content:

import { foo } from './bar';

prettier-atom incorrectly changes that code to this:

import { foo } from "./bar";

When I run prettier via CLI, the singleQuote option is taken into account and the original version is kept as-is:

node_modules/.bin/prettier --write cypress/integration/inquiries/from-list.spec.js

The cypress directory tree looks like this currently:

โ”œโ”€โ”€ integration
โ”‚ย ย  โ”œโ”€โ”€ communications
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ inquiries
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ index.spec.js
โ”‚ย ย  โ”œโ”€โ”€ inquiries
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ from-list.spec.js
โ”‚ย ย  โ”œโ”€โ”€ rails.helper.js
โ”‚ย ย  โ””โ”€โ”€ smoke-test.spec.js
โ”œโ”€โ”€ plugins
โ”‚ย ย  โ””โ”€โ”€ index.js
โ””โ”€โ”€ support
    โ”œโ”€โ”€ commands.js
    โ”œโ”€โ”€ i18n.js
    โ”œโ”€โ”€ index.js
    โ””โ”€โ”€ railsCleanup.js

There's no package.json or anything of that sort that might affect the prettier configuration lookup as much as I know.

When I tried this same thing with v0.54.0:

apm install [email protected]

...the singleQuote option in .prettierrc was working as expected.

Let me know if you need any further debug help here.

Output of Prettier: Debug:

Atom version: 1.29.0
prettier-atom version: 0.55.0
prettier: bundled
prettier version: 1.13.4
prettier-eslint version: 8.8.2
prettier-atom configuration: {
  "formatOnSaveOptions": {
    "enabled": true,
    "isDisabledIfNoConfigFile": true,
    "isDisabledIfNotInPackageJson": true,
    "showInStatusBar": true,
    "respectEslintignore": true,
    "excludedGlobs": [],
    "whitelistedGlobs": []
  },
  "silenceErrors": true,
  "useEditorConfig": false,
  "useEslint": false,
  "useStylelint": false,
  "prettierEslintOptions": {
    "prettierLast": false
  }
}
bug

Most helpful comment

Sorry about this, I'm releasing a hotfix now.

All 4 comments

Sorry about this, I'm releasing a hotfix now.

Wow, thanks for the quick turn-around! ๐Ÿ’ž

Man, this drove me crazy. Hoped I had looked up for this issue earlier yesterday ;-)

Slightly offtopic, but damn, that's how you properly report an issue. ๐Ÿ˜

Was this page helpful?
0 / 5 - 0 ratings