diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 0f783fac..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "env": { - "es6": true, - "node": true, - "jasmine": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2022 - }, - "rules": { - "no-var": "error", - "prefer-const": "error", - "prefer-arrow-callback": "error", - "no-else-return": "error", - "no-multi-spaces": "error", - "no-whitespace-before-property": "error", - "camelcase": "error", - "new-cap": "error", - "no-console": "error", - "comma-dangle": "error", - "no-shadow": "error", - "object-shorthand": [ - "error", - "properties" - ], - "indent": [ - "error", - 4, - { - "SwitchCase": 1 - } - ], - "quotes": [ - "error", - "single" - ], - "semi": [ - "error", - "always" - ] - }, - "globals": { - "BigInt": true - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..3b31506e --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,44 @@ +const js = require("@eslint/js"); +const globals = require("globals"); + +module.exports = [ + js.configs.recommended, + { + languageOptions: { + globals: { + ...globals.es6, + ...globals.node, + ...globals.jasmine, + ...globals.BigInt, + }, + parserOptions: { + ecmaFeatures: { globalReturn: true }, + }, + sourceType: "commonjs", + ecmaVersion: 2022, + }, + rules: { + "no-var": "error", + "prefer-const": "error", + "prefer-arrow-callback": "error", + "no-else-return": "error", + "no-multi-spaces": "error", + "no-whitespace-before-property": "error", + camelcase: "error", + "new-cap": "error", + "no-console": "error", + "comma-dangle": "error", + "no-shadow": "error", + "object-shorthand": ["error", "properties"], + indent: [ + "error", + 4, + { + SwitchCase: 1, + }, + ], + quotes: ["error", "single"], + semi: ["error", "always"], + }, + }, +]; diff --git a/package.json b/package.json index faf5a5c2..9e44e58b 100644 --- a/package.json +++ b/package.json @@ -47,11 +47,13 @@ "spex": "3.3.0" }, "devDependencies": { + "@eslint/js": "9.1.1", "@types/node": "20.12.5", "bluebird": "3.7.2", "coveralls": "3.1.1", "cspell": "8.6.1", - "eslint": "8.57.0", + "eslint": "9.0.0", + "globals": "15.0.0", "istanbul": "0.4.5", "jasmine-node": "3.0.0", "jsdoc": "4.0.2", diff --git a/test/db/init.js b/test/db/init.js index 7783ab83..e9c16abd 100644 --- a/test/db/init.js +++ b/test/db/init.js @@ -8,7 +8,6 @@ const {ColorConsole} = require('../../lib/utils/color'); const header = dbHeader({ query(e) { - // eslint-disable-next-line no-console ColorConsole.info(e.query); // print all executed queries; }, promiseLib: promise, @@ -75,11 +74,9 @@ async function getPgVersion() { } }) .then(() => { - // eslint-disable-next-line no-console ColorConsole.success.bright('*** SUCCESS ***'); }) .catch(error => { - // eslint-disable-next-line no-console ColorConsole.error.bright('FAILED:', error); }) .finally(pgp.end);