Skip to content

Commit 3c068ab

Browse files
authored
Merge pull request #148 from Automattic/dependabot/npm_and_yarn/eslint-9.39.2
deps: bump eslint from 8.57.1 to 9.39.2
2 parents bb79795 + 3b5eec6 commit 3c068ab

23 files changed

Lines changed: 560 additions & 276 deletions

.eslintrc.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import conf from "eslint-config-google";
4+
import jsdoc from 'eslint-plugin-jsdoc';
5+
6+
export default [
7+
js.configs.recommended,
8+
jsdoc.configs['flat/recommended'],
9+
{
10+
languageOptions: {
11+
ecmaVersion: 2022,
12+
sourceType: "script",
13+
globals: {
14+
...globals.node,
15+
...globals.mocha,
16+
}
17+
},
18+
rules: {
19+
...conf.rules,
20+
'arrow-parens': ['error', 'as-needed'],
21+
'max-len': ['error', {
22+
code: 120,
23+
ignoreComments: true,
24+
}],
25+
'jsdoc/require-jsdoc': ['error', {
26+
require: {
27+
FunctionDeclaration: true,
28+
MethodDefinition: false,
29+
ClassDeclaration: false,
30+
ArrowFunctionExpression: false,
31+
FunctionExpression: false,
32+
},
33+
}],
34+
'valid-jsdoc': 'off',
35+
'require-jsdoc': 'off',
36+
}
37+
},
38+
];

lib/app.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
const _ = require('lodash');
55
const hasher = require('object-hash');
66
const path = require('path');
7+
// eslint-disable-next-line no-redeclare
78
const Promise = require('./promise');
89
const utils = require('./utils');
910

@@ -153,7 +154,7 @@ module.exports = class App {
153154
// do stuff with them later
154155
this.warnings = [];
155156
this.id = hasher(`${this.name}-${this.root}`);
156-
};
157+
}
157158

158159
/*
159160
* @TODO, add compose data to the add
@@ -227,7 +228,7 @@ module.exports = class App {
227228
*/
228229
.then(() => this.events.emit('post-destroy'))
229230
.then(() => this.log.info('destroyed app.'));
230-
};
231+
}
231232

232233
/**
233234
* Initializes the app
@@ -308,7 +309,7 @@ module.exports = class App {
308309
* @property {App} app The app instance.
309310
*/
310311
.then(() => this.events.emit('ready', this));
311-
};
312+
}
312313

313314
/**
314315
* Rebuilds an app.
@@ -358,14 +359,14 @@ module.exports = class App {
358359
*/
359360
.then(() => this.events.emit('post-rebuild'))
360361
.then(() => this.log.info('rebuilt app.'));
361-
};
362+
}
362363

363364
/*
364365
* @TODO
365366
*/
366367
reset() {
367368
this.initialized = false;
368-
};
369+
}
369370

370371
/**
371372
* Stops and then starts an app.
@@ -388,7 +389,7 @@ module.exports = class App {
388389
return this.stop()
389390
.then(() => this.start())
390391
.then(() => this.log.info('restarted app.'));
391-
};
392+
}
392393

393394
/**
394395
* Starts an app.
@@ -434,7 +435,7 @@ module.exports = class App {
434435
*/
435436
.then(() => this.events.emit('post-start'))
436437
.then(() => this.log.info('started app.'));
437-
};
438+
}
438439

439440
/**
440441
* Stops an app.
@@ -473,7 +474,7 @@ module.exports = class App {
473474
*/
474475
.then(() => this.events.emit('post-stop'))
475476
.then(() => this.log.info('stopped app.'));
476-
};
477+
}
477478

478479
/**
479480
* Soft removes the apps services but maintains persistent data like app volumes.
@@ -521,14 +522,14 @@ module.exports = class App {
521522
*/
522523
.then(() => this.events.emit('post-uninstall'))
523524
.then(() => this.log.info('uninstalled app.'));
524-
};
525+
}
525526

526527
getServiceContainerId(service) {
527528
return `${this.project}-${service}-1`;
528-
};
529+
}
529530

530531
getServiceFromContainerId(id) {
531532
const regex = new RegExp(`${this.project}-(.*)-1`);
532533
return id.replace(regex, '$1');
533-
};
534+
}
534535
};

lib/art.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ exports.appStart = ({name, phase = 'pre', warnings = {}} = {}) => {
103103
'',
104104
].join(os.EOL);
105105
case 'pre':
106-
return chalk.cyan(`Let\'s get this party started! Starting app ${italicize(name)}...`);
106+
return chalk.cyan(`Let's get this party started! Starting app ${italicize(name)}...`);
107107
case 'post':
108108
return [
109109
'',
@@ -113,7 +113,7 @@ exports.appStart = ({name, phase = 'pre', warnings = {}} = {}) => {
113113
'Here are some vitals:',
114114
'',
115115
].join(os.EOL);
116-
case 'report':
116+
case 'report': {
117117
const message = [
118118
'',
119119
chalk.yellow('Warning!'),
@@ -132,6 +132,7 @@ exports.appStart = ({name, phase = 'pre', warnings = {}} = {}) => {
132132
message.push('Here are some vitals:');
133133
message.push('');
134134
return message.join(os.EOL);
135+
}
135136
}
136137
};
137138

@@ -141,7 +142,7 @@ exports.appStart = ({name, phase = 'pre', warnings = {}} = {}) => {
141142
exports.appStop = ({name, phase = 'pre'} = {}) => {
142143
switch (phase) {
143144
case 'pre':
144-
return chalk.cyan(`This party\'s over :( Stopping app ${italicize(name)}`);
145+
return chalk.cyan(`This party's over :( Stopping app ${italicize(name)}`);
145146
case 'post':
146147
return chalk.red(`App ${italicize(name)} has been stopped!`);
147148
}

lib/cache.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = class Cache extends NodeCache {
2828
this.cacheDir = cacheDir;
2929
// Ensure the cache dir exists
3030
mkdirSync(this.cacheDir, {recursive: true});
31-
};
31+
}
3232

3333
/**
3434
* Sets an item in the cache
@@ -53,6 +53,7 @@ module.exports = class Cache extends NodeCache {
5353
set(key, data, {persist = false, ttl = 0} = {}) {
5454
// Unsafe cache key patterns
5555
const patterns = {
56+
// eslint-disable-next-line no-control-regex
5657
controlRe: /[\x00-\x1f\x80-\x9f]/g, // NOSONAR
5758
illegalRe: /[/?<>\\*|":]/g, // NOSONAR
5859
reservedRe: /^\.+$/,
@@ -75,7 +76,7 @@ module.exports = class Cache extends NodeCache {
7576
if (persist) {
7677
writeFileSync(join(this.cacheDir, key), data);
7778
}
78-
};
79+
}
7980

8081
/**
8182
* Gets an item in the cache
@@ -100,11 +101,11 @@ module.exports = class Cache extends NodeCache {
100101
try {
101102
this.log.debug('Trying to retrieve from file cache with key %s', key);
102103
return readFileSync(join(this.cacheDir, key));
103-
} catch (e) {
104+
} catch {
104105
this.log.debug('File cache miss with key %s', key);
105106
}
106107
}
107-
};
108+
}
108109

109110
/**
110111
* Manually remove an item from the cache.
@@ -124,8 +125,8 @@ module.exports = class Cache extends NodeCache {
124125
// Also remove file if applicable
125126
try {
126127
unlinkSync(join(this.cacheDir, key));
127-
} catch (e) {
128+
} catch {
128129
this.log.debug('No file cache with key %s', key);
129130
}
130-
};
131+
}
131132
};

0 commit comments

Comments
 (0)