This release adds an option for arrow function parens in arguments, support for the new JSX fragment syntax (<>
), support for .editorconfig
files, and nice additions to our GraphQL and Markdown support.
When printing arrow functions, Prettier omitted parens around the arguments if they weren’t strictly necessary, like so:
We received feedback that formatting a JSX file with a really long text (~1000 lines) was really slow and noticed there was two performance bottlenecks in our fill
primitive, which prints text until it reaches the print width and then insert a line break.
After the release of our Markdown support, we received feedback that breaking text to respect the print width could affect some renderers that could be sensitive to line breaks. In 1.8.2 we released a new option proseWrap: false
that would print a paragraph in a single line, and users would rely on the "soft wrapping" feature of editors.
When GraphQL support was released, Prettier did not support interpolation so it would skip formatting if any interpolations were present, because interpolations make formatting very difficult. While that works well for the most part, users of the Apollo Client were missing out on Prettier’s GraphQL support sometimes, because Apollo Client uses interpolation to share fragments between queries. The good news is that only top-level interpolations are allowed, and that was way easier to add support for in Prettier.
(Prettier will continue to skip formatting if the interpolation is inside a query or mutation or so.)
Prettier will now respect intentional line breaks inside GraphQL queries (but limit to 1), where before it would remove them.
CSS is mostly case insensitive, so Prettier has been lowercasing stuff for a while to keep things consistent. Turns out we overlooked a detail in the CSS spec. Element and attribute names in selectors depend on the markup language: In HTML they are case insensitive, but in SVG (XML) they are not. Previously Prettier would incorrectly lowercase element and attribute names, but now we don’t anymore.
Prettier won't break an element with no attributes anymore, keeping elements like <br />
as an unit.
In the previous release we tried a new strategy of breaking template literals with expressions inside to respect the print width. We've received feedback that for some cases it was actually preferred that it would exceed print width than breaking in multiple lines.
From now on, template literals expressions that contain a single identifier won't break anymore:
Fixes an edge case where Prettier was moving comments around breaking tools like Webpack:
There was a case where comments between a decorator and a class property were moved to an invalid position.
We were accidentally dropping flow mixins, this has been fixed, but only for the babylon
parser.
This was inconsistent with JavaScript and Flow, Prettier won't print a trailing comma in the following cases, when using the TypeScript parser:
Fixes cases where Prettier would insert extra whitespace like in the following examples:
Prettier now considers not only ASCII punctuation characters but Unicode as well.
We already supported YAML in the front matter of Markdown files and we added the TOML format as well, since some static site generators support it.
* parent list item
<span class="pl-v">*</span> child list item
* [x] parent task list item
<span class="pl-v">*</span> [x] child task list item</pre></div>
would become:
* parent list item
* child list item
* [x] parent task list item
<span class="pl-v">*</span> [x] child task list item</pre></div>
Preserve non-breaking whitespaces (#3327) by @ikatyang
Non-breaking whitespaces are useful to keep words separated by spaces together in the same line (i.e. number and units or multi-word product names). Prettier was wrongfully converting them to regular whitespaces.
Do not break before special prefix (#3347) by @ikatyang
Fixes a bug where Prettier could break text if it went over the print width right before a number followed by .
which would be parsed as a numbered list:
She grew up in an isolated village in the 19th century and met her father aged
29. Oh no, why are we in a numbered list now?
Omit semicolon in simple JSX expressions (#3330) by @sapegin
Prettier will omit the semicolon (before and after) inside code samples if it's a simple JSX expression:
No semi:
jsx</span><span class="pl-s1"></span> <span class="pl-s1"><div>Example</div></span> <span class="pl-s1"></span><span class="pl-c1">
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
The synth changes in here are causing TypeScript compilation errors:
#377
Not sure what's causing it :(
Hello, how can i fix it?
[Error: EMFILE: too many open files, open 'C:\Users\HP\AppData\Roaming\gcloud\application_default_credentials.json'] {
errno: -4066,
code: 'EMFILE',
syscall: 'open',
path: 'C:\\Users\\HP\\AppData\\Roaming\\gcloud\\application_default_credentials.json'
}
☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.
Branch
|
Build failing 🚨
|
Dependency
|
@google-cloud/nodejs-repo-tools
|
Current Version
|
2.2.2
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
@google-cloud/nodejs-repo-tools is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node9 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ❌ ci/circleci: docs Your tests failed on CircleCI Details
- ✅ ci/circleci: lint Your tests passed on CircleCI! Details
Commits
The new version differs by 1 commits.
7b3af41
Fix link to open in cloud shell button image.
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
We have automl
samples sitting in this repo. While they're samples about translation, they're unrelated to this npm module. We should move these samples over to googleapis/nodejs-automl, so that they're tested as part of the release process of that module.
Branch
|
Build failing 🚨
|
Dependency
|
@google-cloud/nodejs-repo-tools
|
Current Version
|
2.0.10
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
@google-cloud/nodejs-repo-tools is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ ci/circleci: node6 Your tests are queued behind your running builds Details
- ❌ ci/circleci: node8 Your tests are queued behind your running builds Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ❌ ci/circleci: node7 CircleCI is running your tests Details
- ❌ ci/circleci: node4 Your tests failed on CircleCI Details
Commits
The new version differs by 2 commits.
f3fe73d
Small fix.
f20e86a
Successfully ignore the new package-lock.json-12345 files. (#56)
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hello! Autosynth couldn't regenerate nodejs-translate. 💔
Here's the output from running synth.py
:
Cloning into 'working_repo'...
Switched to branch 'autosynth'
Running synthtool
['/tmpfs/src/git/autosynth/env/bin/python3', '-m', 'synthtool', 'synth.py', '--']
synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py.
synthtool > Ensuring dependencies.
synthtool > Cloning googleapis.
synthtool > Pulling Docker image: gapic-generator-typescript:latest
latest: Pulling from gapic-images/gapic-generator-typescript
Digest: sha256:a7f89dbac851b1daf372db435f555fcbd77551a66bfb6ea3a21457e616be156d
Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest
synthtool > Generating code for: google/cloud/translate/v3beta1.
synthtool > Failed executing docker run --mount type=bind,source=/home/kbuilder/.cache/synthtool/googleapis/google/cloud/translate/v3beta1/,destination=/in/google/cloud/translate/v3beta1/,readonly --mount type=bind,source=/tmpfs/tmp/tmp2kz7k2sl/,destination=/out/ --rm --user kbuilder --mount type=bind,source=/home/kbuilder/.cache/synthtool/googleapis/google/cloud/common_resources.proto,destination=/extra/google/cloud/common_resources.proto,readonly gcr.io/gapic-images/gapic-generator-typescript:latest --grpc-service-config google/cloud/translate/v3beta1/translate_grpc_service_config.json --package-name @google-cloud/translate -I /extra google/cloud/common_resources.proto:
docker: Error response from daemon: linux spec user: unable to find user kbuilder: no matching entries in passwd file.
Traceback (most recent call last):
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/__main__.py", line 87, in <module>
main()
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/__main__.py", line 79, in main
spec.loader.exec_module(synth_module) # type: ignore
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/tmpfs/src/git/autosynth/working_repo/synth.py", line 35, in <module>
version=version)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/gcp/gapic_microgenerator.py", line 65, in typescript_library
return self._generate_code(service, version, "typescript", **kwargs)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/gcp/gapic_microgenerator.py", line 182, in _generate_code
shell.run(docker_run_args)
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/shell.py", line 39, in run
raise exc
File "/tmpfs/src/git/autosynth/env/lib/python3.6/site-packages/synthtool/shell.py", line 33, in run
encoding="utf-8",
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['docker', 'run', '--mount', 'type=bind,source=/home/kbuilder/.cache/synthtool/googleapis/google/cloud/translate/v3beta1/,destination=/in/google/cloud/translate/v3beta1/,readonly', '--mount', 'type=bind,source=/tmpfs/tmp/tmp2kz7k2sl/,destination=/out/', '--rm', '--user', 'kbuilder', '--mount', 'type=bind,source=/home/kbuilder/.cache/synthtool/googleapis/google/cloud/common_resources.proto,destination=/extra/google/cloud/common_resources.proto,readonly', 'gcr.io/gapic-images/gapic-generator-typescript:latest', '--grpc-service-config', 'google/cloud/translate/v3beta1/translate_grpc_service_config.json', '--package-name', '@google-cloud/translate', '-I', '/extra', 'google/cloud/common_resources.proto']' returned non-zero exit status 125.
synthtool > Cleaned up 0 temporary directories.
synthtool > Wrote metadata to synth.metadata.
Synthesis failed
Google internal developers can see the full log here.
remove license ignore rule for protos/
once the generator populates this header upstream.
see: #355
The release PR #187 is still in a pending state after several hours
Hello! Autosynth couldn't regenerate nodejs-translate. 💔
Here's the output from running synth.py
:
Cloning into 'working_repo'...
Switched to a new branch 'autosynth'
Traceback (most recent call last):
File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/kbuilder/.pyenv/versions/3.6.9/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 482, in <module>
main()
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 334, in main
return _inner_main(temp_dir)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 418, in _inner_main
git_source.enumerate_versions(metadata["sources"], pathlib.Path(temp_dir))
KeyError: 'sources'
Google internal developers can see the full log here.
Would be great if there were types for @google-cloud/translate
as there is @types/google-cloud__storage
.
Version 2.6.0 of async was just published.
Branch
|
Build failing 🚨
|
Dependency
|
async
|
Current Version
|
2.5.0
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
async is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ✅ ci/circleci: docs Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint Your tests failed on CircleCI Details
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
There are different exports in the latest version on npm:
node -i
> require('@google-cloud/translate');
{ v3beta1:
{ TranslationServiceClient: [Function: TranslationServiceClient] },
v2: { Translate: [Function: Translate] },
v3:
{ TranslationServiceClient: [Function: TranslationServiceClient] },
TranslationServiceClient: [Function: TranslationServiceClient] }
☝️ Greenkeeper’s updated Terms of Service will come into effect on April 6th, 2018.
Branch
|
Build failing 🚨
|
Dependency
|
@google-cloud/common
|
Current Version
|
0.16.1
|
Type
|
dependency
|
This version is covered by your current version range and after updating it in your project the build failed.
@google-cloud/common is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node9 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint CircleCI is running your tests Details
- ❌ ci/circleci: docs Your tests failed on CircleCI Details
Release Notes
v0.16.2
Fixes
This release contains only dependency updates and some style fixes.
- (#16) Dependencies with licensing problems
- (#54) Switch to
let
/const
Commits
The new version differs by 9 commits.
f28620e
chore: release 0.16.2 (#56)
98d7795
chore: switch to let/const (#54)
9b9b8bc
chore: delete js-green-licenses.json (#51)
375c78e
Update js-green-licenses to the latest version 🚀 (#50)
4ccfb9b
chore(package): update proxyquire to version 2.0.0 (#44)
c9658d8
chore: run appveyor on node8 only (#48)
5238b0f
style: fix prettier incompatibility (#47)
9423884
chore: removing node7 job from CircleCI (#38)
050ebce
Update log-driver to the latest version 🚀 (#37)
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Hello! Autosynth couldn't regenerate nodejs-translate. 💔
Here's the output from running synth.py
:
Cloning into 'working_repo'...
Switched to branch 'autosynth'
Traceback (most recent call last):
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 256, in <module>
main()
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 196, in main
last_synth_commit_hash = get_last_metadata_commit(args.metadata_path)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 149, in get_last_metadata_commit
text=True,
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'text'
Google internal developers can see the full log here.
This was getting masked by a problem with the logic in the system tests, which I'm about to fix. CI is failing for this here:
https://circleci.com/gh/googleapis/nodejs-translate/3384
It looks like this is related to the transition to teeny-request
:
1) translate
authentication
should use an API key to authenticate:
TypeError: Cannot read property 'defaults' of undefined
at Util.makeRequest (node_modules/@google-cloud/common/src/util.ts:624:45)
at Translate.request (src/index.ts:551:10)
at Translate.getLanguages (src/index.ts:354:10)
at Translate.wrapper (node_modules/@google-cloud/promisify/src/index.ts:73:29)
at Context.it (system-test/translate.ts:165:17)
Version 1.3.1 of ink-docstrap was just published.
Branch
|
Build failing 🚨
|
Dependency
|
ink-docstrap
|
Current Version
|
1.3.0
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
ink-docstrap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: docs Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint Your tests failed on CircleCI Details
Commits
The new version differs by 2 commits.
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
![image](https://user-images.githubusercontent.com/1804755/69958944-e4446800-1540-11ea-8280-71d3d1afcff6.png)
Image above is the only example
Please add one more example
Demo how to use access_token for Google Translate API
(access_token come from OAuth, I already got this part done, I am translate on users behalf. so the app cost user money instead of mine)
(I am building an Electron desktop app that use Google Translate. the OAuth part is done. now I just need to know what to do with the access_token)
Thank you
Version 4.11.0 of eslint was just published.
Branch
|
Build failing 🚨
|
Dependency
|
eslint
|
Current Version
|
4.10.0
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ✅ ci/circleci: docs Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint Your tests failed on CircleCI Details
- ✅ continuous-integration/appveyor/branch AppVeyor build succeeded Details
Release Notes
v4.11.0
- d4557a6 Docs: disallow use of the comma operator using no-restricted-syntax (#9585) (薛定谔的猫)
- d602f9e Upgrade: espree v3.5.2 (#9611) (Kai Cataldo)
- 4def876 Chore: avoid handling rules instances in config-validator (#9364) (Teddy Katz)
- fe5ac7e Chore: fix incorrect comment in safe-emitter.js (#9605) (Teddy Katz)
- 6672fae Docs: Fixed a typo on lines-between-class-members doc (#9603) (Moinul Hossain)
- 980ecd3 Chore: Update copyright and license info (#9599) (薛定谔的猫)
- cc2c7c9 Build: use Node 8 in appveyor (#9595) (薛定谔的猫)
- 2542f04 Docs: Add missing options for
lines-around-comment
(#9589) (Clément Fiorio)
- b6a7490 Build: ensure fuzzer tests get run with
npm test
(#9590) (Teddy Katz)
- 1073bc5 Build: remove shelljs-nodecli (refs #9533) (#9588) (Teddy Katz)
- 7e3bf6a Fix: edge-cases of semi-style (#9560) (Toru Nagashima)
- e5a37ce Fix: object-curly-newline for flow code (#9458) (Tiddo Langerak)
- 9064b9c Chore: add equalTokens in ast-utils. (#9500) (薛定谔的猫)
- b7c5b19 Fix: Correct [object Object] output of error.data. (#9561) (Jonathan Pool)
- 51c8cf0 Docs: Disambiguate definition of Update tag (#9584) (Jonathan Pool)
- afc3c75 Docs: clarify what eslint-config-eslint is (#9582) (Teddy Katz)
- aedae9d Docs: fix spelling in valid-typeof example (#9574) (Maksim Degtyarev)
- 4c5aaf3 Docs: Fix typo in no-underscore-dangle rule (#9567) (Fabien Lucas)
- 3623600 Chore: upgrade [email protected] (#9557) (薛定谔的猫)
- 1b606cd Chore: Remove an indirect dependency on jsonify (#9444) (Rouven Weßling)
- 4d7d7ab Update: Resolve npm installed formatters (#5900) (#9464) (Tom Erik Støwer)
- accc490 Fix: Files with no failures get "passing" testcase (#9547) (Samuel Levy)
- ab0f66d Docs: Add examples to better show rule coverage. (#9548) (Jonathan Pool)
- 88d2303 Chore: Add object-property-newline tests to increase coverage. (#9553) (Jonathan Pool)
- 7f37b1c Build: test Node 9 on Travis (#9556) (Teddy Katz)
- acccfbd Docs: Minor rephrase in
no-invalid-this
. (#9542) (Francisc)
- 8f9c0fe Docs: improve id-match usage advice (#9544) (Teddy Katz)
- a9606a3 Fix: invalid tests with super (fixes #9539) (#9545) (Teddy Katz)
- 8e1a095 Chore: enable a modified version of multiline-comment-style on codebase (#9452) (Teddy Katz)
- cb60285 Chore: remove commented test for HTML formatter (#9532) (Teddy Katz)
- 06b491e Docs: fix duplicate entries in changelog (#9530) (Teddy Katz)
- 2224733 Chore: use eslint-plugin-rulesdir instead of --rulesdir for self-linting (#9164) (Teddy Katz)
- 9cf4ebe Docs: add .md to link(for github users) (#9529) (薛定谔的猫)
Commits
The new version differs by 35 commits.
1a9a6a5
4.11.0
ef4d268
Build: changelog update for 4.11.0
d4557a6
Docs: disallow use of the comma operator using no-restricted-syntax (#9585)
d602f9e
Upgrade: espree v3.5.2 (#9611)
4def876
Chore: avoid handling rules instances in config-validator (#9364)
fe5ac7e
Chore: fix incorrect comment in safe-emitter.js (#9605)
6672fae
Docs: Fixed a typo on lines-between-class-members doc (#9603)
980ecd3
Chore: Update copyright and license info (#9599)
cc2c7c9
Build: use Node 8 in appveyor (#9595)
2542f04
Docs: Add missing options for lines-around-comment
(#9589)
b6a7490
Build: ensure fuzzer tests get run with npm test
(#9590)
1073bc5
Build: remove shelljs-nodecli (refs #9533) (#9588)
7e3bf6a
Fix: edge-cases of semi-style (#9560)
e5a37ce
Fix: object-curly-newline for flow code (#9458)
9064b9c
Chore: add equalTokens in ast-utils. (#9500)
There are 35 commits in total.
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Branch
|
Build failing 🚨
|
Dependency
|
@google-cloud/nodejs-repo-tools
|
Current Version
|
2.1.1
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
@google-cloud/nodejs-repo-tools is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: docs Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint Your tests failed on CircleCI Details
Commits
The new version differs by 2 commits.
8fec7e1
2.1.2
e9461eb
Add 'yaml' option to "repo-tools test deploy" (#75)
See the full diff
FAQ and help
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Environment details
- OS: MacOS
- Node.js version: v10.9.0
- npm version: 6.2.0
@google-cloud/translate
version: 2.1.1
Steps to reproduce
- https://github.com/googleapis/nodejs-translate/blob/master/src/index.ts#L433
Callback is optional. When omitted, it must return a promise. Typescript requires callback and return void.
Following these steps will guarantee the quickest resolution possible.
Thanks!
Got to make sure it passes first :)
Please add the types definition, that makes the developer experience and api usage so much easier, and will allow extending or making complex use of the api possible for a lot of projects without relying on examples
Version 1.8.0 of prettier was just published.
Branch
|
Build failing 🚨
|
Dependency
|
prettier
|
Current Version
|
1.7.4
|
Type
|
devDependency
|
This version is covered by your current version range and after updating it in your project the build failed.
prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
Status Details
- ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
- ✅ ci/circleci: node8 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node6 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node4 Your tests passed on CircleCI! Details
- ✅ ci/circleci: docs Your tests passed on CircleCI! Details
- ❌ ci/circleci: lint Your tests failed on CircleCI Details
Release Notes
1.8.0: Markdown Support
![image](https://cloud.githubusercontent.com/assets/311752/24736977/385d81c8-1a40-11e7-8adc-c4c879ba6c31.png)
This release adds Markdown support, a new --insert-pragma
flag, fixes a number of formatting issues, adds support for some new experimental operators, and improves our editor integration support.
Highlights
Markdown Support
You can now run Prettier on Markdown files! 🎉
The implementation is highly compliant with the CommonMark spec, and backed by the excellent remark-parse
package.
Word Wrap
One of Prettier's core features is its ability to wrap code at a specified line length. This applies to Markdown too, which means you can maintain nice and clean 80-character-wide Markdown files without having to re-adjust line breaks manually when you add or delete words.
Input:
Voilà! In view, a humble vaudevillian veteran cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valourous visitation of a bygone vexation stands vivified and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition! The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honour to meet you and you may call me V.
Output:
Voilà! In view, a humble vaudevillian veteran cast vicariously as both victim
and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity,
is a vestige of the vox populi, now vacant, vanished. However, this valourous
visitation of a bygone vexation stands vivified and has vowed to vanquish these
venal and virulent vermin vanguarding vice and vouchsafing the violently vicious
and voracious violation of volition! The only verdict is vengeance; a vendetta
held as a votive, not in vain, for the value and veracity of such shall one day
vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage
veers most verbose, so let me simply add that it's my very good honour to meet
you and you may call me V.
Note for CJK users: If your markdown renderer does not support CJK line ending, you'll have to use plugin like markdown-it-perfect-newline-for-cjk, hexo-filter-fix-cjk-spacing, etc. to remove additional spaces.
// Source
一二三
四五六
七八九
// Rendered content with unsupported renderer
一二三 四五六 七八九
// Rendered content with supported renderer or via plugin
一二三四五六七八九
Code Formatting
Powered by Prettier's generic "multiparser", Prettier will format code blocks in Markdown! We use the language code provided with the code block to determine which language it is, and thus we can format any language that Prettier supports (including Markdown itself, if you're into that).
Input:
```js
reallyUgly (
javascript
)
```
.h1 { color : red }
```</pre></div>
<p>Output:</p>
<div class="highlight highlight-source-lisp"><pre>```js
reallyUgly(javascript)<span class="pl-c"><span class="pl-c">;</span></span>
.h1 {
color: red<span class="pl-c"><span class="pl-c">;</span></span>
}
```</pre></div>
<blockquote>
<p>Note: In some cases you may not want to format your code in Markdown, and just like in other languages, in Markdown you can use <code><!-- prettier-ignore --></code> before the code block to ignore it from formatting.</p>
</blockquote>
<p><strong>Lists</strong></p>
<p>When rearranging list items, after running Prettier all the numbers will be fixed!</p>
<p><a href="https://camo.githubusercontent.com/50f76500c503763c50019ad61ff531716ff7f3c9/687474703a2f2f672e7265636f726469742e636f2f4d4174616e5a4d5a526f2e676966" target="_blank"><img src="https://camo.githubusercontent.com/50f76500c503763c50019ad61ff531716ff7f3c9/687474703a2f2f672e7265636f726469742e636f2f4d4174616e5a4d5a526f2e676966" alt="Markdown Lists" style="max-width:100%;"></a></p>
<blockquote>
<p>Note: you can actually opt out of this by using <code>1.</code> for all list items if you want to optimize for cleaner diffs.</p>
</blockquote>
<p><strong>Tables</strong></p>
<p>Tables will also automatically be adjusted to fit their contents. This could be completely unmaintainable without an automated tool.</p>
<p><a href="https://camo.githubusercontent.com/7f33126347f155262873500e5068016d2e71a773/687474703a2f2f672e7265636f726469742e636f2f33356a61383836636b542e676966" target="_blank"><img src="https://camo.githubusercontent.com/7f33126347f155262873500e5068016d2e71a773/687474703a2f2f672e7265636f726469742e636f2f33356a61383836636b542e676966" alt="Markdown Tables" style="max-width:100%;"></a></p>
<p><strong>Markdown-in-JS</strong></p>
<p>By using either <code>md</code> or <code>markdown</code> tagged template literals, you can format markdown code inside JavaScript.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">markdown</span> <span class="pl-k">=</span> md<span class="pl-s"><span class="pl-pds">`</span></span>
<span class="pl-s"> # heading</span>
<span class="pl-s"></span>
<span class="pl-s"> 1. list item</span>
<span class="pl-s"><span class="pl-pds">`</span></span>;</pre></div>
<h2>CLI</h2>
<h3>Add option to insert <code>@format</code> to first docblock if absent (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2865" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="258974830" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2865">#2865</a>) by <a href="https://urls.greenkeeper.io/samouri" class="user-mention">@samouri</a></h3>
<p>In 1.7, we added an option called <code>--require-pragma</code> to require files contain an <code>/** @format */</code> pragma to be formatted. In order to add this pragma to a large set of files you can now use <a href="https://prettier.io/docs/en/cli.html#insert-pragma"><code>--insert-pragma</code></a> flag.</p>
<pre><code>prettier --write "folder/**/*.js" --insert-pragma
</code></pre>
<h3>Add <code>--loglevel</code> option (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2992" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263707174" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2992">#2992</a>) by <a href="https://urls.greenkeeper.io/ikatyang" class="user-mention">@ikatyang</a></h3>
<p>This <a href="https://prettier.io/docs/en/cli.html#loglevel">nifty feature</a> allows you to opt in (or out) of Prettier's logging. We've also cleaned up the logging substantially since 1.7.</p>
<div class="highlight highlight-source-shell"><pre>$ prettier --loglevel=debug blarg
$ ./bin/prettier.js --loglevel=debug blarg
[debug] normalized argv: {<span class="pl-s"><span class="pl-pds">"</span>_<span class="pl-pds">"</span></span>:[<span class="pl-s"><span class="pl-pds">"</span>blarg<span class="pl-pds">"</span></span>],<span class="pl-s"><span class="pl-pds">"</span>bracket-spacing<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>color<span class="pl-pds">"</span></span>:true,<span class="pl-s"><span class="pl-pds">"</span>debug-check<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>debug-print-doc<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>flow-parser<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>insert-pragma<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>jsx-bracket-same-line<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>list-different<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>require-pragma<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>semi<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>single-quote<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>stdin<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>use-tabs<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>version<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>with-node-modules<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>write<span class="pl-pds">"</span></span>:false,<span class="pl-s"><span class="pl-pds">"</span>loglevel<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>debug<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>ignore-path<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>.prettierignore<span class="pl-pds">"</span></span>,<span class="pl-s"><span class="pl-pds">"</span>config-precedence<span class="pl-pds">"</span></span>:<span class="pl-s"><span class="pl-pds">"</span>cli-override<span class="pl-pds">"</span></span>}
[error] No matching files. Patterns tried: blarg <span class="pl-k">!</span><span class="pl-k">**</span>/node_modules/<span class="pl-k">**</span> <span class="pl-k">!</span>./node_modules/<span class="pl-k">**</span>
</pre></div>
<h2>JavaScript</h2>
<h3>Fix indentation for JSDoc comments (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2470" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="242554023" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2470">#2470</a>) by <a href="https://urls.greenkeeper.io/maxdeviant" class="user-mention">@maxdeviant</a></h3>
<p>This has been a long-time known issue with Prettier. When formatting code that results in a change of indentation level, the JSDoc comments would end up being out of alignment. We're happy to report this is now fixed!</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">theFunction2</span>(<span class="pl-smi">action$</span>, <span class="pl-smi">store</span>) {
<span class="pl-c"><span class="pl-c">/*</span></span>
<span class="pl-c"> * comments</span>
<span class="pl-c"> <span class="pl-c">*/</span></span>
<span class="pl-k">return</span> <span class="pl-c1">true</span>;
}
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">function</span> <span class="pl-en">theFunction2</span>(<span class="pl-smi">action$</span>, <span class="pl-smi">store</span>) {
<span class="pl-c"><span class="pl-c">/*</span></span>
<span class="pl-c"> * comments</span>
<span class="pl-c"> <span class="pl-c">*/</span></span>
<span class="pl-k">return</span> <span class="pl-c1">true</span>;
}</pre></div>
<h3>Print pipeline and nullish-coalescing operators (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3036" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265544605" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3036">#3036</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We've added support for two new proposed operators to Prettier: the <em>pipeline operator</em> and the <em>nullish coalescing operator</em>.</p>
<p>The <a href="https://urls.greenkeeper.io/tc39/proposal-pipeline-operator/">pipeline operator</a> is currently a stage one proposal.</p>
<blockquote>
<p>This proposal introduces a new operator |> similar to F#, OCaml, Elixir, Elm, Julia, Hack, and LiveScript, as well as UNIX pipes. It's a backwards-compatible way of streamlining chained function calls in a readable, functional manner, and provides a practical alternative to extending built-in prototypes.</p>
</blockquote>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">let</span> result <span class="pl-k">=</span> <span class="pl-en">exclaim</span>(<span class="pl-en">capitalize</span>(<span class="pl-en">doubleSay</span>(<span class="pl-s"><span class="pl-pds">"</span>hello<span class="pl-pds">"</span></span>)));
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">let</span> result <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>hello<span class="pl-pds">"</span></span>
<span class="pl-k">|</span><span class="pl-k">></span> doubleSay
<span class="pl-k">|</span><span class="pl-k">></span> capitalize
<span class="pl-k">|</span><span class="pl-k">></span> exclaim;</pre></div>
<p>The <a href="https://urls.greenkeeper.io/tc39-transfer/proposal-nullish-coalescing">nullish coalescing operator</a> is another stage one proposal.</p>
<blockquote>
<p>When performing optional property access in a nested structure in conjunction with the optional chaining operator, it is often desired to provide a default value if the result of that property access is null or undefined.</p>
</blockquote>
<p>This operator is similar to <code>||</code> except it only evaluates the right-hand-side if the left is <code>undefined</code> or <code>null</code>, not <code>""</code>, <code>0</code>, <code>NaN</code>, etc.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-c1">foo</span> <span class="pl-k">=</span> <span class="pl-smi">object</span>.<span class="pl-smi">foo</span> <span class="pl-k">??</span> <span class="pl-s"><span class="pl-pds">"</span>default<span class="pl-pds">"</span></span>;</pre></div>
<h3>Improved template literal expresions line breaks (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3124" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="269808048" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3124">#3124</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>This was another known issue with Prettier, when printing a template literal string with expressions inside that went over the print width, it would wrap the code in weird places inside the expressions. Now, if Prettier needs to insert a line break, it should happen right between <code>${</code> and <code>}</code>.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">const</span> <span class="pl-smi">description</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">The value of the <span class="pl-e">${<span class="pl-smi">cssName</span>}</span> css of the <span class="pl-e">${<span class="pl-c1">this</span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e"> <span class="pl-k">.</span><span class="pl-smi">_name</span>}</span> element</span><span class="pl-s">`</span></span>;
<span class="pl-k">const</span> <span class="pl-smi">foo</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">mdl-textfield mdl-js-textfield <span class="pl-e">${<span class="pl-smi">className</span>}</span> <span class="pl-e">${<span class="pl-smi">content</span><span class="pl-k">.</span><span class="pl-smi">length</span><span class="pl-k"> ></span> <span class="pl-c1">0</span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e"> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">"</span>is-dirty<span class="pl-pds">"</span></span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e"> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>}</span> combo-box__input</span><span class="pl-s">`</span></span>;
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-smi">description</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">The value of the \${cssName} css of the \${</span></span>
<span class="pl-s"><span class="pl-s"> this._name</span></span>
<span class="pl-s"><span class="pl-s">} element</span><span class="pl-s">`</span></span>;
<span class="pl-k">const</span> <span class="pl-smi">foo</span><span class="pl-k"> =</span><span class="pl-s"> <span class="pl-s">`</span><span class="pl-s">mdl-textfield mdl-js-textfield <span class="pl-e">${<span class="pl-smi">className</span>}</span> <span class="pl-e">${</span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e"><span class="pl-smi"> content</span><span class="pl-k">.</span><span class="pl-smi">length</span><span class="pl-k"> ></span> <span class="pl-c1">0</span> <span class="pl-k">?</span> <span class="pl-s"><span class="pl-pds">'</span>is-dirty<span class="pl-pds">'</span></span> <span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span></span></span></span>
<span class="pl-s"><span class="pl-s"><span class="pl-e">}</span> combo-box__input</span><span class="pl-s">`</span></span></pre></div>
<h2>JSX</h2>
<h3>Don't inline trailing <code>}</code> for arrow functions attributes (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3110" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="268739661" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3110">#3110</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>In order to align closer to the <a href="https://urls.greenkeeper.io/airbnb/javascript/">Airbnb style guide</a>, and since it was never intentionally printed this way, we've moved the <code>}</code> from to the next line in JSX. This is more diff friendly, and makes it easier to move code around by shifting lines in your editor.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<<span class="pl-ent"><span class="pl-c1">BookingIntroPanel</span></span>
<span class="pl-e">logClick</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">data</span> <span class="pl-k">=></span></span>
<span class="pl-s1"> <span class="pl-en">doLogClick</span>(<span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>,<span class="pl-smi"> data</span>)</span><span class="pl-pse">}</span>
/>;
<span class="pl-c"><span class="pl-c">//</span> After</span>
<<span class="pl-ent"><span class="pl-c1">BookingIntroPanel</span></span>
<span class="pl-e">logClick</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">data</span> <span class="pl-k">=></span></span>
<span class="pl-s1"> <span class="pl-en">doLogClick</span>(<span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>long_name_long_name_long_name<span class="pl-pds">"</span></span>,<span class="pl-smi"> data</span>)</span>
<span class="pl-s1"> </span><span class="pl-pse">}</span>
/>;</pre></div>
<h1>Other Changes</h1>
<h2>JavaScript</h2>
<h3>Make the factory detection handle multiple elements (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3112" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="268967545" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3112">#3112</a>) by <a href="https://urls.greenkeeper.io/vjeux" class="user-mention">@vjeux</a></h3>
<p>There was a bug in the heuristic that Prettier uses to determine whether an expression is a factory or not. It now works correctly with longer member expressions.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-c1">window</span>.<span class="pl-smi">FooClient</span>
.<span class="pl-en">setVars</span>({
locale<span class="pl-k">:</span> <span class="pl-en">getFooLocale</span>({ page }),
authorizationToken<span class="pl-k">:</span> <span class="pl-smi">data</span>.<span class="pl-smi">token</span>
})
.<span class="pl-en">initVerify</span>(<span class="pl-s"><span class="pl-pds">"</span>foo_container<span class="pl-pds">"</span></span>);
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-c1">window</span>.<span class="pl-smi">FooClient</span>.<span class="pl-en">setVars</span>({
locale<span class="pl-k">:</span> <span class="pl-en">getFooLocale</span>({ page }),
authorizationToken<span class="pl-k">:</span> <span class="pl-smi">data</span>.<span class="pl-smi">token</span>
}).<span class="pl-en">initVerify</span>(<span class="pl-s"><span class="pl-pds">"</span>foo_container<span class="pl-pds">"</span></span>);</pre></div>
<h3>Handle comments between function name and open paren (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2979" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263070152" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2979">#2979</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>Printing comments in the right place is an endless challenge <g-emoji alias="wink" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/1f609.png" ios-version="6.0">😉</g-emoji>. This fix ensures that comments next to function names are re-printed correctly.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">f</span>(<span class="pl-c"><span class="pl-c">/*</span> comment<span class="pl-c">*/</span></span> <span class="pl-smi">promise</span>) {}
<span class="pl-c"><span class="pl-c">//</span> After </span>
<span class="pl-k">function</span> f <span class="pl-c"><span class="pl-c">/*</span> comment<span class="pl-c">*/</span></span>(<span class="pl-smi">promise</span>) {}</pre></div>
<h3>Support sequential CallExpressions in member chains (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2990" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="263677479" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2990">#2990</a>) by <a href="https://urls.greenkeeper.io/chrisvoll" class="user-mention">@chrisvoll</a></h3>
<p>Member chains are one of the most complex parts of Prettier. This PR fixes an issue where repeated calls lead to the next method not being pushed to the next line.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
wrapper
.<span class="pl-c1">find</span>(<span class="pl-s"><span class="pl-pds">"</span>SomewhatLongNodeName<span class="pl-pds">"</span></span>)
.<span class="pl-en">prop</span>(<span class="pl-s"><span class="pl-pds">"</span>longPropFunctionName<span class="pl-pds">"</span></span>)().<span class="pl-en">then</span>(<span class="pl-k">function</span>() {
<span class="pl-en">doSomething</span>();
});
<span class="pl-c"><span class="pl-c">//</span> After</span>
wrapper
.<span class="pl-c1">find</span>(<span class="pl-s"><span class="pl-pds">"</span>SomewhatLongNodeName<span class="pl-pds">"</span></span>)
.<span class="pl-en">prop</span>(<span class="pl-s"><span class="pl-pds">"</span>longPropFunctionName<span class="pl-pds">"</span></span>)()
.<span class="pl-en">then</span>(<span class="pl-k">function</span>() {
<span class="pl-en">doSomething</span>();
});</pre></div>
<h3>Account for empty lines in long member call chain (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3035" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265515302" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3035">#3035</a>) by <a href="https://urls.greenkeeper.io/jackyho112" class="user-mention">@jackyho112</a></h3>
<p>Previously, Prettier would delete all newlines within a member chain. Now we keep up to one if it's in the source. This is nice for fluent APIs that you want to break up over multiple lines.</p>
<div class="highlight highlight-source-js"><pre>angular
.<span class="pl-en">module</span>(<span class="pl-s"><span class="pl-pds">"</span>AngularAppModule<span class="pl-pds">"</span></span>)
<span class="pl-c"><span class="pl-c">//</span> Constants.</span>
.<span class="pl-en">constant</span>(<span class="pl-s"><span class="pl-pds">"</span>API_URL<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>http://localhost:8080/api<span class="pl-pds">"</span></span>)
<span class="pl-c"><span class="pl-c">//</span> App configuration.</span>
.<span class="pl-en">config</span>(appConfig)
.<span class="pl-en">run</span>(appRun);</pre></div>
<h3>Fix issue where first argument is left behind when line breaks (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3079" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267371127" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3079">#3079</a>) by <a href="https://urls.greenkeeper.io/mutdmour" class="user-mention">@mutdmour</a></h3>
<p>This addresses an issue where due to our special object inline behaviour, the indentation missing from the function call.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-smi">db</span>.<span class="pl-en">collection</span>(<span class="pl-s"><span class="pl-pds">"</span>indexOptionDefault<span class="pl-pds">"</span></span>).<span class="pl-en">createIndex</span>({ a<span class="pl-k">:</span> <span class="pl-c1">1</span> },
{
indexOptionDefaults<span class="pl-k">:</span> <span class="pl-c1">true</span>
},
<span class="pl-k">function</span>(<span class="pl-smi">err</span>) {
<span class="pl-c"><span class="pl-c">//</span> code</span>
});
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-smi">db</span>.<span class="pl-en">collection</span>(<span class="pl-s"><span class="pl-pds">"</span>indexOptionDefault<span class="pl-pds">"</span></span>).<span class="pl-en">createIndex</span>(
{ a<span class="pl-k">:</span> <span class="pl-c1">1</span> },
{
indexOptionDefaults<span class="pl-k">:</span> <span class="pl-c1">true</span>
},
<span class="pl-k">function</span>(<span class="pl-smi">err</span>) {
<span class="pl-c"><span class="pl-c">//</span> code</span>
}
);</pre></div>
<h3>Break parens for binaries in member expression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2958" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262164203" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2958">#2958</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Similarly, there was another edge case where indentation was missing from logical expressions. This is fixed, too.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">const</span> <span class="pl-c1">someLongVariable</span> <span class="pl-k">=</span> (<span class="pl-en">idx</span>(
<span class="pl-c1">this</span>.<span class="pl-smi">props</span>,
<span class="pl-smi">props</span> <span class="pl-k">=></span> <span class="pl-smi">props</span>.<span class="pl-smi">someLongPropertyName</span>
) <span class="pl-k">||</span> []
).<span class="pl-en">map</span>(<span class="pl-smi">edge</span> <span class="pl-k">=></span> <span class="pl-smi">edge</span>.<span class="pl-smi">node</span>);
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-c1">someLongVariable</span> <span class="pl-k">=</span> (
<span class="pl-en">idx</span>(<span class="pl-c1">this</span>.<span class="pl-smi">props</span>, <span class="pl-smi">props</span> <span class="pl-k">=></span> <span class="pl-smi">props</span>.<span class="pl-smi">someLongPropertyName</span>) <span class="pl-k">||</span> []
).<span class="pl-en">map</span>(<span class="pl-smi">edge</span> <span class="pl-k">=></span> <span class="pl-smi">edge</span>.<span class="pl-smi">node</span>);</pre></div>
<h3>Prevent breaking MemberExpression inside NewExpression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3075" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267232001" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3075">#3075</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>There are so many ways to break a line. Some of them look much worse than others. Breaking between in this case looked really weird, so it has been fixed!</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-k">function</span> <span class="pl-en">functionName</span>() {
<span class="pl-k">if</span> (<span class="pl-c1">true</span>) {
<span class="pl-c1">this</span>.<span class="pl-smi">_aVeryLongVariableNameToForceLineBreak</span> <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-en">this</span>
.<span class="pl-en">Promise</span>((<span class="pl-smi">resolve</span>, <span class="pl-smi">reject</span>) <span class="pl-k">=></span> {
<span class="pl-c"><span class="pl-c">//</span> do something</span>
});
}
}
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">function</span> <span class="pl-en">functionName</span>() {
<span class="pl-k">if</span> (<span class="pl-c1">true</span>) {
<span class="pl-c1">this</span>.<span class="pl-smi">_aVeryLongVariableNameToForceLineBreak</span> <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-en">this.Promise</span>(
(<span class="pl-smi">resolve</span>, <span class="pl-smi">reject</span>) <span class="pl-k">=></span> {
<span class="pl-c"><span class="pl-c">//</span> do something</span>
}
);
}
}</pre></div>
<h3>Fix array acessors in method chains (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3137" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="270637812" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3137">#3137</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>In a method chain we split lines by grouping elements together and accessing an array should be printed in the end of a group instead of the beginning.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-en">find</span>(<span class="pl-s"><span class="pl-pds">'</span>.org-lclp-edit-copy-url-banner__link<span class="pl-pds">'</span></span>)
[<span class="pl-c1">0</span>].<span class="pl-c1">getAttribute</span>(<span class="pl-s"><span class="pl-pds">'</span>href<span class="pl-pds">'</span></span>)
.<span class="pl-c1">indexOf</span>(<span class="pl-c1">this</span>.<span class="pl-smi">landingPageLink</span>)
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-en">find</span>(<span class="pl-s"><span class="pl-pds">'</span>.org-lclp-edit-copy-url-banner__link<span class="pl-pds">'</span></span>)[<span class="pl-c1">0</span>]
.<span class="pl-c1">getAttribute</span>(<span class="pl-s"><span class="pl-pds">'</span>href<span class="pl-pds">'</span></span>)
.<span class="pl-c1">indexOf</span>(<span class="pl-c1">this</span>.<span class="pl-smi">landingPageLink</span>)</pre></div>
<h2>Flow and TypeScript</h2>
<h3>Fix indentation of intersection object types (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3074" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267225804" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3074">#3074</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>This was a minor alignment bug in intersection types, and has now been fixed.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
type intersectionTest <span class="pl-k">=</span> {
propA<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propB<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propC<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propD<span class="pl-k">:</span> <span class="pl-c1">X</span>
};
<span class="pl-c"><span class="pl-c">//</span> After</span>
type Props <span class="pl-k">=</span> {
propA<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propB<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propC<span class="pl-k">:</span> <span class="pl-c1">X</span>
} <span class="pl-k">&</span> {
propD<span class="pl-k">:</span> <span class="pl-c1">X</span>
};</pre></div>
<h3>Keep parens around TSAsExpression in ConditionalExpression (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3053" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="266402555" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3053">#3053</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We missed a case where we need to keep the parenthesis with TypeScript's <code>as</code> assertions. This is now fixed.</p>
<div class="highlight highlight-source-ts"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<span class="pl-c"></span><span class="pl-smi">aValue</span> <span class="pl-k">as</span> <span class="pl-c1">boolean</span> ? <span class="pl-c1">0</span> : <span class="pl-k">-</span><span class="pl-c1">1</span>;
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-c"></span>(<span class="pl-smi">aValue</span> <span class="pl-k">as</span> <span class="pl-c1">boolean</span>) <span class="pl-k">?</span> <span class="pl-c1">0</span> <span class="pl-k">:</span> <span class="pl-k">-</span><span class="pl-c1">1</span>;</pre></div>
<h2>JSX</h2>
<h3>Collapse multiple JSX whitespaces (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2973" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262564212" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2973">#2973</a>) by <a href="https://urls.greenkeeper.io/karl" class="user-mention">@karl</a></h3>
<p>This fixes up the issue where JSX formatting occasionally needed to be run twice to become stable. This occurred when you had multiple JSX whitespace elements or JSX whitespace followed by a space.</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
<<span class="pl-ent">div</span>>
<span class="pl-pse">{</span><span class="pl-s1"><span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">"</span></span></span><span class="pl-pse">}</span> <<span class="pl-ent"><span class="pl-c1">Badge</span></span> <span class="pl-e">src</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">notificationIconPng</span></span><span class="pl-pse">}</span> />
</<span class="pl-ent">div</span>>;
<span class="pl-c"><span class="pl-c">//</span> After</span>
<<span class="pl-ent">div</span>>
<span class="pl-pse">{</span><span class="pl-s1"><span class="pl-s"><span class="pl-pds">"</span> <span class="pl-pds">"</span></span></span><span class="pl-pse">}</span>
<<span class="pl-ent"><span class="pl-c1">Badge</span></span> <span class="pl-e">src</span><span class="pl-k">=</span><span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">notificationIconPng</span></span><span class="pl-pse">}</span> />
</<span class="pl-ent">div</span>></pre></div>
<h3>Don't print JSX bracket on same line when it has trailing comments (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3088" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267549517" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3088">#3088</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>This was an issue with the <code>--jsx-bracket-same-line</code> option. Turns out you can't <em>always</em> put the bracket on the same line...</p>
<div class="highlight highlight-source-js-jsx"><pre><span class="pl-c"><span class="pl-c">//</span> Input</span>
<<span class="pl-ent">div</span>
<span class="pl-c"> <span class="pl-c">//</span> comment</span>
>
<span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
</<span class="pl-ent">div</span>>
<span class="pl-c"><span class="pl-c">//</span> Before</span>
<<span class="pl-ent">div</span>>
// comment
<span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
</<span class="pl-ent">div</span>>;
<span class="pl-c"><span class="pl-c">//</span> After</span>
<<span class="pl-ent">div</span>
<span class="pl-c"><span class="pl-c">//</span> comment</span>
>
<span class="pl-pse">{</span><span class="pl-s1"><span class="pl-smi">foo</span></span><span class="pl-pse">}</span>
</<span class="pl-ent">div</span>>;</pre></div>
<h2>CSS</h2>
<h3>Preserve line breaks in grid declarations (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3133" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="270384528" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3133">#3133</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Prettier will now preserve line breaks included in the source code when formatting the <code>grid</code> and <code>grid-template-*</code> rules, since those are important to keep in separate lines, but still applies the formatting like other rules (e.g., numbers and quotes).</p>
<div class="highlight highlight-source-css"><pre><span class="pl-c"><span class="pl-c">/*</span> Original Input <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
<span class="pl-c1"><span class="pl-c1">grid</span></span>:
[wide-start] <span class="pl-s"><span class="pl-pds">'</span>header header header<span class="pl-pds">'</span></span> <span class="pl-c1">200.000<span class="pl-k">px</span></span>
[wide-end] <span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">.50<span class="pl-k">fr</span></span>
/ <span class="pl-c1">auto</span> <span class="pl-c1">50.000<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}
<span class="pl-c"><span class="pl-c">/*</span> Before <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
<span class="pl-c1"><span class="pl-c1">grid</span></span>: [wide-start] <span class="pl-s"><span class="pl-pds">"</span>header header header<span class="pl-pds">"</span></span> <span class="pl-c1">200<span class="pl-k">px</span></span> [wide-end]
<span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">0.5<span class="pl-k">fr</span></span> / <span class="pl-c1">auto</span> <span class="pl-c1">50<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}
<span class="pl-c"><span class="pl-c">/*</span> After <span class="pl-c">*/</span></span>
<span class="pl-ent">div</span> {
<span class="pl-c1"><span class="pl-c1">grid</span></span>:
[wide-start] <span class="pl-s"><span class="pl-pds">"</span>header header header<span class="pl-pds">"</span></span> <span class="pl-c1">200<span class="pl-k">px</span></span>
[wide-end] <span class="pl-s"><span class="pl-pds">"</span>footer footer footer<span class="pl-pds">"</span></span> <span class="pl-c1">0.5<span class="pl-k">fr</span></span>
/ <span class="pl-c1">auto</span> <span class="pl-c1">50<span class="pl-k">px</span></span> <span class="pl-c1">auto</span>;
}</pre></div>
<h2>SCSS</h2>
<h3>Format SCSS maps like CSS rules (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3070" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267054763" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3070">#3070</a>) by <a href="https://urls.greenkeeper.io/asmockler" class="user-mention">@asmockler</a></h3>
<p>Turns out SCSS maps are much prettier when printed over multiple lines.</p>
<div class="highlight highlight-source-scss"><pre><span class="pl-c">// Before</span>
<span class="pl-smi">$map</span>: (color: <span class="pl-c1">#111111</span>, <span class="pl-c1">text</span><span class="pl-c1">-</span>shadow:<span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 0</span> <span class="pl-bu">salmon</span>)
// After
<span class="pl-smi">$map</span>: (
color: <span class="pl-c1">#111111</span>,
<span class="pl-c1">text</span><span class="pl-c1">-</span>shadow:<span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 1</span><span class="pl-k">px</span><span class="pl-c1"> 0</span> <span class="pl-bu">salmon</span>
);</pre></div>
<h2>CSS-in-JS</h2>
<h3>Fix formatting styled(Foo).attrs(...)`` (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3073" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="267192603" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3073">#3073</a>) by <a href="https://urls.greenkeeper.io/existentialism" class="user-mention">@existentialism</a></h3>
<p>Prettier will now format the CSS in styled-components code that looks like this:</p>
<div class="highlight highlight-source-js"><pre><span class="pl-en">styled</span>(Component).<span class="pl-en">attrs</span>({})<span class="pl-s"><span class="pl-pds">`</span></span>
<span class="pl-s"> color: red;</span>
<span class="pl-s"><span class="pl-pds">`</span></span>;</pre></div>
<h2>GraphQL</h2>
<h3>Prevent formatting GraphQL template literals with expressions (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2975" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262809788" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2975">#2975</a>) by <a href="https://urls.greenkeeper.io/duailibe" class="user-mention">@duailibe</a></h3>
<p>Prettier doesn't support formatting JavaScript expressions in GraphQL. See <a href="https://urls.greenkeeper.io/prettier/prettier/issues/2640" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="251412470" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2640">#2640</a> for tracking. There was a bug where formatting an expression lead to invalid code, so we've completely disabled formatting GraphQL when it contains JavaScript expressions until we fully support it.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before</span>
(invalid code)
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-en">graphql</span>(schema, <span class="pl-s"><span class="pl-pds">`</span>{ query test { id }} <span class="pl-s1"><span class="pl-pse">${</span>fragment<span class="pl-pse">}</span></span><span class="pl-pds">`</span></span>)</pre></div>
<h2>CLI</h2>
<h3>Don't use ANSI codes if stdout isn't a TTY (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2903" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="260810621" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2903">#2903</a>) by <a href="https://urls.greenkeeper.io/narigo" class="user-mention">@Narigo</a></h3>
<p>Previously, piping the output of <code>--list-different</code> to other tools was troublesome due to the ANSI color codes we use to show whether a file was modified or not. This PR disables the use of color when Prettier is piped to a different process.</p>
<h2>Configuration</h2>
<h3>Use relative paths with CLI (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/2969" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="262449905" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/2969">#2969</a>) by <a href="https://urls.greenkeeper.io/ahmedelgabri" class="user-mention">@ahmedelgabri</a></h3>
<p>This fixes a bug where passing a path starting with <code>./</code> to the CLI wouldn't match patterns used in <code>.prettierignore</code>.</p>
<pre><code># .prettierignore
path/to/*.js
</code></pre>
<p>After this fix, no files will be written to when executing:</p>
<div class="highlight highlight-source-shell"><pre>$ prettier --write ./path/to/<span class="pl-k">*</span>.js</pre></div>
<h3>Resolve file paths relative to config file (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3037" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265550594" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3037">#3037</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>This fixes an issue where <code>.prettierrc</code> overrides, under certain conditions, were not being respected for absolute paths with the <code>resolveConfig</code> API.</p>
<h2>Core</h2>
<h3>Respect CJK width and Combined Characters (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3003" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264227112" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3003">#3003</a>, <a href="https://urls.greenkeeper.io/prettier/prettier/pull/3015" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264803229" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3015">#3015</a>) by <a href="https://urls.greenkeeper.io/ikatyang" class="user-mention">@ikatyang</a></h3>
<p>Chinese, Japanese and Korean characters are now considered two characters wide.</p>
<div class="highlight highlight-source-js"><pre><span class="pl-c"><span class="pl-c">//</span> Before (exceeds print width when CJK characters are 2x monospace chars)</span>
<span class="pl-k">const</span> <span class="pl-c1">x</span> <span class="pl-k">=</span> [<span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>];
<span class="pl-c"><span class="pl-c">//</span> After</span>
<span class="pl-k">const</span> <span class="pl-c1">x</span> <span class="pl-k">=</span> [
<span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>,
<span class="pl-c"><span class="pl-c">//</span> ...</span>
<span class="pl-s"><span class="pl-pds">"</span>中文<span class="pl-pds">"</span></span>
];</pre></div>
<p><a href="https://urls.greenkeeper.io/prettier/prettier/pull/3015" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="264803229" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3015">#3015</a> also ensures that combining characters (e.g. <code>Á</code>) are counted as one character.</p>
<h2>Editor Support</h2>
<h3>Implement getSupportInfo() and use it for inference (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3033" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="265494522" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3033">#3033</a>) by <a href="https://urls.greenkeeper.io/azz" class="user-mention">@azz</a></h3>
<p>We've added a new function to the API (<code>prettier.getSupportInfo([version])</code>), and the CLI <code>--support-info</code>. This can be used to interrogate Prettier to find out which languages the current version, or an older version, supports. It also provides useful information such as CodeMirror IDs, tmScopes, etc, which can be used to automate some of the work done with lookup tables in text editor integrations.</p>
<p>Internally, we use this information to drive which extensions trigger which parsers, and support some common files that don't have extensions, like <code>.prettierrc</code>, <code>Jakefile</code>, etc.</p>
<div class="highlight highlight-source-shell"><pre><span class="pl-c"><span class="pl-c">#</span> prettier knows that this file is JSON now.</span>
$ prettier --write .prettierrc</pre></div>
<h3>Split source elements relative to their language. (<a href="https://urls.greenkeeper.io/prettier/prettier/pull/3069" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="266872265" data-permission-text="Issue title is private" data-url="https://github.com/prettier/prettier/issues/3069">#3069</a>) by <a href="https://urls.greenkeeper.io/cigit" class="user-mention">@CiGit</a></h3>
<p>This fixes an issue in editors that support range formatting, where formatting an object would cause Prettier to crash.</p>
<hr>
<h1>Thanks! <g-emoji alias="heart" fallback-src="https://assets-cdn.github.com/images/icons/emoji/unicode/2764.png" ios-version="6.0">❤️</g-emoji></h1>
<p>Thanks to everyone who contributed to this release, as well as those who raised issues! Prettier has become a highly stable piece of software that a large amount of people trust with their code. We take that trust seriously, and fix rare issues that break code with the highest priority. We can't fix these issues if we don't know about them, so never be afraid to <a href="https://urls.greenkeeper.io/prettier/prettier/issues/new">create an issue</a>!</p>
</details>
<details>
<summary>FAQ and help</summary>
There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>
---
Your [Greenkeeper](https://greenkeeper.io) Bot :palm_tree:
The release PR #391 is still in a pending state after several hours
Hi,
I have this error when I try to translate key value in nodejs:
Promise {
<rejected> TypeError: translate_1.Translate is not a constructor
I followed the repo description, here is my code:
const projectId = 'MY_PROJECT_ID';
const translate = new Translate({
projectId: projectId,
});
return translate
.translate(input,lang)
.then(results => {
const translation = results[0];
console.log(`Text: ${input}`);
console.log(`Translation: ${translation}`);
})
.catch(err => {
console.log('ERROR:',err);
})
;
thanks.
Environment details
- OS: Debian GNU/Linux 9 (stretch)
- Node.js version: v13.6.0
- npm version: 6.13.4
@google-cloud/translate
version: 5.1.4
Steps to reproduce
- On a fresh debian-9-drawfork-v20191004 instance, follow the instructions in CONTRIBUTING.md to setup the environment (use the linked GCP documentation, then run
npm install
in the root of this repo).
- Run tests as described in the guide and receive errors about missing packages.
- Run linter and receive errors.
This is the initial change. We need to:
- rename all *.js files to *.ts
npx init gts
- install any
@types
packages needed
- replace all
require
statements with imports
- disable the
check
npm run script for now
- get
npm run compile
passing
- Update the
main
field in package.json
to be build/src/index.js
- Add a
types
property in package.json
to be build/src/index.d.ts
- Add
build
to .gitignore
- .... other stuff I'm likely forgetting 😆
Hello! Autosynth couldn't regenerate nodejs-translate. 💔
Here's the output from running synth.py
:
Cloning into 'working_repo'...
Switched to branch 'autosynth'
�[35msynthtool > �[31m�[43mYou are running the synthesis script directly, this will be disabled in a future release of Synthtool. Please use python3 -m synthtool instead.�[0m
.circleci/config.yml
.circleci/npm-install-retry.js
.eslintignore
.eslintrc.yml
.github/CONTRIBUTING.md
.github/ISSUE_TEMPLATE/bug_report.md
.github/ISSUE_TEMPLATE/feature_request.md
.github/ISSUE_TEMPLATE/support_request.md
.jsdoc.js
.kokoro/common.cfg
.kokoro/continuous/node10/common.cfg
.kokoro/continuous/node10/test.cfg
.kokoro/continuous/node11/common.cfg
.kokoro/continuous/node11/test.cfg
.kokoro/continuous/node6/common.cfg
.kokoro/continuous/node6/test.cfg
.kokoro/continuous/node8/common.cfg
.kokoro/continuous/node8/docs.cfg
.kokoro/continuous/node8/lint.cfg
.kokoro/continuous/node8/samples-test.cfg
.kokoro/continuous/node8/system-test.cfg
.kokoro/continuous/node8/test.cfg
.kokoro/docs.sh
.kokoro/lint.sh
.kokoro/presubmit/node10/common.cfg
.kokoro/presubmit/node10/test.cfg
.kokoro/presubmit/node11/common.cfg
.kokoro/presubmit/node11/test.cfg
.kokoro/presubmit/node6/common.cfg
.kokoro/presubmit/node6/test.cfg
.kokoro/presubmit/node8/common.cfg
.kokoro/presubmit/node8/docs.cfg
.kokoro/presubmit/node8/lint.cfg
.kokoro/presubmit/node8/samples-test.cfg
.kokoro/presubmit/node8/system-test.cfg
.kokoro/presubmit/node8/test.cfg
.kokoro/presubmit/windows/common.cfg
.kokoro/presubmit/windows/test.cfg
.kokoro/samples-test.sh
.kokoro/system-test.sh
.kokoro/test.bat
.kokoro/test.sh
.kokoro/trampoline.sh
.nycrc
CODE_OF_CONDUCT.md
codecov.yaml
�[35msynthtool > �[36mCleaned up 2 temporary directories.�[0m
Changed files:
On branch autosynth
nothing to commit, working tree clean
Traceback (most recent call last):
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 166, in <module>
main()
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 151, in main
commit_changes(pr_title)
File "/tmpfs/src/git/autosynth/autosynth/synth.py", line 95, in commit_changes
subprocess.check_call(["git", "commit", "-m", message])
File "/home/kbuilder/.pyenv/versions/3.6.1/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'commit', '-m', '[CHANGE ME] Re-generated to pick up changes in the API or client library generator.']' returned non-zero exit status 1.
Google internal developers can see the full log here.
The incoming JSON object does not contain a client_email field
at JWT.fromJSON (/node_modules/google-auth-library/build/src/auth/jwtclient.js:193:19)
at GoogleAuth._cacheClientFromJSON (/node_modules/google-auth-library/build/src/auth/googleauth.js:313:16)
at ReadStream.inputStream.setEncoding.on.on.on (/node_modules/google-auth-library/build/src/auth/googleauth.js:347:36)
Though I'm providing correct project id, it is saying invalid api key
I have labeled "should batch translate the input text with a glossary" as flaky, since it's been failing on and off -- we should dig into the underlying issue or remove the test.
see: #363
Recommend Projects
-
-
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
An Open Source Machine Learning Framework for Everyone
-
The Web framework for perfectionists with deadlines.
-
A PHP framework for web artisans
-
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
Some thing interesting about web. New door for the world.
-
A server is a program made to process requests and deliver data to clients.
-
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Some thing interesting about visualization, use data art
-
Some thing interesting about game, make everyone happy.
-
Recommend Org
-
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Open source projects and samples from Microsoft.
-
Google ❤️ Open Source for everyone.
-
Alibaba Open Source for everyone
-
Data-Driven Documents codes.
-
China tencent open source team.
-