Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjansson committed Sep 19, 2018
1 parent fa8c500 commit dd3cad4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/cssnano-preset-default/src/index.js
Expand Up @@ -51,7 +51,7 @@ const defaultOpts = {
},
cssDeclarationSorter: {
exclude: true,
}
},
};

export default function defaultPreset (opts = {}) {
Expand Down
10 changes: 5 additions & 5 deletions packages/cssnano/src/__tests__/fixtures.js
Expand Up @@ -22,7 +22,7 @@ test(
max-width: calc(100% - 32px);
}`,
`paper-card{--paper-card-content:{padding-top:0};margin:0 auto 16px;width:768px;max-width:calc(100% - 32px)}`
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// `paper-card{margin:0 auto 16px;max-width:calc(100% - 32px);width:768px;--paper-card-content:{padding-top:0};}`
);

Expand All @@ -49,7 +49,7 @@ test(
width: 384px;
}`,
`paper-card{--paper-card-header:{height:128px;padding:0 48px;background:var(--primary-color);@apply(--layout-vertical);@apply(--layout-end-justified)};--paper-card-header-color:#fff;--paper-card-content:{padding:64px};--paper-card-actions:{@apply(--layout-horizontal);@apply(--layout-end-justified)};width:384px}`
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// `paper-card{--paper-card-header-color:#fff;width:384px;--paper-card-header:{background:var(--primary-color);height:128px;padding:0 48px;@apply(--layout-vertical);@apply(--layout-end-justified)};--paper-card-content:{padding:64px};--paper-card-actions:{@apply(--layout-horizontal);@apply(--layout-end-justified)};}`

);
Expand Down Expand Up @@ -92,7 +92,7 @@ test(
color: red;;
}`,
`div{font-weight:900;color:red}`
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// `div{color:red;font-weight:900}`
);

Expand Down Expand Up @@ -181,7 +181,7 @@ test(
background-origin: padding-box, padding-box;
}`,
`.two-gradients{background:linear-gradient(#fff,#999) no-repeat border-box,linear-gradient(#eee,#777) no-repeat border-box;background-size:98px 50px,18px 50px;background-position:0 0,98px 0;background-origin:padding-box,padding-box}`
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// `.two-gradients{background:linear-gradient(#fff,#999) no-repeat border-box,linear-gradient(#eee,#777) no-repeat border-box;background-origin:padding-box,padding-box;background-position:0 0,98px 0;background-size:98px 50px,18px 50px}`
);

Expand Down Expand Up @@ -319,7 +319,7 @@ test(
margin-left: 10px !important;
}`,
`h1{margin-top:8px;margin-right:12px!important;margin-bottom:14px;margin-left:10px!important}`
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// `h1{margin-bottom:14px;margin-left:10px!important;margin-right:12px!important;margin-top:8px}`
);

Expand Down
2 changes: 1 addition & 1 deletion packages/cssnano/src/__tests__/issue26.js
Expand Up @@ -23,7 +23,7 @@ const fixture = `
`;

const expected = `@media print{.test{-webkit-box-shadow:none;box-shadow:none;-webkit-border-radius:0;border-radius:0}}.test{width:500px}`;
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// const expected = `@media print{.test{-webkit-border-radius:0;-webkit-box-shadow:none;border-radius:0;box-shadow:none}}.test{width:500px}`;

ava('it should compress whitespace after node.clone()', t => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cssnano/src/__tests__/issue420.js
Expand Up @@ -11,7 +11,7 @@ test('should work with postcss-font-magician with `display` parameter', t => {
`;
return postcss([fontMagician({display: "optional"}), cssnano]).process(css).then(result => {
t.deepEqual(result.css, `@font-face{font-family:Alice;font-style:normal;font-weight:400;src:local("Alice Regular"),local(Alice-Regular),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrgo.eot#) format("eot"),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrg4.woff2) format("woff2"),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrgg.woff) format("woff");font-display:optional}body{font-family:Alice}`);
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// t.deepEqual(result.css, `@font-face{font-display:optional;font-family:Alice;font-style:normal;font-weight:400;src:local("Alice Regular"),local(Alice-Regular),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrgo.eot#) format("eot"),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrg4.woff2) format("woff2"),url(//fonts.gstatic.com/s/alice/v9/OpNCnoEEmtHa6GcOrgg.woff) format("woff")}body{font-family:Alice}`);
});
});
4 changes: 2 additions & 2 deletions packages/cssnano/src/__tests__/postcss-discard-comments.js
@@ -1,5 +1,5 @@
import test from 'ava';
import processCss, { passthrough } from './_processCss';
import processCss, {passthrough} from './_processCss';

test(
'should remove non-special comments',
Expand Down Expand Up @@ -103,7 +103,7 @@ test(
'should keep special comments 2',
passthrough,
'h1{/*!test comment*/font-weight:700}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{font-weight:700/*!test comment*/}',
);

Expand Down
14 changes: 7 additions & 7 deletions packages/cssnano/src/__tests__/postcss-merge-longhand.js
@@ -1,5 +1,5 @@
import test from 'ava';
import processCss, { passthrough } from './_processCss';
import processCss, {passthrough} from './_processCss';

test(
'should merge margin values',
Expand All @@ -26,7 +26,7 @@ test(
'should not merge margin values with mixed !important',
passthrough,
'h1{margin-top:10px!important;margin-right:20px;margin-bottom:30px!important;margin-left:40px}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{margin-bottom:30px!important;margin-left:40px;margin-right:20px;margin-top:10px!important}',
);

Expand All @@ -48,7 +48,7 @@ test(
'should not merge padding values with mixed !important',
passthrough,
'h1{padding-top:10px!important;padding-right:20px;padding-bottom:30px!important;padding-left:40px}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{padding-bottom:30px!important;padding-left:40px;padding-right:20px;padding-top:10px!important}',
);

Expand All @@ -70,7 +70,7 @@ test(
'should not merge identical border values with mixed !important',
passthrough,
'h1{border-top:1px solid #000;border-bottom:1px solid #000;border-left:1px solid #000!important;border-right:1px solid #000!important}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{border-bottom:1px solid #000;border-left:1px solid #000!important;border-right:1px solid #000!important;border-top:1px solid #000}',
);

Expand Down Expand Up @@ -99,7 +99,7 @@ test(
'should not merge border values with mixed !important',
passthrough,
'h1{border-color:red;border-width:1px!important;border-style:dashed!important}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{border-color:red;border-style:dashed!important;border-width:1px!important}',
);

Expand Down Expand Up @@ -191,7 +191,7 @@ test(
'should not merge rule if it includes mixed values',
passthrough,
'h1{padding-top:10px;padding-right:15px;padding-bottom:20px;padding-left:var(--variable)}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{padding-bottom:20px;padding-left:var(--variable);padding-right:15px;padding-top:10px}'
);

Expand Down Expand Up @@ -223,6 +223,6 @@ test(
processCss,
'h1{padding-top:10px;padding-right:var(--variable);padding-right:15px;padding-bottom:var(--variable);padding-bottom:20px;padding-left:25px;padding-top:var(--variable);padding-left:var(--variable)}',
'h1{padding:10px 15px 20px 25px;padding-top:var(--variable);padding-left:var(--variable)}'
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{padding:10px 15px 20px 25px;padding-left:var(--variable);padding-top:var(--variable)}'
);
14 changes: 7 additions & 7 deletions packages/cssnano/src/__tests__/postcss-merge-rules.js
@@ -1,5 +1,5 @@
import test from 'ava';
import processCss, { passthrough } from './_processCss';
import processCss, {passthrough} from './_processCss';

test(
'should merge based on declarations',
Expand All @@ -13,7 +13,7 @@ test(
processCss,
'h1{color:red;line-height:1.5;font-size:2em;}h2{color:red;line-height:1.5;font-size:2em;}',
'h1,h2{color:red;line-height:1.5;font-size:2em}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1,h2{color:red;font-size:2em;line-height:1.5}',
);

Expand All @@ -22,7 +22,7 @@ test(
processCss,
'h1{color:red;line-height:1.5;font-size:2em;}h2{font-size:2em;color:red;line-height:1.5;}',
'h1,h2{color:red;line-height:1.5;font-size:2em}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1,h2{color:red;font-size:2em;line-height:1.5}',
);

Expand All @@ -45,7 +45,7 @@ test(
processCss,
'h1{font-size:2em;color:#000}h1{background:#fff;line-height:1.5;}',
'h1{font-size:2em;color:#000;background:#fff;line-height:1.5}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// 'h1{background:#fff;color:#000;font-size:2em;line-height:1.5}',
);

Expand All @@ -54,7 +54,7 @@ test(
processCss,
'@media print{h1{display:block;}h1{color:red;}}',
'@media print{h1{display:block;color:red}}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// '@media print{h1{color:red;display:block}}',
);

Expand Down Expand Up @@ -231,15 +231,15 @@ test(
processCss,
'@keyframes a{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}100%{transform-origin:right bottom;transform:rotate(0);opacity:1}}a{animation:a}',
'@keyframes a{0%{transform-origin:right bottom;transform:rotate(-90deg);opacity:0}to{transform-origin:right bottom;transform:rotate(0);opacity:1}}a{animation:a}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// '@keyframes a{0%{opacity:0;transform:rotate(-90deg);transform-origin:right bottom}to{opacity:1;transform:rotate(0);transform-origin:right bottom}}a{animation:a}',
);

test(
'should not incorrectly extract background properties',
passthrough,
'.iPhone{background:url(a.png);background-image:url(../../../sprites/c.png);background-repeat:no-repeat;background-position:-102px -74px}.logo{background:url(b.png);background-image:url(../../../sprites/c.png);background-repeat:no-repeat;background-position:-2px -146px}',
// TODO: Switch back once css-declaration-sorter has been fixed
// Switch back once css-declaration-sorter has been fixed
// '.iPhone{background:url(a.png);background-image:url(../../../sprites/c.png);background-position:-102px -74px;background-repeat:no-repeat}.logo{background:url(b.png);background-image:url(../../../sprites/c.png);background-position:-2px -146px;background-repeat:no-repeat}',
);

Expand Down

0 comments on commit dd3cad4

Please sign in to comment.