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

Prettier-atom not respecting quote_type directive from EditorConfig #293

Closed
keyvhinng opened this issue Oct 20, 2017 · 2 comments
Closed
Labels

Comments

@keyvhinng
Copy link

I checked EditorConfig Integration to work with .editorconfig file, which has:

[*.ts]
quote_type = single

With this rule, I assume that prettier-atom will format string literals with single quotes on typescript files, but that's not happening.

This is my prettier-debug output:

Atom version: 1.21.1
prettier-atom version: 0.40.0
prettier version: 1.7.0
prettier-eslint version: 8.1.1
prettier-atom configuration: {
  "formatOnSaveOptions": {
    "showInStatusBar": true,
    "enabled": false,
    "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"
    ],
    "jsonScopes": [
      "source.json"
    ],
    "graphQlScopes": [
      "source.graphql"
    ],
    "excludedGlobs": [],
    "whitelistedGlobs": [],
    "isDisabledIfNotInPackageJson": false,
    "isDisabledIfNoConfigFile": false
  },
  "prettierOptions": {
    "printWidth": 100,
    "singleQuote": false,
    "bracketSpacing": true,
    "semi": true,
    "useTabs": false,
    "jsxBracketSameLine": false,
    "tabWidth": "auto",
    "trailingComma": "none",
    "parser": "babylon"
  },
  "useEslint": false,
  "useEditorConfig": true,
  "prettierEslintOptions": {
    "prettierLast": false
  }
}

Does prettier-atom settings have more priority than .editorconfig rules ?

@robwise
Copy link
Collaborator

robwise commented Oct 20, 2017

@keyvhinng prettier-atom does not support glob overrides ([*.ts]), but prettier itself will be adding its own editorconfig integration itself soon, which we will probably switch over to, so keep a lookout for that: prettier/prettier#2760

@robwise robwise closed this as completed Oct 20, 2017
@keyvhinng
Copy link
Author

Thanks for your reply! I'll take a look on that.

josephfrazier added a commit to prettier/prettier that referenced this issue Nov 8, 2017
This fixes #42.
It adds support for .editorconfig's `indent_style`, `indent_size`, `tab_width`,
and `max_line_length` properties.

It doesn't support the `end_of_line` property as described in
#42 (comment),
but that could be added later. The same goes for `quote_type`
(prettier/prettier-atom#293 (comment)).

* Make test .prettierrc not set config for all file extensions

This makes it easier to keep tests isolated.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants