itgalaxy / imagemin-power-cli Goto Github PK
View Code? Open in Web Editor NEWOptimize (compress) images with power using imagemin :muscle:
License: MIT License
Optimize (compress) images with power using imagemin :muscle:
License: MIT License
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-jsx-a11y |
Current Version | 5.0.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-jsx-a11y 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 πͺ
Swapped Array.includes
for array-includes
polyfill to support node versions <4
The new version differs by 3 commits0.
bf0ac6a
5.0.1
fb8c626
Upgrade all dependencies.
fb5b87a
Fix: backward compatibility with node.js v4 and v5. (#231)
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
4.1.3
to 4.1.4
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
npm-run-all 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 | file-type |
Current Version | 4.2.0 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
file-type is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
The new version differs by 5 commits0.
95a95a7
4.3.0
1cb2a97
Add more variations of QuickTime file format (#81)
1e28362
Add offset option to the magic checker and simplify
c4025ba
Simplify signature checking
441eb47
Check the entire PNG signature
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
7.11.1
to 7.12.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-react 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.
no-typos
: Support createClass (#1828, @alexzherdev)jsx-indent
: add checkAttributes
option for JSX attribute indentation (#2086, @jomasti)propWrapperFunctions
setting values (#2065, @jomasti)jsx-fragments
rule to enforce fragment syntax (#1994, @alexzherdev)jsx-no-literals
: print node value in warning message (#2008, @jlgonzalezdev)jsx-max-depth
: Fix depth of JSX siblings in a JSXEpressionContainer (#1824, @alexzherdev)no-array-index-key
: fix in React.Children methods (#2085, @himynameisdave)no-unused-state
: handle functional setState (#2084, @jomasti)no-deprecated
: Disable legacy lifecycle methods linting for now (#2069, @sergei-startsev)forbid-foreign-prop-types
: ensure allowInPropTypes
option applies to class fields (#2040, @Sheile)jsx-wrap-multilines
: catch single missing newlines (#1984, @MrHen)jsx-first-prop-new-line
: Fix for parsers (like TypeScript) (#2026, @HauptmannEck)jsx-sort-comp
][]: Fix fixer in case of more than 10 props (#2012, @tihonove)no-unused-state
Don't depend on state parameter name ([#1829][], @alexzherdev)no-this-in-sfc
fix for class properties (#1995, @sergei-startsev)no-this-in-sfc
fix rule behavior for arrow functions inside a class field (#1989, @sergei-startsev)destructuring-assignment
: handle nested props usage (#1983, @alexzherdev)sort-prop-types
: fix string property order (#1977, @metreniuk)jsx-no-target-blank
: donβt crash when thereβs no value (#1949, @ljharb)prop-types
, no-unused-prop-types
: better handle object spread (#1939, @alexzherdev)jsx-fragments
: improve message text (#2032, @alexzherdev)no-unsafe
: handle all unsafe life-cycle methods (#2075, @sergei-startsev)require-default-props
: Change error message naming from singular defaultProp to plural defaultProps (#2064, @jseminck)propTypes
detection (#1946, @alexzherdev)defaultProps
detection (#1942, @alexzherdev)propTypes
detection (#2001, @alexzherdev)no-did-mount-set-state
, no-did-update-set-state
, no-will-update-set-state
: fix docs URLs (#2090, @JBallin)jsx-sort-props
: Fix small mistake (#2044, @dimitarnestorov)no-unescaped-entities
: add more escape examples (#2015, @stevemao)display-name
: mention default ignoreTranspilerName
value (#2002, @OliverJAsh)jsx-no-target-blank
: Add full example (#1988, @atomcorp)jsx-no-target-blank
.md (#1953, @brunocoelho)require('babel-eslint')
from tests (#2004, @sergei-startsev)prop-types
: Add tests for prop-types destructuring (#2029, @sstern6)display-name
: add false positive component detection for destructured createElement (#1098, @arian)The new version differs by 127 commits.
a83d65c
Update CHANGELOG and bump version
0c6160e
[Dev Deps] update coveralls
, babel-eslint
, typescript
cd6c8e6
[Deps] update resolve
d2b5b73
Merge pull request #1828 from alexzherdev/1721-no-typos-create-class
e747459
[Tests] remove node 5/7/9, add node 11
b33ae84
Merge pull request #1098 from arian/createElement-display-test
84be80a
Merge pull request #1824 from alexzherdev/1762-jsx-max-depth-false-positive
a442067
Merge pull request #2029 from sstern6/issue1422
7d07c37
Merge pull request #2032 from alexzherdev/jsx-fragments-message
8c6a8e2
Merge pull request #2089 from jomasti/feature/support-react-forwardref-memo
14451d4
Merge pull request #2085 from himynameisdave/issues/2083
8be52c7
π Addresses CR comments
f7e3121
Merge branch 'master' of https://github.com/yannickcr/eslint-plugin-react into issues/2083
77e3fd0
Merge pull request #2090 from JBallin/no-method-set-state-docs-url
7da9e0d
Fix noMethodSetState docsUrl's
There are 127 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-lodash |
Current Version | 2.3.4 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-plugin-lodash 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | coveralls |
Current Version | 2.11.15 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As coveralls 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 13 commits .
8dfcfd6
version bump
4bc93ac
Merge branch 'master' of github.com:nickmerwin/node-coveralls
671acca
removed codeship badge
f390392
Merge pull request #152 from ndaidong/master
de968b0
Merge pull request #147 from hyperlink/update-request-dep
72a4046
Merge pull request #154 from a0viedo/patch-1
87b27f7
Merge pull request #142 from Hirse/feature/travis-pr
3edbecb
Merge pull request #155 from kasperlewau/master
d117e3d
reenable drone
dd230f6
don't hardcode minor version
cc0882d
Update outdate dependencies
99edf1a
Fix node-uuid deprecation by updating request dependency
f94b647
Get PR number from TRAVIS
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
21.22.0
to 21.22.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jest 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.
fdce162
fix(no-disabled-tests): fix false positives for pending() usage (#155)
1361d59
chore: simplify semantic-release a bit (#153)
f4850a3
chore(docs): fixed typo (#142)
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 π΄
1.14.2
to 1.14.3
.π¨ View failing branch.
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.
π Changelog
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 | imagemin |
Current Version | 5.2.2 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
imagemin is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
The new version differs by 5 commits0.
986e095
5.3.0
2310105
Minor tweaks
543437f
Meta tweaks and bump dependencies
4a8b040
Don't recommend mozjpeg in the readme example (#201)
3e2a9f6
Remove mozjpeg option from the example code
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
2.14.0
to 2.15.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-import 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 34 commits.
767f01a
bump to v2.15.0
038d668
bump webpack resolver to v0.11.0
20a8f3b
bump utils to v2.3.0
1e4100d
changelog note for #1261
548ea02
added support for argv parameter of webpack`s config-as-a-function (#1261)
fcf2ce7
Merge pull request #1254 from ljharb/travis
64d9be7
allow_failures for dicey Node/ESLint intersection
73080d0
dep-time-travel: use older versions of dependencies
05c3935
repair no-deprecated
for ESLint* 5
10c9811
node 4 fix for test util
f165237
ah geez, bumping babel-eslint breaks no-amd/no-cjs
acfb6e9
jk, test against eslint 2/3 but skip Typescript tests.
b686f9d
drop ESLint 2/3 from Travis/Appveyor
cf1f6f4
[Deps] update debug
, eslint-import-resolver-node
, has
, lodash
, minimatch
, resolve
d290a87
[Dev Deps] update babylon
, coveralls
, eslint-import-resolver-typescript
, gulp
, linklocal
, nyc
, redux
, rimraf
, sinon
, typescript-eslint-parser
There are 34 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-import |
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-plugin-import 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 10 commits.
44ca158
update utils changelog
a3728d7
bump eslint-module-utils to v2.1.0
3e29169
bump v2.4.0
ea9c92c
Merge pull request #737 from kevin940726/master
8f9b403
fix typos, enforce type of array of strings in allow option
95315e0
update CHANGELOG.md
28e1623
eslint-module-utils: filePath in parserOptions (#840)
2f690b4
update CI to build on Node 6+7 (#846)
7d41745
write doc, add two more tests
dedfb11
add allow glob for rule no-unassigned-import, fix #671
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
2.6.2
to 2.7.0
.π¨ View failing branch.
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.
The new version differs by 3 commits.
869f56d
Build: update package.json and changelog for v2.7.0
38537ba
Update: Support prettierignore and custom processors (#111)
047dc8f
Build: switch to release script package
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 π΄
6.1.1
to 6.1.2
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-plugin-jsx-a11y 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.
6.1.2 / 2018-10-05
[fix] Add link-type styling recommendation to anchor-is-valid #486
[fix] label-has-for: textareas are inputs too #470
The new version differs by 12 commits.
c538d35
6.1.2
ea964b1
Update changelog
43d1d94
Add link-type styling recommendation to anchor-is-valid
71819a0
[Docs] accessible-emoji
: plural of emoji is emoji
4a0608b
[Docs] label-has-associated-control
: update label id
9957219
[Tests] temporarily allow node 4 + eslint 4 to fail
969ce6d
[Dev Deps] add missing dev dep
1be1744
[Tests] use nvm install-latest-npm
9103c7a
[Tests] add additional test case for #474
bbad58a
Merge pull request #471 from ljharb/textarea
47633fb
[Fix] label-has-for
: textarea
s are inputs too
c1bf3c1
Update aria-props.md to link to the correct doc
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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | babel-cli |
Current Version | 6.22.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As babel-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 πͺ
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-node |
Current Version | 4.0.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-node 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-ava |
Current Version | 4.0.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-plugin-ava 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 .
c2235d8
4.1.0
c65eaa7
(#169) Support t.snapshot()
d2f1c4d
Fix unsupported syntax since AVA 0.18
c5194b6
Bump dependencies
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
2.6.2
to 2.6.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
rimraf 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 6 commits.
9442819
2.6.3
42fe369
autopublish scripts
21fd3df
bin test
8f1d3a1
update tap and glob for security stuff
f0bc3a1
update tap, add package-lock
692022b
travis node version updates
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 π΄
Hi guys,
I have problem with recursive saving. I want omit source folder of the tree - in my case front
folder.
Using:
{
"scripts": {
"postinstall": "npm run build",
"build": "npm run sass && npm run autoprefixer && npm run images",
"sass": "node-sass -r -x --output-style compressed ./front/sass/ -o ./public/dist/css/",
"watch": "onchange './front/sass/*' -- npm run build",
"autoprefixer": "postcss -u autoprefixer --autoprefixer.browsers '> 5%, ie 9' -r ./public/dist/*",
"images": "imagemin-power -rvd ./ front/images/**/* --out-dir=public/dist/images"
},
"devDependencies": {
"autoprefixer": "^8.5.0",
"imagemin-power-cli": "^3.0.0",
"node-sass": "^4.9.0",
"onchange": "^4.0.0",
"postcss-cli": "^5.0.0"
}
}
CLI output:
$ npm run images
> [email protected] images /Users/michal.landsman/localhost/pp/report
> imagemin-power -rvd ./ front/images/**/* --out-dir=public/dist/images
β Minifying image "front/images/email/footer.png" (1 of 5) - saved 361 B - 59.5%...
β Minifying image "front/images/venue_report/logo_picto.svg" (2 of 5) - saved 36 B - 6.5%...
β Minifying image "front/images/email/company_logo.png" (3 of 5) - saved 83 B - 2.2%...
β Minifying image "front/images/venue_report/company_logo_white.png" (4 of 5) - saved 83 B - 2.2%...
β Minifying image "front/images/email/frantisek.png" (5 of 5) - already optimized...
βΉ Successfully compressed images: 5. Unsuccessfully compressed images: 0. Total images: 5. Total images size: 52.6 kB. Total saved size: 563 B - 1.0704032549384945%.
Result tree folders:
front
βββ images
βΒ Β βββ email
βΒ Β βΒ Β βββ company_logo.png
βΒ Β βΒ Β βββ footer.png
βΒ Β βΒ Β βββ frantisek.png
βΒ Β βββ venue_report
βΒ Β βββ company_logo_white.png
βΒ Β βββ logo_picto.svg
public
βββ dist
βΒ Β βββ images
βΒ Β βββ front
βΒ Β βββ images
βΒ Β βββ email
βΒ Β βΒ Β βββ company_logo.png
βΒ Β βΒ Β βββ footer.png
βΒ Β βΒ Β βββ frantisek.png
βΒ Β βββ venue_report
βΒ Β βββ company_logo_white.png
βΒ Β βββ logo_picto.svg
Is that possible please?
EDIT:
This setup works for me: imagemin-power -rvd ./front/ images/**/* --out-dir=public/dist/
But I think that setup working directory is not expected by default, right?
Branch | Build failing π¨ |
---|---|
Dependency | prettier |
Current Version | 1.4.4 |
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 πͺ
This is the release I've been waiting for a very long time: one that has only minimal changes to JavaScript!
For the past 6 months, we kept doing changes to various aspects of printing JavaScript, with the hope that one day we would get to a stable place. No automated tool is going to print perfect code for all the possible edge cases. The goal is to find a good place where when people report code that is printed in a funny way, we can't make it better without making other pieces of code look worse, introduce behavior that's very hard to understand for humans and doesn't introduce some disproportionate complexity to the codebase.
We're not 100% there yet, but we're closer than ever!
Now that JavaScript needs for support is trending down, it's an opportunity to support other languages that front-end developers are working on and want formatted. We've introduced TypeScript and CSS in the last release and are doing a batch of fixes for them in this release. We're also adding support for new languages: GraphQL queries, embedding CSS-in-JS and JSON are now available in prettier!
Prettier is not only a useful tool but it's also a really cool piece of technology. @karl spent a bunch of time improving JSX support and in the process implemented a new primitive to prettier: fill
. He wrote a very interesting blog post Adding a new layout strategy to Prettier that I highly recommend reading if you're interested in how prettier is working behind the scenes.
Thanks to @stubailo, @jnwng, @tgriesser and @azz, prettier now supports printing GraphQL queries!
It works for .graphql
files and within JavaScipt templates that start with graphql
, graphql.experimental
and gql
in order to work with Relay and Apollo.
ReactDOM.render( <QueryRenderer query={graphql` query appQuery { viewer { ...TodoApp_viewer } } `} // ... />, mountNode );
Note that it only supports the open source syntax of GraphQL, therefore doesn't work with Relay Classic, it only works with Relay Modern.
If you are using styled-components or styled-jsx, prettier will now reformat the CSS inside of your template expressions.
const EqualDivider = styled.div` margin: 0.5rem; padding: 1rem; background: papayawhip; > * { flex: 1; &:not(:first-child) { ${props => (props.vertical ? "margin-top" : "margin-left")}: 1rem; } } `;
This was pretty straightforward to implement but nonetheless very useful. Thanks to @josephfrazier for doing it :)
{ "name": "prettier", "version": "1.5.0", "description": "Prettier is an opinionated JavaScript formatter", "bin": { "prettier": "./bin/prettier.js" } }
I'm really excited because we only put a few days to build the initial CSS support and it has worked surprisingly well. This release brings a handful of important improvements to CSS but nothing that required big changes.
The biggest unknown when printing CSS was how to deal with multiple selectors. The initial approach we took was to use the 80 columns rule where we would only split if it was bigger than that. Many people reported that they were using another strategy for this: always break after a ,
. It turns out that many popular codebases are using this approach and it feels good as you can see the structure of the selectors when layed out on-top of each others.
// Before .clusterPlannerDialog input[type="text"], .clusterPlannerDialog .uiTypeahead {// After
.clusterPlannerDialog input[type="text"],
.clusterPlannerDialog .uiTypeahead {
The concept of code formatting has blurry boundaries. The core aspect of it is around whitespaces but some things like single vs double quotes and semi-colons are usually bundled with it. With prettier on JavaScript, we also lightly reformat strings by removing extra \
and normalize numbers. For CSS, we need to do a similar interpretation of where the boundary ends. For colors, we decided to turn all the letters into lowercase and stop there. Turning rgb() into hex or 6 hex into 3 hex is out of scope.
// Before .foo { color: #AAA; -o-color: #fabcd3; -ms-color: #AABBCC; }// After
.foo {
color: #aa;
-o-color: #fabcd3;
-ms-color: #aabbcc;
}
The new fill primitive turned out to be very useful for CSS. For long values, instead of breaking and putting a \n
before every element, we can instead only put a \n
when it goes over the limit. It leads to much better looking code.
// Before border-left: 1px solid mix($warningBackgroundColors, $warningBorderColors, 50%);// After
border-left: 1px solid
mix($warningBackgroundColors, $warningBorderColors, 50%);
This is another small fix in the journey of properly supporting a new language. We now encode the ability to break on long @media
rules.
// Before @media all and (-webkit-min-device-pixel-ratio: 1.5), all and (-o-min-device-pixel-ratio: 3/2), all and (min--moz-device-pixel-ratio: 1.5), all and (min-device-pixel-ratio: 1.5) { }// After
@media all and (-webkit-min-device-pixel-ratio: 1.5),
all and (-o-min-device-pixel-ratio: 3/2),
all and (min--moz-device-pixel-ratio: 1.5),
all and (min-device-pixel-ratio: 1.5) {
}
Less and Scss are turning into real programming languages :) Step by step, we're starting to print all their constructs in the same way as JavaScript. This time, it's the else
placement.
// Before @if $media == phonePortrait { $k: .15625; } @else if $media == tabletPortrait { $k: .065106; }// After
@if $media == phonePortrait {
$k: .15625;
} @else if $media == tabletPortrait {
$k: .065106;
}
While we want prettier to format the entire codebase, there are times where we "know better" and want an escape hatch. This is where the prettier-ignore
comment comes in. It wasn't working for CSS but that was an oversight, now it is implemented :)
// Before foo { /* prettier-ignore */ thing: foo; -ms-thing: foo; }// After
foo {
/* prettier-ignore */
thing: foo;
-ms-thing: foo;
}
In order to be fast, many "packagers" do not parse files in order to extract dependencies but instead use a crude regex. This is a reason why we don't break long require()
calls and it happens to also affect CSS Modules. If you add new lines in the composes
field, it doesn't recognize it anymore. So we're no longer breaking it there, even if it goes over 80 columns.
// Before .reference { composes: selector from "a/long/file/path/exceeding/the/maximum/length/forcing/a/line-wrap/file.css"; }// After
.reference {
composes: selector from "a/long/file/path/exceeding/the/maximum/length/forcing/a/line-wrap/file.css";
}
We made a decision to have only a single high level "parser" for CSS, SCSS and Less even though we are using postcss-less
and postcss-scss
under the hood. We use a regex to figure out which parser to try first and fallback to the other one if a syntax error is thrown. Unfortunately, for certain features, the first (incorrect) parser doesn't throw and instead skips some elements. So, we need to beef up the regex to make sure we are right for the early detection.
Thankfully, this hack is working well in practice. If we find a lot more edge cases, we'll likely want to do the right thing(tm) and split them into two parsers.
// Before @import "text-shadow";// After
@import "rounded-corners", "text-shadow";
TypeScript support is now solid, all the changes for this release are small edge cases.
The core algorithm of prettier is to expand a group if all the elements do not fit. It works really well in practice for most of JavaScript but there's one case it doesn't handle very well is when there are two groups side by side, in this case: <Generics>(Arguments)
. We have to carefully create groups such that arguments expand first as this is generally what people expect.
// Before export const forwardS = R.curry(< V, T >(prop: string, reducer: ReducerFunction<V, T>, value: V, state: {[name: string]: T}) => R.assoc(prop, reducer(value, state[prop]), state) );// After
export const forwardS = R.curry(
<V, T>(
prop: string,
reducer: ReducerFunction<V, T>,
value: V,
state: { [name: string]: T }
) => R.assoc(prop, reducer(value, state[prop]), state)
);
For better or worse, we decided to manually handle adding parenthesis. So when a new operator is introduced, we need to make sure that we add correct parenthesis when nested with any other combination of operators. In this case, we missed await inside of TypeScript !
.
// Before const bar = await foo(false)!;// After
const bar = (await foo(false))!;
We use typescript-eslint-parser project that translates TypeScript AST into estree AST in order for prettier to print it. From time to time we're going to find edge cases that it doesn't handle yet. In this case, it didn't give a way to tell that there's an empty {}
, which apparently is important for TypeScript. Thankfully, the team is very responsive and they fixed it after we put a workaround inside of prettier.
// Before import from "@types/googlemaps";// After
import {} from "@types/googlemaps";
The code that implements interface
is shared with the code that prints object
s, which contains a rule to keep them expanded if there's a \n
inside. But, this is not the intended behavior for interfaces. We always want to expand, like we do for classes, even if it fits 80 columns.
// Before interface FooBar { [id: string]: number; }// After
interface FooBar {
[id: string]: number;
}
no-semi
and semi
are often requested but on the prettier team we're one step ahead and implemented two-semi
for you! Just kidding, it was a bug and is now fixed ;)
// Before declare module "classnames" { export default function classnames( ...inputs: (string | number | false | object | undefined)[] ): string;; }// After
declare module "classnames" {
export default function classnames(
...inputs: (string | number | false | object | undefined)[]
): string;
}
Adding a comment before a method used to take into account the comment length and would often expand the method when it wasn't expected. Thankfully, it was a simple fix, just wrap the output in a group
.
// Before interface TimerConstructor { // Line-splitting comment new ( interval: number, callback: (handler: Timer) => void ): Timer; }interface TimerConstructor {
// Line-splitting comment
new (interval: number, callback: (handler: Timer) => void): Timer;
}
This bug was very annoying if you ran into it: anytime you formatted the code, it would add one more _
to the object key!
// Before obj = { __: 42 ___: 42 };// After
obj = {
_: 42
__: 42
};
Unlike in JavaScript, TypeScript lets you extend multiple classes at once. It turns out that people use this feature and prettier now does a better job at printing it.
// Before export interface ThirdVeryLongAndBoringInterfaceName extends AVeryLongAndBoringInterfaceName, AnotherVeryLongAndBoringInterfaceName, AThirdVeryLongAndBoringInterfaceName {}// After
export interface ThirdVeryLongAndBoringInterfaceName
extends AVeryLongAndBoringInterfaceName,
AnotherVeryLongAndBoringInterfaceName,
AThirdVeryLongAndBoringInterfaceName {}
This one isn't very interesting, it's an edge case that's not properly handled in the TypeScript -> estree conversion.
// Before call(c => { bla: 1 }) || [];// After
call(c => ({ bla: 1 })) || [];
By supporting TypeScript, prettier is now being used in a lot of Angular codebases which exercises edge cases that were not properly handled. In this case, we didn't preserve empty lines after directives inside of a function.
// Before export default class { constructor($log, $uibModal) { "ngInject"; Object.assign(this, { $log, $uibModal });// After
export default class {
constructor($log, $uibModal) {
"ngInject";<span class="pl-c1">Object</span>.<span class="pl-en">assign</span>(<span class="pl-c1">this</span>, { $log, $uibModal });</pre></div>
JavaScript
This release is very light in terms of JavaScript changes, which is awesome. We're starting to see the light at the end of the tunnel and get towards a great pretty printer. We're never going to get to a 100% perfect automatic pretty printer. The goal is that for every issue we get, there are no clear ways to improve the way it is printed without regressing other pieces.
Allow JSX lines to be recombined (#1831) by @karl
The goal of prettier is to have a consistent way to format your code: given an AST, we always print the same way. In two places we had to compromise and read the original format: JSX and Objects. With this change, we're no longer relying on the original input for JSX with text inside. This lets us reflow text inside of JSX.
// Before const Abc = () => { return ( <div> Please state your {" "} <b>name</b> {" "} and {" "} <b>occupation</b> {" "} for the board of directors. </div> ); };// After
const Abc = () => {
return (
<div>
Please state your <b>name</b> and <b>occupation</b> for the board of
directors.
</div>
);
}Break on non-literal computed member expression (#2087) by @azz
Printing member chains is the most complicated piece of prettier and we keep finding small tweaks we can do to make it a better experience.
// Before nock(/test/) .matchHeader("Accept", "application/json")[httpMethodNock(method)]("/foo") .reply(200, { foo: "bar", });// After
nock(/test/)
.matchHeader("Accept", "application/json")
[httpMethodNock(method)]("/foo")
.reply(200, {
foo: "bar",
});Indent first variable in one-var scenario (#2095) by @azz
Up until recently we haven't done much to support printing multiple variables in a single declaration as the most common practice is to do one variable declaration per variable. For single declarations, we don't want to indent it, but it turns out that we do when there are other ones afterwards, otherwise it looks weird.
// Before var templateTagsMapping = { '%{itemIndex}': 'index', '%{itemContentMetaTextViews}': 'views' }, separator = '<span class="item__content__meta__separator">β’</span>';// After
var templateTagsMapping = {
'%{itemIndex}': 'index',
'%{itemContentMetaTextViews}': 'views'
},
separator = '<span class="item__content__meta__separator">β’</span>';Allow break with both default named import (#2096) by @azz
This one is an unfortunate regression from 1.4 where we inlined import that only contained a single element. Turns out the definition of a single element allowed a single type and a single element. This is now corrected!
// Before import transformRouterContext, { type TransformedContextRouter } from '../../helpers/transformRouterContext';// After
import transformRouterContext, {
type TransformedContextRouter
} from '../../helpers/transformRouterContext';Turn allowImportExportEverywhere on (#2207) by @zimme
The goal of prettier is to format code people write in practice, so we enable loose/experimental modes for all the parsers we support. Babylon allows you to write import within a function, which is not part of the standard, but it doesn't cost us much to allow it.
// Before ParseError// After
function f() {
import x from 'x';
}Support inline template for new calls (#2222)
We keep adding features for function calls and have to backport them to new calls as they have a different AST node type but in practice we want to treat them the same. This fix refactored the two so that they are going through the same call site, so hopefully should prevent more from sneaking in.
// Before new Error( formatErrorMessage` This a really bad error. Which has more than one line. ` );// After
new Error(formatErrorMessage</span></span> <span class="pl-s"> This a really bad error.</span> <span class="pl-s"> Which has more than one line.</span> <span class="pl-s"><span class="pl-pds">
);Don't indent + in object value (#2227)
When we switched to using the same heuristic for assignment (
a = b
) for objects ({a: b}
), we forgot to fix the indentation. Now it's fixed.// Before var abc = { thing: "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf" + "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf" + "asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf", }// After
var abc = {
thing:
"asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf" +
"asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf" +
"asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf",
}Handle conditions inside of a ternary (#2228)
Prettier already had a special case when the expression was a conditional but it didn't apply when the conditional was the left part of a ternary. Now it does.
// Before room = room.map((row, rowIndex) => row.map( (col, colIndex) => rowIndex === 0 || colIndex === 0 || rowIndex === height || colIndex === width ? 1 : 0 ) );// After
room = room.map((row, rowIndex) =>
row.map(
(col, colIndex) =>
rowIndex === 0 ||
colIndex === 0 ||
rowIndex === height ||
colIndex === width
? 1
: 0
)
);Add caching for printing (#2259)
With the 1.0 release, we fixed a bug in the printing that introduced an exponential behavior. We've been able to mitigate the biggest issue such that reasonable code didn't time out, but it wasn't completely fixed it. By adding a caching layer at the right spot, we should now be in the clear.
This should make printing the IR of prettier using prettier in debug mode no longer time out.
// Before ...times out...// After
someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
return someObject.someFunction().then(function () {
anotherFunction();
});
});
});
});
});
});
});
});
});Fix variance location (#2261)
We refactored the code that prints modifiers when we introduced TypeScript support and accidentally moved around the variance (
+
) part beforestatic
which is not valid in Flow. This is now fixed.// Before class Route { +static param: T; }// After
class Route {
static +param: T;
}Miscellaneous
Various fixes for range and cursor tracking (#2266, #2248, #2250, #2136) by @CiGit and @josephfrazier
Both those features were introduced in the last release and we discovered a bunch of issues when actually using them in production. A bunch of them got fixed, if you see more, please report them!
Not 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-promise |
Current Version | 3.4.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-promise 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 8 commits .
78b7639
3.4.1
bb7226b
Merge pull request #51 from zloirock/fix-49
85ffe84
add test for #49
81b2172
fix #49
803a4ab
Merge pull request #45 from ascariandrea/36-rule_always_return_fails_on_import
c931de0
Used 'node' for context.report, closes #36.
6f49856
Merge pull request #41 from jfmengels/fix-typo
6837bef
Fix typo in README
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-node |
Current Version | 5.0.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-node 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 πͺ
resolvePaths
option to no-missing-require
and no-missing-import
rules. You can customize paths to try for when resolving importing.The new version differs by 6 commits.
af4737e
5.1.0
04e0cf7
Chore: update travis.yml
4f4e216
Chore: remove package-lock.json
9931ded
Chore: upgrade dependencies
d34e09c
Chore: refactoring
47e0cc2
Update: add resolvePaths
option to no-missing-require
(#84)
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-jsx-a11y |
Current Version | 5.0.3 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As eslint-plugin-jsx-a11y 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 π΄
Branch | Build failing π¨ |
---|---|
Dependency | eslint-plugin-jsx-a11y |
Current Version | 6.0.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-jsx-a11y 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 πͺ
See #277
The new version differs by 5 commits.
71ce135
6.0.1
31753c7
Update CHANGELOG.md
436acd2
Merge pull request #277 from jessebeach/remove-src-from-package
f9d3ba9
Remove development artifacts from the NPM package
c121cd0
chore(package): update flow-bin to version 0.49.1
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-import |
Current Version | 2.6.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-import 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.
d9b712a
bump to v2.6.1 to bump dep on node resolver to latest π³
4d561e3
Merge pull request #881 from futpib/named-flow-import-interface
56e60e4
Update no-extraneous-dependencies.md (#878)
9a06426
Fix flow interface imports giving false-negative with named
rule
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 | babel-polyfill |
Current Version | 6.22.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As babel-polyfill 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.