diff --git a/build.js b/build.mjs
similarity index 72%
rename from build.js
rename to build.mjs
index 1fedf924..4873b0da 100644
--- a/build.js
+++ b/build.mjs
@@ -1,20 +1,25 @@
-const { writeFileSync } = require('node:fs');
-const { join, sep } = require('node:path');
+import { writeFileSync } from 'node:fs';
+import { dirname, join, sep } from 'node:path';
+import { fileURLToPath } from 'node:url';
-const prettier = require('prettier');
+import { format } from 'prettier';
-const { configs, environments } = require('./src/config');
+import configFile from './src/config.js';
+
+const { configs, environments } = configFile;
const resolveStart = '__REQUIRE_RESOLVE__';
const resolveEnd = '__END_REQUIRE_RESOLVE__';
+const __dirname = dirname(fileURLToPath(import.meta.url));
+
// Require.resolve needs to be dynamic and cannot be statically stringified with JSON.stringify
const stringify = (data) =>
`module.exports = ${JSON.stringify(data, (k, v) => {
if (k === 'parser' && typeof v === 'string' && v.startsWith(__dirname)) {
const pathWithoutNodeModules = v.replace(
join(__dirname, `node_modules${sep}`),
- ''
+ '',
);
// Takes the file path and changes it to just the name of the package the path was in
const packagePath = pathWithoutNodeModules.startsWith('@')
@@ -29,12 +34,13 @@ const stringify = (data) =>
})}`.replace(
// Wrap the relative parser path with require.resolve
new RegExp(`"${resolveStart}(.*?)${resolveEnd}"`, 'g'),
- (_match, replacement) => `require.resolve("${replacement}")`
+ (_match, replacement) => `require.resolve("${replacement}")`,
);
const createFile = (data) =>
// Clean up the file so that it is readable
- prettier.format(stringify(data), { parser: 'babel', singleQuote: true });
+ format(stringify(data), { parser: 'babel', singleQuote: true });
// Snapshots the merged config to make debugging rules easier and to reduce dependencies
-writeFileSync(join('dist', 'config.js'), createFile({ configs, environments }));
+const text = await createFile({ configs, environments });
+writeFileSync(join('dist', 'config.js'), text);
diff --git a/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/decorators.js b/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/decorators.js
index 007f9769..2f7d24e3 100644
--- a/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/decorators.js
+++ b/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/decorators.js
@@ -20,7 +20,7 @@ function method(key, body) {
'method',
t.identifier(key),
[],
- t.blockStatement(body)
+ t.blockStatement(body),
);
}
@@ -28,7 +28,7 @@ function takeDecorators(node) {
let result;
if (node.decorators && node.decorators.length > 0) {
result = t.arrayExpression(
- node.decorators.map((decorator) => decorator.expression)
+ node.decorators.map((decorator) => decorator.expression),
);
}
@@ -58,7 +58,7 @@ function extractElementDescriptor(/* this: File, */ classRef, superRef, path) {
throw path.buildCodeFrameError(
`Private ${
isMethod ? 'methods' : 'fields'
- } in decorated classes are not supported yet.`
+ } in decorated classes are not supported yet.`,
);
}
@@ -72,7 +72,7 @@ function extractElementDescriptor(/* this: File, */ classRef, superRef, path) {
scope,
file: this,
},
- true
+ true,
).replace();
const properties = [
@@ -88,7 +88,7 @@ function extractElementDescriptor(/* this: File, */ classRef, superRef, path) {
properties.push(prop('value', nameFunction({ node, id, scope }) || node));
} else if (node.value) {
properties.push(
- method('value', template.statements.ast`return ${node.value}`)
+ method('value', template.statements.ast`return ${node.value}`),
);
} else {
properties.push(prop('value', scope.buildUndefinedNode()));
@@ -132,7 +132,7 @@ export function buildDecoratedClass(ref, path, elements, file) {
const classDecorators = takeDecorators(node);
const definitions = t.arrayExpression(
- elements.map(extractElementDescriptor.bind(file, node.id, superId))
+ elements.map(extractElementDescriptor.bind(file, node.id, superId)),
);
let replacement = template.expression.ast`
@@ -149,7 +149,7 @@ export function buildDecoratedClass(ref, path, elements, file) {
if (!isStrict) {
replacement.arguments[1].body.directives.push(
- t.directive(t.directiveLiteral('use strict'))
+ t.directive(t.directiveLiteral('use strict')),
);
}
diff --git a/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/fields.js b/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
index 90d8511e..bc350a41 100644
--- a/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/fixtures/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -54,7 +54,7 @@ export function buildPrivateNamesNodes(privateNamesMap, loose, state) {
initNodes.push(
template.statement.ast`
var ${id} = ${state.addHelper('classPrivateFieldLooseKey')}("${name}")
- `
+ `,
);
} else if (isMethod && !isStatic) {
if (isAccessor) {
@@ -237,7 +237,7 @@ const privateNameHandlerSpec = {
this.receiver(member),
t.cloneNode(id),
]),
- t.identifier('value')
+ t.identifier('value'),
);
},
@@ -260,7 +260,7 @@ const privateNameHandlerLoose = {
BASE: file.addHelper('classPrivateFieldLooseBase'),
REF: object,
PROP: privateNamesMap.get(name).id,
- })
+ }),
);
},
};
@@ -270,7 +270,7 @@ export function transformPrivateNamesUsage(
path,
privateNamesMap,
loose,
- state
+ state,
) {
const body = path.get('body');
@@ -418,8 +418,8 @@ function buildPublicFieldInitLoose(ref, prop) {
t.assignmentExpression(
'=',
t.memberExpression(ref, key, computed || t.isLiteral(key)),
- value
- )
+ value,
+ ),
);
}
@@ -432,7 +432,7 @@ function buildPublicFieldInitSpec(ref, prop, state) {
ref,
computed || t.isLiteral(key) ? key : t.stringLiteral(key.name),
value,
- ])
+ ]),
);
}
@@ -487,7 +487,7 @@ function buildPrivateMethodDeclaration(prop, privateNamesMap, loose = false) {
params,
body,
generator,
- async
+ async,
);
const isGetter = getId && !getterDeclared && params.length === 0;
const isSetter = setId && !setterDeclared && params.length > 0;
@@ -516,7 +516,7 @@ function buildPrivateMethodDeclaration(prop, privateNamesMap, loose = false) {
return t.variableDeclaration('var', [
t.variableDeclarator(
id,
- t.functionExpression(id, params, body, generator, async)
+ t.functionExpression(id, params, body, generator, async),
),
]);
}
@@ -566,7 +566,7 @@ export function buildFieldsInitNodes(
props,
privateNamesMap,
state,
- loose
+ loose,
) {
const staticNodes = [];
const instanceNodes = [];
@@ -591,14 +591,14 @@ export function buildFieldsInitNodes(
case isStatic && isPrivate && isField && loose: {
needsClassRef = true;
staticNodes.push(
- buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap)
+ buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),
);
break;
}
case isStatic && isPrivate && isField && !loose: {
needsClassRef = true;
staticNodes.push(
- buildPrivateStaticFieldInitSpec(prop, privateNamesMap)
+ buildPrivateStaticFieldInitSpec(prop, privateNamesMap),
);
break;
}
@@ -610,13 +610,13 @@ export function buildFieldsInitNodes(
case isStatic && isPublic && isField && !loose: {
needsClassRef = true;
staticNodes.push(
- buildPublicFieldInitSpec(t.cloneNode(ref), prop, state)
+ buildPublicFieldInitSpec(t.cloneNode(ref), prop, state),
);
break;
}
case isInstance && isPrivate && isField && loose: {
instanceNodes.push(
- buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap)
+ buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),
);
break;
}
@@ -625,17 +625,21 @@ export function buildFieldsInitNodes(
buildPrivateInstanceFieldInitSpec(
t.thisExpression(),
prop,
- privateNamesMap
- )
+ privateNamesMap,
+ ),
);
break;
}
case isInstance && isPrivate && isMethod && loose: {
instanceNodes.unshift(
- buildPrivateMethodInitLoose(t.thisExpression(), prop, privateNamesMap)
+ buildPrivateMethodInitLoose(
+ t.thisExpression(),
+ prop,
+ privateNamesMap,
+ ),
);
staticNodes.push(
- buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
+ buildPrivateMethodDeclaration(prop, privateNamesMap, loose),
);
break;
}
@@ -644,21 +648,21 @@ export function buildFieldsInitNodes(
buildPrivateInstanceMethodInitSpec(
t.thisExpression(),
prop,
- privateNamesMap
- )
+ privateNamesMap,
+ ),
);
staticNodes.push(
- buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
+ buildPrivateMethodDeclaration(prop, privateNamesMap, loose),
);
break;
}
case isStatic && isPrivate && isMethod && !loose: {
needsClassRef = true;
staticNodes.push(
- buildPrivateStaticFieldInitSpec(prop, privateNamesMap)
+ buildPrivateStaticFieldInitSpec(prop, privateNamesMap),
);
staticNodes.unshift(
- buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
+ buildPrivateMethodDeclaration(prop, privateNamesMap, loose),
);
break;
}
@@ -669,11 +673,11 @@ export function buildFieldsInitNodes(
t.cloneNode(ref),
prop,
state,
- privateNamesMap
- )
+ privateNamesMap,
+ ),
);
staticNodes.unshift(
- buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
+ buildPrivateMethodDeclaration(prop, privateNamesMap, loose),
);
break;
}
@@ -683,7 +687,7 @@ export function buildFieldsInitNodes(
}
case isInstance && isPublic && isField && !loose: {
instanceNodes.push(
- buildPublicFieldInitSpec(t.thisExpression(), prop, state)
+ buildPublicFieldInitSpec(t.thisExpression(), prop, state),
);
break;
}
@@ -706,7 +710,7 @@ export function buildFieldsInitNodes(
if (path.isClassExpression()) {
path.scope.push({ id: ref });
path.replaceWith(
- t.assignmentExpression('=', t.cloneNode(ref), path.node)
+ t.assignmentExpression('=', t.cloneNode(ref), path.node),
);
} else if (!path.node.id) {
// Anonymous class declaration
diff --git a/fixtures/babel/packages/babel-plugin-transform-for-of/src/index.js b/fixtures/babel/packages/babel-plugin-transform-for-of/src/index.js
index 73de81b9..99bc3936 100644
--- a/fixtures/babel/packages/babel-plugin-transform-for-of/src/index.js
+++ b/fixtures/babel/packages/babel-plugin-transform-for-of/src/index.js
@@ -10,7 +10,7 @@ export default declare((api, options) => {
if (loose === true && assumeArray === true) {
throw new Error(
- `The loose and assumeArray options cannot be used together in @babel/plugin-transform-for-of`
+ `The loose and assumeArray options cannot be used together in @babel/plugin-transform-for-of`,
);
}
@@ -39,7 +39,7 @@ export default declare((api, options) => {
const item = t.memberExpression(
t.cloneNode(array),
t.cloneNode(i),
- true
+ true,
);
let assignment;
if (t.isVariableDeclaration(left)) {
@@ -47,7 +47,7 @@ export default declare((api, options) => {
assignment.declarations[0].init = item;
} else {
assignment = t.expressionStatement(
- t.assignmentExpression('=', left, item)
+ t.assignmentExpression('=', left, item),
);
}
@@ -56,7 +56,7 @@ export default declare((api, options) => {
if (
body.isBlockStatement() &&
Object.keys(path.getBindingIdentifiers()).some((id) =>
- body.scope.hasOwnBinding(id)
+ body.scope.hasOwnBinding(id),
)
) {
blockBody = t.blockStatement([assignment, body.node]);
@@ -71,11 +71,11 @@ export default declare((api, options) => {
t.binaryExpression(
'<',
t.cloneNode(i),
- t.memberExpression(t.cloneNode(array), t.identifier('length'))
+ t.memberExpression(t.cloneNode(array), t.identifier('length')),
),
t.updateExpression('++', t.cloneNode(i)),
- blockBody
- )
+ blockBody,
+ ),
);
},
},
@@ -133,7 +133,7 @@ export default declare((api, options) => {
const iterationValue = t.memberExpression(
t.cloneNode(right),
t.cloneNode(iterationKey),
- true
+ true,
);
const left = node.left;
@@ -142,7 +142,9 @@ export default declare((api, options) => {
loop.body.body.unshift(left);
} else {
loop.body.body.unshift(
- t.expressionStatement(t.assignmentExpression('=', left, iterationValue))
+ t.expressionStatement(
+ t.assignmentExpression('=', left, iterationValue),
+ ),
);
}
@@ -175,7 +177,7 @@ export default declare((api, options) => {
const stepKey = scope.generateUid('step');
const stepValue = t.memberExpression(
t.identifier(stepKey),
- t.identifier('value')
+ t.identifier('value'),
);
const declar = t.isVariableDeclaration(left)
diff --git a/fixtures/babel/packages/babel-plugin-transform-modules-amd/src/index.js b/fixtures/babel/packages/babel-plugin-transform-modules-amd/src/index.js
index b72af387..55a182b9 100644
--- a/fixtures/babel/packages/babel-plugin-transform-modules-amd/src/index.js
+++ b/fixtures/babel/packages/babel-plugin-transform-modules-amd/src/index.js
@@ -75,7 +75,7 @@ export default declare((api, options) => {
imported => ${resolveId}(${result}),
${rejectId}
)
- )`
+ )`,
);
},
@@ -85,7 +85,7 @@ export default declare((api, options) => {
if (requireId) {
injectWrapper(
path,
- buildAnonymousWrapper({ REQUIRE: requireId })
+ buildAnonymousWrapper({ REQUIRE: requireId }),
);
}
@@ -110,7 +110,7 @@ export default declare((api, options) => {
strictMode,
allowTopLevelThis,
noInterop,
- }
+ },
);
if (hasExports(meta)) {
@@ -127,15 +127,15 @@ export default declare((api, options) => {
const interop = wrapInterop(
path,
t.identifier(metadata.name),
- metadata.interop
+ metadata.interop,
);
if (interop) {
const header = t.expressionStatement(
t.assignmentExpression(
'=',
t.identifier(metadata.name),
- interop
- )
+ interop,
+ ),
);
header.loc = metadata.loc;
headers.push(header);
@@ -143,7 +143,7 @@ export default declare((api, options) => {
}
headers.push(
- ...buildNamespaceInitStatements(meta, metadata, loose)
+ ...buildNamespaceInitStatements(meta, metadata, loose),
);
}
@@ -157,7 +157,7 @@ export default declare((api, options) => {
AMD_ARGUMENTS: t.arrayExpression(amdArgs),
IMPORT_NAMES: importNames,
- })
+ }),
);
},
},
diff --git a/fixtures/babel/packages/babel-plugin-transform-modules-commonjs/src/index.js b/fixtures/babel/packages/babel-plugin-transform-modules-commonjs/src/index.js
index db2bb9fb..d5a30605 100644
--- a/fixtures/babel/packages/babel-plugin-transform-modules-commonjs/src/index.js
+++ b/fixtures/babel/packages/babel-plugin-transform-modules-commonjs/src/index.js
@@ -98,7 +98,7 @@ export default declare((api, options) => {
const right = path.get('right');
right.replaceWith(
- t.sequenceExpression([right.node, getAssertion(localName)])
+ t.sequenceExpression([right.node, getAssertion(localName)]),
);
} else if (left.isPattern()) {
const ids = left.getOuterBindingIdentifiers();
@@ -114,7 +114,7 @@ export default declare((api, options) => {
if (localName) {
const right = path.get('right');
right.replaceWith(
- t.sequenceExpression([right.node, getAssertion(localName)])
+ t.sequenceExpression([right.node, getAssertion(localName)]),
);
}
}
@@ -181,7 +181,7 @@ export default declare((api, options) => {
/\.mjs$/.test(state.filename)
? mjsStrictNamespace
: strictNamespace,
- }
+ },
);
for (const [source, metadata] of meta.source) {
@@ -215,7 +215,7 @@ export default declare((api, options) => {
headers.push(
header,
- ...buildNamespaceInitStatements(meta, metadata, loose)
+ ...buildNamespaceInitStatements(meta, metadata, loose),
);
}
diff --git a/fixtures/babel/packages/babel-plugin-transform-parameters/src/params.js b/fixtures/babel/packages/babel-plugin-transform-parameters/src/params.js
index bd0017f4..ec7f4e0b 100644
--- a/fixtures/babel/packages/babel-plugin-transform-parameters/src/params.js
+++ b/fixtures/babel/packages/babel-plugin-transform-parameters/src/params.js
@@ -122,7 +122,7 @@ export default function convertFunctionParams(path, loose) {
ASSIGNMENT_IDENTIFIER: t.cloneNode(left.node),
DEFAULT_VALUE: right.node,
UNDEFINED: undefinedNode,
- })
+ }),
);
param.replaceWith(left.node);
} else if (left.isObjectPattern() || left.isArrayPattern()) {
@@ -133,7 +133,7 @@ export default function convertFunctionParams(path, loose) {
DEFAULT_VALUE: right.node,
PARAMETER_NAME: t.cloneNode(paramName),
UNDEFINED: undefinedNode,
- })
+ }),
);
param.replaceWith(paramName);
}
@@ -203,6 +203,6 @@ function buildScopeIIFE(shadowedParams, body) {
}
return t.returnStatement(
- t.callExpression(t.arrowFunctionExpression(params, body), params)
+ t.callExpression(t.arrowFunctionExpression(params, body), params),
);
}
diff --git a/fixtures/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/fixtures/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
index 643c9457..7619d143 100644
--- a/fixtures/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
+++ b/fixtures/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
@@ -83,7 +83,7 @@ function writeCoreJS({
for (const corejsPath of paths) {
outputFile(
path.join(pkgDirname, runtimeRoot, `${corejsPath}.js`),
- `module.exports = require("${corejsRoot}/${corejsPath}");`
+ `module.exports = require("${corejsRoot}/${corejsPath}");`,
);
}
}
@@ -101,7 +101,7 @@ function writeHelperFiles(runtimeName, { esm, corejs }) {
pkgDirname,
'helpers',
esm ? 'esm' : '',
- `${helperName}.js`
+ `${helperName}.js`,
);
outputFile(
@@ -109,7 +109,7 @@ function writeHelperFiles(runtimeName, { esm, corejs }) {
buildHelper(runtimeName, pkgDirname, helperFilename, helperName, {
esm,
corejs,
- })
+ }),
);
}
}
@@ -119,7 +119,7 @@ function getRuntimeRoot(runtimeName) {
__dirname,
'..',
'..',
- runtimeName.replace(/^@babel\//, 'babel-')
+ runtimeName.replace(/^@babel\//, 'babel-'),
);
}
@@ -129,7 +129,7 @@ function buildHelper(
pkgDirname,
helperFilename,
helperName,
- { esm, corejs }
+ { esm, corejs },
) {
const tree = t.program([], [], esm ? 'module' : 'script');
const dependencies = {};
@@ -152,7 +152,7 @@ function buildHelper(
helperName,
(dep) => dependencies[dep],
esm ? null : template.expression.ast`module.exports`,
- bindings
+ bindings,
);
tree.body.push(...helper.nodes);
@@ -172,7 +172,7 @@ function buildHelper(
buildRuntimeRewritePlugin(
runtimeName,
path.relative(path.dirname(helperFilename), pkgDirname),
- helperName
+ helperName,
),
],
overrides: [
diff --git a/fixtures/cloudfour.com-patterns/.storybook/main.js b/fixtures/cloudfour.com-patterns/.storybook/main.js
index f3db1840..5da7996f 100644
--- a/fixtures/cloudfour.com-patterns/.storybook/main.js
+++ b/fixtures/cloudfour.com-patterns/.storybook/main.js
@@ -52,7 +52,7 @@ module.exports = {
// Optimize and process SVGs as React elements for use in documentation
test: /\.svg$/,
use: '@svgr/webpack',
- }
+ },
);
return config;
diff --git a/fixtures/cloudfour.com-patterns/gulpfile.js/tasks/svg-to-twig.js b/fixtures/cloudfour.com-patterns/gulpfile.js/tasks/svg-to-twig.js
index b048f92a..f93df2de 100644
--- a/fixtures/cloudfour.com-patterns/gulpfile.js/tasks/svg-to-twig.js
+++ b/fixtures/cloudfour.com-patterns/gulpfile.js/tasks/svg-to-twig.js
@@ -39,10 +39,10 @@ function templatizeSvgString(src) {
// Create blocks for SVG content, before and after
const prepend = ltx.parse(
- '{% block before %}{% endblock %}{% block content %}'
+ '{% block before %}{% endblock %}{% block content %}',
);
const append = ltx.parse(
- '{% endblock %}{% block after %}{% endblock %}'
+ '{% endblock %}{% block after %}{% endblock %}',
);
svg.children = [...prepend.children, ...svg.children, ...append.children];
@@ -101,7 +101,7 @@ function svgToTwig() {
}
cb(null, file);
- })
+ }),
)
// Append `.twig` to filenames
.pipe(rename({ extname: '.svg.twig' }))
diff --git a/fixtures/cloudfour.com-patterns/gulpfile.js/theo-formats/stories.mdx.js b/fixtures/cloudfour.com-patterns/gulpfile.js/theo-formats/stories.mdx.js
index 66440458..4cb29281 100644
--- a/fixtures/cloudfour.com-patterns/gulpfile.js/theo-formats/stories.mdx.js
+++ b/fixtures/cloudfour.com-patterns/gulpfile.js/theo-formats/stories.mdx.js
@@ -101,7 +101,7 @@ function mdxStoriesFormat(result) {
const props = result.get('props').toJS();
const categories = groupBy(props, 'category');
const mdxCategories = Object.keys(categories).map((category) =>
- categoryToMdx(category, categories[category])
+ categoryToMdx(category, categories[category]),
);
return `
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs/blocks';
diff --git a/fixtures/dom-testing-library/src/events.js b/fixtures/dom-testing-library/src/events.js
index 9461dcde..3eab5bac 100644
--- a/fixtures/dom-testing-library/src/events.js
+++ b/fixtures/dom-testing-library/src/events.js
@@ -353,13 +353,13 @@ const eventAliasMap = {
function fireEvent(element, event) {
if (!event) {
throw new Error(
- `Unable to fire an event - please provide an event object.`
+ `Unable to fire an event - please provide an event object.`,
);
}
if (!element) {
throw new Error(
- `Unable to fire a "${event.type}" event - please provide a DOM element.`
+ `Unable to fire a "${event.type}" event - please provide a DOM element.`,
);
}
@@ -375,7 +375,7 @@ for (const key of Object.keys(eventMap)) {
createEvent[key] = (node, init) => {
if (!node) {
throw new Error(
- `Unable to fire a "${key}" event - please provide a DOM element.`
+ `Unable to fire a "${key}" event - please provide a DOM element.`,
);
}
diff --git a/fixtures/dom-testing-library/src/queries/role.js b/fixtures/dom-testing-library/src/queries/role.js
index 3fbbb072..025da1a1 100644
--- a/fixtures/dom-testing-library/src/queries/role.js
+++ b/fixtures/dom-testing-library/src/queries/role.js
@@ -26,7 +26,7 @@ function queryAllByRole(
trim,
normalizer,
queryFallbacks = false,
- } = {}
+ } = {},
) {
const matcher = exact ? matches : fuzzyMatches;
const matchNormalizer = makeNormalizer({
@@ -70,7 +70,7 @@ function queryAllByRole(
const implicitRoles = getImplicitAriaRoles(node);
return implicitRoles.some((implicitRole) =>
- matcher(implicitRole, node, role, matchNormalizer)
+ matcher(implicitRole, node, role, matchNormalizer),
);
})
.filter((element) =>
@@ -78,7 +78,7 @@ function queryAllByRole(
? isInaccessible(element, {
isSubtreeInaccessible: cachedIsSubtreeInaccessible,
}) === false
- : true
+ : true,
)
.filter((element) => {
if (name === undefined) {
@@ -90,7 +90,7 @@ function queryAllByRole(
computeAccessibleName(element),
element,
name,
- (text) => text
+ (text) => text,
);
});
}
@@ -101,7 +101,7 @@ const getMultipleError = (c, role) =>
const getMissingError = (
container,
role,
- { hidden = getConfig().defaultHidden, name } = {}
+ { hidden = getConfig().defaultHidden, name } = {},
) => {
const roles = prettyRoles(container, {
hidden,
diff --git a/fixtures/dom-testing-library/src/queries/text.js b/fixtures/dom-testing-library/src/queries/text.js
index df7e075e..1457da72 100644
--- a/fixtures/dom-testing-library/src/queries/text.js
+++ b/fixtures/dom-testing-library/src/queries/text.js
@@ -16,7 +16,7 @@ function queryAllByText(
trim,
ignore = 'script, style',
normalizer,
- } = {}
+ } = {},
) {
const matcher = exact ? matches : fuzzyMatches;
const matchNormalizer = makeNormalizer({
diff --git a/fixtures/dom-testing-library/src/query-helpers.js b/fixtures/dom-testing-library/src/query-helpers.js
index a96d1bb5..45c5adf5 100644
--- a/fixtures/dom-testing-library/src/query-helpers.js
+++ b/fixtures/dom-testing-library/src/query-helpers.js
@@ -5,7 +5,7 @@ import { waitFor } from './wait-for';
function getMultipleElementsFoundError(message, container) {
return getConfig().getElementError(
`${message}\n\n(If this is intentional, then use the \`*AllBy*\` variant of the query (like \`queryAllByText\`, \`getAllByText\`, or \`findAllByText\`)).`,
- container
+ container,
);
}
@@ -13,7 +13,7 @@ function queryAllByAttribute(
attribute,
container,
text,
- { exact = true, collapseWhitespace, trim, normalizer } = {}
+ { exact = true, collapseWhitespace, trim, normalizer } = {},
) {
const matcher = exact ? matches : fuzzyMatches;
const matchNormalizer = makeNormalizer({
@@ -22,7 +22,7 @@ function queryAllByAttribute(
normalizer,
});
return [...container.querySelectorAll(`[${attribute}]`)].filter((node) =>
- matcher(node.getAttribute(attribute), node, text, matchNormalizer)
+ matcher(node.getAttribute(attribute), node, text, matchNormalizer),
);
}
@@ -31,7 +31,7 @@ function queryByAttribute(attribute, container, text, ...args) {
if (els.length > 1) {
throw getMultipleElementsFoundError(
`Found multiple elements by [${attribute}=${text}]`,
- container
+ container,
);
}
@@ -47,7 +47,7 @@ function makeSingleQuery(allQuery, getMultipleError) {
if (els.length > 1) {
throw getMultipleElementsFoundError(
getMultipleError(container, ...args),
- container
+ container,
);
}
@@ -63,7 +63,7 @@ function makeGetAllQuery(allQuery, getMissingError) {
if (els.length === 0) {
throw getConfig().getElementError(
getMissingError(container, ...args),
- container
+ container,
);
}
diff --git a/fixtures/dom-testing-library/src/wait-for-dom-change.js b/fixtures/dom-testing-library/src/wait-for-dom-change.js
index cb80a8ea..1c97c824 100644
--- a/fixtures/dom-testing-library/src/wait-for-dom-change.js
+++ b/fixtures/dom-testing-library/src/wait-for-dom-change.js
@@ -26,7 +26,7 @@ function waitForDomChange({
if (!hasWarned) {
hasWarned = true;
console.warn(
- `\`waitForDomChange\` has been deprecated. Use \`waitFor\` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.`
+ `\`waitForDomChange\` has been deprecated. Use \`waitFor\` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor.`,
);
}
@@ -35,7 +35,7 @@ function waitForDomChange({
const { MutationObserver } = getWindowFromNode(container);
const observer = new MutationObserver(onMutation);
runWithRealTimers(() =>
- observer.observe(container, mutationObserverOptions)
+ observer.observe(container, mutationObserverOptions),
);
function onDone(error, result) {
diff --git a/fixtures/downshift/src/hooks/useCombobox/reducer.js b/fixtures/downshift/src/hooks/useCombobox/reducer.js
index fa16a2bf..591f83b6 100644
--- a/fixtures/downshift/src/hooks/useCombobox/reducer.js
+++ b/fixtures/downshift/src/hooks/useCombobox/reducer.js
@@ -32,7 +32,7 @@ export default function downshiftUseComboboxReducer(state, action) {
state.highlightedIndex,
props.items.length,
action.getItemNodeFromIndex,
- props.circularNavigation
+ props.circularNavigation,
),
}
: {
@@ -40,7 +40,7 @@ export default function downshiftUseComboboxReducer(state, action) {
props,
state,
1,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
),
isOpen: true,
};
@@ -55,7 +55,7 @@ export default function downshiftUseComboboxReducer(state, action) {
state.highlightedIndex,
props.items.length,
action.getItemNodeFromIndex,
- props.circularNavigation
+ props.circularNavigation,
),
}
: {
@@ -63,7 +63,7 @@ export default function downshiftUseComboboxReducer(state, action) {
props,
state,
-1,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
),
isOpen: true,
};
@@ -97,7 +97,7 @@ export default function downshiftUseComboboxReducer(state, action) {
0,
props.items.length,
action.getItemNodeFromIndex,
- false
+ false,
),
};
break;
@@ -109,7 +109,7 @@ export default function downshiftUseComboboxReducer(state, action) {
props.items.length - 1,
props.items.length,
action.getItemNodeFromIndex,
- false
+ false,
),
};
break;
diff --git a/fixtures/downshift/src/hooks/useSelect/reducer.js b/fixtures/downshift/src/hooks/useSelect/reducer.js
index 651a6bfe..d7cb9c85 100644
--- a/fixtures/downshift/src/hooks/useSelect/reducer.js
+++ b/fixtures/downshift/src/hooks/useSelect/reducer.js
@@ -35,7 +35,7 @@ export default function downshiftSelectReducer(state, action) {
state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,
props.items,
props.itemToString,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
);
changes = {
@@ -54,7 +54,7 @@ export default function downshiftSelectReducer(state, action) {
props,
state,
1,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
),
isOpen: true,
};
@@ -67,7 +67,7 @@ export default function downshiftSelectReducer(state, action) {
props,
state,
-1,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
),
isOpen: true,
};
@@ -93,7 +93,7 @@ export default function downshiftSelectReducer(state, action) {
0,
props.items.length,
action.getItemNodeFromIndex,
- false
+ false,
),
};
@@ -106,7 +106,7 @@ export default function downshiftSelectReducer(state, action) {
props.items.length - 1,
props.items.length,
action.getItemNodeFromIndex,
- false
+ false,
),
};
@@ -137,7 +137,7 @@ export default function downshiftSelectReducer(state, action) {
state.highlightedIndex,
props.items,
props.itemToString,
- action.getItemNodeFromIndex
+ action.getItemNodeFromIndex,
);
changes = {
@@ -157,7 +157,7 @@ export default function downshiftSelectReducer(state, action) {
state.highlightedIndex,
props.items.length,
action.getItemNodeFromIndex,
- props.circularNavigation
+ props.circularNavigation,
),
};
@@ -170,7 +170,7 @@ export default function downshiftSelectReducer(state, action) {
state.highlightedIndex,
props.items.length,
action.getItemNodeFromIndex,
- props.circularNavigation
+ props.circularNavigation,
),
};
diff --git a/fixtures/downshift/src/hooks/useSelect/utils.js b/fixtures/downshift/src/hooks/useSelect/utils.js
index 83fa632a..007f45d4 100644
--- a/fixtures/downshift/src/hooks/useSelect/utils.js
+++ b/fixtures/downshift/src/hooks/useSelect/utils.js
@@ -8,10 +8,10 @@ function getItemIndexByCharacterKey(
highlightedIndex,
items,
itemToStringParam,
- getItemNodeFromIndex
+ getItemNodeFromIndex,
) {
const lowerCasedItemStrings = items.map((item) =>
- itemToStringParam(item).toLowerCase()
+ itemToStringParam(item).toLowerCase(),
);
const lowerCasedKeysSoFar = keysSoFar.toLowerCase();
const isValid = (itemString, index) => {
diff --git a/fixtures/downshift/src/hooks/utils.js b/fixtures/downshift/src/hooks/utils.js
index 1b182a07..4d13fd96 100644
--- a/fixtures/downshift/src/hooks/utils.js
+++ b/fixtures/downshift/src/hooks/utils.js
@@ -100,7 +100,7 @@ function useEnhancedReducer(reducer, initialState, props) {
return newState;
},
- [reducer]
+ [reducer],
);
const [state, dispatch] = useReducer(enhancedReducer, initialState);
@@ -211,7 +211,7 @@ function getHighlightedIndexOnOpen(props, state, offset, getItemNodeFromIndex) {
items.indexOf(selectedItem),
items.length,
getItemNodeFromIndex,
- false
+ false,
);
}
diff --git a/fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js b/fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js
index 1951981a..66f79d9e 100644
--- a/fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js
+++ b/fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js
@@ -103,8 +103,8 @@ function createBaseConfigArray({
baseConfigArray.unshift(
configArrayFactory.create(
{ ignorePatterns: IgnorePattern.DefaultPatterns },
- { name: 'DefaultIgnorePattern' }
- )[0]
+ { name: 'DefaultIgnorePattern' },
+ )[0],
);
/*
@@ -123,7 +123,7 @@ function createBaseConfigArray({
// eslint-disable-next-line @cloudfour/unicorn/prefer-object-from-entries
rules: rulePaths.reduce(
(map, rulesPath) => Object.assign(map, loadRules(rulesPath, cwd)),
- {}
+ {},
),
},
filePath: '',
@@ -158,7 +158,7 @@ function createCLIConfigArray({
cliConfigArray.unshift(
...(ignorePath
? configArrayFactory.loadESLintIgnore(ignorePath)
- : configArrayFactory.loadDefaultESLintIgnore())
+ : configArrayFactory.loadDefaultESLintIgnore()),
);
if (specificConfigPath) {
@@ -166,7 +166,7 @@ function createCLIConfigArray({
...configArrayFactory.loadFile(specificConfigPath, {
name: '--config',
basePath: cwd,
- })
+ }),
);
}
@@ -277,7 +277,7 @@ class CascadingConfigArrayFactory {
return this._finalizeConfigArray(
this._loadConfigInAncestors(directoryPath),
directoryPath,
- ignoreNotFoundError
+ ignoreNotFoundError,
);
}
@@ -367,7 +367,7 @@ class CascadingConfigArrayFactory {
parentPath && parentPath !== directoryPath
? this._loadConfigInAncestors(
parentPath,
- configsExistInSubdirs || configArray.length > 0
+ configsExistInSubdirs || configArray.length > 0,
)
: baseConfigArray;
@@ -428,7 +428,7 @@ class CascadingConfigArrayFactory {
const personalConfigArray = configArrayFactory.loadInDirectory(
homePath,
- { name: 'PersonalConfig' }
+ { name: 'PersonalConfig' },
);
if (
@@ -440,7 +440,7 @@ class CascadingConfigArrayFactory {
emitDeprecationWarning(
lastElement.filePath,
- 'ESLINT_PERSONAL_CONFIG_LOAD'
+ 'ESLINT_PERSONAL_CONFIG_LOAD',
);
}
@@ -462,7 +462,7 @@ class CascadingConfigArrayFactory {
debug(
'Configuration was determined: %o on %s',
finalConfigArray,
- directoryPath
+ directoryPath,
);
}
diff --git a/fixtures/eslint/lib/cli-engine/config-array-factory.js b/fixtures/eslint/lib/cli-engine/config-array-factory.js
index 5061aaaa..0c3d0046 100644
--- a/fixtures/eslint/lib/cli-engine/config-array-factory.js
+++ b/fixtures/eslint/lib/cli-engine/config-array-factory.js
@@ -62,7 +62,7 @@ const {
const eslintRecommendedPath = path.resolve(
__dirname,
- '../../conf/eslint-recommended.js'
+ '../../conf/eslint-recommended.js',
);
const eslintAllPath = path.resolve(__dirname, '../../conf/eslint-all.js');
const configFilenames = [
@@ -240,7 +240,7 @@ function loadPackageJSONConfigFile(filePath) {
if (!Object.hasOwnProperty.call(packageData, 'eslintConfig')) {
throw Object.assign(
new Error("package.json file doesn't have 'eslintConfig' field."),
- { code: 'ESLINT_CONFIG_FIELD_NOT_FOUND' }
+ { code: 'ESLINT_CONFIG_FIELD_NOT_FOUND' },
);
}
@@ -287,7 +287,7 @@ function configMissingError(configName, importerName) {
{
messageTemplate: 'extend-config-missing',
messageData: { configName, importerName },
- }
+ },
);
}
@@ -341,7 +341,7 @@ function writeDebugLogForLoading(request, relativeTo, filePath) {
try {
const packageJsonPath = ModuleResolver.resolve(
`${request}/package.json`,
- relativeTo
+ relativeTo,
);
const { version = 'unknown' } = require(packageJsonPath);
@@ -370,7 +370,7 @@ function createContext(
providedType,
providedName,
providedFilePath,
- providedMatchBasePath
+ providedMatchBasePath,
) {
const filePath = providedFilePath ? path.resolve(cwd, providedFilePath) : '';
const matchBasePath =
@@ -479,7 +479,7 @@ class ConfigArrayFactory {
'config',
name,
path.join(directoryPath, filename),
- basePath
+ basePath,
);
if (fs.existsSync(ctx.filePath)) {
@@ -544,7 +544,7 @@ class ConfigArrayFactory {
const ctx = createContext(cwd, 'ignore', undefined, absolutePath, cwd);
return new ConfigArray(
- ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)
+ ...this._normalizeESLintIgnoreData(ignorePatterns, ctx),
);
}
@@ -568,7 +568,7 @@ class ConfigArrayFactory {
if (Object.hasOwnProperty.call(data, 'eslintIgnore')) {
if (!Array.isArray(data.eslintIgnore)) {
throw new TypeError(
- 'Package.json eslintIgnore property requires an array of paths'
+ 'Package.json eslintIgnore property requires an array of paths',
);
}
@@ -577,11 +577,11 @@ class ConfigArrayFactory {
'ignore',
'eslintIgnore in package.json',
packageJsonPath,
- cwd
+ cwd,
);
return new ConfigArray(
- ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)
+ ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx),
);
}
}
@@ -647,7 +647,7 @@ class ConfigArrayFactory {
const criteria = OverrideTester.create(
files,
excludedFiles,
- ctx.matchBasePath
+ ctx.matchBasePath,
);
const elements = this._normalizeObjectConfigDataBody(configBody, ctx);
@@ -697,14 +697,14 @@ class ConfigArrayFactory {
settings,
overrides: overrideList = [],
},
- ctx
+ ctx,
) {
const extendList = Array.isArray(extend) ? extend : [extend];
const ignorePattern =
ignorePatterns &&
new IgnorePattern(
Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],
- ctx.matchBasePath
+ ctx.matchBasePath,
);
// Flatten `extends`.
@@ -897,7 +897,7 @@ class ConfigArrayFactory {
const plugin = this._loadPlugin(name, ctx);
return [plugin.id, plugin];
- })
+ }),
);
}
@@ -942,7 +942,7 @@ class ConfigArrayFactory {
debug(
"Failed to load parser '%s' declared in '%s'.",
nameOrPath,
- ctx.name
+ ctx.name,
);
error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;
@@ -972,7 +972,7 @@ class ConfigArrayFactory {
const id = naming.getShorthandName(request, 'eslint-plugin');
const relativeTo = path.join(
resolvePluginsRelativeTo,
- '__placeholder__.js'
+ '__placeholder__.js',
);
if (/\s+/u.test(name)) {
@@ -981,7 +981,7 @@ class ConfigArrayFactory {
{
messageTemplate: 'whitespace-found',
messageData: { pluginName: request },
- }
+ },
);
return new ConfigDependency({
@@ -1085,7 +1085,7 @@ class ConfigArrayFactory {
...ctx,
type: 'implicit-processor',
name: `${ctx.name}#processors["${pluginId}/${processorId}"]`,
- }
+ },
);
}
}
diff --git a/fixtures/eslint/lib/cli-engine/config-array/ignore-pattern.js b/fixtures/eslint/lib/cli-engine/config-array/ignore-pattern.js
index 826f1760..0cd6575a 100644
--- a/fixtures/eslint/lib/cli-engine/config-array/ignore-pattern.js
+++ b/fixtures/eslint/lib/cli-engine/config-array/ignore-pattern.js
@@ -152,10 +152,10 @@ class IgnorePattern {
debug('Create with: %o', ignorePatterns);
const basePath = getCommonAncestorPath(
- ignorePatterns.map((p) => p.basePath)
+ ignorePatterns.map((p) => p.basePath),
);
const patterns = ignorePatterns.flatMap((p) =>
- p.getPatternsRelativeTo(basePath)
+ p.getPatternsRelativeTo(basePath),
);
const ig = ignore().add([...DotPatterns, ...patterns]);
const dotIg = ignore().add(patterns);
@@ -166,7 +166,7 @@ class IgnorePattern {
(filePath, dot = false) => {
assert(
path.isAbsolute(filePath),
- "'filePath' should be an absolute path."
+ "'filePath' should be an absolute path.",
);
const relPathRaw = relative(basePath, filePath);
const relPath = relPathRaw && relPathRaw + dirSuffix(filePath);
@@ -176,7 +176,7 @@ class IgnorePattern {
debug('Check', { filePath, dot, relativePath: relPath, result });
return result;
},
- { basePath, patterns }
+ { basePath, patterns },
);
}
@@ -225,7 +225,7 @@ class IgnorePattern {
getPatternsRelativeTo(newBasePath) {
assert(
path.isAbsolute(newBasePath),
- "'newBasePath' should be an absolute path."
+ "'newBasePath' should be an absolute path.",
);
const { basePath, loose, patterns } = this;
diff --git a/fixtures/eslint/lib/cli-engine/file-enumerator.js b/fixtures/eslint/lib/cli-engine/file-enumerator.js
index c95ebca6..36af431a 100644
--- a/fixtures/eslint/lib/cli-engine/file-enumerator.js
+++ b/fixtures/eslint/lib/cli-engine/file-enumerator.js
@@ -158,7 +158,7 @@ function readdirSafeSync(directoryPath) {
function createExtensionRegExp(extensions) {
if (extensions) {
const normalizedExts = extensions.map((ext) =>
- escapeRegExp(ext.startsWith('.') ? ext.slice(1) : ext)
+ escapeRegExp(ext.startsWith('.') ? ext.slice(1) : ext),
);
return new RegExp(`.\\.(?:${normalizedExts.join('|')})$`, 'u');
@@ -179,7 +179,7 @@ class NoFilesFoundError extends Error {
super(
`No files matching '${pattern}' were found${
globDisabled ? ' (glob was disabled)' : ''
- }.`
+ }.`,
);
this.messageTemplate = 'file-not-found';
this.messageData = { pattern, globDisabled };
@@ -311,7 +311,7 @@ class FileEnumerator {
if (!foundRegardlessOfIgnored) {
throw new NoFilesFoundError(
pattern,
- !globInputPaths && isGlob(pattern)
+ !globInputPaths && isGlob(pattern),
);
}
@@ -450,7 +450,7 @@ class FileEnumerator {
* point because we don't know if target files exist in
* this directory.
*/
- { ignoreNotFoundError: true }
+ { ignoreNotFoundError: true },
);
}
@@ -509,7 +509,7 @@ class FileEnumerator {
*/
_isIgnoredFile(
filePath,
- { config: providedConfig, dotfiles = false, direct = false }
+ { config: providedConfig, dotfiles = false, direct = false },
) {
const { configArrayFactory, defaultIgnores, ignoreFlag } =
internalSlotsMap.get(this);
diff --git a/fixtures/eslint/lib/init/config-initializer.js b/fixtures/eslint/lib/init/config-initializer.js
index f4f9bc09..75b5f11d 100644
--- a/fixtures/eslint/lib/init/config-initializer.js
+++ b/fixtures/eslint/lib/init/config-initializer.js
@@ -61,7 +61,7 @@ function writeFile(config, format) {
if (installedESLint) {
log.info(
- 'ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.'
+ 'ESLint was installed locally. We recommend using this local copy instead of your globally-installed copy.',
);
}
}
@@ -173,7 +173,7 @@ function configureRules(answers, config) {
{
width: 30,
total: BAR_TOTAL,
- }
+ },
);
bar.tick(0); // Shows the progress bar
@@ -187,7 +187,7 @@ function configureRules(answers, config) {
{ baseConfig: newConfig, useEslintrc: false },
(total) => {
bar.tick(BAR_SOURCE_CODE_TOTAL / total);
- }
+ },
);
} catch (error) {
log.info('\n');
@@ -199,7 +199,7 @@ function configureRules(answers, config) {
if (fileQty === 0) {
log.info('\n');
throw new Error(
- 'Automatic Configuration failed. No files were able to be parsed.'
+ 'Automatic Configuration failed. No files were able to be parsed.',
);
}
@@ -216,8 +216,8 @@ function configureRules(answers, config) {
// Create a list of recommended rules, because we don't want to disable them
const recRules = new Set(
Object.keys(recConfig.rules).filter((ruleId) =>
- ConfigOps.isErrorSeverity(recConfig.rules[ruleId])
- )
+ ConfigOps.isErrorSeverity(recConfig.rules[ruleId]),
+ ),
);
// Find and disable rules which had no error-free configuration
@@ -267,7 +267,7 @@ function configureRules(answers, config) {
const finalRuleIds = Object.keys(newConfig.rules);
const totalRules = finalRuleIds.length;
const enabledRules = finalRuleIds.filter(
- (ruleId) => newConfig.rules[ruleId] !== 0
+ (ruleId) => newConfig.rules[ruleId] !== 0,
).length;
const resultMessage = [
`\nEnabled ${enabledRules} out of ${totalRules}`,
@@ -381,7 +381,7 @@ function getLocalESLintVersion() {
try {
const eslintPath = ModuleResolver.resolve(
'eslint',
- path.join(process.cwd(), '__placeholder__.js')
+ path.join(process.cwd(), '__placeholder__.js'),
);
const eslint = require(eslintPath);
@@ -467,7 +467,7 @@ function askInstallModules(modules, packageJsonExists) {
}
log.info(
- "The config that you've selected requires the following dependencies:\n"
+ "The config that you've selected requires the following dependencies:\n",
);
log.info(modules.join(' '));
return inquirer
@@ -615,7 +615,7 @@ function promptUser() {
message(answers) {
const verb = semver.ltr(
answers.localESLintVersion,
- answers.requiredESLintVersionRange
+ answers.requiredESLintVersionRange,
)
? 'upgrade'
: 'downgrade';
@@ -639,7 +639,7 @@ function promptUser() {
const modules = getModulesList(config);
return askInstallModules(modules, earlyAnswers.packageJsonExists).then(
- () => writeFile(config, earlyAnswers.format)
+ () => writeFile(config, earlyAnswers.format),
);
}
@@ -647,7 +647,7 @@ function promptUser() {
if (earlyAnswers.source === 'guide') {
if (!earlyAnswers.packageJsonExists) {
log.info(
- 'A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again.'
+ 'A package.json is necessary to install plugins such as style guides. Run `npm init` to create a package.json file and try again.',
);
return;
}
@@ -656,11 +656,11 @@ function promptUser() {
earlyAnswers.installESLint === false &&
!semver.satisfies(
earlyAnswers.localESLintVersion,
- earlyAnswers.requiredESLintVersionRange
+ earlyAnswers.requiredESLintVersionRange,
)
) {
log.info(
- `Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`
+ `Note: it might not work since ESLint's version is mismatched with the ${earlyAnswers.styleguide} config.`,
);
}
@@ -684,7 +684,7 @@ function promptUser() {
const modules = getModulesList(config);
return askInstallModules(modules, earlyAnswers.packageJsonExists).then(
- () => writeFile(config, earlyAnswers.format)
+ () => writeFile(config, earlyAnswers.format),
);
}
@@ -694,7 +694,7 @@ function promptUser() {
const modules = getModulesList(config);
return askInstallModules(modules).then(() =>
- writeFile(config, earlyAnswers.format)
+ writeFile(config, earlyAnswers.format),
);
}
@@ -745,7 +745,7 @@ function promptUser() {
const modules = getModulesList(config);
return askInstallModules(modules).then(() =>
- writeFile(config, earlyAnswers.format)
+ writeFile(config, earlyAnswers.format),
);
});
});
diff --git a/fixtures/eslint/lib/linter/apply-disable-directives.js b/fixtures/eslint/lib/linter/apply-disable-directives.js
index 737908e5..a8c2f4a6 100644
--- a/fixtures/eslint/lib/linter/apply-disable-directives.js
+++ b/fixtures/eslint/lib/linter/apply-disable-directives.js
@@ -96,7 +96,7 @@ function applyDirectives(options) {
const unusedDisableDirectives = options.directives
.filter(
(directive) =>
- directive.type === 'disable' && !usedDisableDirectives.has(directive)
+ directive.type === 'disable' && !usedDisableDirectives.has(directive),
)
.map((directive) => ({
ruleId: null,
@@ -138,7 +138,8 @@ module.exports = ({
}) => {
const blockDirectives = directives
.filter(
- (directive) => directive.type === 'disable' || directive.type === 'enable'
+ (directive) =>
+ directive.type === 'disable' || directive.type === 'enable',
)
.map((directive) => ({ ...directive, unprocessedDirective: directive }))
.sort(compareLocations);
@@ -192,7 +193,7 @@ module.exports = ({
default: {
throw new TypeError(
- `Unrecognized directive type '${directive.type}'`
+ `Unrecognized directive type '${directive.type}'`,
);
}
}
diff --git a/fixtures/eslint/lib/linter/node-event-generator.js b/fixtures/eslint/lib/linter/node-event-generator.js
index 4e79e719..9d312074 100644
--- a/fixtures/eslint/lib/linter/node-event-generator.js
+++ b/fixtures/eslint/lib/linter/node-event-generator.js
@@ -108,7 +108,7 @@ function countClassAttributes(parsedSelector) {
case 'matches': {
return parsedSelector.selectors.reduce(
(sum, childSelector) => sum + countClassAttributes(childSelector),
- 0
+ 0,
);
}
@@ -148,7 +148,7 @@ function countIdentifiers(parsedSelector) {
case 'matches': {
return parsedSelector.selectors.reduce(
(sum, childSelector) => sum + countIdentifiers(childSelector),
- 0
+ 0,
);
}
@@ -198,7 +198,7 @@ function tryParseSelector(rawSelector) {
typeof error.location.start.offset === 'number'
) {
throw new SyntaxError(
- `Syntax error in selector "${rawSelector}" at position ${error.location.start.offset}: ${error.message}`
+ `Syntax error in selector "${rawSelector}" at position ${error.location.start.offset}: ${error.message}`,
);
}
@@ -337,7 +337,7 @@ class NodeEventGenerator {
(anyTypeSelectorsIndex < anyTypeSelectors.length &&
compareSpecificity(
anyTypeSelectors[anyTypeSelectorsIndex],
- selectorsByNodeType[selectorsByTypeIndex]
+ selectorsByNodeType[selectorsByTypeIndex],
) < 0)
) {
this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]);
diff --git a/fixtures/eslint/lib/rules/keyword-spacing.js b/fixtures/eslint/lib/rules/keyword-spacing.js
index 2fbc42af..67f721a9 100644
--- a/fixtures/eslint/lib/rules/keyword-spacing.js
+++ b/fixtures/eslint/lib/rules/keyword-spacing.js
@@ -106,7 +106,7 @@ module.exports = {
},
additionalProperties: false,
},
- ])
+ ]),
),
additionalProperties: false,
},
@@ -457,7 +457,7 @@ module.exports = {
}
checkSpacingAround(
- sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken)
+ sourceCode.getTokenBefore(node.right, astUtils.isNotOpeningParenToken),
);
}
@@ -536,7 +536,7 @@ module.exports = {
if (!token) {
throw new Error(
- 'Failed to find token get, set, or async beside method name'
+ 'Failed to find token get, set, or async beside method name',
);
}
diff --git a/fixtures/eslint/lib/rules/padding-line-between-statements.js b/fixtures/eslint/lib/rules/padding-line-between-statements.js
index c1d96ac0..5525418b 100644
--- a/fixtures/eslint/lib/rules/padding-line-between-statements.js
+++ b/fixtures/eslint/lib/rules/padding-line-between-statements.js
@@ -18,7 +18,7 @@ const astUtils = require('./utils/ast-utils');
const LT = `[${[...astUtils.LINEBREAKS].join('')}]`;
const PADDING_LINE_SEQUENCE = new RegExp(
String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`,
- 'u'
+ 'u',
);
const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u;
const CJS_IMPORT = /^require\(/u;
@@ -206,7 +206,7 @@ function getActualLastToken(sourceCode, node) {
prevToken.range[0] >= node.range[0] &&
astUtils.isSemicolonToken(semiToken) &&
semiToken.loc.start.line !== prevToken.loc.end.line &&
- semiToken.loc.end.line === nextToken.loc.start.line
+ semiToken.loc.end.line === nextToken.loc.start.line,
);
return isSemicolonLessStyle ? prevToken : semiToken;
diff --git a/fixtures/eslint/lib/rules/prefer-arrow-callback.js b/fixtures/eslint/lib/rules/prefer-arrow-callback.js
index acac7b38..e2cca98c 100644
--- a/fixtures/eslint/lib/rules/prefer-arrow-callback.js
+++ b/fixtures/eslint/lib/rules/prefer-arrow-callback.js
@@ -308,10 +308,10 @@ module.exports = {
const asyncKeyword = node.async ? 'async ' : '';
const paramsFullText = sourceCode.text.slice(
paramsLeftParen.range[0],
- paramsRightParen.range[1]
+ paramsRightParen.range[1],
);
const arrowFunctionText = `${asyncKeyword}${paramsFullText} => ${sourceCode.getText(
- node.body
+ node.body,
)}`;
/*
diff --git a/fixtures/eslint/lib/rules/require-atomic-updates.js b/fixtures/eslint/lib/rules/require-atomic-updates.js
index 2b0a5660..c662f454 100644
--- a/fixtures/eslint/lib/rules/require-atomic-updates.js
+++ b/fixtures/eslint/lib/rules/require-atomic-updates.js
@@ -78,7 +78,7 @@ function isLocalVariableWithoutEscape(variable, isMemberAccess) {
const functionScope = variable.scope.variableScope;
return variable.references.every(
- (reference) => reference.from.variableScope === functionScope
+ (reference) => reference.from.variableScope === functionScope,
);
}
diff --git a/fixtures/eslint/lib/rules/utils/ast-utils.js b/fixtures/eslint/lib/rules/utils/ast-utils.js
index 1336a58f..f473de24 100644
--- a/fixtures/eslint/lib/rules/utils/ast-utils.js
+++ b/fixtures/eslint/lib/rules/utils/ast-utils.js
@@ -956,7 +956,7 @@ module.exports = {
*/
isEmptyBlock(node) {
return Boolean(
- node && node.type === 'BlockStatement' && node.body.length === 0
+ node && node.type === 'BlockStatement' && node.body.length === 0,
);
},
@@ -1588,7 +1588,7 @@ module.exports = {
if (leftToken.type === 'Punctuator' && leftToken.value === '/') {
return !['Block', 'Line', 'RegularExpression'].includes(
- rightToken.type
+ rightToken.type,
);
}
@@ -1634,7 +1634,7 @@ module.exports = {
getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) {
const namePattern = new RegExp(
`[\\s,]${lodash.escapeRegExp(name)}(?:$|[\\s,:])`,
- 'gu'
+ 'gu',
);
// To ignore the first text "global".
@@ -1645,7 +1645,7 @@ module.exports = {
// Convert the index to loc.
return sourceCode.getLocFromIndex(
- comment.range[0] + '/*'.length + (match ? match.index + 1 : 0)
+ comment.range[0] + '/*'.length + (match ? match.index + 1 : 0),
);
},
diff --git a/fixtures/eslint/lib/source-code/source-code.js b/fixtures/eslint/lib/source-code/source-code.js
index c53016d4..f469b6ee 100644
--- a/fixtures/eslint/lib/source-code/source-code.js
+++ b/fixtures/eslint/lib/source-code/source-code.js
@@ -271,14 +271,14 @@ class SourceCode extends TokenStore {
this.lines.push(
this.text.slice(
this.lineStartIndices[this.lineStartIndices.length - 1],
- match.index
- )
+ match.index,
+ ),
);
this.lineStartIndices.push(match.index + match[0].length);
}
this.lines.push(
- this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1])
+ this.text.slice(this.lineStartIndices[this.lineStartIndices.length - 1]),
);
// Cache for comments found using getComments().
@@ -313,7 +313,7 @@ class SourceCode extends TokenStore {
if (node) {
return this.text.slice(
Math.max(node.range[0] - (beforeCount || 0), 0),
- node.range[1] + (afterCount || 0)
+ node.range[1] + (afterCount || 0),
);
}
@@ -586,7 +586,7 @@ class SourceCode extends TokenStore {
if (index < 0 || index > this.text.length) {
throw new RangeError(
- `Index out of range (requested index ${index}, but source text has length ${this.text.length}).`
+ `Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
);
}
@@ -632,19 +632,19 @@ class SourceCode extends TokenStore {
typeof loc.column !== 'number'
) {
throw new TypeError(
- 'Expected `loc` to be an object with numeric `line` and `column` properties.'
+ 'Expected `loc` to be an object with numeric `line` and `column` properties.',
);
}
if (loc.line <= 0) {
throw new RangeError(
- `Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`
+ `Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`,
);
}
if (loc.line > this.lineStartIndices.length) {
throw new RangeError(
- `Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`
+ `Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`,
);
}
@@ -673,7 +673,7 @@ class SourceCode extends TokenStore {
loc.column
} requested, but the length of line ${loc.line} is ${
lineEndIndex - lineStartIndex
- }).`
+ }).`,
);
}
diff --git a/fixtures/eslint/tools/code-sample-minimizer.js b/fixtures/eslint/tools/code-sample-minimizer.js
index bb3d93c8..e50f6063 100644
--- a/fixtures/eslint/tools/code-sample-minimizer.js
+++ b/fixtures/eslint/tools/code-sample-minimizer.js
@@ -93,7 +93,7 @@ function reduceBadExampleSize({
assert(
reproducesBadCase(sourceText),
- 'Original source text should reproduce issue'
+ 'Original source text should reproduce issue',
);
const parseResult = recast.parse(sourceText, { parser });
@@ -151,7 +151,7 @@ function reduceBadExampleSize({
*/
function extractRelevantChild(node) {
const childNodes = visitorKeys[node.type].flatMap((key) =>
- Array.isArray(node[key]) ? node[key] : [node[key]]
+ Array.isArray(node[key]) ? node[key] : [node[key]],
);
for (const childNode of childNodes) {
@@ -200,7 +200,9 @@ function reduceBadExampleSize({
// Try deleting the contents of the comment
text.slice(0, comment.range[0] + 2) +
text.slice(
- comment.type === 'Block' ? comment.range[1] - 2 : comment.range[1]
+ comment.type === 'Block'
+ ? comment.range[1] - 2
+ : comment.range[1],
),
]) {
if (reproducesBadCase(potentialSimplification)) {
@@ -215,18 +217,18 @@ function reduceBadExampleSize({
pruneIrrelevantSubtrees(parseResult.program);
const relevantChild = recast.print(
- extractRelevantChild(parseResult.program)
+ extractRelevantChild(parseResult.program),
).code;
assert(
reproducesBadCase(relevantChild),
- 'Extracted relevant source text should reproduce issue'
+ 'Extracted relevant source text should reproduce issue',
);
const result = removeIrrelevantComments(relevantChild);
assert(
reproducesBadCase(result),
- 'Source text with irrelevant comments removed should reproduce issue'
+ 'Source text with irrelevant comments removed should reproduce issue',
);
return result;
}
diff --git a/fixtures/got/source/as-promise/calculate-retry-delay.ts b/fixtures/got/source/as-promise/calculate-retry-delay.ts
index b0c0361a..03dff72c 100644
--- a/fixtures/got/source/as-promise/calculate-retry-delay.ts
+++ b/fixtures/got/source/as-promise/calculate-retry-delay.ts
@@ -8,7 +8,7 @@ type Returns unknown, V> = (
const retryAfterStatusCodes: ReadonlySet = new Set([413, 429, 503]);
const isErrorWithResponse = (
- error: RetryObject['error']
+ error: RetryObject['error'],
): error is HTTPError | ParseError | MaxRedirectsError =>
error instanceof HTTPError ||
error instanceof ParseError ||
diff --git a/fixtures/got/source/as-promise/core.ts b/fixtures/got/source/as-promise/core.ts
index 314c6a63..49fb1c53 100644
--- a/fixtures/got/source/as-promise/core.ts
+++ b/fixtures/got/source/as-promise/core.ts
@@ -21,7 +21,7 @@ export const parseBody = (
response: Response,
responseType: string | ResponseType,
parseJson: ParseJsonFunction,
- encoding?: BufferEncoding
+ encoding?: BufferEncoding,
): unknown => {
const { rawBody } = response;
@@ -43,7 +43,7 @@ export const parseBody = (
message: `Unknown body type '${responseType}'`,
name: 'Error',
},
- response
+ response,
);
} catch (error) {
throw new ParseError(error, response);
@@ -57,17 +57,17 @@ export default class PromisableRequest extends Request {
static normalizeArguments(
url?: string | URL,
nonNormalizedOptions?: Options,
- defaults?: Defaults
+ defaults?: Defaults,
): NormalizedOptions {
const options = super.normalizeArguments(
url,
nonNormalizedOptions,
- defaults
+ defaults,
);
if (is.null_(options.encoding)) {
throw new TypeError(
- 'To get a Buffer, set `options.responseType` to `buffer` instead'
+ 'To get a Buffer, set `options.responseType` to `buffer` instead',
);
}
@@ -104,7 +104,7 @@ export default class PromisableRequest extends Request {
options.retry.methods = [
...new Set(
- options.retry.methods.map((method) => method.toUpperCase() as Method)
+ options.retry.methods.map((method) => method.toUpperCase() as Method),
),
];
options.retry.statusCodes = [...new Set(options.retry.statusCodes)];
@@ -116,7 +116,7 @@ export default class PromisableRequest extends Request {
if (is.undefined(options.retry.maxRetryAfter)) {
options.retry.maxRetryAfter = Math.min(
// TypeScript is not smart enough to handle `.filter(x => is.number(x))`.
- ...[options.timeout.request, options.timeout.connect].filter(is.number)
+ ...[options.timeout.request, options.timeout.connect].filter(is.number),
);
}
@@ -137,7 +137,7 @@ export default class PromisableRequest extends Request {
if (!is.function_(pagination.shouldContinue)) {
throw new Error(
- '`options.pagination.shouldContinue` must be implemented'
+ '`options.pagination.shouldContinue` must be implemented',
);
}
@@ -168,7 +168,7 @@ export default class PromisableRequest extends Request {
mergedOptions = PromisableRequest.normalizeArguments(
undefined,
source,
- mergedOptions
+ mergedOptions,
);
}
diff --git a/fixtures/got/source/as-promise/types.ts b/fixtures/got/source/as-promise/types.ts
index f72c3399..ec322695 100644
--- a/fixtures/got/source/as-promise/types.ts
+++ b/fixtures/got/source/as-promise/types.ts
@@ -20,7 +20,7 @@ export interface RetryObject {
}
export type RetryFunction = (
- retryObject: RetryObject
+ retryObject: RetryObject,
) => number | Promise;
export interface RequiredRetryOptions {
@@ -39,7 +39,7 @@ export interface PaginationOptions {
paginate?: (
response: Response,
allItems: T[],
- currentItems: T[]
+ currentItems: T[],
) => Options | false;
shouldContinue?: (item: T, allItems: T[], currentItems: T[]) => boolean;
countLimit?: number;
@@ -52,11 +52,11 @@ export interface PaginationOptions {
export type BeforeRetryHook = (
options: NormalizedOptions,
error?: RequestError,
- retryCount?: number
+ retryCount?: number,
) => void | Promise;
export type AfterResponseHook = (
response: Response,
- retryWithMergedOptions: (options: Options) => CancelableRequest
+ retryWithMergedOptions: (options: Options) => CancelableRequest,
) =>
| Response
| CancelableRequest
@@ -107,7 +107,7 @@ export class ParseError extends RequestError {
super(
`${error.message} in "${options.url.toString()}"`,
error,
- response.request
+ response.request,
);
this.name = 'ParseError';
@@ -119,7 +119,7 @@ export class ParseError extends RequestError {
}
export interface CancelableRequest<
- T extends Response | Response['body'] = Response['body']
+ T extends Response | Response['body'] = Response['body'],
> extends PCancelable,
RequestEvents> {
json: () => CancelableRequest;
diff --git a/fixtures/got/source/core/utils/options-to-url.ts b/fixtures/got/source/core/utils/options-to-url.ts
index cc5f6a8d..d954ed6e 100644
--- a/fixtures/got/source/core/utils/options-to-url.ts
+++ b/fixtures/got/source/core/utils/options-to-url.ts
@@ -26,26 +26,26 @@ export default (origin: string, options: URLOptions): URL => {
if (options.path) {
if (options.pathname) {
throw new TypeError(
- 'Parameters `path` and `pathname` are mutually exclusive.'
+ 'Parameters `path` and `pathname` are mutually exclusive.',
);
}
if (options.search) {
throw new TypeError(
- 'Parameters `path` and `search` are mutually exclusive.'
+ 'Parameters `path` and `search` are mutually exclusive.',
);
}
if (options.searchParams) {
throw new TypeError(
- 'Parameters `path` and `searchParams` are mutually exclusive.'
+ 'Parameters `path` and `searchParams` are mutually exclusive.',
);
}
}
if (options.search && options.searchParams) {
throw new TypeError(
- 'Parameters `search` and `searchParams` are mutually exclusive.'
+ 'Parameters `search` and `searchParams` are mutually exclusive.',
);
}
diff --git a/fixtures/got/source/core/utils/timed-out.ts b/fixtures/got/source/core/utils/timed-out.ts
index 40e9739c..97fed930 100644
--- a/fixtures/got/source/core/utils/timed-out.ts
+++ b/fixtures/got/source/core/utils/timed-out.ts
@@ -34,7 +34,10 @@ export type ErrorCode =
export class TimeoutError extends Error {
code: ErrorCode;
- constructor(threshold: number, public event: string) {
+ constructor(
+ threshold: number,
+ public event: string,
+ ) {
super(`Timeout awaiting '${event}' for ${threshold}ms`);
this.name = 'TimeoutError';
@@ -45,7 +48,7 @@ export class TimeoutError extends Error {
export default (
request: ClientRequest,
delays: Delays,
- options: TimedOutOptions
+ options: TimedOutOptions,
): (() => void) => {
if (reentry in request) {
return noop;
@@ -58,13 +61,13 @@ export default (
const addTimeout = (
delay: number,
callback: (delay: number, event: string) => void,
- event: string
+ event: string,
): typeof noop => {
const timeout = setTimeout(
callback,
delay,
delay,
- event
+ event,
) as unknown as NodeJS.Timeout;
timeout.unref();
@@ -133,7 +136,7 @@ export default (
/* istanbul ignore next: hard to test */
if (socket.connecting) {
const hasPath = Boolean(
- socketPath ?? net.isIP(hostname ?? host ?? '') !== 0
+ socketPath ?? net.isIP(hostname ?? host ?? '') !== 0,
);
if (
@@ -144,7 +147,7 @@ export default (
const cancelTimeout = addTimeout(
delays.lookup,
timeoutHandler,
- 'lookup'
+ 'lookup',
);
once(socket, 'lookup', cancelTimeout);
}
@@ -172,7 +175,7 @@ export default (
const cancelTimeout = addTimeout(
delays.secureConnect,
timeoutHandler,
- 'secureConnect'
+ 'secureConnect',
);
once(socket, 'secureConnect', cancelTimeout);
});
@@ -198,7 +201,7 @@ export default (
const cancelTimeout = addTimeout(
delays.response,
timeoutHandler,
- 'response'
+ 'response',
);
once(request, 'response', cancelTimeout);
});
diff --git a/fixtures/got/source/create.ts b/fixtures/got/source/create.ts
index 5ebb0711..da57720e 100644
--- a/fixtures/got/source/create.ts
+++ b/fixtures/got/source/create.ts
@@ -86,7 +86,7 @@ export const defaultHandler: HandlerFunction = (options, next) => next(options);
*/
const callInitHooks = (
hooks: InitHook[] | undefined,
- options?: Options
+ options?: Options,
): void => {
if (hooks) {
for (const hook of hooks) {
@@ -118,7 +118,7 @@ const create = (defaults: InstanceDefaults): Got => {
Object.setPrototypeOf(typedResult, Object.getPrototypeOf(root));
Object.defineProperties(
typedResult,
- Object.getOwnPropertyDescriptors(root)
+ Object.getOwnPropertyDescriptors(root),
);
// These should point to the new promise
@@ -138,7 +138,7 @@ const create = (defaults: InstanceDefaults): Got => {
newOptions,
iteration === defaults.handlers.length
? getPromiseOrStream
- : iterateHandlers
+ : iterateHandlers,
);
if (is.plainObject(url)) {
@@ -166,7 +166,7 @@ const create = (defaults: InstanceDefaults): Got => {
const normalizedOptions = normalizeArguments(
url,
options,
- defaults.options
+ defaults.options,
);
normalizedOptions[kIsNormalizedAlready] = true;
@@ -174,7 +174,7 @@ const create = (defaults: InstanceDefaults): Got => {
throw new RequestError(
initHookError.message,
initHookError,
- normalizedOptions
+ normalizedOptions,
);
}
@@ -186,7 +186,7 @@ const create = (defaults: InstanceDefaults): Got => {
return createRejection(
error,
defaults.options.hooks.beforeError,
- options?.hooks?.beforeError
+ options?.hooks?.beforeError,
);
}
}
@@ -229,7 +229,7 @@ const create = (defaults: InstanceDefaults): Got => {
// Pagination
const paginateEach = async function* (
url: string | URL,
- options?: OptionsWithPagination
+ options?: OptionsWithPagination,
) {
let normalizedOptions = normalizeArguments(url, options, defaults.options);
normalizedOptions.resolveBodyOnly = false;
@@ -289,7 +289,7 @@ const create = (defaults: InstanceDefaults): Got => {
normalizedOptions = normalizeArguments(
undefined,
optionsToMerge,
- normalizedOptions
+ normalizedOptions,
);
}
@@ -299,12 +299,12 @@ const create = (defaults: InstanceDefaults): Got => {
got.paginate = ((
url: string | URL,
- options?: OptionsWithPagination
+ options?: OptionsWithPagination,
) => paginateEach(url, options)) as GotPaginate;
got.paginate.all = (async (
url: string | URL,
- options?: OptionsWithPagination
+ options?: OptionsWithPagination,
) => {
const results: T[] = [];
diff --git a/fixtures/load-repo.mjs b/fixtures/load-repo.mjs
index 15641ca3..f406e366 100755
--- a/fixtures/load-repo.mjs
+++ b/fixtures/load-repo.mjs
@@ -86,12 +86,12 @@ const interestingFiles = await Promise.all(
(f) =>
f.match(/.[jt]sx?$/) &&
!f.endsWith('.d.ts') && // ignore declaration files
- !f.replace(name, '').includes('test')
+ !f.replace(name, '').includes('test'),
)
.map(async (file) => {
const contents = await readFile(join(reposDir, file), 'utf8');
return { file, contents };
- })
+ }),
);
const eslint = new ESLint({
@@ -187,7 +187,7 @@ const filesWithNumNodeTypesPromises = interestingFiles.map(
numNodeTypes,
loc: contents.split('\n').length,
};
- }
+ },
);
const filesWithNumNodeTypes = await Promise.all(filesWithNumNodeTypesPromises);
@@ -217,14 +217,14 @@ if (chosenFiles.length === 0) {
const outPath = join(fixturesDir, file);
await mkdir(dirname(outPath));
await writeFile(outPath, contents);
- })
+ }),
);
console.log(kleur.bold().blue('Imported files'));
await runCommand('npm', ['run', 'lint']).catch((error) => {
console.log(
- '\nRead ./fixtures/README.md to learn how to resolve these lint errors'
+ '\nRead ./fixtures/README.md to learn how to resolve these lint errors',
);
// eslint-disable-next-line @cloudfour/n/no-process-exit
process.exit(error);
diff --git a/fixtures/mocha/karma.conf.js b/fixtures/mocha/karma.conf.js
index b6ded539..5f44930c 100644
--- a/fixtures/mocha/karma.conf.js
+++ b/fixtures/mocha/karma.conf.js
@@ -46,7 +46,7 @@ module.exports = (config) => {
// Write bundle to directory for debugging
fs.writeFileSync(
path.join(bundleDirpath, `mocha.${Date.now()}.js`),
- content
+ content,
);
}
});
@@ -168,7 +168,7 @@ module.exports = (config) => {
},
require.resolve('unexpected-sinon'),
require.resolve('unexpected-eventemitter/dist/unexpected-eventemitter.js'),
- require.resolve('./test/browser-specific/setup')
+ require.resolve('./test/browser-specific/setup'),
);
config.set(cfg);
diff --git a/fixtures/mocha/lib/cli/one-and-dones.js b/fixtures/mocha/lib/cli/one-and-dones.js
index 7bbc7096..9ddb9935 100644
--- a/fixtures/mocha/lib/cli/one-and-dones.js
+++ b/fixtures/mocha/lib/cli/one-and-dones.js
@@ -27,14 +27,15 @@ const showKeys = (obj) => {
const maxKeyLength = keys.reduce((max, key) => Math.max(max, key.length), 0);
for (const key of keys
.filter(
- (key) => /^[a-z]/.test(key) && !obj[key].browserOnly && !obj[key].abstract
+ (key) =>
+ /^[a-z]/.test(key) && !obj[key].browserOnly && !obj[key].abstract,
)
.sort()) {
const description = obj[key].description;
console.log(
` ${align.left(key, maxKeyLength + 1)}${
description ? `- ${description}` : ''
- }`
+ }`,
);
}
diff --git a/fixtures/mocha/lib/cli/options.js b/fixtures/mocha/lib/cli/options.js
index 3435f442..9a6f90c1 100644
--- a/fixtures/mocha/lib/cli/options.js
+++ b/fixtures/mocha/lib/cli/options.js
@@ -69,14 +69,14 @@ const configuration = { ...YARGS_PARSER_CONFIG, 'camel-case-expansion': false };
*/
const coerceOpts = Object.assign(
Object.fromEntries(
- types.array.map((arg) => [arg, (v) => [...new Set(list(v))]])
+ types.array.map((arg) => [arg, (v) => [...new Set(list(v))]]),
),
Object.fromEntries(
[...types.boolean, ...types.string, ...types.number].map((arg) => [
arg,
(v) => (Array.isArray(v) ? v.pop() : v),
- ])
- )
+ ]),
+ ),
);
/**
@@ -89,7 +89,7 @@ const coerceOpts = Object.assign(
* @ignore
*/
const nargOpts = Object.fromEntries(
- [...types.array, ...types.string, ...types.number].map((arg) => [arg, 1])
+ [...types.array, ...types.string, ...types.number].map((arg) => [arg, 1]),
);
/**
@@ -121,7 +121,7 @@ const parse = (args = [], defaultValues = {}, ...configObjects) => {
return acc;
},
- []
+ [],
);
const result = yargsParser.detailed(args, {
diff --git a/fixtures/mocha/lib/growl.js b/fixtures/mocha/lib/growl.js
index 8eecf8ca..8b7b3b05 100644
--- a/fixtures/mocha/lib/growl.js
+++ b/fixtures/mocha/lib/growl.js
@@ -29,7 +29,7 @@ exports.isCapable = () => {
if (!process.browser) {
return getSupportBinaries().reduce(
(acc, binary) => acc || Boolean(which(binary, { nothrow: true })),
- false
+ false,
);
}
diff --git a/fixtures/mocha/lib/interfaces/common.js b/fixtures/mocha/lib/interfaces/common.js
index e2192f3d..bf6b49e5 100644
--- a/fixtures/mocha/lib/interfaces/common.js
+++ b/fixtures/mocha/lib/interfaces/common.js
@@ -148,7 +148,7 @@ module.exports = function (suites, context, mocha) {
`Suite "${suite.fullTitle()}" was defined but no callback was supplied. ` +
`Supply a callback or explicitly skip the suite.`,
'callback',
- 'function'
+ 'function',
);
} else if (!opts.fn && suite.pending) {
suites.shift();
diff --git a/fixtures/mocha/scripts/markdown-magic.config.js b/fixtures/mocha/scripts/markdown-magic.config.js
index c7b6bdbf..f89637bf 100644
--- a/fixtures/mocha/scripts/markdown-magic.config.js
+++ b/fixtures/mocha/scripts/markdown-magic.config.js
@@ -31,8 +31,8 @@ exports.transforms = {
String(
execSync(`"${process.execPath}" ${executable} ${flag}`, {
cwd: path.join(__dirname, '..'),
- })
- ).trim()
+ }),
+ ).trim(),
);
return [header, output, footer].join('\n\n');
},
@@ -102,7 +102,7 @@ exports.transforms = {
output = output
.replace(
new RegExp(`require\\(['"]${relativeDir}(.*?)['"]\\)`, 'g'),
- "require('mocha$1')"
+ "require('mocha$1')",
)
.trim();
diff --git a/fixtures/mocha/scripts/netlify-headers.js b/fixtures/mocha/scripts/netlify-headers.js
index bfd7f9bd..552dd79d 100644
--- a/fixtures/mocha/scripts/netlify-headers.js
+++ b/fixtures/mocha/scripts/netlify-headers.js
@@ -50,7 +50,7 @@ new AssetGraph({ root: 'docs/_dist' })
for (const header of headers) {
const node = asset.parseTree.querySelector(
- `meta[http-equiv=${header}]`
+ `meta[http-equiv=${header}]`,
);
if (node) {
@@ -65,7 +65,7 @@ new AssetGraph({ root: 'docs/_dist' })
(r) =>
r.type === 'HtmlStyle' &&
r.crossorigin === false &&
- r.href !== undefined
+ r.href !== undefined,
);
if (firstCssRel) {
@@ -75,7 +75,7 @@ new AssetGraph({ root: 'docs/_dist' })
}
const resourceHintRelations = asset.outgoingRelations.filter((r) =>
- ['HtmlPreloadLink', 'HtmlPrefetchLink'].includes(r.type)
+ ['HtmlPreloadLink', 'HtmlPrefetchLink'].includes(r.type),
);
for (const rel of resourceHintRelations) {
@@ -85,7 +85,7 @@ new AssetGraph({ root: 'docs/_dist' })
}
const preconnectRelations = asset.outgoingRelations.filter((r) =>
- ['HtmlPreconnectLink'].includes(r.type)
+ ['HtmlPreconnectLink'].includes(r.type),
);
for (const rel of preconnectRelations) {
diff --git a/fixtures/rollup/build-plugins/generate-license-file.js b/fixtures/rollup/build-plugins/generate-license-file.js
index 46c35df7..132bcf6c 100644
--- a/fixtures/rollup/build-plugins/generate-license-file.js
+++ b/fixtures/rollup/build-plugins/generate-license-file.js
@@ -52,7 +52,7 @@ function generateLicenseFile(dependencies) {
licenses.add(license);
return text;
- }
+ },
)
.join('\n---------------------------------------\n\n');
const licenseText =
diff --git a/fixtures/rollup/rollup.config.js b/fixtures/rollup/rollup.config.js
index 24d7a3e7..41409866 100644
--- a/fixtures/rollup/rollup.config.js
+++ b/fixtures/rollup/rollup.config.js
@@ -27,7 +27,7 @@ const commitHash = (function () {
const now = new Date(
process.env.SOURCE_DATE_EPOCH
? process.env.SOURCE_DATE_EPOCH * 1000
- : Date.now()
+ : Date.now(),
).toUTCString();
const banner = `/*
@@ -44,7 +44,7 @@ const onwarn = (warning) => {
// eslint-disable-next-line no-console
console.error(
'Building Rollup produced warnings that need to be resolved. ' +
- 'Please keep in mind that the browser build may never have external dependencies!'
+ 'Please keep in mind that the browser build may never have external dependencies!',
);
throw new Error(warning.message);
};
diff --git a/fixtures/rollup/src/ExternalModule.ts b/fixtures/rollup/src/ExternalModule.ts
index 59523508..672f65f8 100644
--- a/fixtures/rollup/src/ExternalModule.ts
+++ b/fixtures/rollup/src/ExternalModule.ts
@@ -28,7 +28,7 @@ export default class ExternalModule {
constructor(
private readonly options: NormalizedInputOptions,
id: string,
- moduleSideEffects: boolean | 'no-treeshake'
+ moduleSideEffects: boolean | 'no-treeshake',
) {
this.id = id;
this.execIndex = Infinity;
diff --git a/fixtures/rollup/src/utils/error.ts b/fixtures/rollup/src/utils/error.ts
index 57ef8c82..fe8ed8dc 100644
--- a/fixtures/rollup/src/utils/error.ts
+++ b/fixtures/rollup/src/utils/error.ts
@@ -18,7 +18,7 @@ export function augmentCodeLocation(
props: RollupLogProps,
pos: number | { column: number; line: number },
source: string,
- id: string
+ id: string,
): void {
if (typeof pos === 'object') {
const { line, column } = pos;
@@ -86,7 +86,7 @@ export function errChunkNotGeneratedForFileName(name: string) {
}
export function errAssetReferenceIdNotFoundForSetSource(
- assetReferenceId: string
+ assetReferenceId: string,
) {
return {
code: Errors.ASSET_NOT_FOUND,
@@ -112,7 +112,7 @@ export function errBadLoader(id: string) {
return {
code: Errors.BAD_LOADER,
message: `Error loading ${relativeId(
- id
+ id,
)}: plugin load hook should return a string, a { code, map } object, or nothing/null`,
};
}
@@ -127,7 +127,7 @@ export function errDeprecation(deprecation: string | RollupWarning) {
}
export function errFileReferenceIdNotFoundForFilename(
- assetReferenceId: string
+ assetReferenceId: string,
) {
return {
code: Errors.FILE_NOT_FOUND,
@@ -144,7 +144,7 @@ export function errFileNameConflict(fileName: string) {
export function errInputHookInOutputPlugin(
pluginName: string,
- hookName: string
+ hookName: string,
) {
return {
code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,
@@ -155,12 +155,12 @@ export function errInputHookInOutputPlugin(
export function errCannotAssignModuleToChunk(
moduleId: string,
assignToAlias: string,
- currentAlias: string
+ currentAlias: string,
) {
return {
code: Errors.INVALID_CHUNK,
message: `Cannot assign ${relativeId(
- moduleId
+ moduleId,
)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`,
};
}
@@ -176,24 +176,24 @@ export function errInvalidExportOptionValue(optionValue: string) {
export function errIncompatibleExportOptionValue(
optionValue: string,
keys: string[],
- entryModule: string
+ entryModule: string,
) {
return {
code: 'INVALID_EXPORT_OPTION',
message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(
- entryModule
+ entryModule,
)}" has the following exports: ${keys.join(', ')}`,
};
}
export function errInternalIdCannotBeExternal(
source: string,
- importer: string
+ importer: string,
) {
return {
code: Errors.INVALID_EXTERNAL_ID,
message: `'${source}' is imported as an external by ${relativeId(
- importer
+ importer,
)}, but is already an existing non-external module id.`,
};
}
@@ -221,28 +221,28 @@ export function errInvalidRollupPhaseForChunkEmission() {
export function errImplicitDependantCannotBeExternal(
unresolvedId: string,
- implicitlyLoadedBefore: string
+ implicitlyLoadedBefore: string,
) {
return {
code: Errors.MISSING_IMPLICIT_DEPENDANT,
message: `Module "${relativeId(
- unresolvedId
+ unresolvedId,
)}" that should be implicitly loaded before "${relativeId(
- implicitlyLoadedBefore
+ implicitlyLoadedBefore,
)}" cannot be external.`,
};
}
export function errUnresolvedImplicitDependant(
unresolvedId: string,
- implicitlyLoadedBefore: string
+ implicitlyLoadedBefore: string,
) {
return {
code: Errors.MISSING_IMPLICIT_DEPENDANT,
message: `Module "${relativeId(
- unresolvedId
+ unresolvedId,
)}" that should be implicitly loaded before "${relativeId(
- implicitlyLoadedBefore
+ implicitlyLoadedBefore,
)}" could not be resolved.`,
};
}
@@ -254,7 +254,7 @@ export function errImplicitDependantIsNotIncluded(module: Module) {
return {
code: Errors.MISSING_IMPLICIT_DEPENDANT,
message: `Module "${relativeId(
- module.id
+ module.id,
)}" that should be implicitly loaded before "${
implicitDependencies.length === 1
? implicitDependencies[0]
@@ -270,7 +270,7 @@ export function errMixedExport(facadeModuleId: string, name?: string) {
code: Errors.MIXED_EXPORTS,
id: facadeModuleId,
message: `Entry module "${relativeId(
- facadeModuleId
+ facadeModuleId,
)}" is using named and default exports together. Consumers of your bundle will have to use \`${
name || 'chunk'
}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,
@@ -281,16 +281,16 @@ export function errMixedExport(facadeModuleId: string, name?: string) {
export function errNamespaceConflict(
name: string,
reexportingModule: Module,
- additionalExportAllModule: Module
+ additionalExportAllModule: Module,
) {
return {
code: Errors.NAMESPACE_CONFLICT,
message: `Conflicting namespaces: ${relativeId(
- reexportingModule.id
+ reexportingModule.id,
)} re-exports '${name}' from both ${relativeId(
- reexportingModule.exportsAll[name]
+ reexportingModule.exportsAll[name],
)} and ${relativeId(
- additionalExportAllModule.exportsAll[name]
+ additionalExportAllModule.exportsAll[name],
)} (will be ignored)`,
name,
reexporter: reexportingModule.id,
@@ -324,13 +324,13 @@ export function errUnresolvedImport(source: string, importer: string) {
export function errUnresolvedImportTreatedAsExternal(
source: string,
- importer: string
+ importer: string,
) {
return {
code: Errors.UNRESOLVED_IMPORT,
importer: relativeId(importer),
message: `'${source}' is imported by ${relativeId(
- importer
+ importer,
)}, but could not be resolved – treating it as an external dependency`,
source,
url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency',
@@ -356,13 +356,13 @@ export function errFailedValidation(message: string) {
export function warnDeprecation(
deprecation: string | RollupWarning,
activeDeprecation: boolean,
- options: NormalizedInputOptions
+ options: NormalizedInputOptions,
): void {
warnDeprecationWithOptions(
deprecation,
activeDeprecation,
options.onwarn,
- options.strictDeprecations
+ options.strictDeprecations,
);
}
@@ -370,7 +370,7 @@ export function warnDeprecationWithOptions(
deprecation: string | RollupWarning,
activeDeprecation: boolean,
warn: WarningHandler,
- strictDeprecations: boolean
+ strictDeprecations: boolean,
): void {
if (!activeDeprecation && !strictDeprecations) return;
const warning = errDeprecation(deprecation);
diff --git a/fixtures/rollup/src/utils/executionOrder.ts b/fixtures/rollup/src/utils/executionOrder.ts
index fbe5c24a..59632a30 100644
--- a/fixtures/rollup/src/utils/executionOrder.ts
+++ b/fixtures/rollup/src/utils/executionOrder.ts
@@ -6,8 +6,10 @@ interface OrderedExecutionUnit {
execIndex: number;
}
-const compareExecIndex = (unitA: T, unitB: T) =>
- unitA.execIndex > unitB.execIndex ? 1 : -1;
+const compareExecIndex = (
+ unitA: T,
+ unitB: T,
+) => (unitA.execIndex > unitB.execIndex ? 1 : -1);
export function sortByExecutionOrder(units: OrderedExecutionUnit[]) {
units.sort(compareExecIndex);
@@ -73,7 +75,7 @@ export function analyseModuleExecution(entryModules: Module[]) {
function getCyclePath(
module: Module | ExternalModule,
parent: Module,
- parents: Map
+ parents: Map,
) {
const path = [relativeId(module.id)];
let nextModule = parent;
diff --git a/fixtures/rollup/src/utils/options/mergeOptions.ts b/fixtures/rollup/src/utils/options/mergeOptions.ts
index 97af8e00..0cd6f620 100644
--- a/fixtures/rollup/src/utils/options/mergeOptions.ts
+++ b/fixtures/rollup/src/utils/options/mergeOptions.ts
@@ -31,7 +31,7 @@ export const commandAliases: { [key: string]: string } = {
export function mergeOptions(
config: GenericConfigObject,
rawCommandOptions: GenericConfigObject = {},
- defaultOnWarnHandler: WarningHandler = defaultOnWarn
+ defaultOnWarnHandler: WarningHandler = defaultOnWarn,
): MergedRollupOptions {
const command = getCommandOptions({
external: [],
@@ -45,11 +45,11 @@ export function mergeOptions(
}
const outputOptionsArray = ensureArray(
- config.output
+ config.output,
) as GenericConfigObject[];
if (outputOptionsArray.length === 0) outputOptionsArray.push({});
const outputOptions = outputOptionsArray.map((singleOutputOptions) =>
- mergeOutputOptions(singleOutputOptions, command, warn)
+ mergeOutputOptions(singleOutputOptions, command, warn),
);
warnUnknownOptions(
@@ -57,7 +57,7 @@ export function mergeOptions(
[
...Object.keys(inputOptions),
...Object.keys(outputOptions[0]).filter(
- (option) => option !== 'sourcemapPathTransform'
+ (option) => option !== 'sourcemapPathTransform',
),
...Object.keys(commandAliases),
'config',
@@ -69,14 +69,14 @@ export function mergeOptions(
],
'CLI flags',
warn,
- /^_$|output$|config/
+ /^_$|output$|config/,
);
inputOptions.output = outputOptions;
return inputOptions;
}
function getCommandOptions(
- rawCommandOptions: GenericConfigObject
+ rawCommandOptions: GenericConfigObject,
): CommandConfigObject {
const external =
rawCommandOptions.external && typeof rawCommandOptions.external === 'string'
@@ -109,7 +109,7 @@ type CompleteInputOptions = {
function mergeInputOptions(
config: GenericConfigObject,
overrides: CommandConfigObject,
- defaultOnWarnHandler: WarningHandler
+ defaultOnWarnHandler: WarningHandler,
): InputOptions {
const getOption = (name: string): any => overrides[name] ?? config[name];
const inputOptions: CompleteInputOptions = {
@@ -143,14 +143,14 @@ function mergeInputOptions(
Object.keys(inputOptions),
'input options',
inputOptions.onwarn,
- /^output$/
+ /^output$/,
);
return inputOptions;
}
const getExternal = (
config: GenericConfigObject,
- overrides: CommandConfigObject
+ overrides: CommandConfigObject,
): ExternalOption => {
const configExternal = config.external as ExternalOption | undefined;
return typeof configExternal === 'function'
@@ -162,7 +162,7 @@ const getExternal = (
const getOnWarn = (
config: GenericConfigObject,
- defaultOnWarnHandler: WarningHandler
+ defaultOnWarnHandler: WarningHandler,
): WarningHandler =>
config.onwarn
? (warning: any) => config.onwarn(warning, defaultOnWarnHandler)
@@ -171,7 +171,7 @@ const getOnWarn = (
const getObjectOption = (
config: GenericConfigObject,
overrides: GenericConfigObject,
- name: string
+ name: string,
) => {
const commandOption = normalizeObjectOptionValue(overrides[name]);
const configOption = normalizeObjectOptionValue(config[name]);
@@ -185,7 +185,7 @@ const getObjectOption = (
const getWatch = (
config: GenericConfigObject,
overrides: GenericConfigObject,
- name: string
+ name: string,
) => config.watch !== false && getObjectOption(config, overrides, name);
export const normalizeObjectOptionValue = (optionValue: any) => {
@@ -196,7 +196,7 @@ export const normalizeObjectOptionValue = (optionValue: any) => {
if (Array.isArray(optionValue)) {
return optionValue.reduce(
(result, value) => value && result && { ...result, ...value },
- {}
+ {},
);
}
@@ -214,7 +214,7 @@ type CompleteOutputOptions = {
function mergeOutputOptions(
config: GenericConfigObject,
overrides: GenericConfigObject,
- warn: WarningHandler
+ warn: WarningHandler,
): OutputOptions {
const getOption = (name: string): any => overrides[name] ?? config[name];
const outputOptions: CompleteOutputOptions = {
@@ -262,7 +262,7 @@ function mergeOutputOptions(
config,
Object.keys(outputOptions),
'output options',
- warn
+ warn,
);
return outputOptions;
}
diff --git a/fixtures/rollup/src/utils/options/normalizeOutputOptions.ts b/fixtures/rollup/src/utils/options/normalizeOutputOptions.ts
index 79e09e3b..82d75d6f 100644
--- a/fixtures/rollup/src/utils/options/normalizeOutputOptions.ts
+++ b/fixtures/rollup/src/utils/options/normalizeOutputOptions.ts
@@ -17,7 +17,7 @@ import { warnUnknownOptions } from './options';
export function normalizeOutputOptions(
config: GenericConfigObject,
inputOptions: NormalizedInputOptions,
- unsetInputOptions: Set
+ unsetInputOptions: Set,
): { options: NormalizedOutputOptions; unsetOptions: Set } {
// These are options that may trigger special warnings or behaviour later
// if the user did not select an explicit value
@@ -29,7 +29,7 @@ export function normalizeOutputOptions(
const preserveModules = getPreserveModules(
config,
inlineDynamicImports,
- inputOptions
+ inputOptions,
);
const file = getFile(config, preserveModules, inputOptions);
@@ -65,7 +65,7 @@ export function normalizeOutputOptions(
config,
inlineDynamicImports,
preserveModules,
- inputOptions
+ inputOptions,
),
minifyInternalExports: getMinifyInternalExports(config, format, compact),
name: config.name as string | undefined,
@@ -94,7 +94,7 @@ export function normalizeOutputOptions(
config,
Object.keys(outputOptions),
'output options',
- inputOptions.onwarn
+ inputOptions.onwarn,
);
return { options: outputOptions, unsetOptions };
}
@@ -102,7 +102,7 @@ export function normalizeOutputOptions(
const getFile = (
config: GenericConfigObject,
preserveModules: boolean,
- inputOptions: NormalizedInputOptions
+ inputOptions: NormalizedInputOptions,
): string | undefined => {
const file = config.file as string | undefined;
if (typeof file === 'string') {
@@ -153,7 +153,7 @@ const getFormat = (config: GenericConfigObject): InternalModuleFormat => {
const getInlineDynamicImports = (
config: GenericConfigObject,
- inputOptions: NormalizedInputOptions
+ inputOptions: NormalizedInputOptions,
): boolean => {
const inlineDynamicImports =
((config.inlineDynamicImports as boolean | undefined) ??
@@ -177,7 +177,7 @@ const getInlineDynamicImports = (
const getPreserveModules = (
config: GenericConfigObject,
inlineDynamicImports: boolean,
- inputOptions: NormalizedInputOptions
+ inputOptions: NormalizedInputOptions,
): boolean => {
const preserveModules =
((config.preserveModules as boolean | undefined) ??
@@ -204,7 +204,7 @@ const getPreserveModules = (
};
const getAmd = (
- config: GenericConfigObject
+ config: GenericConfigObject,
): {
define: string;
id?: string;
@@ -218,7 +218,7 @@ const getAmd = (
const getAddon = (
config: GenericConfigObject,
- name: string
+ name: string,
): (() => string | Promise) => {
const configAddon = config[name] as string | (() => string | Promise);
if (typeof configAddon === 'function') {
@@ -230,7 +230,7 @@ const getAddon = (
const getDir = (
config: GenericConfigObject,
- file: string | undefined
+ file: string | undefined,
): string | undefined => {
const dir = config.dir as string | undefined;
if (typeof dir === 'string' && typeof file === 'string') {
@@ -246,7 +246,7 @@ const getDir = (
const getDynamicImportFunction = (
config: GenericConfigObject,
- inputOptions: NormalizedInputOptions
+ inputOptions: NormalizedInputOptions,
): string | undefined => {
const configDynamicImportFunction = config.dynamicImportFunction as
| string
@@ -255,7 +255,7 @@ const getDynamicImportFunction = (
warnDeprecation(
`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`,
false,
- inputOptions
+ inputOptions,
);
}
@@ -264,7 +264,7 @@ const getDynamicImportFunction = (
const getEntryFileNames = (
config: GenericConfigObject,
- unsetOptions: Set
+ unsetOptions: Set,
): string => {
const configEntryFileNames = config.entryFileNames as
| string
@@ -278,7 +278,7 @@ const getEntryFileNames = (
};
function getExports(
- config: GenericConfigObject
+ config: GenericConfigObject,
): 'default' | 'named' | 'none' | 'auto' {
const configExports = config.exports as string | undefined;
if (
@@ -296,7 +296,7 @@ function getExports(
const getIndent = (
config: GenericConfigObject,
- compact: boolean
+ compact: boolean,
): string | true => {
if (compact) {
return '';
@@ -310,7 +310,7 @@ const getManualChunks = (
config: GenericConfigObject,
inlineDynamicImports: boolean,
preserveModules: boolean,
- inputOptions: NormalizedInputOptions
+ inputOptions: NormalizedInputOptions,
): ManualChunksOption => {
const configManualChunks =
(config.manualChunks as ManualChunksOption | undefined) ||
@@ -339,7 +339,7 @@ const getManualChunks = (
const getMinifyInternalExports = (
config: GenericConfigObject,
format: InternalModuleFormat,
- compact: boolean
+ compact: boolean,
): boolean =>
(config.minifyInternalExports as boolean | undefined) ??
(compact || format === 'es' || format === 'system');
diff --git a/fixtures/rollup/src/utils/pureComments.ts b/fixtures/rollup/src/utils/pureComments.ts
index f666d309..0f2361e0 100644
--- a/fixtures/rollup/src/utils/pureComments.ts
+++ b/fixtures/rollup/src/utils/pureComments.ts
@@ -16,7 +16,7 @@ basicWalker.FieldDefinition = function (node: any, st: any, c: any) {
function handlePureAnnotationsOfNode(
node: acorn.Node,
state: { commentIndex: number; commentNodes: CommentDescription[] },
- type: string = node.type
+ type: string = node.type,
) {
let commentNode = state.commentNodes[state.commentIndex];
while (commentNode && node.start >= commentNode.end) {
@@ -31,7 +31,7 @@ function handlePureAnnotationsOfNode(
function markPureNode(
node: acorn.Node & { annotations?: CommentDescription[] },
- comment: CommentDescription
+ comment: CommentDescription,
) {
if (node.annotations) {
node.annotations.push(comment);
@@ -50,7 +50,7 @@ const isPureComment = (comment: CommentDescription) =>
export function markPureCallExpressions(
comments: CommentDescription[],
- esTreeAst: acorn.Node
+ esTreeAst: acorn.Node,
) {
handlePureAnnotationsOfNode(esTreeAst, {
commentIndex: 0,
diff --git a/fixtures/rollup/src/watch/watch.ts b/fixtures/rollup/src/watch/watch.ts
index 58cb8d3b..25ed447f 100644
--- a/fixtures/rollup/src/watch/watch.ts
+++ b/fixtures/rollup/src/watch/watch.ts
@@ -32,7 +32,7 @@ export class Watcher {
watch && typeof watch.buildDelay === 'number'
? Math.max(buildDelay, (watch as WatcherOptions).buildDelay)
: buildDelay,
- this.buildDelay
+ this.buildDelay,
);
this.running = true;
process.nextTick(() => this.run());
@@ -209,7 +209,7 @@ export class Task {
if (error.id) {
this.cache.modules = this.cache.modules.filter(
- (module) => module.id !== error.id
+ (module) => module.id !== error.id,
);
}
diff --git a/generate-changeset.mjs b/generate-changeset.mjs
index 688ad4f7..7fc06a62 100644
--- a/generate-changeset.mjs
+++ b/generate-changeset.mjs
@@ -41,7 +41,7 @@ const log = (message) =>
/** @param {string} dir */
const loadConfig = async (dir) => {
const configModule = await import(join(dir, 'index.js')).then(
- (m) => m.default
+ (m) => m.default,
);
const allRules = configModule.rules;
const config = configModule.configs.recommended.rules;
@@ -126,17 +126,17 @@ ${rules.map((r) => `- ${printRuleLink(r)}`).join('\n')}
console.log(
`${kleur.blue(kleur.bold(groupName))}
${rules.map((r) => printRuleForCLI(r)).join('\n')}
-`
+`,
);
};
const newRules = Object.keys(branchRules).filter(
- (rule) => !(rule in mainRules)
+ (rule) => !(rule in mainRules),
);
printRuleList(newRules, 'New Rules');
const deletedRules = Object.keys(mainRules).filter(
- (rule) => !(rule in branchRules)
+ (rule) => !(rule in branchRules),
);
printRuleList(deletedRules, 'Deleted Rules');
@@ -148,7 +148,7 @@ const isEnabled = (rule) =>
const newlyEnabledRules = Object.entries(branchConfig)
.filter(
- ([ruleName, value]) => isEnabled(value) && !isEnabled(mainConfig[ruleName])
+ ([ruleName, value]) => isEnabled(value) && !isEnabled(mainConfig[ruleName]),
)
.map(([ruleName]) => ruleName);
printRuleList(newlyEnabledRules, 'Newly Enabled Rules');
@@ -156,7 +156,7 @@ printRuleList(newlyEnabledRules, 'Newly Enabled Rules');
const newlyDisabledRules = Object.entries(mainConfig)
.filter(
([ruleName, value]) =>
- isEnabled(value) && !isEnabled(branchConfig[ruleName])
+ isEnabled(value) && !isEnabled(branchConfig[ruleName]),
)
.map(([ruleName]) => ruleName);
printRuleList(newlyDisabledRules, 'Newly Disabled Rules');
@@ -209,7 +209,7 @@ const { versionBump, summary } = await prompts(
},
],
// eslint-disable-next-line @cloudfour/n/no-process-exit, @cloudfour/unicorn/no-process-exit
- { onCancel: () => process.exit(1) }
+ { onCancel: () => process.exit(1) },
);
output = `${summary}\n${output}`;
diff --git a/package-lock.json b/package-lock.json
index c32bd4d0..b6d5cb00 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -31,7 +31,7 @@
"kleur": "4.1.5",
"mkdirplz": "1.0.2",
"powerwalker": "0.1.2",
- "prettier": "2.8.8",
+ "prettier": "3.0.0",
"prompts": "2.4.2",
"typescript": "5.1.6"
},
@@ -396,6 +396,21 @@
"integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==",
"dev": true
},
+ "node_modules/@changesets/apply-release-plan/node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
"node_modules/@changesets/apply-release-plan/node_modules/semver": {
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
@@ -756,6 +771,21 @@
"integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==",
"dev": true
},
+ "node_modules/@changesets/write/node_modules/prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "dev": true,
+ "bin": {
+ "prettier": "bin-prettier.js"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
"node_modules/@es-joy/jsdoccomment": {
"version": "0.39.4",
"resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.39.4.tgz",
@@ -4479,15 +4509,15 @@
}
},
"node_modules/prettier": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
- "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
+ "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true,
"bin": {
- "prettier": "bin-prettier.js"
+ "prettier": "bin/prettier.cjs"
},
"engines": {
- "node": ">=10.13.0"
+ "node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
@@ -6034,6 +6064,12 @@
"integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==",
"dev": true
},
+ "prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "dev": true
+ },
"semver": {
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz",
@@ -6390,6 +6426,12 @@
"resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz",
"integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==",
"dev": true
+ },
+ "prettier": {
+ "version": "2.8.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
+ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "dev": true
}
}
},
@@ -9015,9 +9057,9 @@
"integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="
},
"prettier": {
- "version": "2.8.8",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
- "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz",
+ "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==",
"dev": true
},
"prompts": {
diff --git a/package.json b/package.json
index 68f8b04e..f87c265d 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"kleur": "4.1.5",
"mkdirplz": "1.0.2",
"powerwalker": "0.1.2",
- "prettier": "2.8.8",
+ "prettier": "3.0.0",
"prompts": "2.4.2",
"typescript": "5.1.6"
},
@@ -63,7 +63,7 @@
"check-lint": "eslint --format=pretty --ext=.js,.mjs,.cjs . && prettier --check .",
"load-fixture-repo": "node fixtures/load-repo",
"lint": "eslint --format=pretty --ext=.js,.mjs,.cjs --fix . && prettier --write .",
- "build": "node build.js",
+ "build": "node build.mjs",
"changeset": "changeset",
"version": "changeset version && prettier --write .",
"release": "npm run build && changeset publish"
diff --git a/src/config.js b/src/config.js
index 9c28d315..e5d0700f 100644
--- a/src/config.js
+++ b/src/config.js
@@ -23,7 +23,7 @@ const prefix = (rules) =>
if (key.includes('/') && !key.startsWith('@cloudfour/'))
key = `@cloudfour/${key.replace(/^@/, '')}`;
return [key, val];
- })
+ }),
);
/**
@@ -35,8 +35,8 @@ const removeUnused = (rules) =>
Object.fromEntries(
Object.entries(rules).filter(
([, val]) =>
- !(val === 'off' || val === 0 || val[0] === 'off' || val[0] === 0)
- )
+ !(val === 'off' || val === 0 || val[0] === 'off' || val[0] === 0),
+ ),
);
/**
@@ -51,7 +51,7 @@ const changeWarnToError = (rules) =>
if (Array.isArray(val) && (val[0] === 'warn' || val[0] === 1))
return [key, ['error', ...val.slice(1)]];
return [key, val];
- })
+ }),
);
module.exports.configs = {
@@ -219,7 +219,7 @@ module.exports.configs = {
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-returns-check': 'off', // Does not handle @returns with void or undefined
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
- })
+ }),
),
overrides: [
{
diff --git a/src/rules.js b/src/rules.js
index 08604f51..d95a4f5d 100644
--- a/src/rules.js
+++ b/src/rules.js
@@ -17,7 +17,7 @@ const preferEarlyReturn = require('./rules/prefer-early-return');
*/
const hoist = (prefix, rules) =>
Object.fromEntries(
- Object.entries(rules).map(([key, val]) => [`${prefix}/${key}`, val])
+ Object.entries(rules).map(([key, val]) => [`${prefix}/${key}`, val]),
);
const rules = {
diff --git a/src/rules/prefer-early-return/index.js b/src/rules/prefer-early-return/index.js
index 6897b8de..ff84d483 100644
--- a/src/rules/prefer-early-return/index.js
+++ b/src/rules/prefer-early-return/index.js
@@ -59,7 +59,7 @@ module.exports = {
if (hasSimplifiableConditionalBody(body)) {
context.report(
body,
- 'Prefer an early return to a conditionally-wrapped function body'
+ 'Prefer an early return to a conditionally-wrapped function body',
);
}
}