style: update code style to please lint, close: #2179

This commit is contained in:
Benjy Cui 2017-02-06 12:04:35 +08:00
parent 382dd86475
commit d2b8d65c87
24 changed files with 59 additions and 42 deletions

View File

@ -1,3 +1,23 @@
{
"extends": "stylelint-config-standard"
"extends": "stylelint-config-standard",
"rules": {
"at-rule-empty-line-before": null,
"at-rule-name-space-after": null,
"declaration-bang-space-before": null,
"declaration-empty-line-before": null,
"function-comma-newline-after": null,
"function-name-case": null,
"function-parentheses-newline-inside": null,
"function-max-empty-lines": null,
"function-whitespace-after": null,
"indentation": null,
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"rule-empty-line-before": null,
"selector-combinator-space-after": null,
"selector-list-comma-newline-after": null,
"selector-pseudo-element-colon-notation": null,
"unit-no-unknown": null,
"value-list-max-empty-lines": null
}
}

View File

@ -36,6 +36,5 @@
&:hover {
.hover;
}
}
}

View File

@ -35,7 +35,7 @@
&-dot {
position: absolute;
transform: translateX(-50%);
transform-origin: 0px center;
transform-origin: 0 center;
top: -@badge-dot-size / 2;
height: @badge-dot-size;
width: @badge-dot-size;

View File

@ -204,7 +204,6 @@
color: @text-color;
}
&-fullscreen &-month-panel-current-cell &-month,
&-fullscreen &-today &-date {
border-top-color: @primary-color;

View File

@ -156,7 +156,7 @@
cursor: pointer;
background: #fff;
opacity: 0.3;
display: block;;
display: block;
width: @carousel-dot-width;
height: @carousel-dot-height;
border-radius: 1px;

View File

@ -39,8 +39,10 @@
transition: transform 0.24s ease;
top: 0;
left: 16px;
top: ~"16px \9"; // lesshint duplicateProperty: false
left: ~"0 \9"; // lesshint duplicateProperty: false
/* stylelint-disable declaration-block-no-duplicate-properties */
top: ~"16px \9";
left: ~"0 \9";
/* stylelint-enable declaration-block-no-duplicate-properties */
&:before {
content: "\e606";
}

View File

@ -83,7 +83,6 @@
.make-grid(-sm);
}
// Medium grid
//
// Columns, offsets, pushes, and pulls for the desktop device range.
@ -92,7 +91,6 @@
.make-grid(-md);
}
// Large grid
//
// Columns, offsets, pushes, and pulls for the large desktop device range.

View File

@ -24,7 +24,7 @@
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
padding-left: (@grid-gutter-width / 2);
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
}
}

View File

@ -0,0 +1 @@
// placeholder

View File

@ -274,7 +274,7 @@
&-item-group-list {
& > .@{menu-prefix-cls}-item,
& > .@{menu-prefix-cls}-submenu > .@{menu-prefix-cls}-submenu-title {
padding: 0px 16px 0 28px;
padding: 0 16px 0 28px;
font-size: @font-size-base;
line-height: 42px;
height: 42px;
@ -321,7 +321,7 @@
color: @disabled-color !important;
cursor: not-allowed;
background: none;
border-color: transparent !important;;
border-color: transparent !important;
> a {
color: @disabled-color !important;
pointer-events: none;
@ -329,7 +329,6 @@
}
}
// dark theme
.@{menu-prefix-cls} {
&-dark,

View File

@ -130,7 +130,6 @@
}
}
@media (max-width: 768px) {
.@{dialog-prefix-cls} {
width: auto !important;

View File

@ -82,7 +82,6 @@
font-family: "anticon";
}
}
}
&-jump-prev {
@ -140,7 +139,6 @@
font-family: "anticon";
text-align: center;
}
}
&:hover {

View File

@ -98,7 +98,7 @@
border-color: @border-color-base!important;
background-color: #f3f3f3;
&:after {
background-color: #cccccc;
background-color: #ccc;
}
}

View File

@ -77,6 +77,7 @@
opacity: 0.7;
-webkit-filter: blur(1px);
filter: blur(1px);
/* IE6~IE9 */
filter: ~"progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false)"; // lesshint duplicateProperty: false
// workround for a strange style bug in safari:

View File

@ -291,7 +291,7 @@
top: 0;
height: 100%;
width: 1px;
padding: 30px 0 4px 0;
padding: 30px 0 4px;
> i {
height: 100%;
width: 1px;
@ -333,7 +333,7 @@
position: absolute;
left: 9px;
top: 0;
padding: 22px 0 4px 0;
padding: 22px 0 4px;
> i {
height: 100%;
}

View File

@ -17,7 +17,7 @@
@purple-3: color(~`colorPalette("@{purple-6}", 3)`);
@purple-4: color(~`colorPalette("@{purple-6}", 4)`);
@purple-5: color(~`colorPalette("@{purple-6}", 5)`);
@purple-6: #7265E6;
@purple-6: #7265e6;
@purple-7: color(~`colorPalette("@{purple-6}", 7)`);
@purple-8: color(~`colorPalette("@{purple-6}", 8)`);
@purple-9: color(~`colorPalette("@{purple-6}", 9)`);
@ -28,7 +28,7 @@
@cyan-3: color(~`colorPalette("@{cyan-6}", 3)`);
@cyan-4: color(~`colorPalette("@{cyan-6}", 4)`);
@cyan-5: color(~`colorPalette("@{cyan-6}", 5)`);
@cyan-6: #00A2AE;
@cyan-6: #00a2ae;
@cyan-7: color(~`colorPalette("@{cyan-6}", 7)`);
@cyan-8: color(~`colorPalette("@{cyan-6}", 8)`);
@cyan-9: color(~`colorPalette("@{cyan-6}", 9)`);
@ -39,7 +39,7 @@
@green-3: color(~`colorPalette("@{green-6}", 3)`);
@green-4: color(~`colorPalette("@{green-6}", 4)`);
@green-5: color(~`colorPalette("@{green-6}", 5)`);
@green-6: #00A854;
@green-6: #00a854;
@green-7: color(~`colorPalette("@{green-6}", 7)`);
@green-8: color(~`colorPalette("@{green-6}", 8)`);
@green-9: color(~`colorPalette("@{green-6}", 9)`);
@ -61,7 +61,7 @@
@red-3: color(~`colorPalette("@{red-6}", 3)`);
@red-4: color(~`colorPalette("@{red-6}", 4)`);
@red-5: color(~`colorPalette("@{red-6}", 5)`);
@red-6: #F04134;
@red-6: #f04134;
@red-7: color(~`colorPalette("@{red-6}", 7)`);
@red-8: color(~`colorPalette("@{red-6}", 8)`);
@red-9: color(~`colorPalette("@{red-6}", 9)`);
@ -72,7 +72,7 @@
@orange-3: color(~`colorPalette("@{orange-6}", 3)`);
@orange-4: color(~`colorPalette("@{orange-6}", 4)`);
@orange-5: color(~`colorPalette("@{orange-6}", 5)`);
@orange-6: #F56A00;
@orange-6: #f56a00;
@orange-7: color(~`colorPalette("@{orange-6}", 7)`);
@orange-8: color(~`colorPalette("@{orange-6}", 8)`);
@orange-9: color(~`colorPalette("@{orange-6}", 9)`);

View File

@ -353,7 +353,6 @@ function inputToRGB(color) {
};
}
// Conversion Functions
// --------------------
@ -562,7 +561,6 @@ tinycolor.random = function() {
});
};
// Modification Functions
// ----------------------
// Thanks to less.js for some of the basics here
@ -715,7 +713,6 @@ tinycolor.mix = function(color1, color2, amount) {
return tinycolor(rgba);
};
// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
@ -797,7 +794,6 @@ tinycolor.mostReadable = function(baseColor, colorList, args) {
}
};
// Big List of Colors
// ------------------
// <http://www.w3.org/TR/css3-color/#svg-color>
@ -956,7 +952,6 @@ var names = tinycolor.names = {
// Make it easy to access colors via hexNames[hex]
var hexNames = tinycolor.hexNames = flip(names);
// Utilities
// ---------
@ -1091,7 +1086,7 @@ function isValidCSSUnit(color) {
// based on detected format. Returns { r, g, b } or { h, s, l } or { h, s, v}
function stringInputToObject(color) {
color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase();
var named = false;
if (names[color]) {
color = names[color];

View File

@ -3,10 +3,15 @@
@font-face {
font-family: 'anticon';
src: url('@{icon-url}.eot'); /* IE9*/
src: url('@{icon-url}.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('@{icon-url}.woff') format('woff'), /* chrome、firefox */
url('@{icon-url}.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('@{icon-url}.svg#iconfont') format('svg'); /* iOS 4.1- */
src:
/* IE6-IE8 */
url('@{icon-url}.eot?#iefix') format('embedded-opentype'),
/* chrome、firefox */
url('@{icon-url}.woff') format('woff'),
/* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('@{icon-url}.ttf') format('truetype'),
/* iOS 4.1- */
url('@{icon-url}.svg#iconfont') format('svg');
}
.@{iconfont-css-prefix} {

View File

@ -16,7 +16,7 @@
@keyframes antSwingIn {
0%,
100% {
transform: translateX(0px);
transform: translateX(0);
}
20% {
transform: translateX(-10px);

View File

@ -90,7 +90,7 @@ hr {
*/
pre {
font-family: monospace, monospace; /* 1 */
font-family: monospace, monospace; /* 1 */ /* stylelint-disable-line font-family-no-duplicate-names */
font-size: 1em; /* 2 */
}
@ -154,7 +154,7 @@ strong {
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-family: monospace, monospace; /* 1 */ /* stylelint-disable-line font-family-no-duplicate-names */
font-size: 1em; /* 2 */
}

View File

@ -108,7 +108,7 @@
list-style: none;
box-sizing: border-box;
margin: 0;
padding: 0 0 120px 0;
padding: 0 0 120px;
width: 100%;
}

View File

@ -11,7 +11,7 @@
&-item {
position: relative;
padding: 0 0 12px 0;
padding: 0 0 12px;
list-style: none;
margin: 0;

View File

@ -19,6 +19,7 @@
a[draggable],
a[draggable="true"] {
user-select: none;
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;

View File

@ -143,9 +143,9 @@
"lint:es": "eslint tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx'",
"lint:demo": "cross-env RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'",
"lint:style": "stylelint \"components/**/*.less\" --syntax less",
"eslint-fix": "npm run eslint-fix:code && npm run eslint-fix:demo",
"eslint-fix:code": "eslint --fix tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx'",
"eslint-fix:demo": "eslint-tinker ./components/*/demo/*.md",
"lint-fix": "npm run eslint-fix:code && npm run eslint-fix:demo",
"lint-fix:code": "eslint --fix tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx'",
"lint-fix:demo": "eslint-tinker ./components/*/demo/*.md",
"dist": "antd-tools run dist",
"compile": "antd-tools run compile",
"start": "bisheng start -c ./site/bisheng.config.js --no-livereload",