Commit Graph

19 Commits (3e00fbad7858193978f0bd68082806b9c255b1a8)

Author SHA1 Message Date
Lucas Duailibe 3e00fbad78
Add empty .prettierrc to project root (#6125) 2019-05-15 12:25:22 -03:00
Lucas Azzola f32b289032
Support shared Prettier configuration (#5963)
* Support external configuration

* Document changes

* Update existing snapshots

* Update existing snapshots (2)

* Fix typo in docs

* Add example config repo
2019-03-13 09:34:51 +11:00
Ika 99a3efaa7a
fix: update editorconfig-to-prettier (#5550) 2018-11-26 13:08:52 +08:00
Danny McCormick 18b03a31cc Fix tests for Windows and add Azure Pipelines for cross platform CI (#5410)
* Add azure pipelines

* Add gitattributes

* Updating tests to work on Windows or Unix

* Lint

* Cleaning up

* Fixing names

* Clean up naming

* try to consolidate images

* Clean up

* Add back txt to gitattributes
2018-11-14 07:55:50 -05:00
Jorge Gonzalez 7d78ce68ef feat(config): support TOML configuration files (#4877)
* Add initial support for TOML in configuration files

* Missed brace

* Fix snapshots

* refactor: move loadToml to utils

* Use @iarna/toml

* Add tests for loadToml

* Fix test for CI

* Remove jest-extended

* Create snapshot for load-toml

* Add feat to docs

* lint docs

* Use @iarna/toml/parse-string

* Change path string
2018-08-03 06:27:19 -04:00
Ika 18aa527adc
feat(api): support relative paths for plugin(SearchDir)s in config files (#4667)
* feat(api): support relative paths for plugin(SearchDir)s in config files

* fix: convince appveyor
2018-06-15 04:25:03 +08:00
Lucas Azzola b0cb63a7bb
Use destructuring for imports (#4554)
* Use destructuring for imports

* Clean up integration tests

* Use moduleNameMapper for require_prettier
2018-05-27 21:36:12 +10:00
Joseph Frazier cecf0657a5 Re-add EditorConfig support (undo #3213) (#3255)
* Revert "Revert "Respect EditorConfig settings" (#3213)"

This reverts commit d2241fc0d5.

* Comment out EditorConfig docs

See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769

* editorconfig: Support `indent_size = 0`

See https://github.com/prettier/prettier/pull/2760#discussion_r137447715
and c38b84c42a

* Revert "Comment out EditorConfig docs"

This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f.

* Mark EditorConfig functionality as v1.9.0+

See https://github.com/prettier/prettier/pull/3255#discussion_r150432508

* editorconfig: Upgrade editorconfig-to-prettier to 0.0.4

* editorconfig: Only enable for CLI, by default

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add tests confirming that editorconfig is ignored by default in the API

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add/fix CLI option parsing

* editorconfig: Move docs from configuration.md to options.md

* editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig`

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792

* editorconfig: Update test snapshots

* editorconfig: Remove unnecessary options parsing code

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560

* editorconfig: Move docs from options.md to api.md and cli.md

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979

* resolveConfig: return null if both .prettierrc and .editorconfig are missing

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613

* Don't add now-failing tests

The way these tests work, both `tests_integration/cli/config/.prettierrc`
and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`,
so the test wouldn't work even on master. Here's a way to confirm that:

```js
const path = require('path')
const assert = require('assert')
const prettier = require('./')

const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist'
console.log(prettier.resolveConfig.sync(file))
assert(prettier.resolveConfig.sync(file) === null)
```
2017-12-05 09:28:27 +11:00
Lucas Azzola d2241fc0d5
Revert "Respect EditorConfig settings" (#3213)
* Revert "Respect EditorConfig settings (#2760)"

This reverts commit 8f58ca0f48.
2017-11-09 11:38:58 +11:00
Joseph Frazier 8f58ca0f48
Respect EditorConfig settings (#2760)
This fixes https://github.com/prettier/prettier/issues/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
https://github.com/prettier/prettier/issues/42#issuecomment-327073326,
but that could be added later. The same goes for `quote_type`
(https://github.com/prettier/prettier-atom/issues/293#issue-267288335).

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

This makes it easier to keep tests isolated.
2017-11-08 14:30:28 -05:00
Lucas Azzola d5de6ac84f Delete $schema from resolved config 2017-10-18 23:54:55 +11:00
Lucas Azzola 21d7561ecd Resolve file paths relative to config file (#3037)
* Add currently passing test case for #3005

* Fix test to fail without code change
2017-10-15 18:32:16 +11:00
Ika 7770356a51 test(integration): update title and catch all outputs (#2951) 2017-10-02 18:08:34 +02:00
Simon Lydell 43cb08c45c Make production tests always run against dist/ (attempt 2) (#2942)
* Make production tests always run against dist/

* Try to mock process.stdin instead of get-stream

* fix: mock `get-stream` from `index.js`

* refactor: remove unnecessary variable

* Try `transform: {}` in jest.config.js

* Add comment explaining the unusual get-stream mocking
2017-10-02 17:58:55 +02:00
Lucas Azzola 3c91c2ab42 Fix unit tests on Windows (#2922) 2017-09-28 19:30:51 +10:00
Nick Ribal 592f99fde6 Enable cosmiconfig rcExtensions (#2749)
* Enable cosmiconfig rcExtensions; add two tests

* Remove default value; make integration input files self descripting; update all integration snapshots

* Add engines field to package.json
2017-09-17 02:47:53 +10:00
Ika 088aa71b07 feat(resolve-config): add `.sync()` method (#2722)
* feat(resolve-config): add `sync` option

* docs(readme): add `sync` option

* fix(clearCache):  always clear both

* chore(deps): switch to 3.0 branch

* feat: replace `sync` option with `.sync()`

* docs(readme): update `.sync()`
2017-09-01 20:17:07 +10:00
Lucas Azzola 1c806f81b2 Rename --resolve-config to --find-config-path (#2453) 2017-07-11 23:57:26 +10:00
Lucas Azzola dcccfed366 Implement cosmiconfig for workspace configuration (#2434)
* Implement cosmiconfig

* Add resolveOptions API and extname support

* Add --resolve-config and --config, rename resolveOptions to resolveConfig

* Move color to top-level CLI options

* Fix unknown param warning

* Change from {} to null when no config is found

* Change override API to emulate eslint

* Add test for eslint-style overrides

* Delete overrides from resolveConfig
2017-07-10 22:26:36 +10:00