From 8d796e6c6bb415f6dbab613b7ab0b241ca40f7de Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Mon, 12 Aug 2024 22:43:19 +0200 Subject: [PATCH] upgrade dependencies --- eslint.mjs | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ eslint.yaml | 66 ----------------------------------------------- package.json | 13 +++++----- 3 files changed, 79 insertions(+), 72 deletions(-) create mode 100644 eslint.mjs delete mode 100644 eslint.yaml diff --git a/eslint.mjs b/eslint.mjs new file mode 100644 index 0000000..d878bca --- /dev/null +++ b/eslint.mjs @@ -0,0 +1,72 @@ +/* +** MQTT-JSON-RPC -- JSON-RPC protocol over MQTT communication +** Copyright (c) 2018-2023 Dr. Ralf S. Engelschall +** +** Permission is hereby granted, free of charge, to any person obtaining +** a copy of this software and associated documentation files (the +** "Software"), to deal in the Software without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Software, and to +** permit persons to whom the Software is furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import globals from "globals" +import path from "node:path" +import { fileURLToPath } from "node:url" +import js from "@eslint/js" +import { FlatCompat } from "@eslint/eslintrc" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}) + +export default [ + ...compat.extends("eslint:recommended"), { + languageOptions: { + globals: { + ...globals.browser, + ...Object.fromEntries(Object.entries(globals.node).map(([key]) => [key, "off"])), + ...globals.commonjs, + ...globals.worker, + ...globals.serviceworker, + process: true, + }, + ecmaVersion: 12, + sourceType: "module", + parserOptions: { ecmaFeatures: { jsx: false } } + }, + rules: { + "indent": ["error", 4, { SwitchCase: 1, }], + "linebreak-style": ["error", "unix"], + "semi": ["error", "never"], + "operator-linebreak": ["error", "after", { overrides: { "&&": "before", "||": "before", ":": "before" } }], + "brace-style": ["error", "stroustrup", { allowSingleLine: true }], + "quotes": ["error", "double"], + "no-multi-spaces": "off", + "no-multiple-empty-lines": "off", + "key-spacing": "off", + "object-property-newline": "off", + "curly": "off", + "space-in-parens": "off", + "no-console": "off", + "lines-between-class-members": "off", + "array-bracket-spacing": "off", + }, +}] + diff --git a/eslint.yaml b/eslint.yaml deleted file mode 100644 index b27cccf..0000000 --- a/eslint.yaml +++ /dev/null @@ -1,66 +0,0 @@ -## -## MQTT-JSON-RPC -- JSON-RPC protocol over MQTT communication -## Copyright (c) 2018-2023 Dr. Ralf S. Engelschall -## -## Permission is hereby granted, free of charge, to any person obtaining -## a copy of this software and associated documentation files (the -## "Software"), to deal in the Software without restriction, including -## without limitation the rights to use, copy, modify, merge, publish, -## distribute, sublicense, and/or sell copies of the Software, and to -## permit persons to whom the Software is furnished to do so, subject to -## the following conditions: -## -## The above copyright notice and this permission notice shall be included -## in all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -## IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -## CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -## TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -## SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -## - ---- - -extends: - - eslint:recommended - - eslint-config-standard - -parserOptions: - ecmaVersion: 12 - sourceType: module - ecmaFeatures: - jsx: false - -env: - browser: true - node: false - commonjs: true - worker: true - serviceworker: true - -globals: - process: true - -rules: - # modified rules - indent: [ "error", 4, { "SwitchCase": 1 } ] - linebreak-style: [ "error", "unix" ] - semi: [ "error", "never" ] - operator-linebreak: [ "error", "after", { "overrides": { "&&": "before", "||": "before", ":": "before" } } ] - brace-style: [ "error", "stroustrup", { "allowSingleLine": true } ] - quotes: [ "error", "double" ] - - # disabled rules - no-multi-spaces: off - no-multiple-empty-lines: off - key-spacing: off - object-property-newline: off - curly: off - space-in-parens: off - no-console: off - lines-between-class-members: off - array-bracket-spacing: off - diff --git a/package.json b/package.json index 00f509b..b348b06 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,18 @@ "homepage": "https://github.com/rse/mqtt-json-rpc", "bugs": "https://github.com/rse/mqtt-json-rpc/issues", "devDependencies": { - "eslint": "8.44.0", - "eslint-config-standard": "17.1.0", - "eslint-plugin-import": "2.27.5", + "eslint": "9.9.0", "eslint-plugin-node": "11.1.0", - "mqtt": "4.3.7" + "globals": "15.9.0", + "@eslint/js": "9.9.0", + "@eslint/eslintrc": "3.1.0", + "mqtt": "5.9.1" }, "peerDependencies": { "mqtt": ">=4.0.0" }, "dependencies": { - "pure-uuid": "1.6.4", + "pure-uuid": "1.8.1", "encodr": "1.3.5", "jsonrpc-lite": "2.2.0" }, @@ -36,6 +37,6 @@ "node": ">=12.0.0" }, "scripts": { - "prepublishOnly": "eslint --config eslint.yaml mqtt-json-rpc.js sample/sample.js" + "prepublishOnly": "eslint --config eslint.mjs mqtt-json-rpc.js sample/sample.js" } }