From dca5608f0b6f072f13ce72b694878c5de68c1420 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 30 Nov 2018 17:33:32 -0500 Subject: [PATCH] Chore: update linting config --- .eslintignore | 1 + .eslintrc | 5 ----- .eslintrc.js | 18 ++++++++++++++++++ Makefile.js | 7 +++++++ package.json | 2 +- tests/lib/.eslintrc | 2 -- 6 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .eslintignore delete mode 100644 .eslintrc create mode 100644 .eslintrc.js delete mode 100644 tests/lib/.eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..09a8422e --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +!.eslintrc.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index cf539d28..00000000 --- a/.eslintrc +++ /dev/null @@ -1,5 +0,0 @@ -env: - node: true - es6: true - -extends: eslint diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..793193d4 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,18 @@ +"use strict"; + +module.exports = { + root: true, + extends: "eslint", + env: { + node: true, + es6: true + }, + overrides: [ + { + files: ["tests/lib/*"], + env: { + mocha: true + } + } + ] +}; diff --git a/Makefile.js b/Makefile.js index 9273a0ab..9655c348 100644 --- a/Makefile.js +++ b/Makefile.js @@ -29,6 +29,7 @@ const NODE_MODULES = "./node_modules/", // Files MAKEFILE = "./Makefile.js", + CONFIG_FILES = ".eslintrc.js", JS_FILES = "\"lib/**/*.js\" \"espree.js\"", TEST_FILES = "tests/lib/**/*.js"; @@ -50,6 +51,12 @@ target.lint = function() { errors++; } + echo("Validating configuration files"); + lastReturn = nodeCLI.exec("eslint", CONFIG_FILES); + if (lastReturn.code !== 0) { + errors++; + } + echo("Validating JavaScript files"); lastReturn = nodeCLI.exec("eslint", JS_FILES); if (lastReturn.code !== 0) { diff --git a/package.json b/package.json index a101253f..d756a9d8 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "chai": "^1.10.0", "eslint": "^5.7.0", "eslint-config-eslint": "^5.0.1", - "eslint-plugin-node": "^7.0.1", + "eslint-plugin-node": "^8.0.0", "eslint-release": "^1.0.0", "esprima": "latest", "esprima-fb": "^8001.2001.0-dev-harmony-fb", diff --git a/tests/lib/.eslintrc b/tests/lib/.eslintrc deleted file mode 100644 index 72b9c8cc..00000000 --- a/tests/lib/.eslintrc +++ /dev/null @@ -1,2 +0,0 @@ -env: - mocha: true