From 130dc6d1c710f14a86d1e66d21af0d2c46f8d681 Mon Sep 17 00:00:00 2001 From: Angelina von Gegerfelt Date: Fri, 11 Oct 2019 13:20:06 +0200 Subject: [PATCH] Installed ESLint with recommended config for node Installed ESLint and then used init to set it up. I had it use the recommended settings, environment for node. Fixes: https://github.com/nodejs/llnode/issues/310 --- .eslintrc.js | 17 +++++++++++++++++ package.json | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..df0d96ab --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + "env": { + "node": true, + "commonjs": true, + "es6": true + }, + "extends": ["eslint:recommended"], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018 + }, + "rules": { + } +}; diff --git a/package.json b/package.json index 90bc86d7..fb071f65 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "codecov-upload-js": "codecov --disable=gcov --file=coverage-js.lcov", "codecov-upload": "npm run codecov-upload-cc && npm run codecov-upload-js", "linter": "node scripts/linter.js", - "format": "npx clang-format -i src/*" + "format": "npx clang-format -i src/*", + "lint-test": "(npx eslint test{,/**}/*.js && echo 'No problems found') || echo 'Lint failed for some files'" }, "repository": { "type": "git", @@ -54,9 +55,10 @@ }, "homepage": "https://github.com/nodejs/llnode#readme", "devDependencies": { + "clang-format": "1.2.4", "codecov": "^3.1.0", + "eslint": "^6.5.1", "nyc": "^13.1.0", - "clang-format": "1.2.4", "tape": "^4.4.0" }, "nyc": { @@ -73,4 +75,4 @@ "bindings": "^1.3.0", "node-addon-api": "^1.1.0" } -} +} \ No newline at end of file