From 8208daf1d22c8705b8b96291c8883d68897db8d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 00:58:06 +0000 Subject: [PATCH 1/3] build(deps-dev): bump eslint from 8.26.0 to 9.0.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.26.0 to 9.0.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.26.0...v9.0.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4eb47f1..053283b 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "tar-stream": "3.1.1" }, "devDependencies": { - "eslint": "8.26.0", + "eslint": "9.0.0", "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-html": "8.0.0", From 51cc401e48990643fce85a54668dc5776cb75e54 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Thu, 18 Apr 2024 16:02:44 +0400 Subject: [PATCH 2/3] update with latest eslint version --- .eslintrc.json | 34 ---------------------------------- eslint.config.cjs | 36 ++++++++++++++++++++++++++++++++++++ generators/respec.js | 3 +-- server.js | 5 ++--- test/test.js | 1 - 5 files changed, 39 insertions(+), 40 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.cjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d0a0ae3..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "extends": ["airbnb-base", "prettier"], - "plugins": ["prettier"], - "rules": { - "prettier/prettier": "error", - "func-names": "off", - "vars-on-top": "off", - "consistent-return": "off" - }, - "overrides": [ - { - "files": ["index.html"], - "plugins": [ - "html" - ] - }, - { - "files": ["server.js", "generators/*.js", "tools/**/*.js"], - "plugins": ["node"], - "extends": ["plugin:node/recommended"] - }, - { - "files": ["test/*.js"], - "env": { - "mocha": true - }, - "rules": { - "node/no-unpublished-require": "off" - }, - "plugins": ["node"], - "extends": "plugin:node/recommended" - } - ] -} diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..c949193 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,36 @@ +[ + { + "extends": ["airbnb-base", "prettier"], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error", + "func-names": "off", + "vars-on-top": "off", + "consistent-return": "off" + }, + "overrides": [ + { + "files": ["index.html"], + "plugins": [ + "html" + ] + }, + { + "files": ["server.js", "generators/*.js", "tools/**/*.js"], + "plugins": ["node"], + "extends": ["plugin:node/recommended"] + }, + { + "files": ["test/*.js"], + "env": { + "mocha": true + }, + "rules": { + "node/no-unpublished-require": "off" + }, + "plugins": ["node"], + "extends": "plugin:node/recommended" + } + ] + } +] diff --git a/generators/respec.js b/generators/respec.js index 8c1333a..da86be1 100644 --- a/generators/respec.js +++ b/generators/respec.js @@ -7,10 +7,9 @@ class SpecGeneratorError extends Error { } } -// eslint-disable-next-line import/prefer-default-export export async function generate(url) { try { - // eslint-disable-next-line no-console + console.log("Generating", url); const { html, errors, warnings } = await toHTML(url, { timeout: 30000, diff --git a/server.js b/server.js index 58599e0..ce1689c 100644 --- a/server.js +++ b/server.js @@ -12,7 +12,6 @@ import request from "request"; import { mkdirp } from "mkdirp"; import fetch from "node-fetch"; -// eslint-disable-next-line import/extensions import { generate } from "./generators/respec.js"; const genMap = { @@ -67,7 +66,7 @@ async function extractTar(tarFile) { extract.on("finish", () => { if (!hasIndex) { - // eslint-disable-next-line prefer-promise-reject-errors + reject("No index.html file"); } else { resolve(uploadPath); @@ -103,7 +102,7 @@ app.get( .status(500) .json({ error: "Both 'type' and 'url' are required." }); } - // eslint-disable-next-line no-prototype-builtins + if (!genMap.hasOwnProperty(req.query.type)) { return res .status(500) diff --git a/test/test.js b/test/test.js index c116907..74daaef 100644 --- a/test/test.js +++ b/test/test.js @@ -1,6 +1,5 @@ import ASSERT from "assert"; import REQUEST from "request"; -// eslint-disable-next-line import/named, import/extensions import app, { server } from "../server.js"; const PORT = 3000; From fef5deae3e4d6bf81e91369af4ce9943ac2dba05 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Thu, 18 Apr 2024 16:11:51 +0400 Subject: [PATCH 3/3] remove eslint plugin --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index 053283b..0182a14 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,8 @@ }, "devDependencies": { "eslint": "9.0.0", - "eslint-config-airbnb-base": "15.0.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-html": "8.0.0", - "eslint-plugin-import": "2.26.0", "eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "5.0.0-alpha.2", "husky": "^9.0.6",