Skip to content

Commit

Permalink
update with latest eslint version
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak committed Apr 18, 2024
1 parent 8208daf commit 51cc401
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 40 deletions.
34 changes: 0 additions & 34 deletions .eslintrc.json

This file was deleted.

36 changes: 36 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
3 changes: 1 addition & 2 deletions generators/respec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 51cc401

Please sign in to comment.