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