Commit Graph

1684 Commits (f7907b928227bb67b19ee6d7afa1013a0dadedd6)

Author SHA1 Message Date
Ika f7907b9282 fix(doc-printer): respect CJK width (#3003)
* test: add failing test

* fix(doc-printer): respect CJK width
2017-10-11 00:32:45 -05:00
Ika abc3b12c5e docs(readme): fix description for `filePath` in `prettier.resolveConfig` (#3007) 2017-10-11 15:57:57 +11:00
Lipis c247026346 LESS -> Less (#2995)
* LESS -> Less

They are switched to Less instead of LESS

* Update README.md
2017-10-09 13:19:12 +02:00
Joseph Frazier eb684c59c2 Check Table of Contents on CI (#2994)
This helps ensure that it stays up to date.

See https://github.com/prettier/prettier/pull/2993#issue-263763893
2017-10-09 01:36:52 -04:00
Joseph Frazier 5c86730ec9 Add missing "Require pragma" to Table of Contents (#2993)
This was done with `yarn toc`. Maybe we should add a CI step that runs
`yarn toc` and fails if the README changes?
2017-10-08 20:23:22 -04:00
Marshall Bowers 445f51709e Fix indentation for JSDoc comments (#2470)
* Fix TypeScript comment snapshot

* Add failing test for TypeScript method comments

* Remove trailing space in comment

* Add snapshot for comment with many lines

* Add TODO marking potential location for comment re-indentation

* Update snapshot

* Indent comments based on the parent node

* Only adjust indentation if the comment looks like a JSDoc comment

* Only strip leading spaces when adjusting comment indentation

* Update snapshot

* Add test to show incorrect indentation based on parent node

* Update snapshot

* Update snapshot

* Update comment indentation to not rely on the parent node

* Extract code for getting the indent size

* Add test where the parent indentation changes as well

* Fix lint warning regarding lexical declarations within case block

* Update lockfile

* Update snapshot

* Add test case for block comment inside of a method

* Replace spread operator with `concat`

* Use `align` instead of `addAlignmentToDoc`

* Add test for mismatched indentation within JSDoc comment

* Always add a leading space to subsequent lines in a JSDoc comment

* Refactor JSDoc comment printing into a separate function

* Remove unneeded `align`

* Replace `forEach` with `map` for better style

* Only `trimLeft` when the end comment token is on the last line of the comment

* Remove unneeded `docBuilders`

* Add tests for JSDoc comments in JSX

* Update snapshots
2017-10-08 20:34:24 +11:00
Chris Voll 67e4b7db04 fix: add filenames to flow-verify test descriptions (#2991) 2017-10-08 09:04:40 +02:00
Chris Voll 4a6b61aaf3 fix: support sequential CallExpressions in member chains (#2990)
* fix: support sequential CallExpressions in member chains

fixes #2832

* test: add additional test cases for sequential CallExpressions

* test: regenerate method-chain snapshot
2017-10-08 12:12:17 +11:00
Ika 6c8cde9672 fix(cli): do not early exit for `--debug-check` (#2987)
* test: add failing test

* fix(cli): do not early exit for `--debug-check`
2017-10-07 04:36:43 -05:00
Lucas Azzola 23f7e92162 Handle comments between function name and open paren (#2979) 2017-10-06 20:07:58 +11:00
Joern Bernhardt 3c00979530 Fix typo in test files (`*formated` -> `*formatted`) (#2982)
* Fix typo in test files

Signed-off-by: Joern Bernhardt <jb@campudus.com>

* Rename cursot-offset.js to cursor-offset.js

Signed-off-by: Joern Bernhardt <jb@campudus.com>
2017-10-06 20:01:21 +11:00
Jake 50f3e646c7 Add option to insert @format to first docblock if absent (#2865)
* Add option to insert @format pragma if absent

prependPragma --> insertPragma

add tst dir, move stripBom, add to README, update snapshots

remove noise from test + update snapshots

use jest@test new functions, update docs, rerun snapshots

fix accidental upgrade to jest@test

update jest-docblock again to latest with strip()

updated snapshot

* updated snapshots

* revert jest dep change

* apply a trim to parsed comments

* remove empty object

* Revert "apply a trim to parsed comments"

This reverts commit 467f71ce5f4b4f8a1b5c4474ee0484bc96c92141.

* rerun snapshots with proper jest version

* pin jest-docblock to latest @test release

* comment out docs for new feature from readme

* remove leading newlines

* ensure blank line between docblock and rest of file

* remove backtick string
2017-10-06 19:37:14 +11:00
Simon Lydell bc420370c6 Include duration in --write snapshots (#2960) 2017-10-06 08:20:47 +02:00
Lucas Azzola 482ec01c8e Fix build (#2981) 2017-10-06 14:12:32 +11:00
Joern Bernhardt 201105334d Don't use ANSI codes if stdout isn't a TTY (#2903)
Don't use ANSI codes if stdout isn't a TTY
2017-10-05 22:02:31 +11:00
Lucas Duailibe f82fcbc98e Prevent formatting GQL template literals with expressions (#2975)
* Prevent formatting GQL template literals with expressions

* Remove unnecessary check

* Change quasis check to expression check
2017-10-05 11:23:57 +11:00
Ahmed El Gabri 2fed6c873b Use relative paths with CLI (#2969)
* always get relative paths

* Add test

* update snapshots
2017-10-04 18:56:01 +11:00
Alex Rattray a7223d8262 Merge pull request #2973 from karl/jsx-collapse-multiple-jsx-whitespaces
Collapse multiple JSX whitespaces
2017-10-03 23:31:16 -07:00
Karl O'Keeffe e9b82074a6 Collapse multiple JSX whitespaces 2017-10-03 21:15:49 +01:00
Kaelig Deloumeau-Prigent 4adc7a3096 Fix typo and escape code block character (#2972) 2017-10-03 20:39:52 +02:00
Lucas Azzola 212e5f4a20 Fix website getStream regression (#2967) 2017-10-04 00:03:52 +11:00
Lucas Azzola 2e655a3755 1.7.4 2017-10-03 19:46:42 +10:00
Lucas Azzola 33a1f59e01 Ensure package is published from dist/ with correct version number (#2963) 2017-10-03 19:34:08 +11:00
Simon Lydell fcdf6b5806 Add test for #2880 (#2959)
I added the test in css_case/case.less because it also tests that
`!important` is lowercased in this case.
2017-10-02 21:17:08 +02:00
Ika d9737e6ffa test: fix snapshots (#2957)
* test: trigger test to check its status

* test: update snapshots

* refactor: use strip-ansi
2017-10-02 19:56:34 +02: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
Ika 26254ece0f chore(deps): pin dependencies (#2953) 2017-10-02 17:58:21 +02:00
Lucas Duailibe 2466ce11a5 Force template literals to break after ` for sytled-components (#2926)
Force template literals to break after ` for styled-components
2017-10-02 17:55:42 +02:00
Lucas Azzola 64ec692b92 Mention labels docs in CONTRIBUTING.md (#2950)
Also remove `--` that was required in `yarn` v0.
2017-10-02 07:44:45 +02:00
Ika c7f9bb5731 chore(deps): update cosmiconfig to v3.1.0 (#2952) 2017-10-02 13:01:32 +11:00
Lucas Azzola a6096ee799 Respect --stdin-filepath, regardless of config source (#2948)
* Respect --stdin-filepath, regardless of config source

Fixes #2946

* Remove obsolete snapshot
2017-10-01 15:55:35 +11:00
Lucas Azzola 3329ee022f Upgrade prettier to 1.7.3 (#2940) 2017-09-30 14:28:53 +02:00
Lucas Azzola 099cf760d0 Update ISSUE_TEMPLATE to 1.7.3 2017-09-30 20:57:49 +10:00
Lucas Azzola ecf0281b31 1.7.3 2017-09-30 20:48:10 +10:00
Simon Lydell 808dc4e7e3 Add missing quote in README.md
Fixes #2935.
2017-09-30 10:00:47 +02:00
Simon Lydell 9d448fb217 Try to fix website deploy 2017-09-29 10:50:58 +02:00
Simon Lydell fa882b26af Fix Travis production builds (#2933)
* Fix Travis production builds

* Fix Travis production builds, attempt 2

* Remove `allow_failures` in .travis.yml

The reason we allowed the production builds to fail in the first place:

    ❯ git show 532ac0d3f
    commit 532ac0d3f8
    Author: Joseph Frazier <1212jtraceur@gmail.com>
    Date:   2017-06-17 19:37:51 -0400

        Build/test dist/ on Travis (#2176)

        This helps us keep track of whether or not the dist/ build actually
        works (see https://github.com/prettier/prettier/pull/2174). Note that
        the dist/ jobs are allowed to fail, and do not affect overall build
        time, so they shouldn't slow anything down (see
        https://blog.travis-ci.com/2013-11-27-fast-finishing-builds/).

However, as we discovered in #2933 requiring the production builds to
succeed only adds about 1 minute of build time, so it is not worth the
risk of missing that the production builds fail.
2017-09-29 09:34:47 +02:00
Simon Lydell 63916beebb Try to fix cosmiconfig in the built version of Prettier (#2930) 2017-09-29 09:27:50 +02:00
Ika 0d756080b5 fix: ignore and show warning for unknown option from config file (#2929) 2017-09-28 19:59:32 +02:00
Simon Lydell 51d123b3f1 Update postcss-values-parser (#2928)
My PR has been merged and released to npm, so no need to depend on my
fork anymore.
2017-09-28 19:59:14 +02:00
Lucas Azzola 3c91c2ab42 Fix unit tests on Windows (#2922) 2017-09-28 19:30:51 +10:00
Lucas Azzola 264ec70999 Don't use parens with optional chaining meber expressions (#2921) 2017-09-28 17:46:47 +10:00
Lucas Azzola ae21d60386 Recommend pinning prettier version (#2920)
* Recommend pinning prettier version

* Change from -E to --exact/--save-exact
2017-09-28 14:34:32 +10:00
Stephen Scott 75781a6d16 1.7.2 2017-09-27 17:20:13 -06:00
Lucas Duailibe 038d02b3e2 Revert "Fix line break in test declarations with a single argument function declaration" (#2912)
This reverts commit 3703cb5b07.
2017-09-27 21:32:34 +02:00
Simon Lydell 0313ce6299 Fix the playground for 1.7.1 2017-09-27 20:38:16 +02:00
Stephen Scott c2bc33b3ad 1.7.1 2017-09-27 11:00:29 -06:00
Lucas Azzola 11a7b8d308 Fix printing of comments between decorators and method names (#2906) 2017-09-28 00:03:11 +10:00
Jake Gavin 6179d92518 Fix editor styles for blank playgrounds (#2904) 2017-09-27 08:06:48 +02:00