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.
Release Notes
1.9.0: JSX Fragments, EditorConfig and Arrow Parens
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.
Highlights
JavaScript
Option to add parens in arrow function arguments (#3324) by @rattrayalex and @suchipi
When printing arrow functions, Prettier omitted parens around the arguments if they weren’t strictly necessary, like so:
// no parens
foo => {};
// parens
(foo: Number) => {};
// parens
({ foo }) => {}
// parens
(foo = 5) => {}
This lead to the most commented thread in our issue tracker. Prettier now has the --arrow-parens
option (arrowParens
in the config) that can assume two values today:
"avoid"
- (default) preserve the behavior that omits parens when possible
"always"
- always includes parens
Prettier will now recognize and format JSX with the new fragment syntax, like the code below:
function MyComponent() {
return (
<>
<Children1 />
<Children2 />
<Children3 />
</>
);
}
Fix slow formatting long texts in JSX (#3268, #3273) by @duailibe
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.
Markdown
Add an option to preserve text line breaks (#3340) by @ikatyang
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.
In 1.9 we are releasing a new option proseWrap: "preserve"
which will respect the original line breaks of text, and lets the users decide where the text should break.
[WARNING] proseWrap
with boolean value is deprecated, use "always"
, "never"
or "preserve"
instead.
[BREAKING CHANGE] proseWrap
option now defaults to "preserve"
as some renderers are linebreak-sensitive.
GraphQL
Support top-level interpolations (#3370) by @lydell
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.
In 1.9 we format GraphQL queries with top-level interpolation:
gql`
query User {
user(id: "Bob") {
...UserDetails
}
}
${UserDetailsFragment}
`
(Prettier will continue to skip formatting if the interpolation is inside a query or mutation or so.)
Preserve intentional new lines in GraphQL (#3252) by @duailibe
Prettier will now respect intentional line breaks inside GraphQL queries (but limit to 1), where before it would remove them.
CSS
Don't lowercase element names and attribute names in selectors (#3317) by @lydell
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.
Configuration
It's taken a while, but Prettier will finally respect your .editorconfig
file. This includes:
indent_style
indent_size
/tab_width
max_line_length
The prettier
CLI respects .editorconfig
by default, but you can opt out with --no-editorconfig
.
However, the API doesn't respect .editorconfig
by default, in order to avoid potential editor integration issues (see here for details). To opt in, add editorconfig: true
to the prettier.resolveConfig
options.
Other changes
JavaScript
Don't break simple elements in JSX (#3250) by @duailibe
Prettier won't break an element with no attributes anymore, keeping elements like <br />
as an unit.
Don't break identifiers inside template literals expressions (#3299) by @duailibe
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:
const foo = `Hello ${username}. Today is ${month} ${day}. You have ${newMessages} new messages`.
Fix formatting of comment inside arrow function (#3334) by @jackyho112
Fixes an edge case where Prettier was moving comments around breaking tools like Webpack:
const API = {
loader: () => import('./test' /* webpackChunkName: "test" */),
};
// would get formatted to
const API = {
loader: (/ webpackChunkName: "test" /) => import("./test")
};
Fix printing of comments around decorators and class properties (#3382) by @azz
There was a case where comments between a decorator and a class property were moved to an invalid position.
// Before
class Something {
@decorator
static // comment
property = 1;
}
// After
class Something {
@decorator
// comment
static property = 1;
}
Flow
Do not break on empty type parameters (#3281) by @vjeux
It won't break empty type parameters (foo: Type<>
) anymore.
Add support for flow mixins when using babylon (#3391) by @bakkot
We were accidentally dropping flow mixins, this has been fixed, but only for the babylon
parser.
// Before
class Foo extends Bar {}
// After
class Foo extends Bar mixins Baz {}
TypeScript
Don't print a trailing comma after object rest spread (#3313) by @duailibe
This was inconsistent with JavaScript and Flow, Prettier won't print a trailing comma in the following cases, when using the TypeScript parser:
const {
bar,
baz,
...rest
} = foo;
Print parens around type assertions for decorators (#3329) by @azz
We were omitting parens around type assertions inside decorators:
@(bind as ClassDecorator)
class Decorated {}
Markdown
Don't break inlineCode
(#3230) by @ikatyang
Prettier won't break text inside inlineCode
meaning it will only break of after it.
No extra whitespace between non-CJK and CJK-punctuation and vice-versa (#3244, #3249) by @ikatyang
Fixes cases where Prettier would insert extra whitespace like in the following examples:
扩展运算符(spread )是三个点(`...`)。
This is an english paragraph with a CJK quote " 中文 ".
Escape all emphasis-like text (#3246) by @ikatyang
Fixes the case where \_\_text\_\_
would be formatted as __text__
.
Handle punctuation variants (#3254) by @ikatyang
Prettier now considers not only ASCII punctuation characters but Unicode as well.
Support TOML front matter (#3290) by @ikatyang
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.
+++
date: '2017-10-10T22:49:47.369Z'
title: 'My Post Title'
categories: ['foo', 'bar']
+++
This is the markdown body of my post.
Only indent the first non-list node in checkbox list item (#3297) by @ikatyang
Fixes a bug where it would indent lines after a list when it shouldn't:
* 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 🌴
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
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)
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'
}
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!
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 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 🌴
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.
The release PR #187 is still in a pending state after several hours
Would be great if there were types for @google-cloud/translate
as there is @types/google-cloud__storage
.
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.
Branch
|
Build failing 🚨
|
Dependency
|
eslint-plugin-prettier
|
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.
eslint-plugin-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: node7 Your tests passed on CircleCI! Details
- ✅ ci/circleci: node8 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: node9 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 4 commits.
d772dfa
Build: update package.json and changelog for v2.6.0
9e0fb48
Update: Add option to skip loading prettierrc (#83)
e5b5fa7
Build: add Node 8 and 9 to Travis
1ab43fd
Chore: add test for vue parsing
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 🌴
☝️ 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 🌴
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 🌴
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 🌴
Got to make sure it passes first :)
☝️ 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 🌴
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.
-