diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index faca7bc..0000000 --- a/.eslintrc +++ /dev/null @@ -1,16 +0,0 @@ - -{ - "env": { - "jest": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": "latest" - }, - "rules": { - "no-unused-vars": ["warn", { "argsIgnorePattern": "lazy" }], - "no-extra-semi": 1 - } -} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..6b07733 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,18 @@ +import js from '@eslint/js'; +import globals from 'globals' + +export default [ + js.configs.recommended, + { + languageOptions: { + globals: { + ...globals.node, + ...globals.jest + } + }, + rules: { + 'no-unused-vars': ['warn', { argsIgnorePattern: 'lazy' }], + 'no-extra-semi': 1, + }, + } +] \ No newline at end of file diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index 50518f0..1b4b622 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -602,7 +602,7 @@ module.exports.csdl2openapi = function ( if (serversObject) { try { servers = JSON.parse(serversObject); - } catch (err) { + } catch { throw new Error(`The input server object is invalid.`); } diff --git a/package.json b/package.json index 2da9b3f..a2feaaa 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/node": "^24.3.0", - "eslint": "^8.56.0", + "eslint": "^9.33.0", "typescript": "^5.9.2" } }