From 9c7c5360e6cff7666500cac659197c8653a6fa3e Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Thu, 6 Oct 2016 12:07:45 +0200 Subject: [PATCH] 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",