diff --git a/.stylelintrc b/.stylelintrc index 40db42c668..0b6cb2f7ef 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -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 + } } diff --git a/components/auto-complete/style/index.less b/components/auto-complete/style/index.less index c88b961d79..0139a16deb 100644 --- a/components/auto-complete/style/index.less +++ b/components/auto-complete/style/index.less @@ -36,6 +36,5 @@ &:hover { .hover; } - } } diff --git a/components/badge/style/index.less b/components/badge/style/index.less index 23377c5d7c..e1c1e8ddd0 100644 --- a/components/badge/style/index.less +++ b/components/badge/style/index.less @@ -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; diff --git a/components/calendar/style/index.less b/components/calendar/style/index.less index 6ff31dc21b..2772df0f68 100644 --- a/components/calendar/style/index.less +++ b/components/calendar/style/index.less @@ -204,7 +204,6 @@ color: @text-color; } - &-fullscreen &-month-panel-current-cell &-month, &-fullscreen &-today &-date { border-top-color: @primary-color; diff --git a/components/carousel/style/index.less b/components/carousel/style/index.less index d5e5aa61d2..73ea54c3fa 100644 --- a/components/carousel/style/index.less +++ b/components/carousel/style/index.less @@ -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; diff --git a/components/collapse/style/index.less b/components/collapse/style/index.less index 57c4a6d23e..7330baddaa 100644 --- a/components/collapse/style/index.less +++ b/components/collapse/style/index.less @@ -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"; } diff --git a/components/grid/style/index.less b/components/grid/style/index.less index b4b0ffe423..e8c461a430 100644 --- a/components/grid/style/index.less +++ b/components/grid/style/index.less @@ -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. diff --git a/components/grid/style/mixin.less b/components/grid/style/mixin.less index 58e43327d9..ad6ed96239 100644 --- a/components/grid/style/mixin.less +++ b/components/grid/style/mixin.less @@ -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); } } diff --git a/components/locale-provider/style/index.less b/components/locale-provider/style/index.less index e69de29bb2..ff7bd09c0c 100644 --- a/components/locale-provider/style/index.less +++ b/components/locale-provider/style/index.less @@ -0,0 +1 @@ +// placeholder diff --git a/components/menu/style/index.less b/components/menu/style/index.less index 5da25e203c..1e2165846f 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -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, diff --git a/components/modal/style/modal.less b/components/modal/style/modal.less index 7c6d68c1c7..15686ec416 100644 --- a/components/modal/style/modal.less +++ b/components/modal/style/modal.less @@ -130,7 +130,6 @@ } } - @media (max-width: 768px) { .@{dialog-prefix-cls} { width: auto !important; diff --git a/components/pagination/style/index.less b/components/pagination/style/index.less index 0e29359e31..de70f5b109 100644 --- a/components/pagination/style/index.less +++ b/components/pagination/style/index.less @@ -82,7 +82,6 @@ font-family: "anticon"; } } - } &-jump-prev { @@ -140,7 +139,6 @@ font-family: "anticon"; text-align: center; } - } &:hover { diff --git a/components/radio/style/index.less b/components/radio/style/index.less index b98b1ff64e..c9d3f831b0 100644 --- a/components/radio/style/index.less +++ b/components/radio/style/index.less @@ -98,7 +98,7 @@ border-color: @border-color-base!important; background-color: #f3f3f3; &:after { - background-color: #cccccc; + background-color: #ccc; } } diff --git a/components/spin/style/index.less b/components/spin/style/index.less index 56c8914a0b..c303d2656e 100644 --- a/components/spin/style/index.less +++ b/components/spin/style/index.less @@ -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: diff --git a/components/steps/style/index.less b/components/steps/style/index.less index ff68c98abd..dd6d263645 100644 --- a/components/steps/style/index.less +++ b/components/steps/style/index.less @@ -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%; } diff --git a/components/style/color/colors.less b/components/style/color/colors.less index a285c3bdee..53f16229e5 100644 --- a/components/style/color/colors.less +++ b/components/style/color/colors.less @@ -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)`); diff --git a/components/style/color/tinyColor.less b/components/style/color/tinyColor.less index 0e83bb3bb9..1d95204064 100644 --- a/components/style/color/tinyColor.less +++ b/components/style/color/tinyColor.less @@ -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 // --------------------- // @@ -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]; diff --git a/components/style/core/iconfont.less b/components/style/core/iconfont.less index b5fb0301d6..3ea4050c14 100644 --- a/components/style/core/iconfont.less +++ b/components/style/core/iconfont.less @@ -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} { diff --git a/components/style/core/motion/swing.less b/components/style/core/motion/swing.less index d91514dc87..dcf299a015 100644 --- a/components/style/core/motion/swing.less +++ b/components/style/core/motion/swing.less @@ -16,7 +16,7 @@ @keyframes antSwingIn { 0%, 100% { - transform: translateX(0px); + transform: translateX(0); } 20% { transform: translateX(-10px); diff --git a/components/style/core/normalize.less b/components/style/core/normalize.less index ff83f7d345..8542f290de 100644 --- a/components/style/core/normalize.less +++ b/components/style/core/normalize.less @@ -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 */ } diff --git a/components/time-picker/style/index.less b/components/time-picker/style/index.less index 3ce4aff949..a91a2b70b3 100644 --- a/components/time-picker/style/index.less +++ b/components/time-picker/style/index.less @@ -108,7 +108,7 @@ list-style: none; box-sizing: border-box; margin: 0; - padding: 0 0 120px 0; + padding: 0 0 120px; width: 100%; } diff --git a/components/timeline/style/index.less b/components/timeline/style/index.less index af423d7458..bb88813b3e 100644 --- a/components/timeline/style/index.less +++ b/components/timeline/style/index.less @@ -11,7 +11,7 @@ &-item { position: relative; - padding: 0 0 12px 0; + padding: 0 0 12px; list-style: none; margin: 0; diff --git a/components/tree/style/index.less b/components/tree/style/index.less index 33bd20910e..c7b2e81f6e 100644 --- a/components/tree/style/index.less +++ b/components/tree/style/index.less @@ -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; diff --git a/package.json b/package.json index fef03eb9fb..4df63095e4 100644 --- a/package.json +++ b/package.json @@ -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",