Update linting packages to latest (#4125)

This commit is contained in:
Peter Hedenskog 2024-04-03 08:56:55 +02:00 committed by GitHub
parent df173df953
commit 8121117b82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 553 additions and 380 deletions

View File

@ -8,7 +8,7 @@ function getDomainOrFileName(input) {
let domainOrFile = input;
domainOrFile = domainOrFile.startsWith('http')
? parse(domainOrFile).hostname
: basename(domainOrFile).replace(/\./g, '_');
: basename(domainOrFile).replaceAll('.', '_');
return domainOrFile;
}

View File

@ -8,7 +8,7 @@ const log = intel.getLogger('sitespeedio.file');
function toSafeKey(key) {
// U+2013 : EN DASH as used on https://en.wikipedia.org/wiki/201920_coronavirus_pandemic
return key.replace(/[ %&()+,./:?|~]|%7C/g, '-');
return key.replaceAll(/[ %&()+,./:?|~]|%7C/g, '-');
}
export function pathToFolder(url, options, alias) {
@ -60,7 +60,7 @@ export function pathToFolder(url, options, alias) {
for (const [index, segment] of pathSegments.entries()) {
if (segment) {
pathSegments[index] = segment.replace(/[^\w.\u0621-\u064A-]/gi, '-');
pathSegments[index] = segment.replaceAll(/[^\w.\u0621-\u064A-]/gi, '-');
}
}

View File

@ -159,9 +159,8 @@ export async function analyzeUrl(
}
}
const scriptCategories = await browserScripts.allScriptCategories();
let scriptsByCategory = await browserScripts.getScriptsForCategories(
scriptCategories
);
let scriptsByCategory =
await browserScripts.getScriptsForCategories(scriptCategories);
if (btOptions.script) {
const userScripts = await parseUserScripts(btOptions.script);

View File

@ -194,10 +194,10 @@ export async function getFilmstrip(
const files = await readdir(join(dir, 'data', 'filmstrip', run + ''));
const timings = [];
for (let file of files) {
timings.push({ time: file.replace(/\D/g, ''), file });
timings.push({ time: file.replaceAll(/\D/g, ''), file });
}
const maxTiming = timings.slice(-1)[0].time;
const maxTiming = timings.at(-1).time;
// We step 100 ms each step ... but if you wanna show all and the last change is late
// use 200 ms

View File

@ -18,9 +18,9 @@ export function writeJunit(results, dir, options) {
if (url.startsWith('http')) {
const parsedUrl = parse(url);
name = url.startsWith('http') ? url : url;
parsedUrl.hostname.replace(/\./g, '_') +
parsedUrl.hostname.replaceAll('.', '_') +
'.' +
parsedUrl.path.replace(/\./g, '_').replace(/\//g, '_');
parsedUrl.path.replaceAll('.', '_').replaceAll('/', '_');
}
const suite = jrp

View File

@ -114,7 +114,7 @@ export default class GcsPlugin extends SitespeedioPlugin {
if (this.options.copyLatestFilesToBase) {
const rootPath = resolve(baseDir, '..');
const directoriesAsArray = rootPath.split(sep);
const rootName = directoriesAsArray.slice(-1)[0];
const rootName = directoriesAsArray.at(-1);
await uploadLatestFiles(rootPath, gcsOptions, rootName);
}
log.info('Finished upload to Google Cloud Storage');

View File

@ -78,8 +78,8 @@ export function getMetricsFromPageSummary(pageInfo) {
return timings.loadEventEnd
? `Median LoadEventEnd: ${timings.loadEventEnd.median}`
: '' + timings.fullyLoaded
? `Median Fully loaded: ${timings.fullyLoaded.median}`
: '';
? `Median Fully loaded: ${timings.fullyLoaded.median}`
: '';
} else {
return '';
}

View File

@ -11,7 +11,7 @@ function infoBox(stat, name, formatter) {
return;
}
return _box(stat, name, 'info', formatter, name.replace(/\s/g, ''));
return _box(stat, name, 'info', formatter, name.replaceAll(/\s/g, ''));
}
function scoreBox(stat, name, formatter, box, limits) {
@ -30,7 +30,7 @@ function scoreBox(stat, name, formatter, box, limits) {
label = 'error';
}
}
return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
}
function timingBox(stat, name, formatter, box, limits) {
@ -50,7 +50,7 @@ function timingBox(stat, name, formatter, box, limits) {
}
}
return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
}
function pagexrayBox(stat, name, formatter, box, limits) {
@ -69,7 +69,7 @@ function pagexrayBox(stat, name, formatter, box, limits) {
}
}
return _box(stat, name, label, formatter, name.replace(/\s/g, ''));
return _box(stat, name, label, formatter, name.replaceAll(/\s/g, ''));
}
function axeBox(stat, name, formatter, url, limits) {

View File

@ -127,7 +127,7 @@ export default class S3Plugin extends SitespeedioPlugin {
if (this.options.copyLatestFilesToBase) {
const rootPath = _resolve(baseDir, '..');
const directoriesAsArray = rootPath.split(sep);
const rootName = directoriesAsArray.slice(-1)[0];
const rootName = directoriesAsArray.at(-1);
await uploadLatestFiles(rootPath, s3Options, rootName);
}
log.info('Finished upload to s3');

View File

@ -43,7 +43,7 @@ function getBoxes(metrics, html) {
// foo bar -> fb
function abbr(string_) {
if (/total|overall/i.test(string_)) return string_.trim();
return string_.replace(/\w+\s?/g, a => a[0]);
return string_.replaceAll(/\w+\s?/g, a => a[0]);
}
function noop(a) {

View File

@ -57,7 +57,7 @@ export class ThirdPartyAggregator {
for (let tool of Object.keys(cpuPerTool)) {
pushStats(
this.cpuPerTool[url],
tool.replace(/\./g, '_'),
tool.replaceAll('.', '_'),
cpuPerTool[tool]
);
}

View File

@ -8,7 +8,7 @@ function joinNonEmpty(strings, delimeter) {
function toSafeKey(key) {
// U+2013 : EN DASH as used on https://en.wikipedia.org/wiki/201920_coronavirus_pandemic
return key.replace(/[ %&()+,./:?|~]|%7C/g, '_');
return key.replaceAll(/[ %&()+,./:?|~]|%7C/g, '_');
}
export function keypathFromUrl(url, includeQueryParameters, useHash, group) {

View File

@ -2,7 +2,7 @@ import get from 'lodash.get';
import { keypathFromUrl } from './flattenMessage.js';
export function toSafeKey(key, safeChar = '_') {
return key.replace(/[ %&+,./:?|~]|%7C/g, safeChar);
return key.replaceAll(/[ %&+,./:?|~]|%7C/g, safeChar);
}
export function getConnectivity(options) {
// if we have a friendly name for your connectivity, use that!

880
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -65,16 +65,16 @@
"ava": "5.2.0",
"changelog-parser": "3.0.1",
"clean-css-cli": "5.6.2",
"eslint": "8.35.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "45.0.2",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unicorn": "51.0.1",
"feed": "4.2.2",
"jsdoc": "4.0.2",
"license-checker": "^25.0.0",
"marked": "4.2.12",
"sass": "1.58.3",
"prettier": "2.8.4",
"prettier": "3.2.5",
"pug-lint": "^2.7.0",
"pug-lint-config-clock": "^2.0.0"
},