From 0c0cb87e6c8da87feafcca5d217dbb8cfd459328 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 19 Nov 2017 13:37:21 +0800 Subject: [PATCH] Add eslint-config-compact --- .eslintrc | 7 ++++++- package.json | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 5209bd9c..ae9f2234 100755 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,7 @@ { "parser": "babel-eslint", "extends": "airbnb", + "plugins": ["compat"], "env": { "browser": true, "node": true, @@ -43,11 +44,15 @@ "object-curly-newline": [0], "function-paren-newline": [0], "no-restricted-globals": [0], - "require-yield": [1] + "require-yield": [1], + "compat/compat": "error" }, "parserOptions": { "ecmaFeatures": { "experimentalObjectRestSpread": true } + }, + "settings": { + "polyfills": ["fetch"] } } diff --git a/package.json b/package.json index 2632343e..1a728320 100755 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "eslint": "^4.8.0", "eslint-config-airbnb": "^16.0.0", "eslint-plugin-babel": "^4.0.0", + "eslint-plugin-compat": "^2.1.0", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^6.0.0", "eslint-plugin-markdown": "^1.0.0-beta.6", @@ -107,5 +108,10 @@ "lint-staged": { "**/*.{js,jsx}": "lint-staged:js", "**/*.less": "stylelint --syntax less" - } + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ] } -- GitLab