Skip to content

Commit

Permalink
Bump eslint from 8.26.0 to 9.0.0 (#1191)
Browse files Browse the repository at this point in the history
* 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](eslint/eslint@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] <support@github.com>

* update with latest eslint version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Denis Ah-Kang <denis@w3.org>
  • Loading branch information
dependabot[bot] and deniak committed Apr 18, 2024
1 parent 7d24608 commit 84edffc
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 69 deletions.
45 changes: 0 additions & 45 deletions .eslintrc.json

This file was deleted.

18 changes: 9 additions & 9 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ app.set('trust proxy', true);

// Index Page
app.get('/', (request, response) => {
// eslint-disable-next-line no-undef
response.sendFile(`${process.cwd()}/views/index.html`);
});

// New UI
app.get('/ui', (request, response) => {
// eslint-disable-next-line no-undef
response.sendFile(`${process.cwd()}/views/web-interface.html`);
});

Expand Down Expand Up @@ -99,7 +99,7 @@ app.get('/api/status', (req, res) => {

function dumpJobResult(dest, result) {
Fs.writeFile(dest, `${JSON.stringify(result, null, 2)}\n`, err => {
// eslint-disable-next-line no-console
if (err) console.error(err);
});
}
Expand Down Expand Up @@ -176,7 +176,7 @@ const processRequest = (req, res, isTar) => {
'',
new Map(
jobList.reduce((object, value) => {
// eslint-disable-next-line no-param-reassign
object[value] = new Job();
return object;
}, {}),
Expand Down Expand Up @@ -205,13 +205,13 @@ const processRequest = (req, res, isTar) => {
requests[id].results,
)
.then(async state => {
// eslint-disable-next-line no-console
console.log(`[${state.get('status').toUpperCase()}] ${url}`);
dumpJobResult(
`${argResultLocation + path.sep + id}.json`,
requests[id],
);
// eslint-disable-next-line no-console
if (dryRun) console.log('Dry-run: omitting e-mail notification');
else {
sendMessage(
Expand Down Expand Up @@ -247,7 +247,7 @@ passport.use(

ldap.authenticate(username, password, (err, user) => {
if (err) {
// eslint-disable-next-line no-console
console.log('LDAP auth error: %s', err);
}
done(null, user);
Expand Down Expand Up @@ -286,12 +286,12 @@ app.post(

app.listen(process.env.PORT || port).on('error', err => {
if (err) {
// eslint-disable-next-line no-console
console.error(`Error while trying to launch the server: “${err}”.`);
}
});

// eslint-disable-next-line no-console
console.log(
`${meta.name} version ${meta.version} running on ${
process.platform
Expand Down
2 changes: 1 addition & 1 deletion assets/js/behaviour.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-alert */
/**
* Behaviour of the Echidna UI.
*
Expand Down
47 changes: 47 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"extends": ["airbnb-base", "prettier", "plugin:node/recommended"],
"plugins": ["prettier", "node"],
"env": {
"node": true,
"es2022": true
},
"parserOptions": {
"ecmaVersion": 2022,
"allowImportExportEverywhere": true
},
"rules": {
"prettier/prettier": "error",
"strict": "off",
"consistent-return": "off",
"import/extensions": "off",
"global-require": "off",
"no-restricted-syntax": "warn",
"guard-for-in": "warn",
"prefer-destructuring": "warn",
"import/prefer-default-export": "off",
"no-unpublished-import": "off",
"node/no-unsupported-features/es-syntax": [
"warn",
{
"version": ">=18.0.0",
"ignores": ["modules"]
}
]
},
"overrides": [
{
"files": ["test/**/*.js"],
"env": {
"mocha": true
}
},
{
"files": ["assets/**/*.js"],
"env": {
"browser": true
}
}
]
}
];
8 changes: 4 additions & 4 deletions lib/ip-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import path from 'path';
import { fileURLToPath } from 'url';

const { List } = pkg;
// eslint-disable-next-line no-underscore-dangle
const __filenameNew = fileURLToPath(import.meta.url);
// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(__filenameNew);

/**
Expand All @@ -35,7 +35,7 @@ IPChecker.check = ip =>
const ghIp = octokit.request('GET /meta');
// downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=56519
const azureIp = fs.promises
// eslint-disable-next-line no-undef
.readFile(`${__dirname}/../ServiceTags_Public.json`)
.then(JSON.parse);
Promise.all([ghIp, azureIp])
Expand All @@ -62,7 +62,7 @@ IPChecker.check = ip =>
}
resolve(errors);
})
// eslint-disable-next-line no-console
.catch(e => console.error(e));
});

Expand Down
2 changes: 1 addition & 1 deletion lib/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Job(status, errors) {
* @param {*} v - The value to set
* @returns {Job} The resulting job
*/
// eslint-disable-next-line consistent-return
this.set = (k, v) => {
switch (k) {
case 'status':
Expand Down
8 changes: 4 additions & 4 deletions lib/mailer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file Send e-mail notification about a publication job. Called by app.js after Orchestrator has initiated the jobs.
*/
/* eslint-disable no-console */

'use strict';

Expand All @@ -14,9 +14,9 @@ import SpecberusWrapper from './specberus-wrapper.js';
import { importJSON } from './util.js';

const meta = importJSON('../package.json', import.meta.url);
// eslint-disable-next-line no-underscore-dangle
const __filenameNew = fileURLToPath(import.meta.url);
// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(__filenameNew);

const mailTemplatesDir = `${__dirname}/../assets/mail-templates/`;
Expand Down Expand Up @@ -230,7 +230,7 @@ const sendMessage = async (id, state, json, url, ccEmail, decision) => {
];
} else message.text = message.text.replace('@ATTACHMENT', '');

// eslint-disable-next-line consistent-return
transporter.sendMail(message, (error, info) => {
if (error) return console.log(error);
console.log(`Message ${info.messageId} sent: ${info.response}`);
Expand Down
5 changes: 2 additions & 3 deletions lib/specberus-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable node/no-unsupported-features/es-syntax */
/* eslint-disable global-require */

/**
* @file A [Specberus](https://github.com/w3c/specberus) wrapper. Validate the compliance of Technical Reports with [publication rules](https://www.w3.org/pubrules/doc).
*/
Expand Down Expand Up @@ -58,7 +57,7 @@ SpecberusWrapper.validate = (url, stateMetadata) =>
reject(new Error(exception.message));
});

// eslint-disable-next-line consistent-return
(async () => {
const profile = stateMetadata.get('profile');
const patentPolicy = stateMetadata.get('patentPolicy');
Expand Down
2 changes: 1 addition & 1 deletion lib/transition-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TransitionChecker.check = (
sort: 'updated',
per_page: 100, // TODO: get all the issues, not just the first 100
})
// eslint-disable-next-line consistent-return
.then(content => {
const issueFound = content.items.some(issue => {
if (issue.title.endsWith(` ${shortname}`)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@rvagg/chai-as-promised": "8.0.1",
"coveralls": "3.1.1",
"cspell": "8.0.0",
"eslint": "8.26.0",
"eslint": "9.0.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-import": "2.26.0",
Expand Down

0 comments on commit 84edffc

Please sign in to comment.