From 307605a40434e08c1c6791dffb91e5f51205210d Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Mon, 14 Dec 2015 00:06:12 +0100 Subject: [PATCH] wip refactor for better linting --- .eslintrc | 32 ++------------------------------ package.json | 4 ++++ webpack.config.js | 12 ++++++++++++ 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/.eslintrc b/.eslintrc index dccaa7b..a10f14e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,34 +1,6 @@ { - "rules": { - "no-console": [ 0 ], - "no-unused-vars": [ 0 ], - "indent": [ - 2, - 2 - ], - "quotes": [ - 1, - "single" - ], - "linebreak-style": [ - 2, - "unix" - ], - "semi": [ - 1, - "never" - ] - }, - "env": { - "es6": true, - "node": true, - "browser": true - }, - "extends": "eslint:recommended", - "ecmaFeatures": { - "jsx": true, - "experimentalObjectRestSpread": true - }, + "parser": "babel-eslint", + "extends": "standard", "plugins": [ "react" ] diff --git a/package.json b/package.json index 1f12a3f..8baddd0 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "dependencies": { "async": "^1.5.0", "babel-core": "~6.3.17", + "babel-eslint": "^5.0.0-beta6", "babel-loader": "~6.2.0", "babel-plugin-transform-runtime": "~6.3.13", "babel-preset-es2015": "~6.3.13", @@ -26,7 +27,10 @@ "babel-runtime": "^6.3.13", "css-loader": "~0.23.0", "eslint": "~1.10.3", + "eslint-config-standard": "^4.4.0", + "eslint-loader": "^1.1.1", "eslint-plugin-react": "~3.11.3", + "eslint-plugin-standard": "^1.3.1", "file-loader": "~0.8.5", "font-awesome": "~4.5.0", "history": "~1.13.0", diff --git a/webpack.config.js b/webpack.config.js index 4875521..b8c91b3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,7 +20,19 @@ var config = { https: 'https-browserify' } }, + eslint: { + configFile: './.eslintrc', + failOnWarning: true, + failOnError: true + }, module: { + preLoaders: [ + { + test: /\.jsx?$/, + loader: 'eslint-loader', + exclude: /node_modules/ + } + ], loaders: [ { test: /\.(ttf|eot|svg|woff(2?))(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' }, { test: /\.css$/, loaders: ['style','css'] },