From 01b42849eb8f7807067c52729327fb44d336dd6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20Vrzi=C4=87?= Date: Thu, 24 Oct 2024 18:23:07 +0200 Subject: [PATCH] Migrated from eslint 8 to eslint 9 --- .eslintrc => eslint.config.js | 51 +++++++++-------------------------- package.json | 2 +- tests/blake2.js | 2 -- 3 files changed, 13 insertions(+), 42 deletions(-) rename .eslintrc => eslint.config.js (52%) diff --git a/.eslintrc b/eslint.config.js similarity index 52% rename from .eslintrc rename to eslint.config.js index e06f19c..075e9dd 100644 --- a/.eslintrc +++ b/eslint.config.js @@ -1,56 +1,29 @@ -{ - "rules": { - "indent": [2, "tab"], +module.exports = [{ + languageOptions: { + ecmaVersion: 8, + sourceType: "commonjs", + }, + rules: { + indent: [2, "tab"], "linebreak-style": [2, "unix"], - - "semi": [2, "always"], - + semi: [2, "always"], "no-shadow": 1, - "no-unused-vars": 1, - /* We use _method for private methods */ "no-underscore-dangle": 0, - - /* eslint expects us to put "use strict" in every function? */ - "strict": 0, - - /* eslint doesn't like "use strict" because of concatenation issues, - * but it's not a problem with node. */ - "global-strict": 0, - /* Don't care whether it's "quote" or 'quote' */ - "quotes": 0, - + quotes: 0, /* We do ,obj in multi-line arrays literals */ "comma-spacing": 0, - /* We have a space before a tab in the first line of a multi-line array literal */ "no-mixed-spaces-and-tabs": 0, - - /* Complains about while(true) */ - "no-constant-condition": 0, - /* We don't space our multiplications */ "space-infix-ops": 0, - /* It's okay to make functions in a loop if you're using let and const */ "no-loop-func": 0, - /* We sometimes use 'function() { new X() }` in a test to test - * for exceptions thrown in the constructor. */ - "no-new": 0 - }, - "env": { - "es6": true, - "node": true - }, - "globals": { - "it": true, - "describe": true, + * for exceptions thrown in the constructor. */ + "no-new": 0, }, - "parserOptions": { - "ecmaVersion": 8 - } -} +}]; diff --git a/package.json b/package.json index 7e3d2f8..e6b4315 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "nan": "^2.20.0" }, "devDependencies": { - "eslint": "^8.57.0", + "eslint": "^9.13.0", "mocha": "^10.5.1" }, "contributors": [ diff --git a/tests/blake2.js b/tests/blake2.js index db9f168..fd15a8d 100644 --- a/tests/blake2.js +++ b/tests/blake2.js @@ -374,9 +374,7 @@ describe('blake2', function() { describe('binding', function() { it('throws Error if called without "new"', function() { assert.throws(function() { - /* eslint-disable new-cap */ binding.Hash('blake2b'); - /* eslint-enable new-cap */ }, /must be called with new/); }); });