From 2ecffe1de4f8cade80643f6acdc4491df32eb676 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Sun, 11 Feb 2018 00:49:27 +0800 Subject: [PATCH 1/2] add .editorconfig --- .editorconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e60c128 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +trim_trailing_whitespace = true +quote_type = double + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + From 79167ab0f855beb6942d576735a19d65f0f503e2 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Sun, 11 Feb 2018 16:17:43 +0800 Subject: [PATCH 2/2] use multi .eslintrc.js files --- .eslintrc.js | 1 + package.json | 2 +- src/.eslintrc.js | 5 +++++ tools/.eslintrc.js | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/.eslintrc.js create mode 100644 tools/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 22c9049..cf278b3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,5 @@ module.exports = { + "root": true, "env": { "es6": true }, diff --git a/package.json b/package.json index 26499f5..6f463f2 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "build": "rollup -c tools/rollup.module.js && rollup -c tools/rollup.browser.js && rollup -c tools/rollup.browser.min.js", "prepare": "npm test && rm -rf build && npm run build", - "test": "eslint --env browser src/** && eslint --env node tools/** && tslint -c tslint.json types/**.ts" + "test": "eslint src/** tools/** && tslint -c tslint.json types/**.ts" }, "repository": { "type": "git", diff --git a/src/.eslintrc.js b/src/.eslintrc.js new file mode 100644 index 0000000..eb25143 --- /dev/null +++ b/src/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + "env": { + "browser": true + } +} diff --git a/tools/.eslintrc.js b/tools/.eslintrc.js new file mode 100644 index 0000000..620617f --- /dev/null +++ b/tools/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + "env": { + "node": true + } +}