Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ESLint and use new config format #414

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion __tests__/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// The sample config should suffice for just starting up the server.
// We may need something fancier if the integration tests get more in-depth.
jest.mock("../private-config.json", () => {
// eslint-disable-next-line global-require
return require("../private-config.sample.json");
}, { virtual: true });

Expand Down
31 changes: 31 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import domenicConfig from "@domenic/eslint-config";
import globals from "globals";

export default [
{
ignores: ["coverage/**/*"]
},
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
globals: globals.node
}
},
...domenicConfig,
{
rules: {
camelcase: ["error", { properties: "never" }]
}
},
{
files: ["__tests__/**/*.js"],
languageOptions: {
globals: globals.jest
},
rules: {
// Plays poorly with how we set up mocks.
"no-loop-func": "off"
}
}
];
2 changes: 1 addition & 1 deletion lib/get-user-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async function isOrgMember(org, username) {
try {
await gitHubAPI.orgs.checkPublicMembershipForUser({ org, username });
return true;
} catch (e) {
} catch {
return false;
}
}
1 change: 0 additions & 1 deletion lib/helpers/private-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use strict";
/* eslint-disable global-require */

let privateConfig;
const privateConfigFromEnv = process.env.PRIVATE_CONFIG_JSON;
Expand Down
2 changes: 1 addition & 1 deletion lib/process-agreement.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function getEntityInfo(body) {

try {
info.url = (new URL(info.url)).href;
} catch (e) {
} catch {
throw new BadRequest("The given 'url' could not be parsed as a URL");
}

Expand Down
2 changes: 1 addition & 1 deletion lib/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = [
let parsedURL;
try {
parsedURL = new URL(pr);
} catch (e) {
} catch {
throw new BadRequest("The pull request URL parameter must be a valid URL.");
}

Expand Down
Loading