Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

.prettierrc config not recognized #325

Closed
mgrip opened this issue Dec 14, 2017 · 5 comments
Closed

.prettierrc config not recognized #325

mgrip opened this issue Dec 14, 2017 · 5 comments

Comments

@mgrip
Copy link

mgrip commented Dec 14, 2017

I'm trying to use prettier-atom with a project that already has a .prettierrc file. However it doesn't seem to be picking up any of the settings in that file, and in addition it doesn't run on save if I have the "Only format if a Prettier config is found" setting checked.

Here's the contents of my .prettierrc file:

{
  "printWidth": 80,
  "singleQuote": true,
  "bracketSpacing": false
}
Atom version: 1.23.1
prettier-atom version: 0.43.1
prettier version: 1.9.2
prettier-eslint version: 8.2.6
prettier-atom configuration: {
  "formatOnSaveOptions": {
    "enabled": true,
    "isDisabledIfNoConfigFile": true,
    "showInStatusBar": true,
    "respectEslintignore": true,
    "javascriptScopes": [
      "source.js",
      "source.jsx",
      "source.js.jsx",
      "source.babel",
      "source.js-semantic",
      "text.html.basic",
      "text.html.vue"
    ],
    "typescriptScopes": [
      "source.ts",
      "source.tsx",
      "source.ts.tsx"
    ],
    "cssScopes": [
      "source.css",
      "source.less",
      "source.css.less",
      "source.scss",
      "source.css.scss",
      "source.css.postcss"
    ],
    "jsonScopes": [
      "source.json"
    ],
    "graphQlScopes": [
      "source.graphql"
    ],
    "markdownScopes": [
      "source.md",
      "source.gfm",
      "text.md"
    ],
    "excludedGlobs": [],
    "whitelistedGlobs": [],
    "isDisabledIfNotInPackageJson": false
  },
  "prettierEslintOptions": {
    "prettierLast": false
  },
  "useEditorConfig": false,
  "useEslint": false,
  "useStylelint": false,
  "prettierOptions": {
    "singleQuote": false,
    "bracketSpacing": true,
    "semi": true,
    "useTabs": false,
    "jsxBracketSameLine": false,
    "printWidth": 80,
    "tabWidth": "auto",
    "trailingComma": "none",
    "parser": "babylon"
  }
}
@robwise
Copy link
Collaborator

robwise commented Dec 15, 2017

@mgrip We currently have an issue with prettier-atom not picking up changes to your .prettierrc (see #270), can you restart atom and make sure this isn't what's going?

@mgrip
Copy link
Author

mgrip commented Dec 16, 2017

Ive tried restarting a couple times, still the same problem. Also its not running on save (when I have the "only format if a prettier config is found" setting checked), which seems like its not recognizing the config at all, not just changes to it.

@robwise
Copy link
Collaborator

robwise commented Dec 17, 2017

@mgrip Can you use prettier directly from the command line and see if the same thing happens? Any errors in your atom console?

@mgrip
Copy link
Author

mgrip commented Dec 17, 2017

I actually just tried with another project and it worked fine (settings were picked up from rc file, they override the atom package settings, it runs on save). I don't have access to the original project I was having problems with at the moment but it must be a config issue. I'll report back if I find anything else - thanks!

@cbrunnkvist
Copy link

Confirming that it seems to have to do with plugin startup. Restarting the editor is the only way I can get prettier-atom to pickup the presence-or-absence-of .prettierrc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants