thisconnect / fildes Goto Github PK
View Code? Open in Web Editor NEWMagicless helps working with file descriptors
License: MIT License
Magicless helps working with file descriptors
License: MIT License
If fs.link
fails for the first time it tries to mkdirp
. If the path is on a file different Errors are thrown
On OS X: Error: ENOTDIR: not a directory, mkdir
On Windows: Error: EEXIST: file already exists, mkdir
link dest error
√ Error: EEXIST: file already exists, mkdir
√ is Error
× error.code is ENOTDIR
------------------------
operator: equal
expected: 'ENOTDIR'
actual: 'EEXIST'
√ error.syscal is mkdir
3.2.0
to 3.3.0
.This version is covered by your current version range and after updating it in your project the build failed.
codecov 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.
Added pipe --pipe
, -l
The new version differs by 21 commits.
d81c4f4
Merge pull request #111 from TomSputz/pipe
aa5a2b0
feat(services): add Cirrus CI (#117)
00d484b
v3.2.0
ad51194
Satisfy ESLint configuration
5f2d0e6
Fixed path to npm bin folder
afcf3e5
Fixed merge conflicts
145cb46
updated PR with changes from upstream
2b2ad02
merge package-lock.json from upstream
bf0c751
added documentation
9445f72
fixed wrong fixture file names
348cf7b
lock dependencies
fbf17d2
remove timer because slow CI servers need more than half a second before data is flowing - switch to use --pipe or -l as signal to codecov to recieve data via stdin
b145b19
Merge branch 'master' into pipe
d460065
check if the stale state was due to using the data event instead of the readable event
e8ca9ed
be very explicit about exiting process and clearing timeout
There are 21 commits in total.
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
14.0.0
to 14.1.0
.This version is covered by your current version range and after updating it in your project the build failed.
nyc 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.
The new version differs by 15 commits.
c5d90fa
chore(release): 14.1.0
5cc05f4
chore: Update dependencies
1e39ae1
chore: Refresh snapshots, update test/config-override.js to use helpers (#1085)
3d9eaa4
fix: Purge source-map cache before reporting if cache is disabled. (#1080)
132a074
feat: Add support for env.NYC_CONFIG_OVERRIDE (#1077)
6fc109f
chore: node.js 12 compatibility for object snapshot test. (#1084)
a7bc7ae
fix: Use correct config property for parser plugins (#1082)
600c867
chore: Convert some tap tests to run parallel and use snapshots. (#1075)
56591fa
docs: instrument docs update [skip ci] (#1063)
ca84c42
docs(codecov): favour npx over installing locally [skip ci] (#1074)
85c1eac
chore: Add test for nyc --no-clean
. (#1071)
21fb2c8
fix: Exit with code 1 when nyc doesn't know what to do. (#1070)
0f745ca
chore: Use class to declare NYC (#1069)
ca37ffa
feat: add support for yaml configuration file (#1054)
c4fcf5e
fix: Do not crash when nyc is run inside itself. (#1068)
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Regarding https://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback
fildes.open
should mkdir when flag is 'w', 'w+', 'a' and 'a+'
in this case
Expected EPERM instead of EACCES, for fs.access
Test fail on Window 10 with Node.js 5.3.0
stats
√ Error: EPERM: operation not permitted, access
× error.code is EACCES
-----------------------
operator: equal
expected: 'EACCES'
actual: 'EPERM'
√ should be equal
× should not pass
------------------
operator: fail
× .end() called twice
----------------------
operator: fail
1.14.2
to 1.14.3
.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.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
https://travis-ci.org/thisconnect/nodegit-kit/builds/89676720
> [email protected] test /home/travis/build/thisconnect/nodegit-kit
> tape ./test/test.js | tap-spec
/home/travis/build/thisconnect/nodegit-kit/node_modules/nodegit/lib/nodegit.js:13
throw ex;
^
Error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.17' not found (required by /home/travis/build/thisconnect/nodegit-kit/node_modules/nodegit/build/Release/nodegit.node)
at Error (native)
at Object.Module._extensions..node (module.js:460:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/home/travis/build/thisconnect/nodegit-kit/node_modules/nodegit/lib/nodegit.js:8:12)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
✖ No tests found
npm ERR! Test failed. See above for more details.
The command "npm test" exited with 1.
Done. Your build exited with 1.
Branch | Build failing 🚨 |
---|---|
Dependency | nyc |
Current Version | 11.1.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As nyc is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
The new version differs by 7 commits.
b2ff72d
chore(release): 11.2.0
97b962e
chore: explicit update of istanbul-lib-instrument (#662)
0dcceda
feat: allow cwd to be configured see #620
0fc6d8f
chore: add support for --cwd (#542) (#620)
658dba4
fix: remove excluded files from coverage before writing (#649)
dd40dc5
feat: add possibility to filter coverage-maps (#637)
fb3ab92
docs: add link to community slack (#639)
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Branch | Build failing 🚨 |
---|---|
Dependency | eslint |
Current Version | 4.5.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
The new version differs by 31 commits.
8f01a99
4.6.0
c0acbf2
Build: changelog update for 4.6.0
56dd769
Docs: fix link format in prefer-arrow-callback.md (#9198)
6becf91
Update: add eslint version to error output. (fixes #9037) (#9071)
0e09973
New: function-paren-newline rule (fixes #6074) (#8102)
88a64cc
Chore: Make parseJsonConfig() a pure function in Linter (#9186)
1bbac51
Fix: avoid breaking eslint-plugin-eslint-comments (fixes #9193) (#9196)
3e8b70a
Fix: off-by-one error in eslint-disable comment checking (#9195)
73815f6
Docs: rewrite prefer-arrow-callback documentation (fixes #8950) (#9077)
0d3a854
Chore: avoid mutating report descriptors in report-translator (#9189)
2db356b
Update: no-unused-vars Improve message to include the allowed patterns (#9176)
8fbaf0a
Update: Add configurability to generator-star-spacing (#8985)
8ed779c
Chore: remove currentScopes property from Linter instances (refs #9161) (#9187)
af4ad60
Fix: Handle error when running init without npm (#9169)
4b94c6c
Chore: make parse() a pure function in Linter (refs #9161) (#9183)
There are 31 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Branch | Build failing 🚨 |
---|---|
Dependency |
make-dir
|
Current Version | 1.2.0 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
make-dir 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.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Error: ENAMETOOLONG: name too long, mkdir /Users/admin/source/xggd-gaailio/daua/kelksm3kjncsoidncoier/resources/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/youland/coroga/goliuiithin-emgoeru-miu-uieco-yu-axuauuaing/suory/21699130
Branch | Build failing 🚨 |
---|---|
Dependency | codecov |
Current Version | 2.3.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
codecov 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.
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 | prettier |
Current Version | 1.8.1 |
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.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
3.1.0
to 3.2.0
.This version is covered by your current version range and after updating it in your project the build failed.
codecov 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.
The new version differs by 3 commits.
e427d90
feat(services): add azure pipelines (#114)
023d204
Use small HTTP dependency (#110)
500f308
Update Readme
See the full diff
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
fs.write / fildes.write with 'w' flag does not create a new directory.
Error: ENOENT: no such file or directory, open
Branch | Build failing 🚨 |
---|---|
Dependency | eslint-plugin-prettier |
Current Version | 2.2.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-plugin-prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
The new version differs by 6 commits.
cdd1a83
Build: update package.json and changelog for v2.3.0
bc89153
Update: Support .prettierrc config files (fixes #46) (#55)
95f0808
Docs: .eslintrc.json > .eslintrc (#52)
c777111
Upgrade: jest-docblock to ^21.0.0 (#50)
56deffa
Chore: upgrade prettier to ^1.6.1 (#49)
5ea0526
Chore: use eslint-plugin-self for linting (#47)
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Branch | Build failing 🚨 |
---|---|
Dependency | eslint-plugin-promise |
Current Version | 3.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-promise 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.
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 | prettier-eslint-cli |
Current Version | 4.2.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As prettier-eslint-cli is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
<a name"4.2.2">
The new version differs by 1 commits.
0238687
fix: Bumped eslint, prettier-eslint to latest with updates (#97)
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Test EISDIR: illegal operation on a directory, open for writeFile when writing a file on a directory.
var file = require('fildes');
file.writeFile('./this/is/a/directory', 'should thorw an EISDIR Error')
.catch(function(error){
console.error(error);
});
Allow calling fildes read without a buffer.
file.read(path, {
'offset': 0,
'length': 3
})
Branch | Build failing 🚨 |
---|---|
Dependency | eslint |
Current Version | 4.1.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
indent
internal functions (#8800) (Teddy Katz)The new version differs by 7 commits.
1df6a01
4.1.1
79a4482
Build: changelog update for 4.1.1
f307aa0
Fix: ensure configs from a plugin are cached separately (fixes #8792) (#8798)
8b48ae8
Docs: Add doc on parser services (fixes #8390) (#8795)
0d041e7
Fix: avoid crashing when using baseConfig with extends (fixes #8791) (#8797)
03213bb
Chore: improve comment explanation of indent
internal functions (#8800)
d2e88ed
Chore: Fix misleading comment in ConfigCache.js (#8799)
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Line 24 in eb9f553
write buffer at position
✔ file written
✖ should be equal
------------------
operator: equal
expected: 'foo bar bOz'
actual: '\x00\x00\x00\x00\x00\x00\x00\x00bOz'
fs.ftruncate, fs.fchown, fs.fchmod, fs.futimes, fs.fsync
Branch | Build failing 🚨 |
---|---|
Dependency | prettier |
Current Version | 1.10.0 |
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.
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 |
prettier
|
Current Version | 1.13.1 |
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.
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 | prettier |
Current Version | 1.5.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
I want to give a special shout out to @azz who has been maintaining the repository and implementing a bunch of the changes in this release as I had less time to devote to prettier due to vacation and switching team :)
Since the very first release of prettier, people have asked for a .prettierrc
file. We've been trying to have as few options as possible and tried to avoid being one more .dotfile
that you have to have when starting a new project.
But, the truth is, we need to have some way to configure prettier that can be kept in sync with all the integrations. By not having one, we pushed the problem to them and saw a bunch of incompatible ways of handling the problem. So now, it's handled by prettier itself.
// .prettierrc { "trailingComma": "es5", "singleQuote": true }
For more information on configuration file support, see the README.
Along with telling what configuration to use, you can write a file .prettierignore
to tell which files not to convert.
# .prettierignore
dist/
package.json
The last big friction point from people trying to adopt prettier was around how JSX was being printed. We went through all the issues that were raised and made a bunch of changes:
// Before const Component = props => <div> Hello {props.name}! </div>;// After
const Component = props => (
<div>
Hello {props.name}!
</div>
);
// Before <div> {props.isVisible ? <BaseForm url="/auth/google" method="GET" /> : <Placeholder />} </div>;// After
<div>
{props.isVisible ? (
<BaseForm
url="/auth/google"
method="GET"
/>
) : (
<Placeholder />
)}
</div>
// Before <div> {props.isVisible && <BaseForm url="/auth/google" method="GET" />} </div>;// After
<div>
{props.isVisible && (
<BaseForm
url="/auth/google"
method="GET"
/>
)}
</div>
Hopefully this is going to be more in line with how the majority of the community is writing JSX and we can have prettier be used in more place ;)
With JSX, we started by respecting a lot of line breaks that were in the original source. This had the advantage of doing fewer changes to your codebase but chipped away the value of a consistent pretty printer as the same semantic code could be written in two ways.
During each new release we've tightened this and made decisions around how to always print a piece of code. The latest of those is what happens if there's a single child in a JSX object, we're now always going to inline it.
// Before return ( <div> {this.props.test} </div> ); return <div>{this.props.test}</div>;// After
return <div>{this.props.test}</div>;
return <div>{this.props.test}</div>;
Leading JSX empty spaces are now on their own line. It looked weird to have them before a tag as it "indented" it differently compared to the rest.
// Before <span className="d1"> {' '}<a href="https://github.schibsted.io/finn/troika" className="link" /> </span>// After
<span className="d1">
{' '}
<a
href="https://github.schibsted.io/finn/troika"
className="link"
/>
</span>
We used to use a strict JSON parser that would throw if there was a comment or a trailing comma. This was inconvenient as many JSON files in practice are parsed using JavaScript or json5 that are not as strict. Now, we have relaxed this and are using the JavaScript parser to parse and print JSON. This means that comments will be maintained if there were some.
Note that this is purely additive, if your original file was JSON compliant, it will keep printing a valid JSON.
// Before Syntax error// After
{ / some comment / "a": 1 }
Parenthesis are a hot topic because they are not part of the AST, so prettier ignores all the ones you are putting and re-creating them from scratch. We went through all the things that people reported and came up with a few edge cases that were very confusing when comparisons were chained and %
was mixed with *
or /
.
One thing that we are not changing is the fact that we remove extra parenthesis around combinations of basic arithmetic operators: +-*/
.
// Before x !== y === z; x * y % z;// After
(x !== y) === z;
(x * y) % z;
It's useful to be able to ignore pieces of JSX, it's now possible to add a comment inside of a JSX expression to ignore the formatting of the next element.
// Before <Component> {/*prettier-ignore*/} <span ugly format="" /> </Component>// Before
<Component>
{/prettier-ignore/}
<span ugly format='' />
</Component>
In order to support some edge cases, in the internals, we have the ability to avoid printing comments in a generic way and print them in the call site instead. It turns out that when we used prettier-ignore
, we didn't print the comments at all! This is now fixed.
// Before push( <td> :) </td>, );// After
push(
// prettier-ignore
<td> :)
</td>,
);
It took 6 months for someone to report that do-while were broken when the while condition is multi-line, it confirms my hunch that this construct is not widely used in practice.
// Before do {} while ( someVeryLongFunc( someVeryLongArgA, someVeryLongArgB, someVeryLongArgC ) );// After
do {} while (
someVeryLongFunc(
someVeryLongArgA,
someVeryLongArgB,
someVeryLongArgC
)
);
Another underused feature of JavaScript is sequence expressions. We used to do a bad job at printing them when they would go multi-line, this has been corrected :)
// Before (a = b ? c : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll"), (a = b ? c : "lllllllllllllllllllllll");// After
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll'),
(a = b ? c : 'lllllllllllllllllllllll')
We took the stance with prettier to remove all the trailing whitespaces. We used to not touch comments because it's user generated, but that doesn't mean that they should have whitespace :)
// Before // There is some space here ->______________// After
// There is some space here ->
Our handling for comments inside of the class declaration was very naive, we would just move all the comments to the top. We now are more precise and respect the comments that are interleaved inside of decorators and around extends
.
// Before // A // B // C @Foo() @Bar() class Bar {}// After
// A
@Foo()
// B
@Bar()
// C
class Bar {}
Bind expressions are being discussed at TC39 and we figured we could print it with prettier. We used to be very naive about it and just chain it. Now, we use the same logic as we have for method chaining with the .
operator for it. We also fixed some edge cases where it would output invalid code.
// Before observable::filter(data => data.someTest)::throttle(() => interval(10)::take(1)::takeUntil(observable::filter(data => someOtherTest)) )::map(someFunction);// After
observable
::filter(data => data.someTest)
::throttle(() =>
interval(10)::take(1)::takeUntil(observable::filter(data => someOtherTest))
)
::map(someFunction);
It's being discussed at TC39 to be able to make the argument of a catch(e)
optional. Let's make sure we can support it in prettier if people use it.
// Before Syntax error// After
try {} catch {}
Another new proposal being discussed at TC39 is an optional chaining syntax. This is currently a stage 1 proposal, so the syntax may change at any time.
obj?.prop // optional static property access obj?.[expr] // optional dynamic property access func?.(...args) // optional function or method call
Comments are tricky to get right, but especially when they have meaning based on where they are positioned. We're now special casing the way we deal with comments used as type cast for Closure Compiler such that they keep having the same semantics.
// Before let assignment /** @type {string} */ = getValue();// After
let assignment = /** @type {string} */ (getValue());
It looks kind of odd to have a computed property lookup on the next line, so we added a special case to inline it.
// Before data [key]('foo') .then(() => console.log('bar')) .catch(() => console.log('baz'));// After
data[key]('foo')
.then(() => console.log('bar'))
.catch(() => console.log('baz'));
The flow team introduced two very exciting features under a new syntax. We now support them in prettier. I've personally been waiting for opaque types for a veerrryyyy long time!
// Before Syntax error// After
opaque type ID = string;
export type * from "module";
We've been doing this on JavaScript objects since the early days of prettier but forgot to apply the same thing to Flow and TypeScript types.
// Before type A = { "string": "A"; }// After
type A = {
string: "A";
}
Oopsy, we were dropping the generic in this very specific case.
// Before type myFunction = A => B;// After
type myFunction = <T>(A) => B;
Parenthesis... someday we'll get all of them fixed :)
// Before const actionArray: () => void[] = [];// After
const actionArray: (() => void)[] = [];
TypeScript 2.5 RC was recently announced, allowing you to use the upcoming "optional catch binding" syntax in TypeScript, too. 🎉
// Before namespace global { export namespace JSX { } }// After
global {
export namespace JSX {}
}
Thanks to the untyped and permissive nature of JavaScript, we've been able to concat undefined to a string and get some interesting code as a result. Now fixed for this case :)
// Before <undefined.Author />// After
<this.Author />
We want to make sure that all the special cases that we added for JavaScript and Flow also work for TypeScript constructs. In this case, objects should also hug if they are wrapped in a as
operator.
// Before const state = JSON.stringify( { next: window.location.href, nonce, } as State );// After
const state = JSON.stringify({
next: window.location.href,
nonce,
} as State);
Most of the time we add parenthesis for correctness but in this case, we added them for nothing, so we can just get rid of them and have a cleaner code :)
// Before (<x>a) || {};// After
<x>a || {};
Yet another case of missing parenthesis. Thankfully we're getting very few of them nowadays and they are for extremely rare edge cases.
// Before foo.bar as Baz = [bar];// After
(foo.bar as Baz) = [bar];
The declare
keyword doesn't do anything for interface
so we never put it there. However, it felt weird if you were in a declaration file and seeing everything have declare
before it except for interfaces. So now we reprint declare
if it was there in the first place.
// Before interface Dictionary<T> { [index: string]: T }// After
declare interface Dictionary<T> {
[index: string]: T
}
In order to get a first version of CSS to ship, we kept string quotes as is. We are now respecting the singleQuote
option of prettier. The difficulty here was to make sure that we output correct code for all the crazy escapes, unicode characters, emoji, special rules like charset which only work with double quotes...
// Before div { content: "abc"; }// After
div {
content: 'abc';
}
Another place where we can reuse the logic we've done for JavaScript to improve CSS printing.
// Before border: 1px solid rgba(0., 0.0, .0, .3);// After
border: 1px solid rgba(0, 0, 0, 0.3);
I can never quite remember the rules behind quotes around attributes so we're now always putting quotes there.
// Before a[id=test] {}// After
a[id="test"] {}
// Before const header = css`.top-bar {background: black;margin: 0;position: fixed;}`// After
const header = css</span></span> <span class="pl-s"> .top-bar {</span> <span class="pl-s"> background: black;</span> <span class="pl-s"> margin: 0;</span> <span class="pl-s"> position: fixed;</span> <span class="pl-s"> }</span> <span class="pl-s"><span class="pl-pds">
;
styled-components has a lot of different variants for tagging template literals as CSS. It's not ideal that we've got to encode all those ways inside of prettier but since we started, might as well do it for real.
styled(ExistingComponent)` css: property; `;styled.button.attr({})
</span></span> <span class="pl-s"> border: rebeccapurple;</span> <span class="pl-s"><span class="pl-pds">
;
The CSS parsers we use do not give us a 100% semantic tree: in many occasions they bail and just give us what is being entered. It's up to us to make sure we clean this up while maintaining correctness. In this case, we just printed spaces between selectors as is but we know it's correct to always replace it by a single space.
// Before .hello.<span class="pl-smi">how</span><span class="pl-k">-</span>you<span class="pl-k">-</span>doin {
height: 42;
}// After
.hello .how-you-doin {
height: 42;
}Strip BOM before parsing (#2373) by @azz
I still have nightmares from dealing with BOM in a previous life. Thankfully, in 2017 it's no longer a big issue as most tooling is now aware of it. Thanks @azz for fixing an edge cases related to CSS parsing.
// Before [BOM]/* Block comment * html { content: "#{1}"; }// After [BOM]/* Block comment */ html { content: "#{1}"; }GraphQL
Add support for range-formatting GraphQL (#2319) by @josephfrazier
If you tried to use the range formatting feature in a GraphQL file, it would throw an exception, now it properly worked again and only reformats the piece you selected.
Add
.gql
file extension to be parsed as GraphQL (#2357) by @rrdelaneyAt Facebook, we use
.graphql
extension but it looks like it's common to have.gql
as well, doesn't cost a lot to support it in the heuristic that figures out what parser to use.CLI
Support multiple patterns with ignore pattern (#2356) by @evilebottnawi
It was already possible to have multiple glob patterns but they would be additive, with this change, you can add a glob pattern to ignore some files. It should be very handy to ignore folders that are deeply nested.
prettier --write '{**/*,*}.{js,jsx,json}' '!vendor/**'Make --list-different to work with --stdin (#2393) by @josephfrazier
This is a handy way of knowing if prettier would print a piece of code in a different way. We already had all the concepts in place, we just needed to wire them up correctly.
$ echo 'call ( ) ;' | prettier --list-different (stdin) $ echo $? 1Not sure how things should work exactly?
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
fs.chown
on Windows not supported, fs.stats
return 0 for uid
and gid
× TypeError: process.getuid is not a function
----------------------------------------------
operator: error
Node.js 5.3.0 on Windows 10
Support pos
, len
, off
that map to position
, length
, offset
. Truncate already supports len
.
files.write('./file.txt', 'bar', {
pos: 4
})
Check all methods accept flag
and flags
. Provice enc
for encoding
?
In Node.js v7.6.0
The path parameter can be a WHATWG URL object using file: protocol. Support is currently still experimental
3.4.0
to 3.5.0
.This version is covered by your current version range and after updating it in your project the build failed.
codecov 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.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
related nodejs/node#3718
Lines 132 to 152 in 57c415b
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
fs.writeFile
throws if directory does not exist ENOENT. fildes.writeFile
should catch ENOENT: no such file or directory Error and try to create the directory and try fs.writeFile
again.
var file = require('fildes');
file.writeFile('./dir/does/not/exist/yet/file.txt', 'will create parent directories')
.then(function(){
console.log('dir created and file written');
})
.catch(function(error){
console.error(error);
});
Node.js needs to run as administrator to be able to create symlinks,
see nodejs/node-v0.x-archive#2274
and nodejs/node-v0.x-archive#6342
symlink
× Error: EPERM: operation not permitted, symlink
node_modules\fildes\test\data\symlink\symlink.txt'
-------------------------------------------
----------------------------------------------
operator: error
expected: |-
undefined
actual: |-
{ [Error: EPERM: operation not permitted, symlink
node_modules\fildes\test\data\symlink\symlink.t
2\\test\\data\\symlink.txt', dest: 'c:\\Users\\
stack: |-
Branch | Build failing 🚨 |
---|---|
Dependency | eslint-config-prettier |
Current Version | 2.3.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-config-prettier is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
The new version differs by 4 commits.
68537d1
eslint-config-prettier v2.4.0
cd99265
Fix broken link in changelog
cd84a6b
Update dependencies
42dd938
Turn off function-paren-newline, introduced in ESLint v4.6.0 (#27)
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
Branch | Build failing 🚨 |
---|---|
Dependency | rimraf |
Current Version | 2.6.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As rimraf is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
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. 📊📈🎉
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.
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.