From b3b7e5dd16a580dc6769a4e1eeadb2597f599c70 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 11:30:49 +0200 Subject: [PATCH 01/19] Added .editorconfig --- .editorconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..1fe32959 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.js] +quote_type = single +spaces_around_operators = true + +[*.css] +quote_type = single + +[*.md] +trim_trailing_whitespace = false From 0ccaad582211826a14ea200182cb3317f779b51b Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 12:10:25 +0200 Subject: [PATCH 02/19] Added stylelint + config --- .stylelintrc | 41 +++++++++++++++++++++++++++++++++++++++++ package.json | 11 +++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .stylelintrc diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 00000000..769fcddd --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,41 @@ +{ + "extends": [ + "stylelint-config-standard", + "stylelint-config-css-modules" + ], + "plugins": [ + "stylelint-declaration-block-order" + ], + "rules": { + "at-rule-no-vendor-prefix": true, + "function-url-no-scheme-relative": true, + "function-url-quotes": "always", + "max-nesting-depth": 3, + "media-feature-name-no-vendor-prefix": true, + "property-no-vendor-prefix": true, + "selector-attribute-quotes": "always", + "selector-no-attribute": true, + "selector-no-combinator": true, + "selector-no-qualifying-type": true, + "selector-no-id": true, + "selector-no-type": true, + "selector-no-universal": true, + "selector-no-vendor-prefix": true, + "selector-pseudo-element-colon-notation": "double", + "selector-pseudo-element-no-unknown": true, + "selector-root-no-composition": true, + "selector-type-no-unknown": true, + "string-quotes": "single", + "value-no-vendor-prefix": true, + "stylelint-disable-reason": "always-after", + + + "plugin/declaration-block-order": [ + "custom-properties", + "dollar-variables", + "declarations", + "rules", + "at-rules" + ] + } +} diff --git a/package.json b/package.json index 5c27e180..37e61391 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,11 @@ "build": "webpack --config webpack.config.js", "storybook": "start-storybook -p 9001", "storybook-build": "build-storybook -o dist", - "lint": "eslint .", - "lint:fix": "npm run lint -- --fix", + "lint": "npm run lint:js & npm run lint:css", + "lint:js": "eslint .", + "lint:js:fix": "npm run lint:js -- --fix", + "lint:css": "stylelint 'src/**/*.css'", + "lint:css:fix": "stylelint **/*.css", "lint:staged": "lint-staged" }, "lint-staged": { @@ -72,6 +75,10 @@ "redux-thunk": "^1.0.3", "sass-loader": "^4.0.2", "style-loader": "^0.13.0", + "stylelint": "^7.3.1", + "stylelint-config-css-modules": "^0.1.0", + "stylelint-config-standard": "^13.0.2", + "stylelint-declaration-block-order": "^0.1.0", "url-loader": "^0.5.7", "webpack": "^1.13.2", "webpack-dev-server": "^1.15.1", From a801714f16fdb33365c68c364fcab263f3437d64 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 12:28:00 +0200 Subject: [PATCH 03/19] Added stylefmt and lint:css:fix task --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 37e61391..f58ca092 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint:js": "eslint .", "lint:js:fix": "npm run lint:js -- --fix", "lint:css": "stylelint 'src/**/*.css'", - "lint:css:fix": "stylelint **/*.css", + "lint:css:fix": "stylefmt --recursive src/", "lint:staged": "lint-staged" }, "lint-staged": { @@ -75,6 +75,7 @@ "redux-thunk": "^1.0.3", "sass-loader": "^4.0.2", "style-loader": "^0.13.0", + "stylefmt": "^4.3.1", "stylelint": "^7.3.1", "stylelint-config-css-modules": "^0.1.0", "stylelint-config-standard": "^13.0.2", From af0563eb70b46e066ed84072d77f5cda96468938 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 12:34:27 +0200 Subject: [PATCH 04/19] Added lint-staged rule for CSS files --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index f58ca092..45bdb50f 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,11 @@ "*.@(js|jsx)": [ "eslint --fix", "git add" + ], + "*.css": [ + "stylefmt", + "stylelint", + "git add" ] }, "pre-commit": "lint:staged", From 18be4e8fd2d34762e05f8f3d6a95189c3b8f1361 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 12:34:58 +0200 Subject: [PATCH 05/19] Removed *.jsx from lint-staged config --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45bdb50f..9f05416e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "lint:staged": "lint-staged" }, "lint-staged": { - "*.@(js|jsx)": [ + "*.js": [ "eslint --fix", "git add" ], From e06f8ec3a95071f8c62e19ecc1e34a5c78ef8e0a Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 12:56:33 +0200 Subject: [PATCH 06/19] Added declaration-block-properties-order based on https://github.com/hudochenkov/postcss-sorting/blob/master/configs/default.json --- .stylelintrc | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) diff --git a/.stylelintrc b/.stylelintrc index 769fcddd..17914b35 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -29,6 +29,217 @@ "value-no-vendor-prefix": true, "stylelint-disable-reason": "always-after", + "declaration-block-properties-order": [ + [ + "position", + "top", + "right", + "bottom", + "left", + "z-index", + "display", + "visibility", + "flex", + "flex-grow", + "flex-shrink", + "flex-basis", + "flex-direction", + "flex-flow", + "flex-wrap", + "align-content", + "align-items", + "align-self", + "justify-content", + "order", + "float", + "clear", + "overflow", + "overflow-x", + "overflow-y", + "-webkit-overflow-scrolling", + "clip", + "box-sizing", + "margin", + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + "min-width", + "min-height", + "max-width", + "max-height", + "width", + "height", + "outline", + "outline-width", + "outline-style", + "outline-color", + "outline-offset", + "border", + "border-spacing", + "border-collapse", + "border-width", + "border-style", + "border-color", + "border-top", + "border-top-width", + "border-top-style", + "border-top-color", + "border-right", + "border-right-width", + "border-right-style", + "border-right-color", + "border-bottom", + "border-bottom-width", + "border-bottom-style", + "border-bottom-color", + "border-left", + "border-left-width", + "border-left-style", + "border-left-color", + "border-radius", + "border-top-left-radius", + "border-top-right-radius", + "border-bottom-right-radius", + "border-bottom-left-radius", + "border-image", + "border-image-source", + "border-image-slice", + "border-image-width", + "border-image-outset", + "border-image-repeat", + "border-top-image", + "border-right-image", + "border-bottom-image", + "border-left-image", + "border-corner-image", + "border-top-left-image", + "border-top-right-image", + "border-bottom-right-image", + "border-bottom-left-image", + "background", + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", + "background-color", + "background-image", + "background-attachment", + "background-position", + "background-position-x", + "background-position-y", + "background-clip", + "background-origin", + "background-size", + "background-repeat", + "box-decoration-break", + "box-shadow", + "color", + "table-layout", + "caption-side", + "empty-cells", + "list-style", + "list-style-position", + "list-style-type", + "list-style-image", + "quotes", + "content", + "counter-increment", + "counter-reset", + "-ms-writing-mode", + "vertical-align", + "text-align", + "text-align-last", + "text-decoration", + "text-emphasis", + "text-emphasis-position", + "text-emphasis-style", + "text-emphasis-color", + "text-indent", + "text-justify", + "text-outline", + "text-transform", + "text-wrap", + "text-overflow", + "text-overflow-ellipsis", + "text-overflow-mode", + "text-shadow", + "white-space", + "word-spacing", + "word-wrap", + "word-break", + "tab-size", + "hyphens", + "letter-spacing", + "font", + "font-weight", + "font-style", + "font-variant", + "font-size-adjust", + "font-stretch", + "font-size", + "font-family", + "src", + "line-height", + "opacity", + "filter", + "resize", + "cursor", + "nav-index", + "nav-up", + "nav-right", + "nav-down", + "nav-left", + "transition", + "transition-delay", + "transition-timing-function", + "transition-duration", + "transition-property", + "transform", + "transform-origin", + "animation", + "animation-name", + "animation-duration", + "animation-play-state", + "animation-timing-function", + "animation-delay", + "animation-iteration-count", + "animation-direction", + "animation-fill-mode", + "pointer-events", + "unicode-bidi", + "direction", + "columns", + "column-span", + "column-width", + "column-count", + "column-fill", + "column-gap", + "column-rule", + "column-rule-width", + "column-rule-style", + "column-rule-color", + "break-before", + "break-inside", + "break-after", + "page-break-before", + "page-break-inside", + "page-break-after", + "orphans", + "widows", + "zoom", + "max-zoom", + "min-zoom", + "user-zoom", + "orientation", + "user-select", + "fill", + "stroke" + ], + { "unspecified": "bottomAlphabetical" } + ], "plugin/declaration-block-order": [ "custom-properties", From a560d4e8fe376e80870c0d27228acccb7e767166 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 14:41:45 +0200 Subject: [PATCH 07/19] Updated stylelintrc --- .stylelintrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index 17914b35..21932e5b 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -8,6 +8,7 @@ ], "rules": { "at-rule-no-vendor-prefix": true, + "comment-empty-line-before": false, "function-url-no-scheme-relative": true, "function-url-quotes": "always", "max-nesting-depth": 3, @@ -123,7 +124,6 @@ "border-bottom-right-image", "border-bottom-left-image", "background", - "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", "background-color", "background-image", "background-attachment", @@ -181,6 +181,8 @@ "font-stretch", "font-size", "font-family", + "-webkit-font-smoothing", + "-moz-osx-font-smoothing", "src", "line-height", "opacity", From 3341a3460572884dd00ed0df039c8fa6b7e1243b Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 14:48:15 +0200 Subject: [PATCH 08/19] Fixed stylelintrc config --- .stylelintrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index 21932e5b..0133827d 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -8,7 +8,7 @@ ], "rules": { "at-rule-no-vendor-prefix": true, - "comment-empty-line-before": false, + "comment-empty-line-before": "never", "function-url-no-scheme-relative": true, "function-url-quotes": "always", "max-nesting-depth": 3, @@ -166,6 +166,7 @@ "text-overflow-ellipsis", "text-overflow-mode", "text-shadow", + "text-rendering", "white-space", "word-spacing", "word-wrap", @@ -181,6 +182,7 @@ "font-stretch", "font-size", "font-family", + "font-feature-settings", "-webkit-font-smoothing", "-moz-osx-font-smoothing", "src", From 466da020752adfb7050a040545dd3194af7a18bd Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 14:52:56 +0200 Subject: [PATCH 09/19] Added composes to declaration-block-properties-order --- .stylelintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.stylelintrc b/.stylelintrc index 0133827d..43733b7d 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -32,6 +32,7 @@ "declaration-block-properties-order": [ [ + "composes", "position", "top", "right", From 334b6191bd460b2c2b9e4d216c26685ff1413303 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Thu, 29 Sep 2016 18:55:01 +0200 Subject: [PATCH 10/19] Added some more rules to eslintrc. Removed unnecessary globals from it. --- .eslintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 4d30170d..3e203e22 100644 --- a/.eslintrc +++ b/.eslintrc @@ -35,6 +35,8 @@ rules: # Stylistic Issues # https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues + no-alert: 2 + no-console: [2, { allow: ["warn", "error"] }] comma-spacing: 2 eol-last: 2 indent: [2, 2, {SwitchCase: 1}] @@ -105,8 +107,6 @@ rules: # Global scoped method and vars globals: netlify: true - describe: true - it: true require: true process: true module: true From 4c30278fb51c66bb9ce19951cdd06ea432c6d236 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 15:06:38 +0200 Subject: [PATCH 11/19] Added npm-check with tasks --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f05416e..4614c2a7 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "lint:js:fix": "npm run lint:js -- --fix", "lint:css": "stylelint 'src/**/*.css'", "lint:css:fix": "stylefmt --recursive src/", - "lint:staged": "lint-staged" + "lint:staged": "lint-staged", + "deps": "npm-check -s", + "deps:update": "npm-check -u" }, "lint-staged": { "*.js": [ @@ -63,6 +65,7 @@ "moment": "^2.11.2", "node-sass": "^3.10.0", "normalizr": "^2.0.0", + "npm-check": "^5.2.3", "postcss-cssnext": "^2.7.0", "postcss-import": "^8.1.2", "postcss-loader": "^0.9.1", From 0361c4c79bb234eb222d95bbcc993e88b4b51851 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 15:08:06 +0200 Subject: [PATCH 12/19] Updated eslint-* deps --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4614c2a7..4a0e5d23 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@kadira/storybook": "^1.36.0", "autoprefixer": "^6.3.3", "babel-core": "^6.5.1", - "babel-eslint": "^6.1.2", + "babel-eslint": "^7.0.0", "babel-loader": "^6.2.2", "babel-plugin-lodash": "^3.2.0", "babel-plugin-transform-class-properties": "^6.5.2", @@ -53,7 +53,7 @@ "css-loader": "^0.23.1", "eslint": "^3.5.0", "eslint-plugin-class-property": "^1.0.1", - "eslint-plugin-react": "^5.1.1", + "eslint-plugin-react": "^6.3.0", "expect": "^1.20.2", "exports-loader": "^0.6.3", "file-loader": "^0.8.5", From 6d484463ca379fbe6becf0f465f4aff088f6cfd6 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 16:39:08 +0200 Subject: [PATCH 13/19] Added declaration-use-variable --- .stylelintrc | 13 ++++++++++++- package.json | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index 43733b7d..fcc4d0c2 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -4,7 +4,8 @@ "stylelint-config-css-modules" ], "plugins": [ - "stylelint-declaration-block-order" + "stylelint-declaration-block-order", + "stylelint-declaration-use-variable" ], "rules": { "at-rule-no-vendor-prefix": true, @@ -252,6 +253,16 @@ "declarations", "rules", "at-rules" + ], + + "sh-waqar/declaration-use-variable": [ + [ + "/color/", + "z-index", + "font-size", + "border-radius", + "/background/" + ] ] } } diff --git a/package.json b/package.json index 4a0e5d23..1ff9aa1b 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "stylelint-config-css-modules": "^0.1.0", "stylelint-config-standard": "^13.0.2", "stylelint-declaration-block-order": "^0.1.0", + "stylelint-declaration-use-variable": "^1.6.0", "url-loader": "^0.5.7", "webpack": "^1.13.2", "webpack-dev-server": "^1.15.1", From ab67a350e379cbe55a902b267e10d78fbe77f133 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 16:39:36 +0200 Subject: [PATCH 14/19] Removed selector-no-combinator for now --- .stylelintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index fcc4d0c2..5a7c3148 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -17,7 +17,6 @@ "property-no-vendor-prefix": true, "selector-attribute-quotes": "always", "selector-no-attribute": true, - "selector-no-combinator": true, "selector-no-qualifying-type": true, "selector-no-id": true, "selector-no-type": true, From 8ba925726d87c8292061861cc8ad5a868eac6d0a Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 16:41:29 +0200 Subject: [PATCH 15/19] Added declaration-no-important --- .stylelintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.stylelintrc b/.stylelintrc index 5a7c3148..eedf8e75 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -10,6 +10,7 @@ "rules": { "at-rule-no-vendor-prefix": true, "comment-empty-line-before": "never", + "declaration-no-important": true, "function-url-no-scheme-relative": true, "function-url-quotes": "always", "max-nesting-depth": 3, From 391c2fe07832bc6cac4e5a66d7ea1ebef5932bb0 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 16:43:21 +0200 Subject: [PATCH 16/19] Added number-leading-zero with "never" --- .stylelintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.stylelintrc b/.stylelintrc index eedf8e75..df434d59 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -15,6 +15,7 @@ "function-url-quotes": "always", "max-nesting-depth": 3, "media-feature-name-no-vendor-prefix": true, + "number-leading-zero": "never", "property-no-vendor-prefix": true, "selector-attribute-quotes": "always", "selector-no-attribute": true, From a923cfd7309a36d83bd90dea81d14be6f7a6ab9b Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 5 Oct 2016 16:48:15 +0200 Subject: [PATCH 17/19] Added number-max-precision and reduced max-nesting-depth --- .stylelintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.stylelintrc b/.stylelintrc index df434d59..e014f049 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -13,9 +13,10 @@ "declaration-no-important": true, "function-url-no-scheme-relative": true, "function-url-quotes": "always", - "max-nesting-depth": 3, + "max-nesting-depth": 1, "media-feature-name-no-vendor-prefix": true, "number-leading-zero": "never", + "number-max-precision": 3, "property-no-vendor-prefix": true, "selector-attribute-quotes": "always", "selector-no-attribute": true, From 9c7c5360e6cff7666500cac659197c8653a6fa3e Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Thu, 6 Oct 2016 12:07:45 +0200 Subject: [PATCH 18/19] Use shareable netlify eslint config. --- .eslintrc | 118 +++------------------------------------------------ package.json | 6 +-- 2 files changed, 7 insertions(+), 117 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3e203e22..264fcdd4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,113 +1,5 @@ -env: - browser: true - es6: true - -parser: babel-eslint -plugins: [ - "react", - "class-property" -] - -rules: - # Possible Errors - # https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors - no-control-regex: 2 - no-debugger: 2 - no-dupe-args: 2 - no-dupe-keys: 2 - no-duplicate-case: 2 - no-empty-character-class: 2 - no-ex-assign: 2 - no-extra-boolean-cast : 2 - no-extra-semi: 2 - no-invalid-regexp: 2 - no-irregular-whitespace: 2 - no-proto: 2 - no-unexpected-multiline: 2 - no-unreachable: 2 - valid-typeof: 2 - - # Best Practices - # https://github.com/eslint/eslint/tree/master/docs/rules#best-practices - no-fallthrough: 2 - no-redeclare: 2 - no-constant-condition: 2 - - # Stylistic Issues - # https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues - no-alert: 2 - no-console: [2, { allow: ["warn", "error"] }] - comma-spacing: 2 - eol-last: 2 - indent: [2, 2, {SwitchCase: 1}] - max-len: [2, 160, 2] - new-parens: 2 - no-mixed-spaces-and-tabs: 2 - no-multiple-empty-lines: [2, {max: 2}] - no-trailing-spaces: 2 - object-curly-spacing: [1, "always"] - quotes: [2, "single", "avoid-escape"] - semi: 2 - keyword-spacing: 2 - space-before-blocks: [2, "always"] - space-before-function-paren: [2, "never"] - space-in-parens: [2, "never"] - space-infix-ops: 2 - space-unary-ops: 2 - - # ECMAScript 6 - # http://eslint.org/docs/rules/#ecmascript-6 - arrow-spacing: [2, {"before": true, "after": true}] - no-confusing-arrow: 2 - prefer-const: 2 - - # Strict Mode - # https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode - strict: [2, "global"] - - # Variables - # https://github.com/eslint/eslint/tree/master/docs/rules#variables - no-undef: 2 - no-unused-vars: [2, {"args": "none"}] - - - react/prop-types: 1 - react/forbid-prop-types: 1 - react/jsx-boolean-value: 1 - react/jsx-closing-bracket-location: 1 - react/jsx-curly-spacing: 1 - react/jsx-equals-spacing: 1 - react/jsx-handler-names: 1 - react/jsx-indent-props: 1 - react/jsx-indent: [2, 2] - react/jsx-no-bind: 1 - react/jsx-no-duplicate-props: 1 - react/jsx-no-undef: 1 - react/jsx-pascal-case: 1 - react/jsx-uses-react: 1 - react/jsx-uses-vars: 1 - react/no-danger: 1 - react/no-deprecated: 1 - react/no-did-mount-set-state: 1 - react/no-did-update-set-state: 1 - react/no-direct-mutation-state: 1 - react/no-is-mounted: 1 - react/no-multi-comp: 1 - react/no-string-refs: 1 - react/no-unknown-property: 1 - react/prefer-es6-class: 1 - react/prefer-stateless-function: 1 - react/react-in-jsx-scope: 1 - react/require-extension: 1 - react/self-closing-comp: 1 - react/sort-comp: 1 - - class-property/class-property-semicolon: 2 - -# Global scoped method and vars -globals: - netlify: true - require: true - process: true - module: true - CMS_ENV: true +{ + "extends": [ + "eslint-config-netlify" + ] +} diff --git a/package.json b/package.json index 1ff9aa1b..fb2ce3d7 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "@kadira/storybook": "^1.36.0", "autoprefixer": "^6.3.3", "babel-core": "^6.5.1", - "babel-eslint": "^7.0.0", "babel-loader": "^6.2.2", "babel-plugin-lodash": "^3.2.0", "babel-plugin-transform-class-properties": "^6.5.2", @@ -51,9 +50,8 @@ "babel-preset-react": "^6.5.0", "babel-runtime": "^6.5.0", "css-loader": "^0.23.1", - "eslint": "^3.5.0", - "eslint-plugin-class-property": "^1.0.1", - "eslint-plugin-react": "^6.3.0", + "eslint": "^3.7.1", + "eslint-config-netlify": "github:netlify/netlify-eslint", "expect": "^1.20.2", "exports-loader": "^0.6.3", "file-loader": "^0.8.5", From 5388884bf65d86e4e3528220885d1e83218306ab Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Thu, 6 Oct 2016 15:27:25 +0200 Subject: [PATCH 19/19] Integrated with webpack dev config --- .eslintrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 264fcdd4..153d7d64 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,12 @@ { "extends": [ "eslint-config-netlify" - ] + ], + "settings": { + "import/resolver": { + "webpack": { + "config": "webpack.dev.js" + } + } + } }