Closed thorn0 closed 3 years ago
prettier/prettier#10222 VS prettier/prettier@2.2.1
Submodule repos/babel contains modified content
Submodule repos/babel b63be94..0860b71:
diff --git a/repos/babel/packages/babel-core/src/config/config-chain.js b/repos/babel/packages/babel-core/src/config/config-chain.js
index 350111a1a..6e586eeaf 100644
--- a/repos/babel/packages/babel-core/src/config/config-chain.js
+++ b/repos/babel/packages/babel-core/src/config/config-chain.js
@@ -76,17 +76,15 @@ export function* buildPresetChain(
};
}
-export const buildPresetChainWalker: (
- arg: PresetInstance,
- context: *,
-) => * = makeChainWalker({
- root: preset => loadPresetDescriptors(preset),
- env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
- overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
- overridesEnv: (preset, index, envName) =>
- loadPresetOverridesEnvDescriptors(preset)(index)(envName),
- createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
-});
+export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * =
+ makeChainWalker({
+ root: preset => loadPresetDescriptors(preset),
+ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
+ overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
+ overridesEnv: (preset, index, envName) =>
+ loadPresetOverridesEnvDescriptors(preset)(index)(envName),
+ createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
+ });
const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>
buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),
);
@@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
function dedupDescriptors(
items: Array<UnloadedDescriptor>,
): Array<UnloadedDescriptor> {
- const map: Map<
- Function,
- Map<string | void, { value: UnloadedDescriptor }>,
- > = new Map();
+ const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
+ new Map();
const descriptors = [];
diff --git a/repos/babel/packages/babel-core/src/config/files/plugins.js b/repos/babel/packages/babel-core/src/config/files/plugins.js
index 298843e2d..fde98cfd3 100644
--- a/repos/babel/packages/babel-core/src/config/files/plugins.js
+++ b/repos/babel/packages/babel-core/src/config/files/plugins.js
@@ -14,8 +14,10 @@ const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
-const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
-const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PLUGIN_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PRESET_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
export function resolvePlugin(name: string, dirname: string): string | null {
diff --git a/repos/babel/packages/babel-core/src/config/validation/options.js b/repos/babel/packages/babel-core/src/config/validation/options.js
index 27caf3bcc..529d6606d 100644
--- a/repos/babel/packages/babel-core/src/config/validation/options.js
+++ b/repos/babel/packages/babel-core/src/config/validation/options.js
@@ -369,10 +369,8 @@ function throwUnknownError(loc: OptionPath) {
const key = loc.name;
if (removed[key]) {
- const {
- message,
- version = 5,
- }: { message: string, version?: number } = removed[key];
+ const { message, version = 5 }: { message: string, version?: number } =
+ removed[key];
throw new Error(
`Using removed Babel ${version} option: ${msg(loc)} - ${message}`,
diff --git a/repos/babel/packages/babel-core/src/transformation/normalize-file.js b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
index aca84e1e4..8734534cc 100644
--- a/repos/babel/packages/babel-core/src/transformation/normalize-file.js
+++ b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
@@ -98,8 +98,10 @@ export default function* normalizeFile(
// but without // or /* at the beginning of the comment.
// eslint-disable-next-line max-len
-const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
-const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
+const INLINE_SOURCEMAP_REGEX =
+ /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
+const EXTERNAL_SOURCEMAP_REGEX =
+ /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
function extractCommentsFromList(regex, comments, lastComment) {
if (comments) {
diff --git a/repos/babel/packages/babel-core/test/api.js b/repos/babel/packages/babel-core/test/api.js
index d715b6386..a8aed41cc 100644
--- a/repos/babel/packages/babel-core/test/api.js
+++ b/repos/babel/packages/babel-core/test/api.js
@@ -308,9 +308,8 @@ describe("api", function () {
new Plugin({
visitor: {
Function: function (path) {
- const alias = path.scope
- .getProgramParent()
- .path.get("body")[0].node;
+ const alias =
+ path.scope.getProgramParent().path.get("body")[0].node;
if (!babel.types.isTypeAlias(alias)) return;
// In case of `passPerPreset` being `false`, the
diff --git a/repos/babel/packages/babel-core/test/config-chain.js b/repos/babel/packages/babel-core/test/config-chain.js
index 8de2bc99d..4b3c1d10b 100644
--- a/repos/babel/packages/babel-core/test/config-chain.js
+++ b/repos/babel/packages/babel-core/test/config-chain.js
@@ -94,7 +94,8 @@ async function loadOptionsAsyncInSpawedProcess({ filename, cwd }) {
},
);
- const EXPERIMENTAL_WARNING = /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
+ const EXPERIMENTAL_WARNING =
+ /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) {
throw new Error(
diff --git a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
index aca3cfa75..08fb1f6e0 100644
--- a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -200,14 +200,8 @@ const privateNameHandlerSpec = {
get(member) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- methodId,
- getId,
- setId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, methodId, getId, setId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
@@ -264,13 +258,8 @@ const privateNameHandlerSpec = {
set(member, value) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- setId,
- getId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, setId, getId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/index.js b/repos/babel/packages/babel-helper-module-transforms/src/index.js
index 164462ee0..77b6845c0 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/index.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/index.js
@@ -214,10 +214,8 @@ const buildReexportsFromMeta = (
true,
);
} else {
- NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(
- t.cloneNode(namespace),
- t.identifier(importName),
- );
+ NAMESPACE_IMPORT = NAMESPACE_IMPORT =
+ t.memberExpression(t.cloneNode(namespace), t.identifier(importName));
}
const astNodes = {
EXPORTS: meta.exportName,
@@ -243,23 +241,26 @@ function buildESModuleHeader(
metadata: ModuleMetadata,
enumerable: boolean = false,
) {
- return (enumerable
- ? template.statement`
+ return (
+ enumerable
+ ? template.statement`
EXPORTS.__esModule = true;
`
- : template.statement`
+ : template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
- `)({ EXPORTS: metadata.exportName });
+ `
+ )({ EXPORTS: metadata.exportName });
}
/**
* Create a re-export initialization loop for a specific imported namespace.
*/
function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose
- ? template.statement`
+ return (
+ loose
+ ? template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -268,13 +269,13 @@ function buildNamespaceReexport(metadata, namespace, loose) {
EXPORTS[key] = NAMESPACE[key];
});
`
- : // Also skip already assigned bindings if they are strictly equal
- // to be somewhat more spec-compliant when a file has multiple
- // namespace re-exports that would cause a binding to be exported
- // multiple times. However, multiple bindings of the same name that
- // export the same primitive value are silently skipped
- // (the spec requires an "ambigous bindings" early error here).
- template.statement`
+ : // Also skip already assigned bindings if they are strictly equal
+ // to be somewhat more spec-compliant when a file has multiple
+ // namespace re-exports that would cause a binding to be exported
+ // multiple times. However, multiple bindings of the same name that
+ // export the same primitive value are silently skipped
+ // (the spec requires an "ambigous bindings" early error here).
+ template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -287,7 +288,8 @@ function buildNamespaceReexport(metadata, namespace, loose) {
},
});
});
- `)({
+ `
+ )({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
index 4f31fd926..706d84efc 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
@@ -165,13 +165,8 @@ const buildImportThrow = localName => {
const rewriteReferencesVisitor = {
ReferencedIdentifier(path) {
- const {
- seen,
- buildImportReference,
- scope,
- imported,
- requeueInParent,
- } = this;
+ const { seen, buildImportReference, scope, imported, requeueInParent } =
+ this;
if (seen.has(path.node)) return;
seen.add(path.node);
diff --git a/repos/babel/packages/babel-parser/src/parser/statement.js b/repos/babel/packages/babel-parser/src/parser/statement.js
index 5827e5154..a1b0e5824 100644
--- a/repos/babel/packages/babel-parser/src/parser/statement.js
+++ b/repos/babel/packages/babel-parser/src/parser/statement.js
@@ -316,9 +316,8 @@ export default class StatementParser extends ExpressionParser {
}
takeDecorators(node: N.HasDecorators): void {
- const decorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const decorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (decorators.length) {
node.decorators = decorators;
this.resetStartLocationFromNode(node, decorators[0]);
@@ -331,9 +330,8 @@ export default class StatementParser extends ExpressionParser {
}
parseDecorators(allowExport?: boolean): void {
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
while (this.match(tt.at)) {
const decorator = this.parseDecorator();
currentContextDecorators.push(decorator);
@@ -2010,9 +2008,8 @@ export default class StatementParser extends ExpressionParser {
}
}
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
// If node.declaration is a class, it will take all decorators in the current context.
// Thus we should throw if we see non-empty decorators here.
if (currentContextDecorators.length) {
diff --git a/repos/babel/packages/babel-parser/src/plugins/flow.js b/repos/babel/packages/babel-parser/src/plugins/flow.js
index 0e00291fc..db810370f 100644
--- a/repos/babel/packages/babel-parser/src/plugins/flow.js
+++ b/repos/babel/packages/babel-parser/src/plugins/flow.js
@@ -2962,7 +2962,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.callee = base;
const result = this.tryParse(() => {
- node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ node.typeArguments =
+ this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
if (subscriptState.optionalChainMember) node.optional = false;
diff --git a/repos/babel/packages/babel-parser/src/tokenizer/context.js b/repos/babel/packages/babel-parser/src/tokenizer/context.js
index 5581e6b05..942f83b82 100644
--- a/repos/babel/packages/babel-parser/src/tokenizer/context.js
+++ b/repos/babel/packages/babel-parser/src/tokenizer/context.js
@@ -49,19 +49,23 @@ export const types: {
// When `=>` is eaten, the context update of `yield` is executed, however,
// `this.prodParam` still has `[Yield]` production because it is not yet updated
-tt.parenR.updateContext = tt.braceR.updateContext = function () {
- if (this.state.context.length === 1) {
- this.state.exprAllowed = true;
- return;
- }
+tt.parenR.updateContext = tt.braceR.updateContext =
+ function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
- let out = this.state.context.pop();
- if (out === types.braceStatement && this.curContext().token === "function") {
- out = this.state.context.pop();
- }
+ let out = this.state.context.pop();
+ if (
+ out === types.braceStatement &&
+ this.curContext().token === "function"
+ ) {
+ out = this.state.context.pop();
+ }
- this.state.exprAllowed = !out.isExpr;
-};
+ this.state.exprAllowed = !out.isExpr;
+ };
tt.name.updateContext = function (prevType) {
let allowed = false;
@@ -110,24 +114,25 @@ tt.incDec.updateContext = function () {
// tokExprAllowed stays unchanged
};
-tt._function.updateContext = tt._class.updateContext = function (prevType) {
- if (
- prevType.beforeExpr &&
- prevType !== tt.semi &&
- prevType !== tt._else &&
- !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
- !(
- (prevType === tt.colon || prevType === tt.braceL) &&
- this.curContext() === types.b_stat
- )
- ) {
- this.state.context.push(types.functionExpression);
- } else {
- this.state.context.push(types.functionStatement);
- }
+tt._function.updateContext = tt._class.updateContext =
+ function (prevType) {
+ if (
+ prevType.beforeExpr &&
+ prevType !== tt.semi &&
+ prevType !== tt._else &&
+ !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
+ !(
+ (prevType === tt.colon || prevType === tt.braceL) &&
+ this.curContext() === types.b_stat
+ )
+ ) {
+ this.state.context.push(types.functionExpression);
+ } else {
+ this.state.context.push(types.functionStatement);
+ }
- this.state.exprAllowed = false;
-};
+ this.state.exprAllowed = false;
+ };
tt.backQuote.updateContext = function () {
if (this.curContext() === types.template) {
diff --git a/repos/babel/packages/babel-parser/src/types.js b/repos/babel/packages/babel-parser/src/types.js
index d5a28729d..b75520a79 100644
--- a/repos/babel/packages/babel-parser/src/types.js
+++ b/repos/babel/packages/babel-parser/src/types.js
@@ -1137,9 +1137,10 @@ export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & {
typeAnnotation: ?TsTypeAnnotation,
};
-export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & {
- typeParameters: ?TsTypeParameterDeclaration,
-};
+export type TsSignatureDeclarationBase =
+ TsSignatureDeclarationOrIndexSignatureBase & {
+ typeParameters: ?TsTypeParameterDeclaration,
+ };
// ================
// TypeScript type members (for type literal / interface / class)
diff --git a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d860d884e..e19a77552 100644
--- a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet();
*/
function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
- const decorators = (path.isClass()
- ? [path].concat(path.get("body.body"))
- : path.get("properties")
+ const decorators = (
+ path.isClass()
+ ? [path].concat(path.get("body.body"))
+ : path.get("properties")
).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(
@@ -47,9 +48,8 @@ function applyEnsureOrdering(path) {
identDecorators
.map(decorator => {
const expression = decorator.expression;
- const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(
- "dec",
- ));
+ const id = (decorator.expression =
+ path.scope.generateDeclaredUidIdentifier("dec"));
return t.assignmentExpression("=", id, expression);
})
.concat([path.node]),
diff --git a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
index e1f9b7d51..387e2634c 100644
--- a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
+++ b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
@@ -357,11 +357,8 @@ export default declare((api, opts) => {
path.isObjectPattern(),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(objectPatternPath, file, ref);
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(objectPatternPath, file, ref);
if (loose) {
removeUnusedExcludedKeys(objectPatternPath);
@@ -440,11 +437,8 @@ export default declare((api, opts) => {
]),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(leftPath, file, t.identifier(refName));
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(leftPath, file, t.identifier(refName));
if (impureComputedPropertyDeclarators.length > 0) {
nodes.push(
diff --git a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
index cca55d21b..47dbd1ed3 100644
--- a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
@@ -4,11 +4,8 @@ import { types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);
- const {
- loose = false,
- useBuiltIns = false,
- allowArrayLike = false,
- } = options;
+ const { loose = false, useBuiltIns = false, allowArrayLike = false } =
+ options;
if (typeof loose !== "boolean") {
throw new Error(`.loose must be a boolean or undefined`);
@@ -296,10 +293,11 @@ export default declare((api, options) => {
const name = this.scope.generateUidIdentifierBasedOnNode(key);
this.nodes.push(this.buildVariableDeclaration(name, key));
if (!copiedPattern) {
- copiedPattern = pattern = {
- ...pattern,
- properties: pattern.properties.slice(),
- };
+ copiedPattern = pattern =
+ {
+ ...pattern,
+ properties: pattern.properties.slice(),
+ };
}
copiedPattern.properties[i] = {
...copiedPattern.properties[i],
diff --git a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
index 4608a225a..60989c943 100644
--- a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
+++ b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
@@ -37,8 +37,8 @@ const iifeVisitor = {
}
},
// type annotations don't use or introduce "real" bindings
- "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": path =>
- path.skip(),
+ "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration":
+ path => path.skip(),
};
// last 2 parameters are optional -- they are used by proposal-object-rest-spread/src/index.js
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
index 1cdbf6491..2d944d58c 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
@@ -10,8 +10,10 @@ const t = require("@babel/types");
const transformRuntime = require("../");
const runtimeVersion = require("@babel/runtime/package.json").version;
-const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default();
-const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default();
+const corejs2Definitions =
+ require("../lib/runtime-corejs2-definitions").default();
+const corejs3Definitions =
+ require("../lib/runtime-corejs3-definitions").default();
function outputFile(filePath, data) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
index 12c1a20b8..046cbceda 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
@@ -170,9 +170,9 @@ export default declare((api, options, dirname) => {
const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2
- ? getCoreJS2Definitions
- : getCoreJS3Definitions)(runtimeVersion);
+ const { BuiltIns, StaticProperties, InstanceProperties } = (
+ injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions
+ )(runtimeVersion);
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
diff --git a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
index 95ca9b119..baeca41a9 100644
--- a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
+++ b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
@@ -4,7 +4,7 @@
const proposalPlugins = new Set([
"proposal-class-properties",
- "proposal-private-methods"
+ "proposal-private-methods",
]);
// use intermediary object to enforce alphabetical key order
diff --git a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
index 0cd423af1..37370a9b6 100644
--- a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
+++ b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
@@ -39,13 +39,14 @@ const corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)
return memo;
}, {});
-const corejs3PolyfillsWithShippedProposals = (corejs3ShippedProposalsList: string[]).reduce(
- (memo, key) => {
- memo[key] = corejs3Polyfills[key];
- return memo;
- },
- { ...corejs3PolyfillsWithoutProposals },
-);
+const corejs3PolyfillsWithShippedProposals =
+ (corejs3ShippedProposalsList: string[]).reduce(
+ (memo, key) => {
+ memo[key] = corejs3Polyfills[key];
+ return memo;
+ },
+ { ...corejs3PolyfillsWithoutProposals },
+ );
export default function (
_: any,
diff --git a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
index ea0cd6950..1b9d8c7db 100644
--- a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
@@ -1,7 +1,7 @@
"use strict";
-const getOptionSpecificExcludesFor = require("../lib/get-option-specific-excludes")
- .default;
+const getOptionSpecificExcludesFor =
+ require("../lib/get-option-specific-excludes").default;
describe("defaults", () => {
describe("getOptionSpecificExcludesFor", () => {
diff --git a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
index 1958a7fa6..9b3541292 100644
--- a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
@@ -1,17 +1,16 @@
"use strict";
-const getCoreJS2PlatformSpecificDefaultFor = require("../lib/polyfills/corejs2/get-platform-specific-default")
- .default;
+const getCoreJS2PlatformSpecificDefaultFor =
+ require("../lib/polyfills/corejs2/get-platform-specific-default").default;
describe("defaults", () => {
describe("getCoreJS2PlatformSpecificDefaultFor", () => {
it("should return web polyfills for non-`node` platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
chrome: "63",
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toEqual([
"web.timers",
"web.immediate",
@@ -20,11 +19,10 @@ describe("defaults", () => {
});
it("shouldn't return web polyfills for node platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toBeNull();
});
});
diff --git a/repos/babel/packages/babel-preset-env/test/index.spec.js b/repos/babel/packages/babel-preset-env/test/index.spec.js
index 291bb26c7..e6a2d00c6 100644
--- a/repos/babel/packages/babel-preset-env/test/index.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/index.spec.js
@@ -1,18 +1,18 @@
"use strict";
const babelPresetEnv = require("../lib/index");
-const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin")
- .default;
-const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin")
- .default;
-const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin")
- .default;
-const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin")
- .default;
-const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin")
- .default;
-const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin")
- .default;
+const addCoreJS2UsagePlugin =
+ require("../lib/polyfills/corejs2/usage-plugin").default;
+const addCoreJS3UsagePlugin =
+ require("../lib/polyfills/corejs3/usage-plugin").default;
+const addRegeneratorUsagePlugin =
+ require("../lib/polyfills/regenerator/usage-plugin").default;
+const replaceCoreJS2EntryPlugin =
+ require("../lib/polyfills/corejs2/entry-plugin").default;
+const replaceCoreJS3EntryPlugin =
+ require("../lib/polyfills/corejs3/entry-plugin").default;
+const removeRegeneratorEntryPlugin =
+ require("../lib/polyfills/regenerator/entry-plugin").default;
const transformations = require("../lib/module-transformations").default;
const compatData = require("@babel/compat-data/plugins");
diff --git a/repos/babel/packages/babel-register/src/index.js b/repos/babel/packages/babel-register/src/index.js
index aea88df53..d9fefa1c4 100644
--- a/repos/babel/packages/babel-register/src/index.js
+++ b/repos/babel/packages/babel-register/src/index.js
@@ -4,9 +4,10 @@
* from a compiled Babel import.
*/
-exports = module.exports = function (...args) {
- return register(...args);
-};
+exports = module.exports =
+ function (...args) {
+ return register(...args);
+ };
exports.__esModule = true;
const node = require("./nodeWrapper");
diff --git a/repos/babel/packages/babel-standalone/src/generated/plugins.js b/repos/babel/packages/babel-standalone/src/generated/plugins.js
index 889f6a494..01a0ae395 100644
--- a/repos/babel/packages/babel-standalone/src/generated/plugins.js
+++ b/repos/babel/packages/babel-standalone/src/generated/plugins.js
@@ -259,7 +259,8 @@ export const all = {
"transform-new-target": transformNewTarget,
"transform-object-assign": transformObjectAssign,
"transform-object-super": transformObjectSuper,
- "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign,
+ "transform-object-set-prototype-of-to-assign":
+ transformObjectSetPrototypeOfToAssign,
"transform-parameters": transformParameters,
"transform-property-literals": transformPropertyLiterals,
"transform-property-mutators": transformPropertyMutators,
diff --git a/repos/babel/packages/babel-template/test/index.js b/repos/babel/packages/babel-template/test/index.js
index 7b893d7e4..63b821b0d 100644
--- a/repos/babel/packages/babel-template/test/index.js
+++ b/repos/babel/packages/babel-template/test/index.js
@@ -43,11 +43,12 @@ describe("@babel/template", function () {
describe("string-based", () => {
it("should handle replacing values from an object", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if (SOME_VAR === "") {}
`)({
- SOME_VAR: value,
- });
+ SOME_VAR: value,
+ });
expect(result.type).toBe("IfStatement");
expect(result.test.type).toBe("BinaryExpression");
@@ -56,7 +57,8 @@ describe("@babel/template", function () {
it("should handle replacing values given an array", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if ($0 === "") {}
`)([value]);
@@ -66,7 +68,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values with null to remove them", () => {
- const result = template(`
+ const result =
+ template(`
callee(ARG);
`)({ ARG: null });
@@ -76,7 +79,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values that are string content", () => {
- const result = template(`
+ const result =
+ template(`
("ARG");
`)({ ARG: "some new content" });
@@ -88,7 +92,8 @@ describe("@babel/template", function () {
it("should automatically clone nodes if they are injected twice", () => {
const id = t.identifier("someIdent");
- const result = template(`
+ const result =
+ template(`
ID;
ID;
`)({ ID: id });
@@ -277,23 +282,26 @@ describe("@babel/template", function () {
describe(".syntacticPlaceholders", () => {
it("works in function body", () => {
- const output = template(`function f() %%A%%`)({
- A: t.blockStatement([]),
- });
+ const output =
+ template(`function f() %%A%%`)({
+ A: t.blockStatement([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"function f() {}"`);
});
it("works in class body", () => {
- const output = template(`class C %%A%%`)({
- A: t.classBody([]),
- });
+ const output =
+ template(`class C %%A%%`)({
+ A: t.classBody([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"class C {}"`);
});
it("replaces lowercase names", () => {
- const output = template(`%%foo%%`)({
- foo: t.numericLiteral(1),
- });
+ const output =
+ template(`%%foo%%`)({
+ foo: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
@@ -372,23 +380,26 @@ describe("@babel/template", function () {
describe("undefined", () => {
it("allows placeholders", () => {
- const output = template(`%%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`%%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("replaces identifiers", () => {
- const output = template(`FOO`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("doesn't mix placeholder styles", () => {
- const output = template(`FOO + %%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO + %%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"FOO + 1;"`);
});
});
Submodule repos/eslint-plugin-vue contains modified content
Submodule repos/eslint-plugin-vue cc9c140..048779b:
diff --git a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
index b54c206..ed4a3dc 100644
--- a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
+++ b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
@@ -164,7 +164,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLTagClose') {
return null
@@ -188,7 +189,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLSelfClosingTagClose') {
return null
diff --git a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
index 3f202fa..20c2593 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
@@ -176,7 +176,8 @@ function createForVueSyntax(context) {
}
return {
- "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
+ "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer":
+ verify,
'VElement > VExpressionContainer': verify
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
index 7c05083..1cfbd61 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
@@ -15,8 +15,10 @@ const utils = require('../utils')
// Constants
// ------------------------------------------------------------------------------
-const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
-const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
+const ALL_IRREGULARS =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
+const IRREGULAR_WHITESPACE =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu
// ------------------------------------------------------------------------------
@@ -195,7 +197,8 @@ module.exports = {
const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
...(skipHTMLAttributeValues
? {
- 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue
+ 'VAttribute[directive=false] > VLiteral':
+ removeInvalidNodeErrorsInHTMLAttributeValue
}
: {}),
...(skipHTMLTextContents
diff --git a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
index 02ac6e3..d15bb4c 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
diff --git a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
index 7c0639b..3d2d8f0 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
@@ -104,16 +104,17 @@ module.exports = {
}
const targetBody = scopeStack.body
- const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
- vueNode
- )).find((cp) => {
- return (
- cp.value &&
- node.loc.start.line >= cp.value.loc.start.line &&
- node.loc.end.line <= cp.value.loc.end.line &&
- targetBody === cp.value
- )
- })
+ const computedProperty =
+ /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
+ vueNode
+ )).find((cp) => {
+ return (
+ cp.value &&
+ node.loc.start.line >= cp.value.loc.start.line &&
+ node.loc.end.line <= cp.value.loc.end.line &&
+ targetBody === cp.value
+ )
+ })
if (computedProperty) {
if (!utils.isThis(node, context)) {
return
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
index b8a2057..709617e 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
@@ -19,9 +19,10 @@ function stripQuotesForHTML(text) {
return text.slice(1, -1)
}
- const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
- text
- )
+ const re =
+ /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
+ text
+ )
if (!re) {
return null
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
index 01549ca..c2440da 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
@@ -144,7 +144,8 @@ module.exports = {
}
return utils.defineTemplateBodyVisitor(context, {
- "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify
+ "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]":
+ verify
})
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
index ec35636..aac0924 100644
--- a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
+++ b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
@@ -451,14 +451,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: ['${nameNode.value}']`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: ['${nameNode.value}']${
@@ -488,14 +484,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: {'${nameNode.value}': null}`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: {'${nameNode.value}': null}${
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
index 9a790e9..e670fa3 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
@@ -20,7 +20,8 @@ module.exports = {
}
return {
- 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
+ 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer':
+ reportDynamicArgument
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
index c356a67..af7dbcd 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
@@ -23,7 +23,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope
+ "VAttribute[directive=true] > VDirectiveKey[name.name='scope']":
+ reportScope
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
index 1ce2748..ba59c6e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
@@ -128,7 +128,8 @@ module.exports = {
return {
"VAttribute[directive=false][key.name='slot']": reportSlot,
- "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
+ "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']":
+ reportVBindSlot
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
index 219d2b3..5a53a9e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
@@ -27,7 +27,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand
+ "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']":
+ reportPropModifierShorthand
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
index f0cbe36..1bb5f57 100644
--- a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
+++ b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
@@ -28,7 +28,10 @@ function normalizeOptions(options) {
}
if (typeof options === 'string') {
- normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options)
+ normalized.atComponent =
+ normalized.default =
+ normalized.named =
+ /** @type {"shorthand" | "longform"} */ (options)
} else if (options != null) {
/** @type {(keyof Options)[]} */
const keys = ['atComponent', 'default', 'named']
diff --git a/repos/eslint-plugin-vue/lib/utils/indent-common.js b/repos/eslint-plugin-vue/lib/utils/indent-common.js
index 9e6bfde..3f9f548 100644
--- a/repos/eslint-plugin-vue/lib/utils/indent-common.js
+++ b/repos/eslint-plugin-vue/lib/utils/indent-common.js
@@ -1078,9 +1078,8 @@ module.exports.defineVisitor = function create(
baseline.add(token)
} else if (baseline.has(offsetInfo.baseToken)) {
// The base token is a baseline token on this line, so inherit it.
- offsetInfo.expectedIndent = offsets.get(
- offsetInfo.baseToken
- ).expectedIndent
+ offsetInfo.expectedIndent =
+ offsets.get(offsetInfo.baseToken).expectedIndent
baseline.add(token)
} else {
// Otherwise, set the expected indent of this line.
@@ -1464,8 +1463,8 @@ module.exports.defineVisitor = function create(
ExportDefaultDeclaration(node) {
const exportToken = tokenStore.getFirstToken(node)
const defaultToken = tokenStore.getFirstToken(node, 1)
- const declarationToken = getFirstAndLastTokens(node.declaration)
- .firstToken
+ const declarationToken =
+ getFirstAndLastTokens(node.declaration).firstToken
setOffset([defaultToken, declarationToken], 1, exportToken)
},
/** @param {ExportNamedDeclaration} node */
@@ -1739,10 +1738,11 @@ module.exports.defineVisitor = function create(
'MemberExpression, MetaProperty'(node) {
const objectToken = tokenStore.getFirstToken(node)
if (node.type === 'MemberExpression' && node.computed) {
- const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore(
- node.property,
- isLeftBracket
- ))
+ const leftBracketToken =
+ /** @type {Token} */ (tokenStore.getTokenBefore(
+ node.property,
+ isLeftBracket
+ ))
const propertyToken = tokenStore.getTokenAfter(leftBracketToken)
const rightBracketToken = tokenStore.getTokenAfter(
node.property,
@@ -1777,10 +1777,11 @@ module.exports.defineVisitor = function create(
isLeftBracket
))
const keyToken = tokenStore.getTokenAfter(keyLeftToken)
- const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.key,
- isRightBracket
- )))
+ const keyRightToken = (lastKeyToken =
+ /** @type {Token} */ (tokenStore.getTokenAfter(
+ node.key,
+ isRightBracket
+ )))
if (hasPrefix) {
setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens)))
diff --git a/repos/eslint-plugin-vue/lib/utils/index.js b/repos/eslint-plugin-vue/lib/utils/index.js
index 0bcf801..460f3d4 100644
--- a/repos/eslint-plugin-vue/lib/utils/index.js
+++ b/repos/eslint-plugin-vue/lib/utils/index.js
@@ -838,11 +838,12 @@ module.exports = {
if (propValue.type === 'FunctionExpression') {
value = propValue.body
} else if (propValue.type === 'ObjectExpression') {
- const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
- propValue,
- 'get',
- (p) => p.value.type === 'FunctionExpression'
- ))
+ const get =
+ /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
+ propValue,
+ 'get',
+ (p) => p.value.type === 'FunctionExpression'
+ ))
value = get ? get.value.body : null
}
@@ -870,13 +871,14 @@ module.exports = {
}
if (arg.type === 'ObjectExpression') {
- const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
- arg,
- 'get',
- (p) =>
- p.value.type === 'FunctionExpression' ||
- p.value.type === 'ArrowFunctionExpression'
- ))
+ const getProperty =
+ /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
+ arg,
+ 'get',
+ (p) =>
+ p.value.type === 'FunctionExpression' ||
+ p.value.type === 'ArrowFunctionExpression'
+ ))
return getProperty ? getProperty.value : null
}
diff --git a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
index 85a0ad4..9c3a40c 100644
--- a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
@@ -11,9 +11,10 @@ const tester = new RuleTester({
parserOptions: { ecmaVersion: 2018 }
})
-const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
- ''
-)
+const IRREGULAR_WHITESPACES =
+ '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
+ ''
+ )
const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('')
const ALL_IRREGULAR_WHITESPACES = [].concat(
IRREGULAR_WHITESPACES,
Submodule repos/excalidraw 1973ae9..115691e:
Submodule repos/prettier contains modified content
Submodule repos/prettier 2c1b8f6..cf8e9fd:
diff --git a/repos/prettier/scripts/release/steps/update-dependents-count.js b/repos/prettier/scripts/release/steps/update-dependents-count.js
index 1fb641bb6..b8e717537 100644
--- a/repos/prettier/scripts/release/steps/update-dependents-count.js
+++ b/repos/prettier/scripts/release/steps/update-dependents-count.js
@@ -23,9 +23,9 @@ async function update() {
const githubPage = await logPromise(
"Fetching github dependents count",
- fetch(
- "https://github.com/prettier/prettier/network/dependents"
- ).then((response) => response.text())
+ fetch("https://github.com/prettier/prettier/network/dependents").then(
+ (response) => response.text()
+ )
);
const dependentsCountGithub = Number(
githubPage
diff --git a/repos/prettier/src/language-html/conditional-comment.js b/repos/prettier/src/language-html/conditional-comment.js
index 228076446..f93551f98 100644
--- a/repos/prettier/src/language-html/conditional-comment.js
+++ b/repos/prettier/src/language-html/conditional-comment.js
@@ -7,7 +7,8 @@ const {
// https://css-tricks.com/how-to-create-an-ie-only-stylesheet
// <!--[if ... ]> ... <![endif]-->
-const IE_CONDITIONAL_START_END_COMMENT_REGEX = /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
+const IE_CONDITIONAL_START_END_COMMENT_REGEX =
+ /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
// <!--[if ... ]><!-->
const IE_CONDITIONAL_START_COMMENT_REGEX = /^\[if([^\]]*?)]><!$/;
// <!--<![endif]-->
diff --git a/repos/prettier/src/language-html/print-preprocess.js b/repos/prettier/src/language-html/print-preprocess.js
index 896d72bcd..600947b77 100644
--- a/repos/prettier/src/language-html/print-preprocess.js
+++ b/repos/prettier/src/language-html/print-preprocess.js
@@ -336,11 +336,8 @@ function extractWhitespaces(ast /*, options*/) {
const localChildren = [];
- const {
- leadingWhitespace,
- text,
- trailingWhitespace,
- } = getLeadingAndTrailingHtmlWhitespace(child.value);
+ const { leadingWhitespace, text, trailingWhitespace } =
+ getLeadingAndTrailingHtmlWhitespace(child.value);
if (leadingWhitespace) {
localChildren.push({ type: TYPE_WHITESPACE });
diff --git a/repos/prettier/src/language-html/syntax-vue.js b/repos/prettier/src/language-html/syntax-vue.js
index 0ce5bb005..48bc66d47 100644
--- a/repos/prettier/src/language-html/syntax-vue.js
+++ b/repos/prettier/src/language-html/syntax-vue.js
@@ -79,7 +79,8 @@ function isVueEventBindingExpression(eventBindingValue) {
// arrow function or anonymous function
const fnExpRE = /^([\w$]+|\([^)]*?\))\s*=>|^function\s*\(/;
// simple member expression chain (a, a.b, a['b'], a["b"], a[0], a[b])
- const simplePathRE = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
+ const simplePathRE =
+ /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
// https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
const value = eventBindingValue.trim();
diff --git a/repos/prettier/src/language-js/comments.js b/repos/prettier/src/language-js/comments.js
index e4e0caa09..d34fa03ce 100644
--- a/repos/prettier/src/language-js/comments.js
+++ b/repos/prettier/src/language-js/comments.js
@@ -588,10 +588,11 @@ function handleLastFunctionArgComments({
locEnd(getLast(parameters))
);
}
- const functionParamLeftParenIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- locEnd(enclosingNode.id)
- );
+ const functionParamLeftParenIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
+ text,
+ locEnd(enclosingNode.id)
+ );
return (
functionParamLeftParenIndex !== false &&
getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
diff --git a/repos/prettier/src/language-js/parse-postprocess.js b/repos/prettier/src/language-js/parse-postprocess.js
index be9dcd9dd..d74e063cc 100644
--- a/repos/prettier/src/language-js/parse-postprocess.js
+++ b/repos/prettier/src/language-js/parse-postprocess.js
@@ -21,10 +21,8 @@ function postprocess(ast, options) {
// Invalid decorators are removed since `@typescript-eslint/typescript-estree` v4
// https://github.com/typescript-eslint/typescript-eslint/pull/2375
if (options.parser === "typescript" && options.originalText.includes("@")) {
- const {
- esTreeNodeToTSNodeMap,
- tsNodeToESTreeNodeMap,
- } = options.tsParseResult;
+ const { esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } =
+ options.tsParseResult;
ast = visitNode(ast, (node) => {
const tsNode = esTreeNodeToTSNodeMap.get(node);
if (!tsNode) {
diff --git a/repos/prettier/src/language-js/parser-babel.js b/repos/prettier/src/language-js/parser-babel.js
index dad0eded4..b9f3282f7 100644
--- a/repos/prettier/src/language-js/parser-babel.js
+++ b/repos/prettier/src/language-js/parser-babel.js
@@ -62,10 +62,8 @@ function isFlowFile(text, options) {
text = text.slice(shebang.length);
}
- const firstNonSpaceNonCommentCharacterIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- 0
- );
+ const firstNonSpaceNonCommentCharacterIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, 0);
if (firstNonSpaceNonCommentCharacterIndex !== false) {
text = text.slice(0, firstNonSpaceNonCommentCharacterIndex);
diff --git a/repos/prettier/src/language-markdown/constants.evaluate.js b/repos/prettier/src/language-markdown/constants.evaluate.js
index 1b9ab9d09..45c799f9e 100644
--- a/repos/prettier/src/language-markdown/constants.evaluate.js
+++ b/repos/prettier/src/language-markdown/constants.evaluate.js
@@ -27,7 +27,8 @@ const kPattern = unicodeRegex({ Script: ["Hangul"] })
.toString();
// http://spec.commonmark.org/0.25/#ascii-punctuation-character
-const asciiPunctuationCharset = /* prettier-ignore */ regexpUtil.charset(
+const asciiPunctuationCharset =
+ /* prettier-ignore */ regexpUtil.charset(
"!", '"', "#", "$", "%", "&", "'", "(", ")", "*",
"+", ",", "-", ".", "/", ":", ";", "<", "=", ">",
"?", "@", "[", "\\", "]", "^", "_", "`", "{", "|",
diff --git a/repos/prettier/src/language-markdown/utils.js b/repos/prettier/src/language-markdown/utils.js
index de21b4e60..4b7d2608e 100644
--- a/repos/prettier/src/language-markdown/utils.js
+++ b/repos/prettier/src/language-markdown/utils.js
@@ -51,9 +51,13 @@ function splitText(text, options) {
/** @type {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} */
const nodes = [];
- const tokens = (options.proseWrap === "preserve"
- ? text
- : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
+ const tokens = (
+ options.proseWrap === "preserve"
+ ? text
+ : text.replace(
+ new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"),
+ "$1$2"
+ )
).split(/([\t\n ]+)/);
for (const [index, token] of tokens.entries()) {
// whitespace
diff --git a/repos/prettier/src/main/ast-to-doc.js b/repos/prettier/src/main/ast-to-doc.js
index 369e6fc50..3d5a5fec0 100644
--- a/repos/prettier/src/main/ast-to-doc.js
+++ b/repos/prettier/src/main/ast-to-doc.js
@@ -86,12 +86,8 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
}
function printPrettierIgnoredNode(node, options) {
- const {
- originalText,
- [Symbol.for("comments")]: comments,
- locStart,
- locEnd,
- } = options;
+ const { originalText, [Symbol.for("comments")]: comments, locStart, locEnd } =
+ options;
const start = locStart(node);
const end = locEnd(node);
diff --git a/repos/prettier/src/main/comments.js b/repos/prettier/src/main/comments.js
index 3903278c3..8dec303a2 100644
--- a/repos/prettier/src/main/comments.js
+++ b/repos/prettier/src/main/comments.js
@@ -313,10 +313,8 @@ function isOwnLineComment(text, options, decoratedComments, commentIndex) {
if (precedingNode) {
// Find first comment on the same line
for (let index = commentIndex - 1; index >= 0; index--) {
- const {
- comment,
- precedingNode: currentCommentPrecedingNode,
- } = decoratedComments[index];
+ const { comment, precedingNode: currentCommentPrecedingNode } =
+ decoratedComments[index];
if (
currentCommentPrecedingNode !== precedingNode ||
!isAllEmptyAndNoLineBreak(text.slice(locEnd(comment), start))
@@ -342,10 +340,8 @@ function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
index < decoratedComments.length;
index++
) {
- const {
- comment,
- followingNode: currentCommentFollowingNode,
- } = decoratedComments[index];
+ const { comment, followingNode: currentCommentFollowingNode } =
+ decoratedComments[index];
if (
currentCommentFollowingNode !== followingNode ||
!isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment)))
diff --git a/repos/prettier/tests_integration/__tests__/infer-parser.js b/repos/prettier/tests_integration/__tests__/infer-parser.js
index 5e27a6b09..88ea30065 100644
--- a/repos/prettier/tests_integration/__tests__/infer-parser.js
+++ b/repos/prettier/tests_integration/__tests__/infer-parser.js
@@ -163,11 +163,9 @@ describe("--write and --list-different with unknown path and no parser", () => {
});
describe("multiple files", () => {
- runPrettier("cli/infer-parser/", [
- "--list-different",
- "--write",
- "*",
- ]).test({ status: 0 });
+ runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
+ { status: 0 }
+ );
});
});
diff --git a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
index a420c561f..8622a9bce 100644
--- a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
+++ b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
@@ -3,14 +3,8 @@
/** @type {import('prettier')} */
const prettier = require("prettier-local");
-const {
- group,
- indent,
- line,
- lineSuffix,
- lineSuffixBoundary,
- softline,
-} = prettier.doc.builders;
+const { group, indent, line, lineSuffix, lineSuffixBoundary, softline } =
+ prettier.doc.builders;
const printDoc = require("../printDoc");
diff --git a/repos/prettier/website/README.md b/repos/prettier/website/README.md
index 53d5a2778..17c91ccbc 100644
--- a/repos/prettier/website/README.md
+++ b/repos/prettier/website/README.md
@@ -59,7 +59,6 @@ previous: doc0 # previous doc on sidebar for navigation
next: doc2 # next doc on the sidebar for navigation
# don’t include next if this is the last doc; don’t include previous if first doc
---
-
docs/
are published to https://prettier.io/docs/en/next/
and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from docs/
are copied to the website/versioned_docs/version-stable
directory, whose content is published to https://prettier.io/docs/en
.
@@ -73,7 +72,6 @@ title: Blog Post Title
author: Author Name
authorURL: http://github.com/author # (or some other link)-
In the blog post, you should include a line `<!--truncate-->`. This determines under which point text will be ignored when generating the preview of your blog post. Blog posts should have the file name format: `yyyy-mm-dd-your-file-name.md`.
diff --git a/repos/prettier/website/pages/playground-redirect.html b/repos/prettier/website/pages/playground-redirect.html
index e8bc4a40f..f03a9a573 100644
--- a/repos/prettier/website/pages/playground-redirect.html
+++ b/repos/prettier/website/pages/playground-redirect.html
@@ -16,9 +16,10 @@
/>
</p>
<script>
- const match = /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
- document.referrer
- );
+ const match =
+ /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
+ document.referrer
+ );
if (match != null) {
const [, /* url */ pr] = match;
location.replace(
diff --git a/repos/prettier/website/playground/util.js b/repos/prettier/website/playground/util.js
index b41bde90e..8a22a34df 100644
--- a/repos/prettier/website/playground/util.js
+++ b/repos/prettier/website/playground/util.js
@@ -55,7 +55,8 @@ export function getCodemirrorMode(parser) {
const astAutoFold = {
estree: /^\s*"(loc|start|end)":/,
postcss: /^\s*"(source|input|raws|file)":/,
- html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
+ html:
+ /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
mdast: /^\s*"position":/,
yaml: /^\s*"position":/,
glimmer: /^\s*"loc":/,
Submodule repos/typescript-eslint contains modified content
Submodule repos/typescript-eslint 7b701a3..dd532e7:
diff --git a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index bc26d9d9..c38a8702 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -55,9 +55,8 @@ function getExpectedIndentForNode(
sourceCodeLines: string[],
): number {
const lineIdx = node.loc.start.line - 1;
- const indent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- sourceCodeLines[lineIdx],
- )![1];
+ const indent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(sourceCodeLines[lineIdx])![1];
return indent.length;
}
function doIndent(line: string, indent: number): string {
@@ -333,9 +332,8 @@ export default createRule<Options, MessageIds>({
// +2 because we expect the string contents are indented one level
const expectedIndent = parentIndent + 2;
- const firstLineIndent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- lines[0],
- )![1];
+ const firstLineIndent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(lines[0])![1];
const requiresIndent = firstLineIndent.length > 0;
if (requiresIndent) {
if (firstLineIndent.length !== expectedIndent) {
@@ -488,7 +486,8 @@ export default createRule<Options, MessageIds>({
return {
// valid
- 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest,
+ 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression':
+ checkValidTest,
// invalid - errors
[invalidTestsSelectorPath.join(' > ')]: checkInvalidTest,
// invalid - suggestions
@@ -502,7 +501,8 @@ export default createRule<Options, MessageIds>({
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
// special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest,
+ 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
+ checkInvalidTest,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
index b6da50bb..4e95b731 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -19,7 +19,7 @@ export type RawRulesConfig = Record<
| {
severity?: RuleSeverity | 'warn' | 'none' | 'default';
options?: unknown;
- }
+ },
>;
export type MessageIds = 'failure';
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 7c2f237c..4bf17c25 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -102,8 +102,10 @@ export default util.createRule<[Options], MessageIds>({
The regex used are taken from the ones used in the official TypeScript repo -
https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L281-L289
*/
- const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
- const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExSingleLine =
+ /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExMultiLine =
+ /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const sourceCode = context.getSourceCode();
return {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 4521fcb1..37dfefd3 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -3,7 +3,8 @@ import * as util from '../util';
// tslint regex
// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32
-const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
+const ENABLE_DISABLE_REGEX =
+ /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
const toText = (
text: string,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
index c9f03c89..2f2be15c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
@@ -13,7 +13,7 @@ type Types = Record<
| {
message: string;
fixWith?: string;
- }
+ },
>;
export type Options = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
index 7107bdf4..b1915bcb 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
@@ -26,10 +26,8 @@ export default createRule<Options, MessageIds>({
},
defaultOptions: ['1tbs'],
create(context) {
- const [
- style,
- { allowSingleLine } = { allowSingleLine: false },
- ] = context.options;
+ const [style, { allowSingleLine } = { allowSingleLine: false }] =
+ context.options;
const isAllmanStyle = style === 'allman';
const sourceCode = context.getSourceCode();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
index e0e06a67..be22b20c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -10,7 +10,7 @@ export type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
type Option = Options[0];
type NormalizedOptions = Required<
- Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>
+ Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>,
>;
const OPTION_VALUE_SCHEME = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 5d14576a..096deaff 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -225,9 +225,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';
// we have a mixed type/value import, so we need to split them out into multiple exports
- const importNames = (isTypeImport
- ? report.valueSpecifiers
- : report.typeSpecifiers
+ const importNames = (
+ isTypeImport
+ ? report.valueSpecifiers
+ : report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);
context.report({
node: report.node,
@@ -308,10 +309,11 @@ export default util.createRule<Options, MessageIds>({
(specifier): specifier is TSESTree.ImportNamespaceSpecifier =>
specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,
) ?? null;
- const namedSpecifiers: TSESTree.ImportSpecifier[] = node.specifiers.filter(
- (specifier): specifier is TSESTree.ImportSpecifier =>
- specifier.type === AST_NODE_TYPES.ImportSpecifier,
- );
+ const namedSpecifiers: TSESTree.ImportSpecifier[] =
+ node.specifiers.filter(
+ (specifier): specifier is TSESTree.ImportSpecifier =>
+ specifier.type === AST_NODE_TYPES.ImportSpecifier,
+ );
return {
defaultSpecifier,
namespaceSpecifier,
@@ -476,11 +478,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier && !defaultSpecifier) {
// e.g.
@@ -687,11 +686,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier) {
// e.g.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
index 2c9dd9f2..b2b980cd 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -78,8 +78,8 @@ export default createRule<Options, MessageIds>({
const objectSymbol = typeChecker.getSymbolAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node.property),
);
- const modifierKind = objectSymbol?.getDeclarations()?.[0]
- ?.modifiers?.[0].kind;
+ const modifierKind =
+ objectSymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind;
if (
(allowPrivateClassPropertyAccess &&
modifierKind == ts.SyntaxKind.PrivateKeyword) ||
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 05c35c7a..088849f2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -248,7 +248,7 @@ type MessageIds = 'wrongIndentation';
type AppliedOptions = ExcludeKeys<
// slight hack to make interface work with Record<string, unknown>
RequireKeys<Pick<IndentConfig, keyof IndentConfig>, keyof IndentConfig>,
- AST_NODE_TYPES.VariableDeclarator
+ AST_NODE_TYPES.VariableDeclarator,
> & {
VariableDeclarator: 'off' | VariableDeclaratorObj;
};
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
* 2. Don't set any offsets against the first token of the node.
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
*/
- const offsetListeners = Object.keys(baseOffsetListeners).reduce<
- TSESLint.RuleListener
- >(
+ const offsetListeners = Object.keys(
+ baseOffsetListeners,
+ ).reduce<TSESLint.RuleListener>(
/*
* Offset listener calls are deferred until traversal is finished, and are called as
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
* ignored nodes are known.
*/
(acc, key) => {
- const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const listener = baseOffsetListeners[
+ key
+ ] as TSESLint.RuleFunction<TSESTree.Node>;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
acc[key] = node => listenerCallQueue.push({ listener, node });
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
index de5b971f..fc28832e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -123,7 +123,7 @@ export const defaultOrder = [
];
const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce<
- string[]
+ string[],
>((all, type) => {
all.push(type);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
index 54e68b2c..4775a1fe 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -130,12 +130,13 @@ export default util.createRule<Options, MessageIds>({
? parent.members
: [];
- const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter(
- (element): element is TSESTree.TSMethodSignature =>
- element.type === AST_NODE_TYPES.TSMethodSignature &&
- element !== methodNode &&
- getMethodKey(element) === getMethodKey(methodNode),
- );
+ const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] =
+ members.filter(
+ (element): element is TSESTree.TSMethodSignature =>
+ element.type === AST_NODE_TYPES.TSMethodSignature &&
+ element !== methodNode &&
+ getMethodKey(element) === getMethodKey(methodNode),
+ );
const isParentModule = isNodeParentModuleDeclaration(methodNode);
if (duplicatedKeyMethodNodes.length > 0) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
index 2640aee6..833f8b00 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
return !wasUnderscore;
}
-const PredefinedFormatToCheckFunction: Readonly<Record<
- PredefinedFormats,
- (name: string) => boolean
->> = {
+const PredefinedFormatToCheckFunction: Readonly<
+ Record<PredefinedFormats, (name: string) => boolean>,
+> = {
[PredefinedFormats.PascalCase]: isPascalCase,
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[PredefinedFormats.camelCase]: isCamelCase,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index b58edd99..f507f372 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -32,8 +32,10 @@ export default util.createRule({
return {
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
- 'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
- 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
+ 'MemberExpression[optional = true] > TSNonNullExpression.object':
+ checkExtraNonNullAssertion,
+ 'CallExpression[optional = true] > TSNonNullExpression.callee':
+ checkExtraNonNullAssertion,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 0cb41337..1f45a489 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -84,9 +84,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
- let fullNumberNode:
- | TSESTree.Literal
- | TSESTree.UnaryExpression = node;
+ let fullNumberNode: TSESTree.Literal | TSESTree.UnaryExpression =
+ node;
let raw = node.raw;
if (
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
index fa67859f..21456319 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -73,7 +73,7 @@ export default util.createRule<Options, MessageIds>({
loc?: TSESTree.SourceLocation;
},
void,
- unknown
+ unknown,
> {
if (
options?.builtinGlobals &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index aee4963a..fcf11f3f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -443,9 +443,9 @@ export default createRule<Options, MessageId>({
// (Value to complexity ratio is dubious however)
}
// Otherwise just do type analysis on the function as a whole.
- const returnTypes = getCallSignaturesOfType(
- getNodeType(callback),
- ).map(sig => sig.getReturnType());
+ const returnTypes = getCallSignaturesOfType(getNodeType(callback)).map(
+ sig => sig.getReturnType(),
+ );
/* istanbul ignore if */ if (returnTypes.length === 0) {
// Not a callable function
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
index 395bbfdc..014b2c22 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
@@ -170,12 +170,16 @@ export default util.createRule({
return {
TSModuleDeclaration: enterDeclaration,
TSEnumDeclaration: enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]':
+ enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]':
+ enterDeclaration,
'TSModuleDeclaration:exit': exitDeclaration,
'TSEnumDeclaration:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit':
+ exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit':
+ exitDeclaration,
TSQualifiedName(node: TSESTree.TSQualifiedName): void {
visitNamespaceAccess(node, node.left, node.right);
},
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 6d5036c2..030f2748 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -11,7 +11,7 @@ type MakeRequired<Base, Key extends keyof Base> = Omit<Base, Key> &
type TypeParameterWithConstraint = MakeRequired<
TSESTree.TSTypeParameter,
- 'constraint'
+ 'constraint',
>;
const is3dot5 = semver.satisfies(
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index b326c754..12284640 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -72,7 +72,8 @@ export default util.createRule({
return {
// ignore MemberExpression if it's parent is TSClassImplements or TSInterfaceHeritage
- ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression': checkMemberExpression,
+ ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression':
+ checkMemberExpression,
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
index 2b0bb32c..59680863 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -5,7 +5,8 @@ import {
} from '@typescript-eslint/experimental-utils';
import * as util from '../util';
-const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
+const SENTINEL_TYPE =
+ /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
/**
* Parses a given value as options.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
index 581e7ac1..01721d44 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
@@ -170,8 +170,8 @@ export default createRule<Options, MessageIds>({
): void {
if (isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween!(first, second);
- const secondType = sourceCode.getNodeByRangeIndex(second.range[0])!
- .type;
+ const secondType =
+ sourceCode.getNodeByRangeIndex(second.range[0])!.type;
const openingCurlyBraceMustBeSpaced =
options.arraysInObjectsException &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
index f49b5385..d21b088d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -134,10 +134,11 @@ export default createRule({
].join(', ')](node: TSESTree.MemberExpression): void {
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent as TSESTree.CallExpression;
- const compareNode = (callNode.parent?.type ===
- AST_NODE_TYPES.ChainExpression
- ? callNode.parent.parent
- : callNode.parent) as TSESTree.BinaryExpression;
+ const compareNode = (
+ callNode.parent?.type === AST_NODE_TYPES.ChainExpression
+ ? callNode.parent.parent
+ : callNode.parent
+ ) as TSESTree.BinaryExpression;
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index cd886a9d..0e15bf8f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -65,10 +65,12 @@ export default util.createRule({
| TSESTree.MemberExpression,
): void {
// selector guarantees this cast
- const initialExpression = (initialIdentifierOrNotEqualsExpr.parent
- ?.type === AST_NODE_TYPES.ChainExpression
- ? initialIdentifierOrNotEqualsExpr.parent.parent
- : initialIdentifierOrNotEqualsExpr.parent) as TSESTree.LogicalExpression;
+ const initialExpression = (
+ initialIdentifierOrNotEqualsExpr.parent?.type ===
+ AST_NODE_TYPES.ChainExpression
+ ? initialIdentifierOrNotEqualsExpr.parent.parent
+ : initialIdentifierOrNotEqualsExpr.parent
+ ) as TSESTree.LogicalExpression;
if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) {
// the node(identifier or member expression) is not the deepest left node
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 27eb7dca..0d4c3a7a 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -267,11 +267,11 @@ const DIRECTLY_INSIDE_CONSTRUCTOR = 0;
class ClassScope {
private readonly privateModifiableMembers = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly privateModifiableStatics = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly memberVariableModifications = new Set<string>();
private readonly staticVariableModifications = new Set<string>();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
index 99c455cd..764ca63d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
@@ -146,7 +146,7 @@ export default util.createRule({
'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(
node: Exclude<
TSESTree.Node,
- TSESTree.BlockStatement | TSESTree.AwaitExpression
+ TSESTree.BlockStatement | TSESTree.AwaitExpression,
>,
): void {
const expression = parserServices.esTreeNodeToTSNodeMap.get(node);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
index e73fd4b5..eccc264e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
@@ -36,9 +36,8 @@ export default util.createRule<Options, MessageIds>({
],
create(context) {
const rules = baseRule.create(context);
- const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const checkForSemicolon =
+ rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
/*
The following nodes are handled by the member-delimiter-style rule
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
index 08c3ad62..525febe2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
@@ -94,7 +94,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
programNode = node;
- const referenceRegExp = /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
+ const referenceRegExp =
+ /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
const commentsBefore = sourceCode.getCommentsBefore(programNode);
commentsBefore.forEach(comment => {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index 19aaf335..2b9150a6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -9,11 +9,11 @@ import * as util from '.';
class UnusedVarsVisitor<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> extends Visitor {
private static readonly RESULTS_CACHE = new WeakMap<
TSESTree.Program,
- ReadonlySet<TSESLint.Scope.Variable>
+ ReadonlySet<TSESLint.Scope.Variable>,
>();
readonly #scopeManager: TSESLint.Scope.ScopeManager;
@@ -32,7 +32,7 @@ class UnusedVarsVisitor<
public static collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: TSESLint.RuleContext<TMessageIds, TOptions>,
): ReadonlySet<TSESLint.Scope.Variable> {
@@ -747,7 +747,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
*/
function collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
): ReadonlySet<TSESLint.Scope.Variable> {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
index 86e0ec23..fe531fec 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
@@ -12,15 +12,10 @@ export * from './requiresQuoting';
export * from './types';
// this is done for convenience - saves migrating all of the old rules
-const {
- applyDefault,
- deepMerge,
- isObjectNotArray,
- getParserServices,
-} = ESLintUtils;
-type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
- T
->;
+const { applyDefault, deepMerge, isObjectNotArray, getParserServices } =
+ ESLintUtils;
+type InferMessageIdsTypeFromRule<T> =
+ ESLintUtils.InferMessageIdsTypeFromRule<T>;
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
export {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
index 2e6c4711..e7e0991b 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
@@ -91,11 +91,11 @@ function getNameFromMember(
type ExcludeKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = { [k in Exclude<keyof TObj, TKeys>]: TObj[k] };
type RequireKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = ExcludeKeys<TObj, TKeys> & { [k in TKeys]-?: Exclude<TObj[k], undefined> };
function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
index 103caeb5..d67ff887 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
@@ -137,9 +137,10 @@ describe('Validating README.md', () => {
for (const [ruleName, rule] of notDeprecated) {
describe(`Checking rule ${ruleName}`, () => {
- const ruleRow: string[] | undefined = (rule.meta.docs?.extendsBaseRule
- ? rulesTables.extension.cells
- : rulesTables.base.cells
+ const ruleRow: string[] | undefined = (
+ rule.meta.docs?.extendsBaseRule
+ ? rulesTables.extension.cells
+ : rulesTables.base.cells
).find(row => row[0].includes(`/${ruleName}.md`));
if (!ruleRow) {
// rule is in the wrong table, the first two tests will catch this, so no point in creating noise;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index 5134d591..855e13a0 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -3804,7 +3804,7 @@ class Foo {
const sortedWithoutGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + multiple types
@@ -4182,7 +4182,7 @@ const foo = class Foo {
const sortedWithoutGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + multiple types --> Only member group order is checked (default config)
@@ -4392,7 +4392,7 @@ class Foo {
const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + multiple types --> Only member group order is checked (default config)
@@ -4629,7 +4629,7 @@ const foo = class Foo {
const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + multiple types
@@ -4864,7 +4864,7 @@ interface Foo {
const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + multiple types --> Only member group order is checked (default config)
@@ -5097,14 +5097,12 @@ type Foo = {
],
};
-const sortedWithGroupingDefaultOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // default option + interface + default order + alphabetically
- {
- code: `
+const sortedWithGroupingDefaultOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // default option + interface + default order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5121,14 +5119,14 @@ interface Foo {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + interface + custom order + alphabetically
- {
- code: `
+ // default option + interface + custom order + alphabetically
+ {
+ code: `
interface Foo {
new () : Bar;
@@ -5144,19 +5142,19 @@ interface Foo {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + default order + alphabetically
- {
- code: `
+ // default option + type literal + default order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5173,14 +5171,14 @@ type Foo = {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + type literal + custom order + alphabetically
- {
- code: `
+ // default option + type literal + custom order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5197,19 +5195,19 @@ type Foo = {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + default order + alphabetically
- {
- code: `
+ // default option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5222,13 +5220,13 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
- // default option + class + decorators + default order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
+ // default option + class + decorators + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5245,14 +5243,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class + custom order + alphabetically
- {
- code: `
+ // default option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5265,19 +5263,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + default order + alphabetically
- {
- code: `
+ // default option + class expression + default order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5290,14 +5288,14 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class expression + custom order + alphabetically
- {
- code: `
+ // default option + class expression + custom order + alphabetically
+ {
+ code: `
const foo = class Foo {
constructor() {}
@@ -5310,20 +5308,20 @@ const foo = class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
- },
- },
- ],
- },
- ],
- invalid: [
- // default option + interface + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ },
+ ],
+ invalid: [
+ // default option + interface + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5340,23 +5338,23 @@ interface Foo {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + type literal + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5373,23 +5371,23 @@ type Foo = {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5400,23 +5398,23 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class expression + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static c: string = "";
public static b: string = "";
@@ -5427,22 +5425,22 @@ const foo = class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
- },
- },
- ],
- },
- // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
+ },
+ ],
+ },
+ // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
@Dec() a1: string;
@Dec()
@@ -5459,47 +5457,45 @@ class Foo {
@Dec() d(): void
}
`,
- options: [
- {
- default: {
- memberTypes: [
- 'decorated-field',
- 'field',
- 'constructor',
- 'decorated-method',
- ],
- order: 'alphabetically',
- },
- },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b1',
- rank: 'constructor',
- },
- },
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b2',
- rank: 'constructor',
- },
- },
- ],
- },
- ],
-};
-
-const sortedWithGroupingClassesOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // classes option + interface + alphabetically --> Default order applies
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: [
+ 'decorated-field',
+ 'field',
+ 'constructor',
+ 'decorated-method',
+ ],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b1',
+ rank: 'constructor',
+ },
+ },
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b2',
+ rank: 'constructor',
+ },
+ },
+ ],
+ },
+ ],
+ };
+
+const sortedWithGroupingClassesOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // classes option + interface + alphabetically --> Default order applies
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5516,12 +5512,12 @@ interface Foo {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + type literal + alphabetically --> Default order applies
- {
- code: `
+ // classes option + type literal + alphabetically --> Default order applies
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5538,12 +5534,12 @@ type Foo = {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + class + default order + alphabetically
- {
- code: `
+ // classes option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5556,14 +5552,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // classes option + class + custom order + alphabetically
- {
- code: `
+ // classes option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5576,19 +5572,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- classes: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ classes: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // classes option + class expression + alphabetically --> Default order applies
- {
- code: `
+ // classes option + class expression + alphabetically --> Default order applies
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5601,13 +5597,13 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
- ],
- invalid: [
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
+ ],
+ invalid: [
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5618,25 +5614,25 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
- ],
-};
+ ],
+ },
+ ],
+ };
const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + alphabetically --> Default order applies
@@ -5783,7 +5779,7 @@ const foo = class Foo {
const sortedWithGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + default order + alphabetically
@@ -5939,7 +5935,7 @@ interface Foo {
const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + alphabetically --> Default order applies
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index 93173074..eb3bec70 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -18,10 +18,9 @@ const parserOptions = {
project: './tsconfig.json',
};
-const formatTestNames: Readonly<Record<
- PredefinedFormatsString,
- Record<'valid' | 'invalid', string[]>
->> = {
+const formatTestNames: Readonly<
+ Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>,
+> = {
camelCase: {
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index 0f7bb141..61caf073 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -72,27 +72,25 @@ const testCases = [
const validTestCases = flatten(
testCases.map(c => c.code.map(code => `const a = ${code}`)),
);
-const invalidTestCases: TSESLint.InvalidTestCase<
- MessageIds,
- Options
->[] = flatten(
- testCases.map(cas =>
- cas.code.map(code => ({
- code: `const a: ${cas.type} = ${code}`,
- output: `const a = ${code}`,
- errors: [
- {
- messageId: 'noInferrableType',
- data: {
- type: cas.type,
+const invalidTestCases: TSESLint.InvalidTestCase<MessageIds, Options>[] =
+ flatten(
+ testCases.map(cas =>
+ cas.code.map(code => ({
+ code: `const a: ${cas.type} = ${code}`,
+ output: `const a = ${code}`,
+ errors: [
+ {
+ messageId: 'noInferrableType',
+ data: {
+ type: cas.type,
+ },
+ line: 1,
+ column: 7,
},
- line: 1,
- column: 7,
- },
- ],
- })),
- ),
-);
+ ],
+ })),
+ ),
+ );
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
index c0934982..67b9d22c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
@@ -21,7 +21,7 @@ const ruleTester = new RuleTester({
const hasExport = /^export/m;
// const hasImport = /^import .+? from ['"]/m;
function makeExternalModule<
- T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>
+ T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>,
>(tests: T[]): T[] {
return tests.map(t => {
if (!hasExport.test(t.code)) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index 80340828..2afa8616 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -144,7 +144,7 @@ const baseCases = [
],
} as TSESLint.InvalidTestCase<
InferMessageIdsTypeFromRule<typeof rule>,
- InferOptionsTypeFromRule<typeof rule>
+ InferOptionsTypeFromRule<typeof rule>,
>),
);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index 0cef8974..aefb7cd8 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1069,13 +1069,13 @@ function addOptional<TOptions extends Readonly<unknown[]>>(
): TSESLint.ValidTestCase<TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: TSESLint.InvalidTestCase<TMessageIds, TOptions>[],
): TSESLint.InvalidTestCase<TMessageIds, TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: (Case<TMessageIds, TOptions> | string)[],
): Case<TMessageIds, TOptions>[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
index e78808aa..ed84f286 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
@@ -49,10 +49,8 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Map(
);
const EXTENDS = ['./configs/base', './configs/eslint-recommended'];
-const ruleEntries: [
- string,
- TSESLint.RuleModule<string, unknown[]>,
-][] = Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
+const ruleEntries: [string, TSESLint.RuleModule<string, unknown[]>][] =
+ Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
/**
* Helper function reduces records to key - value pairs.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
index 49e48541..2c35583c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -20,7 +20,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -40,7 +40,7 @@ declare module 'eslint/lib/rules/camelcase' {
],
{
Identifier(node: TSESTree.Identifier): void;
- }
+ },
>;
export = rule;
}
@@ -136,7 +136,7 @@ declare module 'eslint/lib/rules/indent' {
JSXOpeningElement(node: TSESTree.JSXOpeningElement): void;
JSXClosingElement(node: TSESTree.JSXClosingElement): void;
JSXExpressionContainer(node: TSESTree.JSXExpressionContainer): void;
- }
+ },
>;
export = rule;
}
@@ -154,7 +154,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
{
before?: boolean;
after?: boolean;
- }
+ },
>;
},
];
@@ -215,7 +215,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
ImportNamespaceSpecifier: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
MethodDefinition: RuleFunction<TSESTree.MethodDefinition>;
Property: RuleFunction<TSESTree.Property>;
- }
+ },
>;
export = rule;
}
@@ -231,7 +231,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
ClassBody(): void;
'ClassBody:exit'(): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -245,7 +245,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -263,7 +263,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -280,7 +280,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
[],
{
Program(node: TSESTree.Program): void;
- }
+ },
>;
export = rule;
}
@@ -295,7 +295,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -318,7 +318,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -335,7 +335,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -354,7 +354,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -373,7 +373,7 @@ declare module 'eslint/lib/rules/no-shadow' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -390,7 +390,7 @@ declare module 'eslint/lib/rules/no-undef' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -415,7 +415,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -434,7 +434,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
],
{
ExpressionStatement(node: TSESTree.ExpressionStatement): void;
- }
+ },
>;
export = rule;
}
@@ -454,7 +454,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -476,7 +476,7 @@ declare module 'eslint/lib/rules/strict' {
['never' | 'global' | 'function' | 'safe'],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -489,7 +489,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
[],
{
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -542,7 +542,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
WhileStatement(node: TSESTree.WhileStatement): void;
WithStatement(node: TSESTree.WithStatement): void;
YieldExpression(node: TSESTree.YieldExpression): void;
- }
+ },
>;
export = rule;
}
@@ -572,7 +572,7 @@ declare module 'eslint/lib/rules/semi' {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -592,7 +592,7 @@ declare module 'eslint/lib/rules/quotes' {
{
Literal(node: TSESTree.Literal): void;
TemplateLiteral(node: TSESTree.TemplateLiteral): void;
- }
+ },
>;
export = rule;
}
@@ -619,7 +619,7 @@ declare module 'eslint/lib/rules/brace-style' {
SwitchStatement(node: TSESTree.SwitchStatement): void;
IfStatement(node: TSESTree.IfStatement): void;
TryStatement(node: TSESTree.TryStatement): void;
- }
+ },
>;
export = rule;
}
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
EmptyStatement(node: TSESTree.EmptyStatement): void;
ClassBody(node: TSESTree.ClassBody): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -653,7 +653,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
],
{
ClassBody(node: TSESTree.ClassBody): void;
- }
+ },
>;
export = rule;
}
@@ -671,7 +671,7 @@ declare module 'eslint/lib/rules/init-declarations' {
],
{
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -694,7 +694,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
FunctionExpression(node: TSESTree.FunctionExpression): void;
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
ThisExpression(node: TSESTree.ThisExpression): void;
- }
+ },
>;
export = rule;
}
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/dot-notation' {
],
{
MemberExpression(node: TSESTree.MemberExpression): void;
- }
+ },
>;
export = rule;
}
@@ -726,7 +726,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
[],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -759,7 +759,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
node: TSESTree.TSTypeParameterDeclaration,
): void;
TSTupleType(node: TSESTree.TSTupleType): void;
- }
+ },
>;
export = rule;
}
@@ -785,7 +785,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration?(node: TSESTree.ExportNamedDeclaration): void;
ExportAllDeclaration?(node: TSESTree.ExportAllDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -807,7 +807,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
LogicalExpression(node: TSESTree.LogicalExpression): void;
ConditionalExpression(node: TSESTree.ConditionalExpression): void;
VariableDeclarator(node: TSESTree.VariableDeclarator): void;
- }
+ },
>;
export = rule;
}
@@ -826,7 +826,7 @@ declare module 'eslint/lib/rules/prefer-const' {
{
'Program:exit'(node: TSESTree.Program): void;
VariableDeclaration(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -851,7 +851,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
ObjectExpression(node: TSESTree.ObjectExpression): void;
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
- }
+ },
>;
export = rule;
}
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
index cbf83771..e88a7314 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
@@ -47,7 +47,7 @@ const isCommentToken = eslintUtils.isCommentToken as (
token: TSESTree.Token | TSESTree.Comment,
) => token is TSESTree.Comment;
const isNotCommentToken = eslintUtils.isNotCommentToken as <
- T extends TSESTree.Token | TSESTree.Comment
+ T extends TSESTree.Token | TSESTree.Comment,
>(
token: T,
) => token is Exclude<T, TSESTree.Comment>;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
index 1fd2e752..2b1584bc 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
@@ -5,7 +5,7 @@ import { RuleCreateFunction, RuleModule } from '../ts-eslint';
*/
type InferOptionsTypeFromRule<T> = T extends RuleModule<
infer _TMessageIds,
- infer TOptions
+ infer TOptions,
>
? TOptions
: T extends RuleCreateFunction<infer _TMessageIds, infer TOptions>
@@ -17,7 +17,7 @@ type InferOptionsTypeFromRule<T> = T extends RuleModule<
*/
type InferMessageIdsTypeFromRule<T> = T extends RuleModule<
infer TMessageIds,
- infer _TOptions
+ infer _TOptions,
>
? TMessageIds
: T extends RuleCreateFunction<infer TMessageIds, infer _TOptions>
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
index ca1cfb33..f02b7589 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
@@ -19,7 +19,7 @@ function RuleCreator(urlCreator: (ruleName: string) => string) {
return function createRule<
TOptions extends readonly unknown[],
TMessageIds extends string,
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>({
name,
meta,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
index 6ed25e4a..29a56671 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
@@ -24,13 +24,13 @@ function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(
*/
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
test: InvalidTestCase<TMessageIds, TOptions>,
): InvalidTestCase<TMessageIds, TOptions>[];
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
options: ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>,
): (ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>)[] {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
index 925d4976..27ad5792 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
@@ -9,7 +9,7 @@ const ERROR_MESSAGE =
*/
function getParserServices<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
allowWithoutFullTypeInformation = false,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
index 15c69bbf..1999c4f4 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
@@ -27,13 +27,14 @@ const Definition = ESLintDefinition as DefinitionConstructor;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ParameterDefinition extends Definition {}
-const ParameterDefinition = ESLintParameterDefinition as DefinitionConstructor & {
- new (
- name: TSESTree.Node,
- node: TSESTree.Node,
- index?: number | null,
- rest?: boolean,
- ): ParameterDefinition;
-};
+const ParameterDefinition =
+ ESLintParameterDefinition as DefinitionConstructor & {
+ new (
+ name: TSESTree.Node,
+ node: TSESTree.Node,
+ index?: number | null,
+ rest?: boolean,
+ ): ParameterDefinition;
+ };
export { Definition, ParameterDefinition };
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
index 49f1e11c..9b2c711d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
@@ -142,8 +142,9 @@ const ModuleScope = ESLintModuleScope as ScopeConstructor &
ScopeChildConstructorWithUpperScope<ModuleScope>;
interface FunctionExpressionNameScope extends Scope {}
-const FunctionExpressionNameScope = ESLintFunctionExpressionNameScope as ScopeConstructor &
- ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
+const FunctionExpressionNameScope =
+ ESLintFunctionExpressionNameScope as ScopeConstructor &
+ ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
interface CatchScope extends Scope {}
const CatchScope = ESLintCatchScope as ScopeConstructor &
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
index fec56c17..dfcc2347 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
@@ -71,7 +71,7 @@ declare class CLIEngineBase {
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
////////////////////
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
index 9abefbab..ec79326d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
@@ -38,7 +38,7 @@ declare class LinterBase {
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(
rulesToDefine: Record<
string,
- RuleModule<TMessageIds, TOptions> | RuleCreateFunction
+ RuleModule<TMessageIds, TOptions> | RuleCreateFunction,
>,
): void;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
index 8ced374d..076b1731 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -115,9 +115,8 @@ interface RuleFixer {
type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
-type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
- TMessageIds
->[];
+type ReportSuggestionArray<TMessageIds extends string> =
+ ReportDescriptorBase<TMessageIds>[];
interface ReportDescriptorBase<TMessageIds extends string> {
/**
@@ -162,14 +161,13 @@ interface ReportDescriptorLocOnly {
*/
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
}
-type ReportDescriptor<
- TMessageIds extends string
-> = ReportDescriptorWithSuggestion<TMessageIds> &
- (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
+type ReportDescriptor<TMessageIds extends string> =
+ ReportDescriptorWithSuggestion<TMessageIds> &
+ (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
interface RuleContext<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> {
/**
* The rule ID.
@@ -328,29 +326,21 @@ interface RuleListener {
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
- TSAbstractMethodDefinition?: RuleFunction<
- TSESTree.TSAbstractMethodDefinition
- >;
+ TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
- TSCallSignatureDeclaration?: RuleFunction<
- TSESTree.TSCallSignatureDeclaration
- >;
+ TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
- TSConstructSignatureDeclaration?: RuleFunction<
- TSESTree.TSConstructSignatureDeclaration
- >;
+ TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
- TSEmptyBodyFunctionExpression?: RuleFunction<
- TSESTree.TSEmptyBodyFunctionExpression
- >;
+ TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +361,7 @@ interface RuleListener {
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
- TSNamespaceExportDeclaration?: RuleFunction<
- TSESTree.TSNamespaceExportDeclaration
- >;
+ TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +388,8 @@ interface RuleListener {
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
- TSTypeParameterDeclaration?: RuleFunction<
- TSESTree.TSTypeParameterDeclaration
- >;
- TSTypeParameterInstantiation?: RuleFunction<
- TSESTree.TSTypeParameterInstantiation
- >;
+ TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
+ TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
@@ -426,7 +410,7 @@ interface RuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> {
/**
* Metadata about the rule
@@ -444,7 +428,7 @@ type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
export {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
index 652567f6..e237586d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
@@ -59,7 +59,7 @@ interface SuggestionOutput<TMessageIds extends string> {
interface InvalidTestCase<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> extends ValidTestCase<TOptions> {
/**
* Expected errors.
@@ -111,7 +111,7 @@ interface TestCaseError<TMessageIds extends string> {
interface RunTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> {
// RuleTester.run also accepts strings for valid cases
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
index 6907e229..bc3db012 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
@@ -19,7 +19,8 @@ namespace Scope {
export type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
export type ClassNameDefinition = scopeManager.ClassNameDefinition;
export type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
- export type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
+ export type ImplicitGlobalVariableDefinition =
+ scopeManager.ImplicitGlobalVariableDefinition;
export type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
export type ParameterDefinition = scopeManager.ParameterDefinition;
export type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
@@ -34,7 +35,8 @@ namespace Scope {
export type ClassScope = scopeManager.ClassScope;
export type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
export type ForScope = scopeManager.ForScope;
- export type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
+ export type FunctionExpressionNameScope =
+ scopeManager.FunctionExpressionNameScope;
export type FunctionScope = scopeManager.FunctionScope;
export type FunctionTypeScope = scopeManager.FunctionTypeScope;
export type GlobalScope = scopeManager.GlobalScope;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
index 1bfb569e..654b27bf 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
@@ -6,7 +6,7 @@ class CatchClauseDefinition extends DefinitionBase<
DefinitionType.CatchClause,
TSESTree.CatchClause,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']) {
super(DefinitionType.CatchClause, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
index 5d587b34..9279dd8b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
@@ -6,7 +6,7 @@ class ClassNameDefinition extends DefinitionBase<
DefinitionType.ClassName,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']) {
super(DefinitionType.ClassName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
index ed25a722..7147ebc6 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
@@ -8,7 +8,7 @@ abstract class DefinitionBase<
TType extends DefinitionType,
TNode extends TSESTree.Node,
TParent extends TSESTree.Node | null,
- TName extends TSESTree.Node = TSESTree.BindingName
+ TName extends TSESTree.Node = TSESTree.BindingName,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
index b4cf2405..80e83b7c 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
@@ -9,7 +9,7 @@ class FunctionNameDefinition extends DefinitionBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']) {
super(DefinitionType.FunctionName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
index 43012c0f..67cfbf3b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
@@ -6,7 +6,7 @@ class ImplicitGlobalVariableDefinition extends DefinitionBase<
DefinitionType.ImplicitGlobalVariable,
TSESTree.Node,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(
name: TSESTree.BindingName,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
index 874edadf..d4f11607 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
@@ -9,7 +9,7 @@ class ImportBindingDefinition extends DefinitionBase<
| TSESTree.ImportNamespaceSpecifier
| TSESTree.TSImportEqualsDeclaration,
TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
@@ -20,7 +20,7 @@ class ImportBindingDefinition extends DefinitionBase<
name: TSESTree.Identifier,
node: Exclude<
ImportBindingDefinition['node'],
- TSESTree.TSImportEqualsDeclaration
+ TSESTree.TSImportEqualsDeclaration,
>,
decl: TSESTree.ImportDeclaration,
);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
index b0c0ea32..fb73b081 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
@@ -15,7 +15,7 @@ class ParameterDefinition extends DefinitionBase<
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
/**
* Whether the parameter definition is a part of a rest parameter.
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
index cff6bbaa..3670d070 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumMemberDefinition extends DefinitionBase<
DefinitionType.TSEnumMember,
TSESTree.TSEnumMember,
null,
- TSESTree.Identifier | TSESTree.StringLiteral
+ TSESTree.Identifier | TSESTree.StringLiteral,
> {
constructor(
name: TSESTree.Identifier | TSESTree.StringLiteral,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
index 5374a562..36d74cb8 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumNameDefinition extends DefinitionBase<
DefinitionType.TSEnumName,
TSESTree.TSEnumDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']) {
super(DefinitionType.TSEnumName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
index 98f90778..5b0c0a75 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
@@ -6,7 +6,7 @@ class TSModuleNameDefinition extends DefinitionBase<
DefinitionType.TSModuleName,
TSESTree.TSModuleDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']) {
super(DefinitionType.TSModuleName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
index ad3b4368..45a61e12 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
@@ -8,7 +8,7 @@ class TypeDefinition extends DefinitionBase<
| TSESTree.TSTypeAliasDeclaration
| TSESTree.TSTypeParameter,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']) {
super(DefinitionType.Type, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
index 975c5886..4ab2ca18 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
@@ -6,7 +6,7 @@ class VariableDefinition extends DefinitionBase<
DefinitionType.Variable,
TSESTree.VariableDeclarator,
TSESTree.VariableDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
index 90cd98bb..dc8ed7a3 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
@@ -6,5 +6,5 @@ import { ImplicitLibVariableOptions } from '../variable';
export const webworker_importscripts = {} as Record<
string,
- ImplicitLibVariableOptions
+ ImplicitLibVariableOptions,
>;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
index 95904428..2a741d28 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class BlockScope extends ScopeBase<
ScopeType.block,
TSESTree.BlockStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
index 46b4005f..e6b5f95f 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class CatchScope extends ScopeBase<
ScopeType.catch,
TSESTree.CatchClause,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
index ee28a31a..e0ae2613 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ClassScope extends ScopeBase<
ScopeType.class,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
index c20f1217..c0d88231 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ConditionalTypeScope extends ScopeBase<
ScopeType.conditionalType,
TSESTree.TSConditionalType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
index 36703b5d..b7f25494 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ForScope extends ScopeBase<
ScopeType.for,
TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
index a84bc4b2..b1731c9d 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class FunctionExpressionNameScope extends ScopeBase<
ScopeType.functionExpressionName,
TSESTree.FunctionExpression,
- Scope
+ Scope,
> {
public readonly functionExpressionScope: true;
constructor(
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
index 18e12321..6c362639 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
@@ -14,7 +14,7 @@ class FunctionScope extends ScopeBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.Program,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
index d459070c..d3cc8c5b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -11,7 +11,7 @@ class FunctionTypeScope extends ScopeBase<
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
index 3da909c1..87b727fc 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
@@ -18,7 +18,7 @@ class GlobalScope extends ScopeBase<
/**
* The global scope has no parent.
*/
- null
+ null,
> {
// note this is accessed in used in the legacy eslint-scope tests, so it can't be true private
private readonly implicit: {
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
index 9b5c2a05..c9729031 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class MappedTypeScope extends ScopeBase<
ScopeType.mappedType,
TSESTree.TSMappedType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a..90e2c0fb 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
@@ -137,7 +137,7 @@ type AnyScope = ScopeBase<ScopeType, TSESTree.Node, Scope | null>;
abstract class ScopeBase<
TType extends ScopeType,
TBlock extends TSESTree.Node,
- TUpper extends Scope | null
+ TUpper extends Scope | null,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
index 7a684564..f18a1aae 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class SwitchScope extends ScopeBase<
ScopeType.switch,
TSESTree.SwitchStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
index 3962784a..ed79b3a9 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSEnumScope extends ScopeBase<
ScopeType.tsEnum,
TSESTree.TSEnumDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
index bdc7c7dc..3ca626f1 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSModuleScope extends ScopeBase<
ScopeType.tsModule,
TSESTree.TSModuleDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
index 7f21a60f..37c9cf78 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TypeScope extends ScopeBase<
ScopeType.type,
TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
index 84a3e4c7..b50fe2ba 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class WithScope extends ScopeBase<
ScopeType.with,
TSESTree.WithStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
index 69833caa..5255ed02 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
@@ -36,7 +36,7 @@ const QUOTED_STRING = /^["'](.+?)['"]$/;
type ALLOWED_VALUE = ['number' | 'boolean' | 'string', Set<unknown>?];
const ALLOWED_OPTIONS: Map<string, ALLOWED_VALUE> = new Map<
keyof AnalyzeOptions,
- ALLOWED_VALUE
+ ALLOWED_VALUE,
>([
['ecmaVersion', ['number']],
['globalReturn', ['boolean']],
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
index d20ab14f..8f04f4a8 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
@@ -3,11 +3,11 @@ import { simpleTraverse } from '@typescript-eslint/typescript-estree';
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(ast: TSESTree.Node, selector: TSelector): TNode;
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(
ast: TSESTree.Node,
selector: TSelector,
@@ -16,7 +16,7 @@ function getSpecificNode<
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
TNode extends Extract<TSESTree.Node, { type: TSelector }>,
- TReturnType extends TSESTree.Node
+ TReturnType extends TSESTree.Node,
>(
ast: TSESTree.Node,
selector: TSelector,
diff --git a/repos/typescript-eslint/packages/types/src/ts-estree.ts b/repos/typescript-eslint/packages/types/src/ts-estree.ts
index 4dd89c96..a17252d8 100644
--- a/repos/typescript-eslint/packages/types/src/ts-estree.ts
+++ b/repos/typescript-eslint/packages/types/src/ts-estree.ts
@@ -130,7 +130,7 @@ export type Token =
export type OptionalRangeAndLoc<T> = Pick<
T,
- Exclude<keyof T, 'range' | 'loc'>
+ Exclude<keyof T, 'range' | 'loc'>,
> & {
range?: Range;
loc?: SourceLocation;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
index a22eae1a..43bfd6ba 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
@@ -821,7 +821,7 @@ export class Converter {
const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node);
const result = this.createNode<
- TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration
+ TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration,
>(node, {
type:
isDeclare || !node.body
@@ -846,9 +846,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -1002,7 +1003,7 @@ export class Converter {
case SyntaxKind.PropertyDeclaration: {
const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty
+ TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty,
>(node, {
type: isAbstract
? AST_NODE_TYPES.TSAbstractClassProperty
@@ -1050,7 +1051,7 @@ export class Converter {
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration: {
const method = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1070,9 +1071,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- method.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ method.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(method, method.typeParameters.range);
}
@@ -1112,7 +1114,7 @@ export class Converter {
: AST_NODE_TYPES.MethodDefinition;
result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
@@ -1161,7 +1163,7 @@ export class Converter {
node.getFirstToken()!;
const constructor = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1177,9 +1179,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- constructor.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ constructor.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(constructor, constructor.typeParameters.range);
}
@@ -1196,7 +1199,7 @@ export class Converter {
const isStatic = hasModifier(SyntaxKind.StaticKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: hasModifier(SyntaxKind.AbstractKeyword, node)
? AST_NODE_TYPES.TSAbstractMethodDefinition
@@ -1234,9 +1237,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1332,9 +1336,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1439,10 +1444,11 @@ export class Converter {
let result: TSESTree.RestElement | TSESTree.AssignmentPattern;
if (node.dotDotDotToken) {
- parameter = result = this.createNode<TSESTree.RestElement>(node, {
- type: AST_NODE_TYPES.RestElement,
- argument: this.convertChild(node.name),
- });
+ parameter = result =
+ this.createNode<TSESTree.RestElement>(node, {
+ type: AST_NODE_TYPES.RestElement,
+ argument: this.convertChild(node.name),
+ });
} else if (node.initializer) {
parameter = this.convertChild(node.name) as TSESTree.BindingName;
result = this.createNode<TSESTree.AssignmentPattern>(node, {
@@ -1512,7 +1518,7 @@ export class Converter {
);
const result = this.createNode<
- TSESTree.ClassDeclaration | TSESTree.ClassExpression
+ TSESTree.ClassDeclaration | TSESTree.ClassExpression,
>(node, {
type: classNodeType,
id: this.convertChild(node.name),
@@ -1536,17 +1542,19 @@ export class Converter {
}
if (superClass.types[0]?.typeArguments) {
- result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(
- superClass.types[0].typeArguments,
- superClass.types[0],
- );
+ result.superTypeParameters =
+ this.convertTypeArgumentsToTypeParameters(
+ superClass.types[0].typeArguments,
+ superClass.types[0],
+ );
}
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (implementsClause) {
@@ -1788,7 +1796,7 @@ export class Converter {
return this.createNode<
| TSESTree.AssignmentExpression
| TSESTree.LogicalExpression
- | TSESTree.BinaryExpression
+ | TSESTree.BinaryExpression,
>(node, {
type,
operator: getTextForTokenKind(node.operatorToken.kind),
@@ -2313,9 +2321,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -2343,9 +2352,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
const accessibility = getTSNodeAccessibility(node);
@@ -2438,7 +2448,7 @@ export class Converter {
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSCallSignatureDeclaration
| TSESTree.TSFunctionType
- | TSESTree.TSConstructorType
+ | TSESTree.TSConstructorType,
>(node, {
type: type,
params: this.convertParameters(node.parameters),
@@ -2449,9 +2459,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
@@ -2459,7 +2470,7 @@ export class Converter {
case SyntaxKind.ExpressionWithTypeArguments: {
const result = this.createNode<
- TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements
+ TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements,
>(node, {
type:
parent && parent.kind === SyntaxKind.InterfaceDeclaration
@@ -2490,9 +2501,10 @@ export class Converter {
});
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (interfaceHeritageClauses.length > 0) {
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
index e00663a1..a3f007a0 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
@@ -18,7 +18,7 @@ const log = debug('typescript-eslint:typescript-estree:createWatchProgram');
*/
const knownWatchProgramMap = new Map<
CanonicalPath,
- ts.WatchOfConfigFile<ts.BuilderProgram>
+ ts.WatchOfConfigFile<ts.BuilderProgram>,
>();
/**
@@ -27,11 +27,11 @@ const knownWatchProgramMap = new Map<
*/
const fileWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
const folderWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
/**
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
index 36ca3f80..a3758fff 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
@@ -191,7 +191,7 @@ export interface ParserWeakMap<TKey, TValueBase> {
}
export interface ParserWeakMapESTreeToTSNode<
- TKey extends TSESTree.Node = TSESTree.Node
+ TKey extends TSESTree.Node = TSESTree.Node,
> {
get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
has(key: unknown): boolean;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index 62053920..ff7aea73 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -281,5 +281,5 @@ export interface EstreeToTsNodeTypes {
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<
TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>,
// if this errors, it means that one of the AST_NODE_TYPES is not defined in the above interface
- EstreeToTsNodeTypes[T['type']]
+ EstreeToTsNodeTypes[T['type']],
>;
diff --git a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 36726ac1..9ce5ca68 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -159,9 +159,8 @@ describe('semanticInfo', () => {
const computedPropertyString = ((parseResult.ast
.body[1] as TSESTree.ClassDeclaration).body
.body[0] as TSESTree.ClassProperty).key;
- const tsComputedPropertyString = parseResult.services.esTreeNodeToTSNodeMap.get(
- computedPropertyString,
- );
+ const tsComputedPropertyString =
+ parseResult.services.esTreeNodeToTSNodeMap.get(computedPropertyString);
expect(tsComputedPropertyString.kind).toEqual(ts.SyntaxKind.StringLiteral);
});
diff --git a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
index 1b386be1..1a6a815d 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
@@ -98,7 +98,7 @@ export function omitDeep<T = UnknownObject>(
keysToOmit: { key: string; predicate: (value: unknown) => boolean }[] = [],
selectors: Record<
string,
- (node: UnknownObject, parent: UnknownObject | null) => void
+ (node: UnknownObject, parent: UnknownObject | null) => void,
> = {},
): UnknownObject {
function shouldOmit(keyName: string, val: unknown): boolean {
diff --git a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
index 68c6b806..a9ed3cdb 100644
--- a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
+++ b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
@@ -7,7 +7,7 @@ interface VisitorKeys {
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
// strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs
diff --git a/repos/typescript-eslint/tools/generate-contributors.ts b/repos/typescript-eslint/tools/generate-contributors.ts
index 38c3690c..6bb908b3 100644
--- a/repos/typescript-eslint/tools/generate-contributors.ts
+++ b/repos/typescript-eslint/tools/generate-contributors.ts
@@ -42,9 +42,8 @@ async function* fetchUsers(page = 1): AsyncIterableIterator<Contributor[]> {
const response = await fetch(`${contributorsApiUrl}&page=${page}`, {
method: 'GET',
});
- const contributors:
- | Contributor[]
- | { message: string } = await response.json();
+ const contributors: Contributor[] | { message: string } =
+ await response.json();
if (!Array.isArray(contributors)) {
throw new Error(contributors.message);
run #10222 vs main
SyntaxError: Unexpected source value 'main'.
run #10222
prettier/prettier#10222 VS prettier/prettier@main
Submodule repos/babel contains modified content
Submodule repos/babel b63be94..c54d467:
diff --git a/repos/babel/packages/babel-core/src/config/config-chain.js b/repos/babel/packages/babel-core/src/config/config-chain.js
index 350111a1a..6e586eeaf 100644
--- a/repos/babel/packages/babel-core/src/config/config-chain.js
+++ b/repos/babel/packages/babel-core/src/config/config-chain.js
@@ -76,17 +76,15 @@ export function* buildPresetChain(
};
}
-export const buildPresetChainWalker: (
- arg: PresetInstance,
- context: *,
-) => * = makeChainWalker({
- root: preset => loadPresetDescriptors(preset),
- env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
- overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
- overridesEnv: (preset, index, envName) =>
- loadPresetOverridesEnvDescriptors(preset)(index)(envName),
- createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
-});
+export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * =
+ makeChainWalker({
+ root: preset => loadPresetDescriptors(preset),
+ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
+ overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
+ overridesEnv: (preset, index, envName) =>
+ loadPresetOverridesEnvDescriptors(preset)(index)(envName),
+ createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
+ });
const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>
buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),
);
@@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
function dedupDescriptors(
items: Array<UnloadedDescriptor>,
): Array<UnloadedDescriptor> {
- const map: Map<
- Function,
- Map<string | void, { value: UnloadedDescriptor }>,
- > = new Map();
+ const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
+ new Map();
const descriptors = [];
diff --git a/repos/babel/packages/babel-core/src/config/files/plugins.js b/repos/babel/packages/babel-core/src/config/files/plugins.js
index 298843e2d..fde98cfd3 100644
--- a/repos/babel/packages/babel-core/src/config/files/plugins.js
+++ b/repos/babel/packages/babel-core/src/config/files/plugins.js
@@ -14,8 +14,10 @@ const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
-const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
-const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PLUGIN_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PRESET_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
export function resolvePlugin(name: string, dirname: string): string | null {
diff --git a/repos/babel/packages/babel-core/src/config/validation/options.js b/repos/babel/packages/babel-core/src/config/validation/options.js
index 27caf3bcc..529d6606d 100644
--- a/repos/babel/packages/babel-core/src/config/validation/options.js
+++ b/repos/babel/packages/babel-core/src/config/validation/options.js
@@ -369,10 +369,8 @@ function throwUnknownError(loc: OptionPath) {
const key = loc.name;
if (removed[key]) {
- const {
- message,
- version = 5,
- }: { message: string, version?: number } = removed[key];
+ const { message, version = 5 }: { message: string, version?: number } =
+ removed[key];
throw new Error(
`Using removed Babel ${version} option: ${msg(loc)} - ${message}`,
diff --git a/repos/babel/packages/babel-core/src/transformation/normalize-file.js b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
index aca84e1e4..8734534cc 100644
--- a/repos/babel/packages/babel-core/src/transformation/normalize-file.js
+++ b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
@@ -98,8 +98,10 @@ export default function* normalizeFile(
// but without // or /* at the beginning of the comment.
// eslint-disable-next-line max-len
-const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
-const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
+const INLINE_SOURCEMAP_REGEX =
+ /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
+const EXTERNAL_SOURCEMAP_REGEX =
+ /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
function extractCommentsFromList(regex, comments, lastComment) {
if (comments) {
diff --git a/repos/babel/packages/babel-core/test/api.js b/repos/babel/packages/babel-core/test/api.js
index d715b6386..a8aed41cc 100644
--- a/repos/babel/packages/babel-core/test/api.js
+++ b/repos/babel/packages/babel-core/test/api.js
@@ -308,9 +308,8 @@ describe("api", function () {
new Plugin({
visitor: {
Function: function (path) {
- const alias = path.scope
- .getProgramParent()
- .path.get("body")[0].node;
+ const alias =
+ path.scope.getProgramParent().path.get("body")[0].node;
if (!babel.types.isTypeAlias(alias)) return;
// In case of `passPerPreset` being `false`, the
diff --git a/repos/babel/packages/babel-core/test/config-chain.js b/repos/babel/packages/babel-core/test/config-chain.js
index 8de2bc99d..4b3c1d10b 100644
--- a/repos/babel/packages/babel-core/test/config-chain.js
+++ b/repos/babel/packages/babel-core/test/config-chain.js
@@ -94,7 +94,8 @@ async function loadOptionsAsyncInSpawedProcess({ filename, cwd }) {
},
);
- const EXPERIMENTAL_WARNING = /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
+ const EXPERIMENTAL_WARNING =
+ /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) {
throw new Error(
diff --git a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
index aca3cfa75..08fb1f6e0 100644
--- a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -200,14 +200,8 @@ const privateNameHandlerSpec = {
get(member) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- methodId,
- getId,
- setId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, methodId, getId, setId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
@@ -264,13 +258,8 @@ const privateNameHandlerSpec = {
set(member, value) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- setId,
- getId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, setId, getId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/index.js b/repos/babel/packages/babel-helper-module-transforms/src/index.js
index 164462ee0..77b6845c0 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/index.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/index.js
@@ -214,10 +214,8 @@ const buildReexportsFromMeta = (
true,
);
} else {
- NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(
- t.cloneNode(namespace),
- t.identifier(importName),
- );
+ NAMESPACE_IMPORT = NAMESPACE_IMPORT =
+ t.memberExpression(t.cloneNode(namespace), t.identifier(importName));
}
const astNodes = {
EXPORTS: meta.exportName,
@@ -243,23 +241,26 @@ function buildESModuleHeader(
metadata: ModuleMetadata,
enumerable: boolean = false,
) {
- return (enumerable
- ? template.statement`
+ return (
+ enumerable
+ ? template.statement`
EXPORTS.__esModule = true;
`
- : template.statement`
+ : template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
- `)({ EXPORTS: metadata.exportName });
+ `
+ )({ EXPORTS: metadata.exportName });
}
/**
* Create a re-export initialization loop for a specific imported namespace.
*/
function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose
- ? template.statement`
+ return (
+ loose
+ ? template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -268,13 +269,13 @@ function buildNamespaceReexport(metadata, namespace, loose) {
EXPORTS[key] = NAMESPACE[key];
});
`
- : // Also skip already assigned bindings if they are strictly equal
- // to be somewhat more spec-compliant when a file has multiple
- // namespace re-exports that would cause a binding to be exported
- // multiple times. However, multiple bindings of the same name that
- // export the same primitive value are silently skipped
- // (the spec requires an "ambigous bindings" early error here).
- template.statement`
+ : // Also skip already assigned bindings if they are strictly equal
+ // to be somewhat more spec-compliant when a file has multiple
+ // namespace re-exports that would cause a binding to be exported
+ // multiple times. However, multiple bindings of the same name that
+ // export the same primitive value are silently skipped
+ // (the spec requires an "ambigous bindings" early error here).
+ template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -287,7 +288,8 @@ function buildNamespaceReexport(metadata, namespace, loose) {
},
});
});
- `)({
+ `
+ )({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
index 4f31fd926..706d84efc 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
@@ -165,13 +165,8 @@ const buildImportThrow = localName => {
const rewriteReferencesVisitor = {
ReferencedIdentifier(path) {
- const {
- seen,
- buildImportReference,
- scope,
- imported,
- requeueInParent,
- } = this;
+ const { seen, buildImportReference, scope, imported, requeueInParent } =
+ this;
if (seen.has(path.node)) return;
seen.add(path.node);
diff --git a/repos/babel/packages/babel-parser/src/parser/statement.js b/repos/babel/packages/babel-parser/src/parser/statement.js
index 5827e5154..a1b0e5824 100644
--- a/repos/babel/packages/babel-parser/src/parser/statement.js
+++ b/repos/babel/packages/babel-parser/src/parser/statement.js
@@ -316,9 +316,8 @@ export default class StatementParser extends ExpressionParser {
}
takeDecorators(node: N.HasDecorators): void {
- const decorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const decorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (decorators.length) {
node.decorators = decorators;
this.resetStartLocationFromNode(node, decorators[0]);
@@ -331,9 +330,8 @@ export default class StatementParser extends ExpressionParser {
}
parseDecorators(allowExport?: boolean): void {
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
while (this.match(tt.at)) {
const decorator = this.parseDecorator();
currentContextDecorators.push(decorator);
@@ -2010,9 +2008,8 @@ export default class StatementParser extends ExpressionParser {
}
}
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
// If node.declaration is a class, it will take all decorators in the current context.
// Thus we should throw if we see non-empty decorators here.
if (currentContextDecorators.length) {
diff --git a/repos/babel/packages/babel-parser/src/plugins/flow.js b/repos/babel/packages/babel-parser/src/plugins/flow.js
index 0e00291fc..db810370f 100644
--- a/repos/babel/packages/babel-parser/src/plugins/flow.js
+++ b/repos/babel/packages/babel-parser/src/plugins/flow.js
@@ -2962,7 +2962,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.callee = base;
const result = this.tryParse(() => {
- node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ node.typeArguments =
+ this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
if (subscriptState.optionalChainMember) node.optional = false;
diff --git a/repos/babel/packages/babel-parser/src/tokenizer/context.js b/repos/babel/packages/babel-parser/src/tokenizer/context.js
index 5581e6b05..942f83b82 100644
--- a/repos/babel/packages/babel-parser/src/tokenizer/context.js
+++ b/repos/babel/packages/babel-parser/src/tokenizer/context.js
@@ -49,19 +49,23 @@ export const types: {
// When `=>` is eaten, the context update of `yield` is executed, however,
// `this.prodParam` still has `[Yield]` production because it is not yet updated
-tt.parenR.updateContext = tt.braceR.updateContext = function () {
- if (this.state.context.length === 1) {
- this.state.exprAllowed = true;
- return;
- }
+tt.parenR.updateContext = tt.braceR.updateContext =
+ function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
- let out = this.state.context.pop();
- if (out === types.braceStatement && this.curContext().token === "function") {
- out = this.state.context.pop();
- }
+ let out = this.state.context.pop();
+ if (
+ out === types.braceStatement &&
+ this.curContext().token === "function"
+ ) {
+ out = this.state.context.pop();
+ }
- this.state.exprAllowed = !out.isExpr;
-};
+ this.state.exprAllowed = !out.isExpr;
+ };
tt.name.updateContext = function (prevType) {
let allowed = false;
@@ -110,24 +114,25 @@ tt.incDec.updateContext = function () {
// tokExprAllowed stays unchanged
};
-tt._function.updateContext = tt._class.updateContext = function (prevType) {
- if (
- prevType.beforeExpr &&
- prevType !== tt.semi &&
- prevType !== tt._else &&
- !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
- !(
- (prevType === tt.colon || prevType === tt.braceL) &&
- this.curContext() === types.b_stat
- )
- ) {
- this.state.context.push(types.functionExpression);
- } else {
- this.state.context.push(types.functionStatement);
- }
+tt._function.updateContext = tt._class.updateContext =
+ function (prevType) {
+ if (
+ prevType.beforeExpr &&
+ prevType !== tt.semi &&
+ prevType !== tt._else &&
+ !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
+ !(
+ (prevType === tt.colon || prevType === tt.braceL) &&
+ this.curContext() === types.b_stat
+ )
+ ) {
+ this.state.context.push(types.functionExpression);
+ } else {
+ this.state.context.push(types.functionStatement);
+ }
- this.state.exprAllowed = false;
-};
+ this.state.exprAllowed = false;
+ };
tt.backQuote.updateContext = function () {
if (this.curContext() === types.template) {
diff --git a/repos/babel/packages/babel-parser/src/types.js b/repos/babel/packages/babel-parser/src/types.js
index d5a28729d..b75520a79 100644
--- a/repos/babel/packages/babel-parser/src/types.js
+++ b/repos/babel/packages/babel-parser/src/types.js
@@ -1137,9 +1137,10 @@ export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & {
typeAnnotation: ?TsTypeAnnotation,
};
-export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & {
- typeParameters: ?TsTypeParameterDeclaration,
-};
+export type TsSignatureDeclarationBase =
+ TsSignatureDeclarationOrIndexSignatureBase & {
+ typeParameters: ?TsTypeParameterDeclaration,
+ };
// ================
// TypeScript type members (for type literal / interface / class)
diff --git a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d860d884e..e19a77552 100644
--- a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet();
*/
function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
- const decorators = (path.isClass()
- ? [path].concat(path.get("body.body"))
- : path.get("properties")
+ const decorators = (
+ path.isClass()
+ ? [path].concat(path.get("body.body"))
+ : path.get("properties")
).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(
@@ -47,9 +48,8 @@ function applyEnsureOrdering(path) {
identDecorators
.map(decorator => {
const expression = decorator.expression;
- const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(
- "dec",
- ));
+ const id = (decorator.expression =
+ path.scope.generateDeclaredUidIdentifier("dec"));
return t.assignmentExpression("=", id, expression);
})
.concat([path.node]),
diff --git a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
index e1f9b7d51..387e2634c 100644
--- a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
+++ b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
@@ -357,11 +357,8 @@ export default declare((api, opts) => {
path.isObjectPattern(),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(objectPatternPath, file, ref);
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(objectPatternPath, file, ref);
if (loose) {
removeUnusedExcludedKeys(objectPatternPath);
@@ -440,11 +437,8 @@ export default declare((api, opts) => {
]),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(leftPath, file, t.identifier(refName));
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(leftPath, file, t.identifier(refName));
if (impureComputedPropertyDeclarators.length > 0) {
nodes.push(
diff --git a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
index cca55d21b..47dbd1ed3 100644
--- a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
@@ -4,11 +4,8 @@ import { types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);
- const {
- loose = false,
- useBuiltIns = false,
- allowArrayLike = false,
- } = options;
+ const { loose = false, useBuiltIns = false, allowArrayLike = false } =
+ options;
if (typeof loose !== "boolean") {
throw new Error(`.loose must be a boolean or undefined`);
@@ -296,10 +293,11 @@ export default declare((api, options) => {
const name = this.scope.generateUidIdentifierBasedOnNode(key);
this.nodes.push(this.buildVariableDeclaration(name, key));
if (!copiedPattern) {
- copiedPattern = pattern = {
- ...pattern,
- properties: pattern.properties.slice(),
- };
+ copiedPattern = pattern =
+ {
+ ...pattern,
+ properties: pattern.properties.slice(),
+ };
}
copiedPattern.properties[i] = {
...copiedPattern.properties[i],
diff --git a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
index 4608a225a..60989c943 100644
--- a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
+++ b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
@@ -37,8 +37,8 @@ const iifeVisitor = {
}
},
// type annotations don't use or introduce "real" bindings
- "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": path =>
- path.skip(),
+ "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration":
+ path => path.skip(),
};
// last 2 parameters are optional -- they are used by proposal-object-rest-spread/src/index.js
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
index 1cdbf6491..2d944d58c 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
@@ -10,8 +10,10 @@ const t = require("@babel/types");
const transformRuntime = require("../");
const runtimeVersion = require("@babel/runtime/package.json").version;
-const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default();
-const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default();
+const corejs2Definitions =
+ require("../lib/runtime-corejs2-definitions").default();
+const corejs3Definitions =
+ require("../lib/runtime-corejs3-definitions").default();
function outputFile(filePath, data) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
index 12c1a20b8..046cbceda 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
@@ -170,9 +170,9 @@ export default declare((api, options, dirname) => {
const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2
- ? getCoreJS2Definitions
- : getCoreJS3Definitions)(runtimeVersion);
+ const { BuiltIns, StaticProperties, InstanceProperties } = (
+ injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions
+ )(runtimeVersion);
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
diff --git a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
index 95ca9b119..baeca41a9 100644
--- a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
+++ b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
@@ -4,7 +4,7 @@
const proposalPlugins = new Set([
"proposal-class-properties",
- "proposal-private-methods"
+ "proposal-private-methods",
]);
// use intermediary object to enforce alphabetical key order
diff --git a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
index 0cd423af1..37370a9b6 100644
--- a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
+++ b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
@@ -39,13 +39,14 @@ const corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)
return memo;
}, {});
-const corejs3PolyfillsWithShippedProposals = (corejs3ShippedProposalsList: string[]).reduce(
- (memo, key) => {
- memo[key] = corejs3Polyfills[key];
- return memo;
- },
- { ...corejs3PolyfillsWithoutProposals },
-);
+const corejs3PolyfillsWithShippedProposals =
+ (corejs3ShippedProposalsList: string[]).reduce(
+ (memo, key) => {
+ memo[key] = corejs3Polyfills[key];
+ return memo;
+ },
+ { ...corejs3PolyfillsWithoutProposals },
+ );
export default function (
_: any,
diff --git a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
index ea0cd6950..1b9d8c7db 100644
--- a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
@@ -1,7 +1,7 @@
"use strict";
-const getOptionSpecificExcludesFor = require("../lib/get-option-specific-excludes")
- .default;
+const getOptionSpecificExcludesFor =
+ require("../lib/get-option-specific-excludes").default;
describe("defaults", () => {
describe("getOptionSpecificExcludesFor", () => {
diff --git a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
index 1958a7fa6..9b3541292 100644
--- a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
@@ -1,17 +1,16 @@
"use strict";
-const getCoreJS2PlatformSpecificDefaultFor = require("../lib/polyfills/corejs2/get-platform-specific-default")
- .default;
+const getCoreJS2PlatformSpecificDefaultFor =
+ require("../lib/polyfills/corejs2/get-platform-specific-default").default;
describe("defaults", () => {
describe("getCoreJS2PlatformSpecificDefaultFor", () => {
it("should return web polyfills for non-`node` platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
chrome: "63",
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toEqual([
"web.timers",
"web.immediate",
@@ -20,11 +19,10 @@ describe("defaults", () => {
});
it("shouldn't return web polyfills for node platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toBeNull();
});
});
diff --git a/repos/babel/packages/babel-preset-env/test/index.spec.js b/repos/babel/packages/babel-preset-env/test/index.spec.js
index 291bb26c7..e6a2d00c6 100644
--- a/repos/babel/packages/babel-preset-env/test/index.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/index.spec.js
@@ -1,18 +1,18 @@
"use strict";
const babelPresetEnv = require("../lib/index");
-const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin")
- .default;
-const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin")
- .default;
-const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin")
- .default;
-const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin")
- .default;
-const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin")
- .default;
-const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin")
- .default;
+const addCoreJS2UsagePlugin =
+ require("../lib/polyfills/corejs2/usage-plugin").default;
+const addCoreJS3UsagePlugin =
+ require("../lib/polyfills/corejs3/usage-plugin").default;
+const addRegeneratorUsagePlugin =
+ require("../lib/polyfills/regenerator/usage-plugin").default;
+const replaceCoreJS2EntryPlugin =
+ require("../lib/polyfills/corejs2/entry-plugin").default;
+const replaceCoreJS3EntryPlugin =
+ require("../lib/polyfills/corejs3/entry-plugin").default;
+const removeRegeneratorEntryPlugin =
+ require("../lib/polyfills/regenerator/entry-plugin").default;
const transformations = require("../lib/module-transformations").default;
const compatData = require("@babel/compat-data/plugins");
diff --git a/repos/babel/packages/babel-register/src/index.js b/repos/babel/packages/babel-register/src/index.js
index aea88df53..d9fefa1c4 100644
--- a/repos/babel/packages/babel-register/src/index.js
+++ b/repos/babel/packages/babel-register/src/index.js
@@ -4,9 +4,10 @@
* from a compiled Babel import.
*/
-exports = module.exports = function (...args) {
- return register(...args);
-};
+exports = module.exports =
+ function (...args) {
+ return register(...args);
+ };
exports.__esModule = true;
const node = require("./nodeWrapper");
diff --git a/repos/babel/packages/babel-standalone/src/generated/plugins.js b/repos/babel/packages/babel-standalone/src/generated/plugins.js
index 889f6a494..01a0ae395 100644
--- a/repos/babel/packages/babel-standalone/src/generated/plugins.js
+++ b/repos/babel/packages/babel-standalone/src/generated/plugins.js
@@ -259,7 +259,8 @@ export const all = {
"transform-new-target": transformNewTarget,
"transform-object-assign": transformObjectAssign,
"transform-object-super": transformObjectSuper,
- "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign,
+ "transform-object-set-prototype-of-to-assign":
+ transformObjectSetPrototypeOfToAssign,
"transform-parameters": transformParameters,
"transform-property-literals": transformPropertyLiterals,
"transform-property-mutators": transformPropertyMutators,
diff --git a/repos/babel/packages/babel-template/test/index.js b/repos/babel/packages/babel-template/test/index.js
index 7b893d7e4..63b821b0d 100644
--- a/repos/babel/packages/babel-template/test/index.js
+++ b/repos/babel/packages/babel-template/test/index.js
@@ -43,11 +43,12 @@ describe("@babel/template", function () {
describe("string-based", () => {
it("should handle replacing values from an object", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if (SOME_VAR === "") {}
`)({
- SOME_VAR: value,
- });
+ SOME_VAR: value,
+ });
expect(result.type).toBe("IfStatement");
expect(result.test.type).toBe("BinaryExpression");
@@ -56,7 +57,8 @@ describe("@babel/template", function () {
it("should handle replacing values given an array", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if ($0 === "") {}
`)([value]);
@@ -66,7 +68,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values with null to remove them", () => {
- const result = template(`
+ const result =
+ template(`
callee(ARG);
`)({ ARG: null });
@@ -76,7 +79,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values that are string content", () => {
- const result = template(`
+ const result =
+ template(`
("ARG");
`)({ ARG: "some new content" });
@@ -88,7 +92,8 @@ describe("@babel/template", function () {
it("should automatically clone nodes if they are injected twice", () => {
const id = t.identifier("someIdent");
- const result = template(`
+ const result =
+ template(`
ID;
ID;
`)({ ID: id });
@@ -277,23 +282,26 @@ describe("@babel/template", function () {
describe(".syntacticPlaceholders", () => {
it("works in function body", () => {
- const output = template(`function f() %%A%%`)({
- A: t.blockStatement([]),
- });
+ const output =
+ template(`function f() %%A%%`)({
+ A: t.blockStatement([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"function f() {}"`);
});
it("works in class body", () => {
- const output = template(`class C %%A%%`)({
- A: t.classBody([]),
- });
+ const output =
+ template(`class C %%A%%`)({
+ A: t.classBody([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"class C {}"`);
});
it("replaces lowercase names", () => {
- const output = template(`%%foo%%`)({
- foo: t.numericLiteral(1),
- });
+ const output =
+ template(`%%foo%%`)({
+ foo: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
@@ -372,23 +380,26 @@ describe("@babel/template", function () {
describe("undefined", () => {
it("allows placeholders", () => {
- const output = template(`%%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`%%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("replaces identifiers", () => {
- const output = template(`FOO`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("doesn't mix placeholder styles", () => {
- const output = template(`FOO + %%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO + %%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"FOO + 1;"`);
});
});
Submodule repos/eslint-plugin-vue contains modified content
Submodule repos/eslint-plugin-vue cc9c140..9c58bea:
diff --git a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
index b54c206..ed4a3dc 100644
--- a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
+++ b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
@@ -164,7 +164,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLTagClose') {
return null
@@ -188,7 +189,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLSelfClosingTagClose') {
return null
diff --git a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
index 3f202fa..20c2593 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
@@ -176,7 +176,8 @@ function createForVueSyntax(context) {
}
return {
- "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
+ "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer":
+ verify,
'VElement > VExpressionContainer': verify
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
index 7c05083..1cfbd61 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
@@ -15,8 +15,10 @@ const utils = require('../utils')
// Constants
// ------------------------------------------------------------------------------
-const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
-const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
+const ALL_IRREGULARS =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
+const IRREGULAR_WHITESPACE =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu
// ------------------------------------------------------------------------------
@@ -195,7 +197,8 @@ module.exports = {
const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
...(skipHTMLAttributeValues
? {
- 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue
+ 'VAttribute[directive=false] > VLiteral':
+ removeInvalidNodeErrorsInHTMLAttributeValue
}
: {}),
...(skipHTMLTextContents
diff --git a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
index 02ac6e3..d15bb4c 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
diff --git a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
index 7c0639b..3d2d8f0 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
@@ -104,16 +104,17 @@ module.exports = {
}
const targetBody = scopeStack.body
- const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
- vueNode
- )).find((cp) => {
- return (
- cp.value &&
- node.loc.start.line >= cp.value.loc.start.line &&
- node.loc.end.line <= cp.value.loc.end.line &&
- targetBody === cp.value
- )
- })
+ const computedProperty =
+ /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
+ vueNode
+ )).find((cp) => {
+ return (
+ cp.value &&
+ node.loc.start.line >= cp.value.loc.start.line &&
+ node.loc.end.line <= cp.value.loc.end.line &&
+ targetBody === cp.value
+ )
+ })
if (computedProperty) {
if (!utils.isThis(node, context)) {
return
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
index b8a2057..709617e 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
@@ -19,9 +19,10 @@ function stripQuotesForHTML(text) {
return text.slice(1, -1)
}
- const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
- text
- )
+ const re =
+ /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
+ text
+ )
if (!re) {
return null
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
index 01549ca..c2440da 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
@@ -144,7 +144,8 @@ module.exports = {
}
return utils.defineTemplateBodyVisitor(context, {
- "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify
+ "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]":
+ verify
})
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
index ec35636..aac0924 100644
--- a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
+++ b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
@@ -451,14 +451,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: ['${nameNode.value}']`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: ['${nameNode.value}']${
@@ -488,14 +484,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: {'${nameNode.value}': null}`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: {'${nameNode.value}': null}${
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
index 9a790e9..e670fa3 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
@@ -20,7 +20,8 @@ module.exports = {
}
return {
- 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
+ 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer':
+ reportDynamicArgument
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
index c356a67..af7dbcd 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
@@ -23,7 +23,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope
+ "VAttribute[directive=true] > VDirectiveKey[name.name='scope']":
+ reportScope
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
index 1ce2748..ba59c6e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
@@ -128,7 +128,8 @@ module.exports = {
return {
"VAttribute[directive=false][key.name='slot']": reportSlot,
- "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
+ "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']":
+ reportVBindSlot
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
index 219d2b3..5a53a9e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
@@ -27,7 +27,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand
+ "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']":
+ reportPropModifierShorthand
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
index f0cbe36..1bb5f57 100644
--- a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
+++ b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
@@ -28,7 +28,10 @@ function normalizeOptions(options) {
}
if (typeof options === 'string') {
- normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options)
+ normalized.atComponent =
+ normalized.default =
+ normalized.named =
+ /** @type {"shorthand" | "longform"} */ (options)
} else if (options != null) {
/** @type {(keyof Options)[]} */
const keys = ['atComponent', 'default', 'named']
diff --git a/repos/eslint-plugin-vue/lib/utils/indent-common.js b/repos/eslint-plugin-vue/lib/utils/indent-common.js
index 9e6bfde..3f9f548 100644
--- a/repos/eslint-plugin-vue/lib/utils/indent-common.js
+++ b/repos/eslint-plugin-vue/lib/utils/indent-common.js
@@ -1078,9 +1078,8 @@ module.exports.defineVisitor = function create(
baseline.add(token)
} else if (baseline.has(offsetInfo.baseToken)) {
// The base token is a baseline token on this line, so inherit it.
- offsetInfo.expectedIndent = offsets.get(
- offsetInfo.baseToken
- ).expectedIndent
+ offsetInfo.expectedIndent =
+ offsets.get(offsetInfo.baseToken).expectedIndent
baseline.add(token)
} else {
// Otherwise, set the expected indent of this line.
@@ -1464,8 +1463,8 @@ module.exports.defineVisitor = function create(
ExportDefaultDeclaration(node) {
const exportToken = tokenStore.getFirstToken(node)
const defaultToken = tokenStore.getFirstToken(node, 1)
- const declarationToken = getFirstAndLastTokens(node.declaration)
- .firstToken
+ const declarationToken =
+ getFirstAndLastTokens(node.declaration).firstToken
setOffset([defaultToken, declarationToken], 1, exportToken)
},
/** @param {ExportNamedDeclaration} node */
@@ -1739,10 +1738,11 @@ module.exports.defineVisitor = function create(
'MemberExpression, MetaProperty'(node) {
const objectToken = tokenStore.getFirstToken(node)
if (node.type === 'MemberExpression' && node.computed) {
- const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore(
- node.property,
- isLeftBracket
- ))
+ const leftBracketToken =
+ /** @type {Token} */ (tokenStore.getTokenBefore(
+ node.property,
+ isLeftBracket
+ ))
const propertyToken = tokenStore.getTokenAfter(leftBracketToken)
const rightBracketToken = tokenStore.getTokenAfter(
node.property,
@@ -1777,10 +1777,11 @@ module.exports.defineVisitor = function create(
isLeftBracket
))
const keyToken = tokenStore.getTokenAfter(keyLeftToken)
- const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.key,
- isRightBracket
- )))
+ const keyRightToken = (lastKeyToken =
+ /** @type {Token} */ (tokenStore.getTokenAfter(
+ node.key,
+ isRightBracket
+ )))
if (hasPrefix) {
setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens)))
diff --git a/repos/eslint-plugin-vue/lib/utils/index.js b/repos/eslint-plugin-vue/lib/utils/index.js
index 0bcf801..460f3d4 100644
--- a/repos/eslint-plugin-vue/lib/utils/index.js
+++ b/repos/eslint-plugin-vue/lib/utils/index.js
@@ -838,11 +838,12 @@ module.exports = {
if (propValue.type === 'FunctionExpression') {
value = propValue.body
} else if (propValue.type === 'ObjectExpression') {
- const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
- propValue,
- 'get',
- (p) => p.value.type === 'FunctionExpression'
- ))
+ const get =
+ /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
+ propValue,
+ 'get',
+ (p) => p.value.type === 'FunctionExpression'
+ ))
value = get ? get.value.body : null
}
@@ -870,13 +871,14 @@ module.exports = {
}
if (arg.type === 'ObjectExpression') {
- const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
- arg,
- 'get',
- (p) =>
- p.value.type === 'FunctionExpression' ||
- p.value.type === 'ArrowFunctionExpression'
- ))
+ const getProperty =
+ /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
+ arg,
+ 'get',
+ (p) =>
+ p.value.type === 'FunctionExpression' ||
+ p.value.type === 'ArrowFunctionExpression'
+ ))
return getProperty ? getProperty.value : null
}
diff --git a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
index 85a0ad4..9c3a40c 100644
--- a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
@@ -11,9 +11,10 @@ const tester = new RuleTester({
parserOptions: { ecmaVersion: 2018 }
})
-const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
- ''
-)
+const IRREGULAR_WHITESPACES =
+ '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
+ ''
+ )
const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('')
const ALL_IRREGULAR_WHITESPACES = [].concat(
IRREGULAR_WHITESPACES,
Submodule repos/excalidraw 1973ae9..098ee34:
Submodule repos/prettier contains modified content
Submodule repos/prettier 2c1b8f6..7f0573a:
diff --git a/repos/prettier/scripts/release/steps/update-dependents-count.js b/repos/prettier/scripts/release/steps/update-dependents-count.js
index 1fb641bb6..b8e717537 100644
--- a/repos/prettier/scripts/release/steps/update-dependents-count.js
+++ b/repos/prettier/scripts/release/steps/update-dependents-count.js
@@ -23,9 +23,9 @@ async function update() {
const githubPage = await logPromise(
"Fetching github dependents count",
- fetch(
- "https://github.com/prettier/prettier/network/dependents"
- ).then((response) => response.text())
+ fetch("https://github.com/prettier/prettier/network/dependents").then(
+ (response) => response.text()
+ )
);
const dependentsCountGithub = Number(
githubPage
diff --git a/repos/prettier/src/language-html/conditional-comment.js b/repos/prettier/src/language-html/conditional-comment.js
index 228076446..f93551f98 100644
--- a/repos/prettier/src/language-html/conditional-comment.js
+++ b/repos/prettier/src/language-html/conditional-comment.js
@@ -7,7 +7,8 @@ const {
// https://css-tricks.com/how-to-create-an-ie-only-stylesheet
// <!--[if ... ]> ... <![endif]-->
-const IE_CONDITIONAL_START_END_COMMENT_REGEX = /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
+const IE_CONDITIONAL_START_END_COMMENT_REGEX =
+ /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
// <!--[if ... ]><!-->
const IE_CONDITIONAL_START_COMMENT_REGEX = /^\[if([^\]]*?)]><!$/;
// <!--<![endif]-->
diff --git a/repos/prettier/src/language-html/print-preprocess.js b/repos/prettier/src/language-html/print-preprocess.js
index 896d72bcd..600947b77 100644
--- a/repos/prettier/src/language-html/print-preprocess.js
+++ b/repos/prettier/src/language-html/print-preprocess.js
@@ -336,11 +336,8 @@ function extractWhitespaces(ast /*, options*/) {
const localChildren = [];
- const {
- leadingWhitespace,
- text,
- trailingWhitespace,
- } = getLeadingAndTrailingHtmlWhitespace(child.value);
+ const { leadingWhitespace, text, trailingWhitespace } =
+ getLeadingAndTrailingHtmlWhitespace(child.value);
if (leadingWhitespace) {
localChildren.push({ type: TYPE_WHITESPACE });
diff --git a/repos/prettier/src/language-html/syntax-vue.js b/repos/prettier/src/language-html/syntax-vue.js
index 0ce5bb005..48bc66d47 100644
--- a/repos/prettier/src/language-html/syntax-vue.js
+++ b/repos/prettier/src/language-html/syntax-vue.js
@@ -79,7 +79,8 @@ function isVueEventBindingExpression(eventBindingValue) {
// arrow function or anonymous function
const fnExpRE = /^([\w$]+|\([^)]*?\))\s*=>|^function\s*\(/;
// simple member expression chain (a, a.b, a['b'], a["b"], a[0], a[b])
- const simplePathRE = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
+ const simplePathRE =
+ /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
// https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
const value = eventBindingValue.trim();
diff --git a/repos/prettier/src/language-js/comments.js b/repos/prettier/src/language-js/comments.js
index e4e0caa09..d34fa03ce 100644
--- a/repos/prettier/src/language-js/comments.js
+++ b/repos/prettier/src/language-js/comments.js
@@ -588,10 +588,11 @@ function handleLastFunctionArgComments({
locEnd(getLast(parameters))
);
}
- const functionParamLeftParenIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- locEnd(enclosingNode.id)
- );
+ const functionParamLeftParenIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
+ text,
+ locEnd(enclosingNode.id)
+ );
return (
functionParamLeftParenIndex !== false &&
getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
diff --git a/repos/prettier/src/language-js/parse-postprocess.js b/repos/prettier/src/language-js/parse-postprocess.js
index be9dcd9dd..d74e063cc 100644
--- a/repos/prettier/src/language-js/parse-postprocess.js
+++ b/repos/prettier/src/language-js/parse-postprocess.js
@@ -21,10 +21,8 @@ function postprocess(ast, options) {
// Invalid decorators are removed since `@typescript-eslint/typescript-estree` v4
// https://github.com/typescript-eslint/typescript-eslint/pull/2375
if (options.parser === "typescript" && options.originalText.includes("@")) {
- const {
- esTreeNodeToTSNodeMap,
- tsNodeToESTreeNodeMap,
- } = options.tsParseResult;
+ const { esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } =
+ options.tsParseResult;
ast = visitNode(ast, (node) => {
const tsNode = esTreeNodeToTSNodeMap.get(node);
if (!tsNode) {
diff --git a/repos/prettier/src/language-js/parser-babel.js b/repos/prettier/src/language-js/parser-babel.js
index dad0eded4..b9f3282f7 100644
--- a/repos/prettier/src/language-js/parser-babel.js
+++ b/repos/prettier/src/language-js/parser-babel.js
@@ -62,10 +62,8 @@ function isFlowFile(text, options) {
text = text.slice(shebang.length);
}
- const firstNonSpaceNonCommentCharacterIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- 0
- );
+ const firstNonSpaceNonCommentCharacterIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, 0);
if (firstNonSpaceNonCommentCharacterIndex !== false) {
text = text.slice(0, firstNonSpaceNonCommentCharacterIndex);
diff --git a/repos/prettier/src/language-markdown/constants.evaluate.js b/repos/prettier/src/language-markdown/constants.evaluate.js
index 1b9ab9d09..45c799f9e 100644
--- a/repos/prettier/src/language-markdown/constants.evaluate.js
+++ b/repos/prettier/src/language-markdown/constants.evaluate.js
@@ -27,7 +27,8 @@ const kPattern = unicodeRegex({ Script: ["Hangul"] })
.toString();
// http://spec.commonmark.org/0.25/#ascii-punctuation-character
-const asciiPunctuationCharset = /* prettier-ignore */ regexpUtil.charset(
+const asciiPunctuationCharset =
+ /* prettier-ignore */ regexpUtil.charset(
"!", '"', "#", "$", "%", "&", "'", "(", ")", "*",
"+", ",", "-", ".", "/", ":", ";", "<", "=", ">",
"?", "@", "[", "\\", "]", "^", "_", "`", "{", "|",
diff --git a/repos/prettier/src/language-markdown/utils.js b/repos/prettier/src/language-markdown/utils.js
index de21b4e60..4b7d2608e 100644
--- a/repos/prettier/src/language-markdown/utils.js
+++ b/repos/prettier/src/language-markdown/utils.js
@@ -51,9 +51,13 @@ function splitText(text, options) {
/** @type {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} */
const nodes = [];
- const tokens = (options.proseWrap === "preserve"
- ? text
- : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
+ const tokens = (
+ options.proseWrap === "preserve"
+ ? text
+ : text.replace(
+ new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"),
+ "$1$2"
+ )
).split(/([\t\n ]+)/);
for (const [index, token] of tokens.entries()) {
// whitespace
diff --git a/repos/prettier/src/main/ast-to-doc.js b/repos/prettier/src/main/ast-to-doc.js
index 369e6fc50..3d5a5fec0 100644
--- a/repos/prettier/src/main/ast-to-doc.js
+++ b/repos/prettier/src/main/ast-to-doc.js
@@ -86,12 +86,8 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
}
function printPrettierIgnoredNode(node, options) {
- const {
- originalText,
- [Symbol.for("comments")]: comments,
- locStart,
- locEnd,
- } = options;
+ const { originalText, [Symbol.for("comments")]: comments, locStart, locEnd } =
+ options;
const start = locStart(node);
const end = locEnd(node);
diff --git a/repos/prettier/src/main/comments.js b/repos/prettier/src/main/comments.js
index 3903278c3..8dec303a2 100644
--- a/repos/prettier/src/main/comments.js
+++ b/repos/prettier/src/main/comments.js
@@ -313,10 +313,8 @@ function isOwnLineComment(text, options, decoratedComments, commentIndex) {
if (precedingNode) {
// Find first comment on the same line
for (let index = commentIndex - 1; index >= 0; index--) {
- const {
- comment,
- precedingNode: currentCommentPrecedingNode,
- } = decoratedComments[index];
+ const { comment, precedingNode: currentCommentPrecedingNode } =
+ decoratedComments[index];
if (
currentCommentPrecedingNode !== precedingNode ||
!isAllEmptyAndNoLineBreak(text.slice(locEnd(comment), start))
@@ -342,10 +340,8 @@ function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
index < decoratedComments.length;
index++
) {
- const {
- comment,
- followingNode: currentCommentFollowingNode,
- } = decoratedComments[index];
+ const { comment, followingNode: currentCommentFollowingNode } =
+ decoratedComments[index];
if (
currentCommentFollowingNode !== followingNode ||
!isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment)))
diff --git a/repos/prettier/tests_integration/__tests__/infer-parser.js b/repos/prettier/tests_integration/__tests__/infer-parser.js
index 5e27a6b09..88ea30065 100644
--- a/repos/prettier/tests_integration/__tests__/infer-parser.js
+++ b/repos/prettier/tests_integration/__tests__/infer-parser.js
@@ -163,11 +163,9 @@ describe("--write and --list-different with unknown path and no parser", () => {
});
describe("multiple files", () => {
- runPrettier("cli/infer-parser/", [
- "--list-different",
- "--write",
- "*",
- ]).test({ status: 0 });
+ runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
+ { status: 0 }
+ );
});
});
diff --git a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
index a420c561f..8622a9bce 100644
--- a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
+++ b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
@@ -3,14 +3,8 @@
/** @type {import('prettier')} */
const prettier = require("prettier-local");
-const {
- group,
- indent,
- line,
- lineSuffix,
- lineSuffixBoundary,
- softline,
-} = prettier.doc.builders;
+const { group, indent, line, lineSuffix, lineSuffixBoundary, softline } =
+ prettier.doc.builders;
const printDoc = require("../printDoc");
diff --git a/repos/prettier/website/README.md b/repos/prettier/website/README.md
index 53d5a2778..17c91ccbc 100644
--- a/repos/prettier/website/README.md
+++ b/repos/prettier/website/README.md
@@ -59,7 +59,6 @@ previous: doc0 # previous doc on sidebar for navigation
next: doc2 # next doc on the sidebar for navigation
# don’t include next if this is the last doc; don’t include previous if first doc
---
-
docs/
are published to https://prettier.io/docs/en/next/
and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from docs/
are copied to the website/versioned_docs/version-stable
directory, whose content is published to https://prettier.io/docs/en
.
@@ -73,7 +72,6 @@ title: Blog Post Title
author: Author Name
authorURL: http://github.com/author # (or some other link)-
In the blog post, you should include a line `<!--truncate-->`. This determines under which point text will be ignored when generating the preview of your blog post. Blog posts should have the file name format: `yyyy-mm-dd-your-file-name.md`.
diff --git a/repos/prettier/website/pages/playground-redirect.html b/repos/prettier/website/pages/playground-redirect.html
index e8bc4a40f..f03a9a573 100644
--- a/repos/prettier/website/pages/playground-redirect.html
+++ b/repos/prettier/website/pages/playground-redirect.html
@@ -16,9 +16,10 @@
/>
</p>
<script>
- const match = /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
- document.referrer
- );
+ const match =
+ /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
+ document.referrer
+ );
if (match != null) {
const [, /* url */ pr] = match;
location.replace(
diff --git a/repos/prettier/website/playground/util.js b/repos/prettier/website/playground/util.js
index b41bde90e..8a22a34df 100644
--- a/repos/prettier/website/playground/util.js
+++ b/repos/prettier/website/playground/util.js
@@ -55,7 +55,8 @@ export function getCodemirrorMode(parser) {
const astAutoFold = {
estree: /^\s*"(loc|start|end)":/,
postcss: /^\s*"(source|input|raws|file)":/,
- html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
+ html:
+ /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
mdast: /^\s*"position":/,
yaml: /^\s*"position":/,
glimmer: /^\s*"loc":/,
Submodule repos/typescript-eslint contains modified content
Submodule repos/typescript-eslint 7b701a3..dac9d3a:
diff --git a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index bc26d9d9..c38a8702 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -55,9 +55,8 @@ function getExpectedIndentForNode(
sourceCodeLines: string[],
): number {
const lineIdx = node.loc.start.line - 1;
- const indent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- sourceCodeLines[lineIdx],
- )![1];
+ const indent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(sourceCodeLines[lineIdx])![1];
return indent.length;
}
function doIndent(line: string, indent: number): string {
@@ -333,9 +332,8 @@ export default createRule<Options, MessageIds>({
// +2 because we expect the string contents are indented one level
const expectedIndent = parentIndent + 2;
- const firstLineIndent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- lines[0],
- )![1];
+ const firstLineIndent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(lines[0])![1];
const requiresIndent = firstLineIndent.length > 0;
if (requiresIndent) {
if (firstLineIndent.length !== expectedIndent) {
@@ -488,7 +486,8 @@ export default createRule<Options, MessageIds>({
return {
// valid
- 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest,
+ 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression':
+ checkValidTest,
// invalid - errors
[invalidTestsSelectorPath.join(' > ')]: checkInvalidTest,
// invalid - suggestions
@@ -502,7 +501,8 @@ export default createRule<Options, MessageIds>({
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
// special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest,
+ 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
+ checkInvalidTest,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
index b6da50bb..4e95b731 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -19,7 +19,7 @@ export type RawRulesConfig = Record<
| {
severity?: RuleSeverity | 'warn' | 'none' | 'default';
options?: unknown;
- }
+ },
>;
export type MessageIds = 'failure';
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 7c2f237c..4bf17c25 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -102,8 +102,10 @@ export default util.createRule<[Options], MessageIds>({
The regex used are taken from the ones used in the official TypeScript repo -
https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L281-L289
*/
- const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
- const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExSingleLine =
+ /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExMultiLine =
+ /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const sourceCode = context.getSourceCode();
return {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 4521fcb1..37dfefd3 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -3,7 +3,8 @@ import * as util from '../util';
// tslint regex
// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32
-const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
+const ENABLE_DISABLE_REGEX =
+ /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
const toText = (
text: string,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
index c9f03c89..2f2be15c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
@@ -13,7 +13,7 @@ type Types = Record<
| {
message: string;
fixWith?: string;
- }
+ },
>;
export type Options = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
index 7107bdf4..b1915bcb 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
@@ -26,10 +26,8 @@ export default createRule<Options, MessageIds>({
},
defaultOptions: ['1tbs'],
create(context) {
- const [
- style,
- { allowSingleLine } = { allowSingleLine: false },
- ] = context.options;
+ const [style, { allowSingleLine } = { allowSingleLine: false }] =
+ context.options;
const isAllmanStyle = style === 'allman';
const sourceCode = context.getSourceCode();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
index e0e06a67..be22b20c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -10,7 +10,7 @@ export type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
type Option = Options[0];
type NormalizedOptions = Required<
- Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>
+ Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>,
>;
const OPTION_VALUE_SCHEME = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 5d14576a..096deaff 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -225,9 +225,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';
// we have a mixed type/value import, so we need to split them out into multiple exports
- const importNames = (isTypeImport
- ? report.valueSpecifiers
- : report.typeSpecifiers
+ const importNames = (
+ isTypeImport
+ ? report.valueSpecifiers
+ : report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);
context.report({
node: report.node,
@@ -308,10 +309,11 @@ export default util.createRule<Options, MessageIds>({
(specifier): specifier is TSESTree.ImportNamespaceSpecifier =>
specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,
) ?? null;
- const namedSpecifiers: TSESTree.ImportSpecifier[] = node.specifiers.filter(
- (specifier): specifier is TSESTree.ImportSpecifier =>
- specifier.type === AST_NODE_TYPES.ImportSpecifier,
- );
+ const namedSpecifiers: TSESTree.ImportSpecifier[] =
+ node.specifiers.filter(
+ (specifier): specifier is TSESTree.ImportSpecifier =>
+ specifier.type === AST_NODE_TYPES.ImportSpecifier,
+ );
return {
defaultSpecifier,
namespaceSpecifier,
@@ -476,11 +478,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier && !defaultSpecifier) {
// e.g.
@@ -687,11 +686,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier) {
// e.g.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
index 2c9dd9f2..b2b980cd 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -78,8 +78,8 @@ export default createRule<Options, MessageIds>({
const objectSymbol = typeChecker.getSymbolAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node.property),
);
- const modifierKind = objectSymbol?.getDeclarations()?.[0]
- ?.modifiers?.[0].kind;
+ const modifierKind =
+ objectSymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind;
if (
(allowPrivateClassPropertyAccess &&
modifierKind == ts.SyntaxKind.PrivateKeyword) ||
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 05c35c7a..088849f2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -248,7 +248,7 @@ type MessageIds = 'wrongIndentation';
type AppliedOptions = ExcludeKeys<
// slight hack to make interface work with Record<string, unknown>
RequireKeys<Pick<IndentConfig, keyof IndentConfig>, keyof IndentConfig>,
- AST_NODE_TYPES.VariableDeclarator
+ AST_NODE_TYPES.VariableDeclarator,
> & {
VariableDeclarator: 'off' | VariableDeclaratorObj;
};
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
* 2. Don't set any offsets against the first token of the node.
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
*/
- const offsetListeners = Object.keys(baseOffsetListeners).reduce<
- TSESLint.RuleListener
- >(
+ const offsetListeners = Object.keys(
+ baseOffsetListeners,
+ ).reduce<TSESLint.RuleListener>(
/*
* Offset listener calls are deferred until traversal is finished, and are called as
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
* ignored nodes are known.
*/
(acc, key) => {
- const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const listener = baseOffsetListeners[
+ key
+ ] as TSESLint.RuleFunction<TSESTree.Node>;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
acc[key] = node => listenerCallQueue.push({ listener, node });
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
index de5b971f..fc28832e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -123,7 +123,7 @@ export const defaultOrder = [
];
const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce<
- string[]
+ string[],
>((all, type) => {
all.push(type);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
index 54e68b2c..4775a1fe 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -130,12 +130,13 @@ export default util.createRule<Options, MessageIds>({
? parent.members
: [];
- const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter(
- (element): element is TSESTree.TSMethodSignature =>
- element.type === AST_NODE_TYPES.TSMethodSignature &&
- element !== methodNode &&
- getMethodKey(element) === getMethodKey(methodNode),
- );
+ const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] =
+ members.filter(
+ (element): element is TSESTree.TSMethodSignature =>
+ element.type === AST_NODE_TYPES.TSMethodSignature &&
+ element !== methodNode &&
+ getMethodKey(element) === getMethodKey(methodNode),
+ );
const isParentModule = isNodeParentModuleDeclaration(methodNode);
if (duplicatedKeyMethodNodes.length > 0) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
index 2640aee6..833f8b00 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
return !wasUnderscore;
}
-const PredefinedFormatToCheckFunction: Readonly<Record<
- PredefinedFormats,
- (name: string) => boolean
->> = {
+const PredefinedFormatToCheckFunction: Readonly<
+ Record<PredefinedFormats, (name: string) => boolean>,
+> = {
[PredefinedFormats.PascalCase]: isPascalCase,
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[PredefinedFormats.camelCase]: isCamelCase,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index b58edd99..f507f372 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -32,8 +32,10 @@ export default util.createRule({
return {
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
- 'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
- 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
+ 'MemberExpression[optional = true] > TSNonNullExpression.object':
+ checkExtraNonNullAssertion,
+ 'CallExpression[optional = true] > TSNonNullExpression.callee':
+ checkExtraNonNullAssertion,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 0cb41337..1f45a489 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -84,9 +84,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
- let fullNumberNode:
- | TSESTree.Literal
- | TSESTree.UnaryExpression = node;
+ let fullNumberNode: TSESTree.Literal | TSESTree.UnaryExpression =
+ node;
let raw = node.raw;
if (
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
index fa67859f..21456319 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -73,7 +73,7 @@ export default util.createRule<Options, MessageIds>({
loc?: TSESTree.SourceLocation;
},
void,
- unknown
+ unknown,
> {
if (
options?.builtinGlobals &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index aee4963a..fcf11f3f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -443,9 +443,9 @@ export default createRule<Options, MessageId>({
// (Value to complexity ratio is dubious however)
}
// Otherwise just do type analysis on the function as a whole.
- const returnTypes = getCallSignaturesOfType(
- getNodeType(callback),
- ).map(sig => sig.getReturnType());
+ const returnTypes = getCallSignaturesOfType(getNodeType(callback)).map(
+ sig => sig.getReturnType(),
+ );
/* istanbul ignore if */ if (returnTypes.length === 0) {
// Not a callable function
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
index 395bbfdc..014b2c22 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
@@ -170,12 +170,16 @@ export default util.createRule({
return {
TSModuleDeclaration: enterDeclaration,
TSEnumDeclaration: enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]':
+ enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]':
+ enterDeclaration,
'TSModuleDeclaration:exit': exitDeclaration,
'TSEnumDeclaration:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit':
+ exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit':
+ exitDeclaration,
TSQualifiedName(node: TSESTree.TSQualifiedName): void {
visitNamespaceAccess(node, node.left, node.right);
},
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 6d5036c2..030f2748 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -11,7 +11,7 @@ type MakeRequired<Base, Key extends keyof Base> = Omit<Base, Key> &
type TypeParameterWithConstraint = MakeRequired<
TSESTree.TSTypeParameter,
- 'constraint'
+ 'constraint',
>;
const is3dot5 = semver.satisfies(
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index b326c754..12284640 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -72,7 +72,8 @@ export default util.createRule({
return {
// ignore MemberExpression if it's parent is TSClassImplements or TSInterfaceHeritage
- ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression': checkMemberExpression,
+ ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression':
+ checkMemberExpression,
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
index 2b0bb32c..59680863 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -5,7 +5,8 @@ import {
} from '@typescript-eslint/experimental-utils';
import * as util from '../util';
-const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
+const SENTINEL_TYPE =
+ /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
/**
* Parses a given value as options.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
index 581e7ac1..01721d44 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
@@ -170,8 +170,8 @@ export default createRule<Options, MessageIds>({
): void {
if (isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween!(first, second);
- const secondType = sourceCode.getNodeByRangeIndex(second.range[0])!
- .type;
+ const secondType =
+ sourceCode.getNodeByRangeIndex(second.range[0])!.type;
const openingCurlyBraceMustBeSpaced =
options.arraysInObjectsException &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
index f49b5385..d21b088d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -134,10 +134,11 @@ export default createRule({
].join(', ')](node: TSESTree.MemberExpression): void {
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent as TSESTree.CallExpression;
- const compareNode = (callNode.parent?.type ===
- AST_NODE_TYPES.ChainExpression
- ? callNode.parent.parent
- : callNode.parent) as TSESTree.BinaryExpression;
+ const compareNode = (
+ callNode.parent?.type === AST_NODE_TYPES.ChainExpression
+ ? callNode.parent.parent
+ : callNode.parent
+ ) as TSESTree.BinaryExpression;
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index cd886a9d..0e15bf8f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -65,10 +65,12 @@ export default util.createRule({
| TSESTree.MemberExpression,
): void {
// selector guarantees this cast
- const initialExpression = (initialIdentifierOrNotEqualsExpr.parent
- ?.type === AST_NODE_TYPES.ChainExpression
- ? initialIdentifierOrNotEqualsExpr.parent.parent
- : initialIdentifierOrNotEqualsExpr.parent) as TSESTree.LogicalExpression;
+ const initialExpression = (
+ initialIdentifierOrNotEqualsExpr.parent?.type ===
+ AST_NODE_TYPES.ChainExpression
+ ? initialIdentifierOrNotEqualsExpr.parent.parent
+ : initialIdentifierOrNotEqualsExpr.parent
+ ) as TSESTree.LogicalExpression;
if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) {
// the node(identifier or member expression) is not the deepest left node
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 27eb7dca..0d4c3a7a 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -267,11 +267,11 @@ const DIRECTLY_INSIDE_CONSTRUCTOR = 0;
class ClassScope {
private readonly privateModifiableMembers = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly privateModifiableStatics = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly memberVariableModifications = new Set<string>();
private readonly staticVariableModifications = new Set<string>();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
index 99c455cd..764ca63d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
@@ -146,7 +146,7 @@ export default util.createRule({
'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(
node: Exclude<
TSESTree.Node,
- TSESTree.BlockStatement | TSESTree.AwaitExpression
+ TSESTree.BlockStatement | TSESTree.AwaitExpression,
>,
): void {
const expression = parserServices.esTreeNodeToTSNodeMap.get(node);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
index e73fd4b5..eccc264e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
@@ -36,9 +36,8 @@ export default util.createRule<Options, MessageIds>({
],
create(context) {
const rules = baseRule.create(context);
- const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const checkForSemicolon =
+ rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
/*
The following nodes are handled by the member-delimiter-style rule
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
index 08c3ad62..525febe2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
@@ -94,7 +94,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
programNode = node;
- const referenceRegExp = /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
+ const referenceRegExp =
+ /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
const commentsBefore = sourceCode.getCommentsBefore(programNode);
commentsBefore.forEach(comment => {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index 19aaf335..2b9150a6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -9,11 +9,11 @@ import * as util from '.';
class UnusedVarsVisitor<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> extends Visitor {
private static readonly RESULTS_CACHE = new WeakMap<
TSESTree.Program,
- ReadonlySet<TSESLint.Scope.Variable>
+ ReadonlySet<TSESLint.Scope.Variable>,
>();
readonly #scopeManager: TSESLint.Scope.ScopeManager;
@@ -32,7 +32,7 @@ class UnusedVarsVisitor<
public static collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: TSESLint.RuleContext<TMessageIds, TOptions>,
): ReadonlySet<TSESLint.Scope.Variable> {
@@ -747,7 +747,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
*/
function collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
): ReadonlySet<TSESLint.Scope.Variable> {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
index 86e0ec23..fe531fec 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
@@ -12,15 +12,10 @@ export * from './requiresQuoting';
export * from './types';
// this is done for convenience - saves migrating all of the old rules
-const {
- applyDefault,
- deepMerge,
- isObjectNotArray,
- getParserServices,
-} = ESLintUtils;
-type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
- T
->;
+const { applyDefault, deepMerge, isObjectNotArray, getParserServices } =
+ ESLintUtils;
+type InferMessageIdsTypeFromRule<T> =
+ ESLintUtils.InferMessageIdsTypeFromRule<T>;
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
export {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
index 2e6c4711..e7e0991b 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
@@ -91,11 +91,11 @@ function getNameFromMember(
type ExcludeKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = { [k in Exclude<keyof TObj, TKeys>]: TObj[k] };
type RequireKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = ExcludeKeys<TObj, TKeys> & { [k in TKeys]-?: Exclude<TObj[k], undefined> };
function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
index 103caeb5..d67ff887 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
@@ -137,9 +137,10 @@ describe('Validating README.md', () => {
for (const [ruleName, rule] of notDeprecated) {
describe(`Checking rule ${ruleName}`, () => {
- const ruleRow: string[] | undefined = (rule.meta.docs?.extendsBaseRule
- ? rulesTables.extension.cells
- : rulesTables.base.cells
+ const ruleRow: string[] | undefined = (
+ rule.meta.docs?.extendsBaseRule
+ ? rulesTables.extension.cells
+ : rulesTables.base.cells
).find(row => row[0].includes(`/${ruleName}.md`));
if (!ruleRow) {
// rule is in the wrong table, the first two tests will catch this, so no point in creating noise;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index 5134d591..855e13a0 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -3804,7 +3804,7 @@ class Foo {
const sortedWithoutGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + multiple types
@@ -4182,7 +4182,7 @@ const foo = class Foo {
const sortedWithoutGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + multiple types --> Only member group order is checked (default config)
@@ -4392,7 +4392,7 @@ class Foo {
const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + multiple types --> Only member group order is checked (default config)
@@ -4629,7 +4629,7 @@ const foo = class Foo {
const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + multiple types
@@ -4864,7 +4864,7 @@ interface Foo {
const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + multiple types --> Only member group order is checked (default config)
@@ -5097,14 +5097,12 @@ type Foo = {
],
};
-const sortedWithGroupingDefaultOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // default option + interface + default order + alphabetically
- {
- code: `
+const sortedWithGroupingDefaultOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // default option + interface + default order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5121,14 +5119,14 @@ interface Foo {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + interface + custom order + alphabetically
- {
- code: `
+ // default option + interface + custom order + alphabetically
+ {
+ code: `
interface Foo {
new () : Bar;
@@ -5144,19 +5142,19 @@ interface Foo {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + default order + alphabetically
- {
- code: `
+ // default option + type literal + default order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5173,14 +5171,14 @@ type Foo = {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + type literal + custom order + alphabetically
- {
- code: `
+ // default option + type literal + custom order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5197,19 +5195,19 @@ type Foo = {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + default order + alphabetically
- {
- code: `
+ // default option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5222,13 +5220,13 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
- // default option + class + decorators + default order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
+ // default option + class + decorators + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5245,14 +5243,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class + custom order + alphabetically
- {
- code: `
+ // default option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5265,19 +5263,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + default order + alphabetically
- {
- code: `
+ // default option + class expression + default order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5290,14 +5288,14 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class expression + custom order + alphabetically
- {
- code: `
+ // default option + class expression + custom order + alphabetically
+ {
+ code: `
const foo = class Foo {
constructor() {}
@@ -5310,20 +5308,20 @@ const foo = class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
- },
- },
- ],
- },
- ],
- invalid: [
- // default option + interface + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ },
+ ],
+ invalid: [
+ // default option + interface + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5340,23 +5338,23 @@ interface Foo {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + type literal + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5373,23 +5371,23 @@ type Foo = {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5400,23 +5398,23 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class expression + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static c: string = "";
public static b: string = "";
@@ -5427,22 +5425,22 @@ const foo = class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
- },
- },
- ],
- },
- // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
+ },
+ ],
+ },
+ // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
@Dec() a1: string;
@Dec()
@@ -5459,47 +5457,45 @@ class Foo {
@Dec() d(): void
}
`,
- options: [
- {
- default: {
- memberTypes: [
- 'decorated-field',
- 'field',
- 'constructor',
- 'decorated-method',
- ],
- order: 'alphabetically',
- },
- },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b1',
- rank: 'constructor',
- },
- },
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b2',
- rank: 'constructor',
- },
- },
- ],
- },
- ],
-};
-
-const sortedWithGroupingClassesOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // classes option + interface + alphabetically --> Default order applies
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: [
+ 'decorated-field',
+ 'field',
+ 'constructor',
+ 'decorated-method',
+ ],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b1',
+ rank: 'constructor',
+ },
+ },
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b2',
+ rank: 'constructor',
+ },
+ },
+ ],
+ },
+ ],
+ };
+
+const sortedWithGroupingClassesOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // classes option + interface + alphabetically --> Default order applies
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5516,12 +5512,12 @@ interface Foo {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + type literal + alphabetically --> Default order applies
- {
- code: `
+ // classes option + type literal + alphabetically --> Default order applies
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5538,12 +5534,12 @@ type Foo = {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + class + default order + alphabetically
- {
- code: `
+ // classes option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5556,14 +5552,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // classes option + class + custom order + alphabetically
- {
- code: `
+ // classes option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5576,19 +5572,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- classes: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ classes: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // classes option + class expression + alphabetically --> Default order applies
- {
- code: `
+ // classes option + class expression + alphabetically --> Default order applies
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5601,13 +5597,13 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
- ],
- invalid: [
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
+ ],
+ invalid: [
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5618,25 +5614,25 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
- ],
-};
+ ],
+ },
+ ],
+ };
const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + alphabetically --> Default order applies
@@ -5783,7 +5779,7 @@ const foo = class Foo {
const sortedWithGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + default order + alphabetically
@@ -5939,7 +5935,7 @@ interface Foo {
const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + alphabetically --> Default order applies
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index 93173074..eb3bec70 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -18,10 +18,9 @@ const parserOptions = {
project: './tsconfig.json',
};
-const formatTestNames: Readonly<Record<
- PredefinedFormatsString,
- Record<'valid' | 'invalid', string[]>
->> = {
+const formatTestNames: Readonly<
+ Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>,
+> = {
camelCase: {
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index 0f7bb141..61caf073 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -72,27 +72,25 @@ const testCases = [
const validTestCases = flatten(
testCases.map(c => c.code.map(code => `const a = ${code}`)),
);
-const invalidTestCases: TSESLint.InvalidTestCase<
- MessageIds,
- Options
->[] = flatten(
- testCases.map(cas =>
- cas.code.map(code => ({
- code: `const a: ${cas.type} = ${code}`,
- output: `const a = ${code}`,
- errors: [
- {
- messageId: 'noInferrableType',
- data: {
- type: cas.type,
+const invalidTestCases: TSESLint.InvalidTestCase<MessageIds, Options>[] =
+ flatten(
+ testCases.map(cas =>
+ cas.code.map(code => ({
+ code: `const a: ${cas.type} = ${code}`,
+ output: `const a = ${code}`,
+ errors: [
+ {
+ messageId: 'noInferrableType',
+ data: {
+ type: cas.type,
+ },
+ line: 1,
+ column: 7,
},
- line: 1,
- column: 7,
- },
- ],
- })),
- ),
-);
+ ],
+ })),
+ ),
+ );
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
index c0934982..67b9d22c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
@@ -21,7 +21,7 @@ const ruleTester = new RuleTester({
const hasExport = /^export/m;
// const hasImport = /^import .+? from ['"]/m;
function makeExternalModule<
- T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>
+ T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>,
>(tests: T[]): T[] {
return tests.map(t => {
if (!hasExport.test(t.code)) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index 80340828..2afa8616 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -144,7 +144,7 @@ const baseCases = [
],
} as TSESLint.InvalidTestCase<
InferMessageIdsTypeFromRule<typeof rule>,
- InferOptionsTypeFromRule<typeof rule>
+ InferOptionsTypeFromRule<typeof rule>,
>),
);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index 0cef8974..aefb7cd8 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1069,13 +1069,13 @@ function addOptional<TOptions extends Readonly<unknown[]>>(
): TSESLint.ValidTestCase<TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: TSESLint.InvalidTestCase<TMessageIds, TOptions>[],
): TSESLint.InvalidTestCase<TMessageIds, TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: (Case<TMessageIds, TOptions> | string)[],
): Case<TMessageIds, TOptions>[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
index e78808aa..ed84f286 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
@@ -49,10 +49,8 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Map(
);
const EXTENDS = ['./configs/base', './configs/eslint-recommended'];
-const ruleEntries: [
- string,
- TSESLint.RuleModule<string, unknown[]>,
-][] = Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
+const ruleEntries: [string, TSESLint.RuleModule<string, unknown[]>][] =
+ Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
/**
* Helper function reduces records to key - value pairs.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
index 49e48541..2c35583c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -20,7 +20,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -40,7 +40,7 @@ declare module 'eslint/lib/rules/camelcase' {
],
{
Identifier(node: TSESTree.Identifier): void;
- }
+ },
>;
export = rule;
}
@@ -136,7 +136,7 @@ declare module 'eslint/lib/rules/indent' {
JSXOpeningElement(node: TSESTree.JSXOpeningElement): void;
JSXClosingElement(node: TSESTree.JSXClosingElement): void;
JSXExpressionContainer(node: TSESTree.JSXExpressionContainer): void;
- }
+ },
>;
export = rule;
}
@@ -154,7 +154,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
{
before?: boolean;
after?: boolean;
- }
+ },
>;
},
];
@@ -215,7 +215,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
ImportNamespaceSpecifier: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
MethodDefinition: RuleFunction<TSESTree.MethodDefinition>;
Property: RuleFunction<TSESTree.Property>;
- }
+ },
>;
export = rule;
}
@@ -231,7 +231,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
ClassBody(): void;
'ClassBody:exit'(): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -245,7 +245,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -263,7 +263,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -280,7 +280,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
[],
{
Program(node: TSESTree.Program): void;
- }
+ },
>;
export = rule;
}
@@ -295,7 +295,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -318,7 +318,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -335,7 +335,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -354,7 +354,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -373,7 +373,7 @@ declare module 'eslint/lib/rules/no-shadow' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -390,7 +390,7 @@ declare module 'eslint/lib/rules/no-undef' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -415,7 +415,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -434,7 +434,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
],
{
ExpressionStatement(node: TSESTree.ExpressionStatement): void;
- }
+ },
>;
export = rule;
}
@@ -454,7 +454,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -476,7 +476,7 @@ declare module 'eslint/lib/rules/strict' {
['never' | 'global' | 'function' | 'safe'],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -489,7 +489,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
[],
{
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -542,7 +542,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
WhileStatement(node: TSESTree.WhileStatement): void;
WithStatement(node: TSESTree.WithStatement): void;
YieldExpression(node: TSESTree.YieldExpression): void;
- }
+ },
>;
export = rule;
}
@@ -572,7 +572,7 @@ declare module 'eslint/lib/rules/semi' {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -592,7 +592,7 @@ declare module 'eslint/lib/rules/quotes' {
{
Literal(node: TSESTree.Literal): void;
TemplateLiteral(node: TSESTree.TemplateLiteral): void;
- }
+ },
>;
export = rule;
}
@@ -619,7 +619,7 @@ declare module 'eslint/lib/rules/brace-style' {
SwitchStatement(node: TSESTree.SwitchStatement): void;
IfStatement(node: TSESTree.IfStatement): void;
TryStatement(node: TSESTree.TryStatement): void;
- }
+ },
>;
export = rule;
}
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
EmptyStatement(node: TSESTree.EmptyStatement): void;
ClassBody(node: TSESTree.ClassBody): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -653,7 +653,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
],
{
ClassBody(node: TSESTree.ClassBody): void;
- }
+ },
>;
export = rule;
}
@@ -671,7 +671,7 @@ declare module 'eslint/lib/rules/init-declarations' {
],
{
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -694,7 +694,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
FunctionExpression(node: TSESTree.FunctionExpression): void;
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
ThisExpression(node: TSESTree.ThisExpression): void;
- }
+ },
>;
export = rule;
}
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/dot-notation' {
],
{
MemberExpression(node: TSESTree.MemberExpression): void;
- }
+ },
>;
export = rule;
}
@@ -726,7 +726,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
[],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -759,7 +759,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
node: TSESTree.TSTypeParameterDeclaration,
): void;
TSTupleType(node: TSESTree.TSTupleType): void;
- }
+ },
>;
export = rule;
}
@@ -785,7 +785,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration?(node: TSESTree.ExportNamedDeclaration): void;
ExportAllDeclaration?(node: TSESTree.ExportAllDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -807,7 +807,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
LogicalExpression(node: TSESTree.LogicalExpression): void;
ConditionalExpression(node: TSESTree.ConditionalExpression): void;
VariableDeclarator(node: TSESTree.VariableDeclarator): void;
- }
+ },
>;
export = rule;
}
@@ -826,7 +826,7 @@ declare module 'eslint/lib/rules/prefer-const' {
{
'Program:exit'(node: TSESTree.Program): void;
VariableDeclaration(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -851,7 +851,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
ObjectExpression(node: TSESTree.ObjectExpression): void;
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
- }
+ },
>;
export = rule;
}
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
index cbf83771..e88a7314 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
@@ -47,7 +47,7 @@ const isCommentToken = eslintUtils.isCommentToken as (
token: TSESTree.Token | TSESTree.Comment,
) => token is TSESTree.Comment;
const isNotCommentToken = eslintUtils.isNotCommentToken as <
- T extends TSESTree.Token | TSESTree.Comment
+ T extends TSESTree.Token | TSESTree.Comment,
>(
token: T,
) => token is Exclude<T, TSESTree.Comment>;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
index 1fd2e752..2b1584bc 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
@@ -5,7 +5,7 @@ import { RuleCreateFunction, RuleModule } from '../ts-eslint';
*/
type InferOptionsTypeFromRule<T> = T extends RuleModule<
infer _TMessageIds,
- infer TOptions
+ infer TOptions,
>
? TOptions
: T extends RuleCreateFunction<infer _TMessageIds, infer TOptions>
@@ -17,7 +17,7 @@ type InferOptionsTypeFromRule<T> = T extends RuleModule<
*/
type InferMessageIdsTypeFromRule<T> = T extends RuleModule<
infer TMessageIds,
- infer _TOptions
+ infer _TOptions,
>
? TMessageIds
: T extends RuleCreateFunction<infer TMessageIds, infer _TOptions>
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
index ca1cfb33..f02b7589 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
@@ -19,7 +19,7 @@ function RuleCreator(urlCreator: (ruleName: string) => string) {
return function createRule<
TOptions extends readonly unknown[],
TMessageIds extends string,
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>({
name,
meta,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
index 6ed25e4a..29a56671 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
@@ -24,13 +24,13 @@ function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(
*/
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
test: InvalidTestCase<TMessageIds, TOptions>,
): InvalidTestCase<TMessageIds, TOptions>[];
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
options: ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>,
): (ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>)[] {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
index 925d4976..27ad5792 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
@@ -9,7 +9,7 @@ const ERROR_MESSAGE =
*/
function getParserServices<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
allowWithoutFullTypeInformation = false,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
index 15c69bbf..1999c4f4 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
@@ -27,13 +27,14 @@ const Definition = ESLintDefinition as DefinitionConstructor;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ParameterDefinition extends Definition {}
-const ParameterDefinition = ESLintParameterDefinition as DefinitionConstructor & {
- new (
- name: TSESTree.Node,
- node: TSESTree.Node,
- index?: number | null,
- rest?: boolean,
- ): ParameterDefinition;
-};
+const ParameterDefinition =
+ ESLintParameterDefinition as DefinitionConstructor & {
+ new (
+ name: TSESTree.Node,
+ node: TSESTree.Node,
+ index?: number | null,
+ rest?: boolean,
+ ): ParameterDefinition;
+ };
export { Definition, ParameterDefinition };
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
index 49f1e11c..9b2c711d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
@@ -142,8 +142,9 @@ const ModuleScope = ESLintModuleScope as ScopeConstructor &
ScopeChildConstructorWithUpperScope<ModuleScope>;
interface FunctionExpressionNameScope extends Scope {}
-const FunctionExpressionNameScope = ESLintFunctionExpressionNameScope as ScopeConstructor &
- ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
+const FunctionExpressionNameScope =
+ ESLintFunctionExpressionNameScope as ScopeConstructor &
+ ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
interface CatchScope extends Scope {}
const CatchScope = ESLintCatchScope as ScopeConstructor &
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
index fec56c17..dfcc2347 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
@@ -71,7 +71,7 @@ declare class CLIEngineBase {
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
////////////////////
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
index 9abefbab..ec79326d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
@@ -38,7 +38,7 @@ declare class LinterBase {
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(
rulesToDefine: Record<
string,
- RuleModule<TMessageIds, TOptions> | RuleCreateFunction
+ RuleModule<TMessageIds, TOptions> | RuleCreateFunction,
>,
): void;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
index 8ced374d..076b1731 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -115,9 +115,8 @@ interface RuleFixer {
type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
-type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
- TMessageIds
->[];
+type ReportSuggestionArray<TMessageIds extends string> =
+ ReportDescriptorBase<TMessageIds>[];
interface ReportDescriptorBase<TMessageIds extends string> {
/**
@@ -162,14 +161,13 @@ interface ReportDescriptorLocOnly {
*/
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
}
-type ReportDescriptor<
- TMessageIds extends string
-> = ReportDescriptorWithSuggestion<TMessageIds> &
- (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
+type ReportDescriptor<TMessageIds extends string> =
+ ReportDescriptorWithSuggestion<TMessageIds> &
+ (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
interface RuleContext<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> {
/**
* The rule ID.
@@ -328,29 +326,21 @@ interface RuleListener {
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
- TSAbstractMethodDefinition?: RuleFunction<
- TSESTree.TSAbstractMethodDefinition
- >;
+ TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
- TSCallSignatureDeclaration?: RuleFunction<
- TSESTree.TSCallSignatureDeclaration
- >;
+ TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
- TSConstructSignatureDeclaration?: RuleFunction<
- TSESTree.TSConstructSignatureDeclaration
- >;
+ TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
- TSEmptyBodyFunctionExpression?: RuleFunction<
- TSESTree.TSEmptyBodyFunctionExpression
- >;
+ TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +361,7 @@ interface RuleListener {
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
- TSNamespaceExportDeclaration?: RuleFunction<
- TSESTree.TSNamespaceExportDeclaration
- >;
+ TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +388,8 @@ interface RuleListener {
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
- TSTypeParameterDeclaration?: RuleFunction<
- TSESTree.TSTypeParameterDeclaration
- >;
- TSTypeParameterInstantiation?: RuleFunction<
- TSESTree.TSTypeParameterInstantiation
- >;
+ TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
+ TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
@@ -426,7 +410,7 @@ interface RuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> {
/**
* Metadata about the rule
@@ -444,7 +428,7 @@ type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
export {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
index 652567f6..e237586d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
@@ -59,7 +59,7 @@ interface SuggestionOutput<TMessageIds extends string> {
interface InvalidTestCase<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> extends ValidTestCase<TOptions> {
/**
* Expected errors.
@@ -111,7 +111,7 @@ interface TestCaseError<TMessageIds extends string> {
interface RunTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> {
// RuleTester.run also accepts strings for valid cases
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
index 6907e229..bc3db012 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
@@ -19,7 +19,8 @@ namespace Scope {
export type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
export type ClassNameDefinition = scopeManager.ClassNameDefinition;
export type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
- export type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
+ export type ImplicitGlobalVariableDefinition =
+ scopeManager.ImplicitGlobalVariableDefinition;
export type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
export type ParameterDefinition = scopeManager.ParameterDefinition;
export type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
@@ -34,7 +35,8 @@ namespace Scope {
export type ClassScope = scopeManager.ClassScope;
export type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
export type ForScope = scopeManager.ForScope;
- export type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
+ export type FunctionExpressionNameScope =
+ scopeManager.FunctionExpressionNameScope;
export type FunctionScope = scopeManager.FunctionScope;
export type FunctionTypeScope = scopeManager.FunctionTypeScope;
export type GlobalScope = scopeManager.GlobalScope;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
index 1bfb569e..654b27bf 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
@@ -6,7 +6,7 @@ class CatchClauseDefinition extends DefinitionBase<
DefinitionType.CatchClause,
TSESTree.CatchClause,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']) {
super(DefinitionType.CatchClause, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
index 5d587b34..9279dd8b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
@@ -6,7 +6,7 @@ class ClassNameDefinition extends DefinitionBase<
DefinitionType.ClassName,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']) {
super(DefinitionType.ClassName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
index ed25a722..7147ebc6 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
@@ -8,7 +8,7 @@ abstract class DefinitionBase<
TType extends DefinitionType,
TNode extends TSESTree.Node,
TParent extends TSESTree.Node | null,
- TName extends TSESTree.Node = TSESTree.BindingName
+ TName extends TSESTree.Node = TSESTree.BindingName,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
index b4cf2405..80e83b7c 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
@@ -9,7 +9,7 @@ class FunctionNameDefinition extends DefinitionBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']) {
super(DefinitionType.FunctionName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
index 43012c0f..67cfbf3b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
@@ -6,7 +6,7 @@ class ImplicitGlobalVariableDefinition extends DefinitionBase<
DefinitionType.ImplicitGlobalVariable,
TSESTree.Node,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(
name: TSESTree.BindingName,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
index 874edadf..d4f11607 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
@@ -9,7 +9,7 @@ class ImportBindingDefinition extends DefinitionBase<
| TSESTree.ImportNamespaceSpecifier
| TSESTree.TSImportEqualsDeclaration,
TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
@@ -20,7 +20,7 @@ class ImportBindingDefinition extends DefinitionBase<
name: TSESTree.Identifier,
node: Exclude<
ImportBindingDefinition['node'],
- TSESTree.TSImportEqualsDeclaration
+ TSESTree.TSImportEqualsDeclaration,
>,
decl: TSESTree.ImportDeclaration,
);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
index b0c0ea32..fb73b081 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
@@ -15,7 +15,7 @@ class ParameterDefinition extends DefinitionBase<
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
/**
* Whether the parameter definition is a part of a rest parameter.
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
index cff6bbaa..3670d070 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumMemberDefinition extends DefinitionBase<
DefinitionType.TSEnumMember,
TSESTree.TSEnumMember,
null,
- TSESTree.Identifier | TSESTree.StringLiteral
+ TSESTree.Identifier | TSESTree.StringLiteral,
> {
constructor(
name: TSESTree.Identifier | TSESTree.StringLiteral,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
index 5374a562..36d74cb8 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumNameDefinition extends DefinitionBase<
DefinitionType.TSEnumName,
TSESTree.TSEnumDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']) {
super(DefinitionType.TSEnumName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
index 98f90778..5b0c0a75 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
@@ -6,7 +6,7 @@ class TSModuleNameDefinition extends DefinitionBase<
DefinitionType.TSModuleName,
TSESTree.TSModuleDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']) {
super(DefinitionType.TSModuleName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
index ad3b4368..45a61e12 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
@@ -8,7 +8,7 @@ class TypeDefinition extends DefinitionBase<
| TSESTree.TSTypeAliasDeclaration
| TSESTree.TSTypeParameter,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']) {
super(DefinitionType.Type, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
index 975c5886..4ab2ca18 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
@@ -6,7 +6,7 @@ class VariableDefinition extends DefinitionBase<
DefinitionType.Variable,
TSESTree.VariableDeclarator,
TSESTree.VariableDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
index 90cd98bb..dc8ed7a3 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
@@ -6,5 +6,5 @@ import { ImplicitLibVariableOptions } from '../variable';
export const webworker_importscripts = {} as Record<
string,
- ImplicitLibVariableOptions
+ ImplicitLibVariableOptions,
>;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
index 95904428..2a741d28 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class BlockScope extends ScopeBase<
ScopeType.block,
TSESTree.BlockStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
index 46b4005f..e6b5f95f 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class CatchScope extends ScopeBase<
ScopeType.catch,
TSESTree.CatchClause,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
index ee28a31a..e0ae2613 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ClassScope extends ScopeBase<
ScopeType.class,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
index c20f1217..c0d88231 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ConditionalTypeScope extends ScopeBase<
ScopeType.conditionalType,
TSESTree.TSConditionalType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
index 36703b5d..b7f25494 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ForScope extends ScopeBase<
ScopeType.for,
TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
index a84bc4b2..b1731c9d 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class FunctionExpressionNameScope extends ScopeBase<
ScopeType.functionExpressionName,
TSESTree.FunctionExpression,
- Scope
+ Scope,
> {
public readonly functionExpressionScope: true;
constructor(
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
index 18e12321..6c362639 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
@@ -14,7 +14,7 @@ class FunctionScope extends ScopeBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.Program,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
index d459070c..d3cc8c5b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -11,7 +11,7 @@ class FunctionTypeScope extends ScopeBase<
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
index 3da909c1..87b727fc 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
@@ -18,7 +18,7 @@ class GlobalScope extends ScopeBase<
/**
* The global scope has no parent.
*/
- null
+ null,
> {
// note this is accessed in used in the legacy eslint-scope tests, so it can't be true private
private readonly implicit: {
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
index 9b5c2a05..c9729031 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class MappedTypeScope extends ScopeBase<
ScopeType.mappedType,
TSESTree.TSMappedType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a..90e2c0fb 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
@@ -137,7 +137,7 @@ type AnyScope = ScopeBase<ScopeType, TSESTree.Node, Scope | null>;
abstract class ScopeBase<
TType extends ScopeType,
TBlock extends TSESTree.Node,
- TUpper extends Scope | null
+ TUpper extends Scope | null,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
index 7a684564..f18a1aae 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class SwitchScope extends ScopeBase<
ScopeType.switch,
TSESTree.SwitchStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
index 3962784a..ed79b3a9 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSEnumScope extends ScopeBase<
ScopeType.tsEnum,
TSESTree.TSEnumDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
index bdc7c7dc..3ca626f1 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSModuleScope extends ScopeBase<
ScopeType.tsModule,
TSESTree.TSModuleDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
index 7f21a60f..37c9cf78 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TypeScope extends ScopeBase<
ScopeType.type,
TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
index 84a3e4c7..b50fe2ba 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class WithScope extends ScopeBase<
ScopeType.with,
TSESTree.WithStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
index 69833caa..5255ed02 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
@@ -36,7 +36,7 @@ const QUOTED_STRING = /^["'](.+?)['"]$/;
type ALLOWED_VALUE = ['number' | 'boolean' | 'string', Set<unknown>?];
const ALLOWED_OPTIONS: Map<string, ALLOWED_VALUE> = new Map<
keyof AnalyzeOptions,
- ALLOWED_VALUE
+ ALLOWED_VALUE,
>([
['ecmaVersion', ['number']],
['globalReturn', ['boolean']],
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
index d20ab14f..8f04f4a8 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
@@ -3,11 +3,11 @@ import { simpleTraverse } from '@typescript-eslint/typescript-estree';
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(ast: TSESTree.Node, selector: TSelector): TNode;
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(
ast: TSESTree.Node,
selector: TSelector,
@@ -16,7 +16,7 @@ function getSpecificNode<
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
TNode extends Extract<TSESTree.Node, { type: TSelector }>,
- TReturnType extends TSESTree.Node
+ TReturnType extends TSESTree.Node,
>(
ast: TSESTree.Node,
selector: TSelector,
diff --git a/repos/typescript-eslint/packages/types/src/ts-estree.ts b/repos/typescript-eslint/packages/types/src/ts-estree.ts
index 4dd89c96..a17252d8 100644
--- a/repos/typescript-eslint/packages/types/src/ts-estree.ts
+++ b/repos/typescript-eslint/packages/types/src/ts-estree.ts
@@ -130,7 +130,7 @@ export type Token =
export type OptionalRangeAndLoc<T> = Pick<
T,
- Exclude<keyof T, 'range' | 'loc'>
+ Exclude<keyof T, 'range' | 'loc'>,
> & {
range?: Range;
loc?: SourceLocation;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
index a22eae1a..43bfd6ba 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
@@ -821,7 +821,7 @@ export class Converter {
const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node);
const result = this.createNode<
- TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration
+ TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration,
>(node, {
type:
isDeclare || !node.body
@@ -846,9 +846,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -1002,7 +1003,7 @@ export class Converter {
case SyntaxKind.PropertyDeclaration: {
const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty
+ TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty,
>(node, {
type: isAbstract
? AST_NODE_TYPES.TSAbstractClassProperty
@@ -1050,7 +1051,7 @@ export class Converter {
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration: {
const method = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1070,9 +1071,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- method.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ method.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(method, method.typeParameters.range);
}
@@ -1112,7 +1114,7 @@ export class Converter {
: AST_NODE_TYPES.MethodDefinition;
result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
@@ -1161,7 +1163,7 @@ export class Converter {
node.getFirstToken()!;
const constructor = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1177,9 +1179,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- constructor.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ constructor.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(constructor, constructor.typeParameters.range);
}
@@ -1196,7 +1199,7 @@ export class Converter {
const isStatic = hasModifier(SyntaxKind.StaticKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: hasModifier(SyntaxKind.AbstractKeyword, node)
? AST_NODE_TYPES.TSAbstractMethodDefinition
@@ -1234,9 +1237,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1332,9 +1336,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1439,10 +1444,11 @@ export class Converter {
let result: TSESTree.RestElement | TSESTree.AssignmentPattern;
if (node.dotDotDotToken) {
- parameter = result = this.createNode<TSESTree.RestElement>(node, {
- type: AST_NODE_TYPES.RestElement,
- argument: this.convertChild(node.name),
- });
+ parameter = result =
+ this.createNode<TSESTree.RestElement>(node, {
+ type: AST_NODE_TYPES.RestElement,
+ argument: this.convertChild(node.name),
+ });
} else if (node.initializer) {
parameter = this.convertChild(node.name) as TSESTree.BindingName;
result = this.createNode<TSESTree.AssignmentPattern>(node, {
@@ -1512,7 +1518,7 @@ export class Converter {
);
const result = this.createNode<
- TSESTree.ClassDeclaration | TSESTree.ClassExpression
+ TSESTree.ClassDeclaration | TSESTree.ClassExpression,
>(node, {
type: classNodeType,
id: this.convertChild(node.name),
@@ -1536,17 +1542,19 @@ export class Converter {
}
if (superClass.types[0]?.typeArguments) {
- result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(
- superClass.types[0].typeArguments,
- superClass.types[0],
- );
+ result.superTypeParameters =
+ this.convertTypeArgumentsToTypeParameters(
+ superClass.types[0].typeArguments,
+ superClass.types[0],
+ );
}
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (implementsClause) {
@@ -1788,7 +1796,7 @@ export class Converter {
return this.createNode<
| TSESTree.AssignmentExpression
| TSESTree.LogicalExpression
- | TSESTree.BinaryExpression
+ | TSESTree.BinaryExpression,
>(node, {
type,
operator: getTextForTokenKind(node.operatorToken.kind),
@@ -2313,9 +2321,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -2343,9 +2352,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
const accessibility = getTSNodeAccessibility(node);
@@ -2438,7 +2448,7 @@ export class Converter {
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSCallSignatureDeclaration
| TSESTree.TSFunctionType
- | TSESTree.TSConstructorType
+ | TSESTree.TSConstructorType,
>(node, {
type: type,
params: this.convertParameters(node.parameters),
@@ -2449,9 +2459,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
@@ -2459,7 +2470,7 @@ export class Converter {
case SyntaxKind.ExpressionWithTypeArguments: {
const result = this.createNode<
- TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements
+ TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements,
>(node, {
type:
parent && parent.kind === SyntaxKind.InterfaceDeclaration
@@ -2490,9 +2501,10 @@ export class Converter {
});
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (interfaceHeritageClauses.length > 0) {
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
index e00663a1..a3f007a0 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
@@ -18,7 +18,7 @@ const log = debug('typescript-eslint:typescript-estree:createWatchProgram');
*/
const knownWatchProgramMap = new Map<
CanonicalPath,
- ts.WatchOfConfigFile<ts.BuilderProgram>
+ ts.WatchOfConfigFile<ts.BuilderProgram>,
>();
/**
@@ -27,11 +27,11 @@ const knownWatchProgramMap = new Map<
*/
const fileWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
const folderWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
/**
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
index 36ca3f80..a3758fff 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
@@ -191,7 +191,7 @@ export interface ParserWeakMap<TKey, TValueBase> {
}
export interface ParserWeakMapESTreeToTSNode<
- TKey extends TSESTree.Node = TSESTree.Node
+ TKey extends TSESTree.Node = TSESTree.Node,
> {
get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
has(key: unknown): boolean;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index 62053920..ff7aea73 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -281,5 +281,5 @@ export interface EstreeToTsNodeTypes {
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<
TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>,
// if this errors, it means that one of the AST_NODE_TYPES is not defined in the above interface
- EstreeToTsNodeTypes[T['type']]
+ EstreeToTsNodeTypes[T['type']],
>;
diff --git a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 36726ac1..9ce5ca68 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -159,9 +159,8 @@ describe('semanticInfo', () => {
const computedPropertyString = ((parseResult.ast
.body[1] as TSESTree.ClassDeclaration).body
.body[0] as TSESTree.ClassProperty).key;
- const tsComputedPropertyString = parseResult.services.esTreeNodeToTSNodeMap.get(
- computedPropertyString,
- );
+ const tsComputedPropertyString =
+ parseResult.services.esTreeNodeToTSNodeMap.get(computedPropertyString);
expect(tsComputedPropertyString.kind).toEqual(ts.SyntaxKind.StringLiteral);
});
diff --git a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
index 1b386be1..1a6a815d 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
@@ -98,7 +98,7 @@ export function omitDeep<T = UnknownObject>(
keysToOmit: { key: string; predicate: (value: unknown) => boolean }[] = [],
selectors: Record<
string,
- (node: UnknownObject, parent: UnknownObject | null) => void
+ (node: UnknownObject, parent: UnknownObject | null) => void,
> = {},
): UnknownObject {
function shouldOmit(keyName: string, val: unknown): boolean {
diff --git a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
index 68c6b806..a9ed3cdb 100644
--- a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
+++ b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
@@ -7,7 +7,7 @@ interface VisitorKeys {
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
// strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs
diff --git a/repos/typescript-eslint/tools/generate-contributors.ts b/repos/typescript-eslint/tools/generate-contributors.ts
index 38c3690c..6bb908b3 100644
--- a/repos/typescript-eslint/tools/generate-contributors.ts
+++ b/repos/typescript-eslint/tools/generate-contributors.ts
@@ -42,9 +42,8 @@ async function* fetchUsers(page = 1): AsyncIterableIterator<Contributor[]> {
const response = await fetch(`${contributorsApiUrl}&page=${page}`, {
method: 'GET',
});
- const contributors:
- | Contributor[]
- | { message: string } = await response.json();
+ const contributors: Contributor[] | { message: string } =
+ await response.json();
if (!Array.isArray(contributors)) {
throw new Error(contributors.message);
run prettier/prettier#main vs 2.2.1
prettier/prettier@main VS prettier/prettier@2.2.1
Submodule repos/babel contains modified content
Submodule repos/babel b63be94..9e2cbbc:
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/index.js b/repos/babel/packages/babel-helper-module-transforms/src/index.js
index 164462ee0..c1aff14c1 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/index.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/index.js
@@ -243,23 +243,26 @@ function buildESModuleHeader(
metadata: ModuleMetadata,
enumerable: boolean = false,
) {
- return (enumerable
- ? template.statement`
+ return (
+ enumerable
+ ? template.statement`
EXPORTS.__esModule = true;
`
- : template.statement`
+ : template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
- `)({ EXPORTS: metadata.exportName });
+ `
+ )({ EXPORTS: metadata.exportName });
}
/**
* Create a re-export initialization loop for a specific imported namespace.
*/
function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose
- ? template.statement`
+ return (
+ loose
+ ? template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -268,13 +271,13 @@ function buildNamespaceReexport(metadata, namespace, loose) {
EXPORTS[key] = NAMESPACE[key];
});
`
- : // Also skip already assigned bindings if they are strictly equal
- // to be somewhat more spec-compliant when a file has multiple
- // namespace re-exports that would cause a binding to be exported
- // multiple times. However, multiple bindings of the same name that
- // export the same primitive value are silently skipped
- // (the spec requires an "ambigous bindings" early error here).
- template.statement`
+ : // Also skip already assigned bindings if they are strictly equal
+ // to be somewhat more spec-compliant when a file has multiple
+ // namespace re-exports that would cause a binding to be exported
+ // multiple times. However, multiple bindings of the same name that
+ // export the same primitive value are silently skipped
+ // (the spec requires an "ambigous bindings" early error here).
+ template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -287,7 +290,8 @@ function buildNamespaceReexport(metadata, namespace, loose) {
},
});
});
- `)({
+ `
+ )({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName
diff --git a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d860d884e..34198840e 100644
--- a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet();
*/
function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
- const decorators = (path.isClass()
- ? [path].concat(path.get("body.body"))
- : path.get("properties")
+ const decorators = (
+ path.isClass()
+ ? [path].concat(path.get("body.body"))
+ : path.get("properties")
).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
index 12c1a20b8..046cbceda 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
@@ -170,9 +170,9 @@ export default declare((api, options, dirname) => {
const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2
- ? getCoreJS2Definitions
- : getCoreJS3Definitions)(runtimeVersion);
+ const { BuiltIns, StaticProperties, InstanceProperties } = (
+ injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions
+ )(runtimeVersion);
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
diff --git a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
index 95ca9b119..baeca41a9 100644
--- a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
+++ b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
@@ -4,7 +4,7 @@
const proposalPlugins = new Set([
"proposal-class-properties",
- "proposal-private-methods"
+ "proposal-private-methods",
]);
// use intermediary object to enforce alphabetical key order
Submodule repos/eslint-plugin-vue contains modified content
Submodule repos/eslint-plugin-vue cc9c140..7d6c055:
diff --git a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
index 02ac6e3..d15bb4c 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
Submodule repos/excalidraw 1973ae9..96b0bdf:
Submodule repos/prettier contains modified content
Submodule repos/prettier 2c1b8f6..2552d7d:
diff --git a/repos/prettier/src/language-markdown/utils.js b/repos/prettier/src/language-markdown/utils.js
index de21b4e60..4b7d2608e 100644
--- a/repos/prettier/src/language-markdown/utils.js
+++ b/repos/prettier/src/language-markdown/utils.js
@@ -51,9 +51,13 @@ function splitText(text, options) {
/** @type {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} */
const nodes = [];
- const tokens = (options.proseWrap === "preserve"
- ? text
- : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
+ const tokens = (
+ options.proseWrap === "preserve"
+ ? text
+ : text.replace(
+ new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"),
+ "$1$2"
+ )
).split(/([\t\n ]+)/);
for (const [index, token] of tokens.entries()) {
// whitespace
diff --git a/repos/prettier/website/README.md b/repos/prettier/website/README.md
index 53d5a2778..17c91ccbc 100644
--- a/repos/prettier/website/README.md
+++ b/repos/prettier/website/README.md
@@ -59,7 +59,6 @@ previous: doc0 # previous doc on sidebar for navigation
next: doc2 # next doc on the sidebar for navigation
# don’t include next if this is the last doc; don’t include previous if first doc
---
-
docs/
are published to https://prettier.io/docs/en/next/
and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from docs/
are copied to the website/versioned_docs/version-stable
directory, whose content is published to https://prettier.io/docs/en
.
@@ -73,7 +72,6 @@ title: Blog Post Title
author: Author Name
authorURL: http://github.com/author # (or some other link)-
In the blog post, you should include a line `<!--truncate-->`. This determines under which point text will be ignored when generating the preview of your blog post. Blog posts should have the file name format: `yyyy-mm-dd-your-file-name.md`.
Submodule repos/typescript-eslint contains modified content
Submodule repos/typescript-eslint 7b701a3..9a66862:
diff --git a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
index b6da50bb..4e95b731 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -19,7 +19,7 @@ export type RawRulesConfig = Record<
| {
severity?: RuleSeverity | 'warn' | 'none' | 'default';
options?: unknown;
- }
+ },
>;
export type MessageIds = 'failure';
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
index c9f03c89..2f2be15c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
@@ -13,7 +13,7 @@ type Types = Record<
| {
message: string;
fixWith?: string;
- }
+ },
>;
export type Options = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
index e0e06a67..be22b20c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -10,7 +10,7 @@ export type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
type Option = Options[0];
type NormalizedOptions = Required<
- Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>
+ Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>,
>;
const OPTION_VALUE_SCHEME = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 5d14576a..666ddc04 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -225,9 +225,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';
// we have a mixed type/value import, so we need to split them out into multiple exports
- const importNames = (isTypeImport
- ? report.valueSpecifiers
- : report.typeSpecifiers
+ const importNames = (
+ isTypeImport
+ ? report.valueSpecifiers
+ : report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);
context.report({
node: report.node,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 05c35c7a..088849f2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -248,7 +248,7 @@ type MessageIds = 'wrongIndentation';
type AppliedOptions = ExcludeKeys<
// slight hack to make interface work with Record<string, unknown>
RequireKeys<Pick<IndentConfig, keyof IndentConfig>, keyof IndentConfig>,
- AST_NODE_TYPES.VariableDeclarator
+ AST_NODE_TYPES.VariableDeclarator,
> & {
VariableDeclarator: 'off' | VariableDeclaratorObj;
};
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
* 2. Don't set any offsets against the first token of the node.
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
*/
- const offsetListeners = Object.keys(baseOffsetListeners).reduce<
- TSESLint.RuleListener
- >(
+ const offsetListeners = Object.keys(
+ baseOffsetListeners,
+ ).reduce<TSESLint.RuleListener>(
/*
* Offset listener calls are deferred until traversal is finished, and are called as
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
* ignored nodes are known.
*/
(acc, key) => {
- const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const listener = baseOffsetListeners[
+ key
+ ] as TSESLint.RuleFunction<TSESTree.Node>;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
acc[key] = node => listenerCallQueue.push({ listener, node });
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
index de5b971f..fc28832e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -123,7 +123,7 @@ export const defaultOrder = [
];
const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce<
- string[]
+ string[],
>((all, type) => {
all.push(type);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
index 2640aee6..833f8b00 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
return !wasUnderscore;
}
-const PredefinedFormatToCheckFunction: Readonly<Record<
- PredefinedFormats,
- (name: string) => boolean
->> = {
+const PredefinedFormatToCheckFunction: Readonly<
+ Record<PredefinedFormats, (name: string) => boolean>,
+> = {
[PredefinedFormats.PascalCase]: isPascalCase,
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[PredefinedFormats.camelCase]: isCamelCase,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
index fa67859f..21456319 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -73,7 +73,7 @@ export default util.createRule<Options, MessageIds>({
loc?: TSESTree.SourceLocation;
},
void,
- unknown
+ unknown,
> {
if (
options?.builtinGlobals &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 6d5036c2..030f2748 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -11,7 +11,7 @@ type MakeRequired<Base, Key extends keyof Base> = Omit<Base, Key> &
type TypeParameterWithConstraint = MakeRequired<
TSESTree.TSTypeParameter,
- 'constraint'
+ 'constraint',
>;
const is3dot5 = semver.satisfies(
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
index f49b5385..d21b088d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -134,10 +134,11 @@ export default createRule({
].join(', ')](node: TSESTree.MemberExpression): void {
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent as TSESTree.CallExpression;
- const compareNode = (callNode.parent?.type ===
- AST_NODE_TYPES.ChainExpression
- ? callNode.parent.parent
- : callNode.parent) as TSESTree.BinaryExpression;
+ const compareNode = (
+ callNode.parent?.type === AST_NODE_TYPES.ChainExpression
+ ? callNode.parent.parent
+ : callNode.parent
+ ) as TSESTree.BinaryExpression;
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index cd886a9d..0e15bf8f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -65,10 +65,12 @@ export default util.createRule({
| TSESTree.MemberExpression,
): void {
// selector guarantees this cast
- const initialExpression = (initialIdentifierOrNotEqualsExpr.parent
- ?.type === AST_NODE_TYPES.ChainExpression
- ? initialIdentifierOrNotEqualsExpr.parent.parent
- : initialIdentifierOrNotEqualsExpr.parent) as TSESTree.LogicalExpression;
+ const initialExpression = (
+ initialIdentifierOrNotEqualsExpr.parent?.type ===
+ AST_NODE_TYPES.ChainExpression
+ ? initialIdentifierOrNotEqualsExpr.parent.parent
+ : initialIdentifierOrNotEqualsExpr.parent
+ ) as TSESTree.LogicalExpression;
if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) {
// the node(identifier or member expression) is not the deepest left node
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 27eb7dca..0d4c3a7a 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -267,11 +267,11 @@ const DIRECTLY_INSIDE_CONSTRUCTOR = 0;
class ClassScope {
private readonly privateModifiableMembers = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly privateModifiableStatics = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly memberVariableModifications = new Set<string>();
private readonly staticVariableModifications = new Set<string>();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
index 99c455cd..764ca63d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
@@ -146,7 +146,7 @@ export default util.createRule({
'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(
node: Exclude<
TSESTree.Node,
- TSESTree.BlockStatement | TSESTree.AwaitExpression
+ TSESTree.BlockStatement | TSESTree.AwaitExpression,
>,
): void {
const expression = parserServices.esTreeNodeToTSNodeMap.get(node);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
index e73fd4b5..9c18d0e3 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
@@ -36,9 +36,7 @@ export default util.createRule<Options, MessageIds>({
],
create(context) {
const rules = baseRule.create(context);
- const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
/*
The following nodes are handled by the member-delimiter-style rule
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index 19aaf335..2b9150a6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -9,11 +9,11 @@ import * as util from '.';
class UnusedVarsVisitor<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> extends Visitor {
private static readonly RESULTS_CACHE = new WeakMap<
TSESTree.Program,
- ReadonlySet<TSESLint.Scope.Variable>
+ ReadonlySet<TSESLint.Scope.Variable>,
>();
readonly #scopeManager: TSESLint.Scope.ScopeManager;
@@ -32,7 +32,7 @@ class UnusedVarsVisitor<
public static collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: TSESLint.RuleContext<TMessageIds, TOptions>,
): ReadonlySet<TSESLint.Scope.Variable> {
@@ -747,7 +747,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
*/
function collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
): ReadonlySet<TSESLint.Scope.Variable> {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
index 86e0ec23..315eec9c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
@@ -18,9 +18,9 @@ const {
isObjectNotArray,
getParserServices,
} = ESLintUtils;
-type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
- T
->;
+type InferMessageIdsTypeFromRule<
+ T,
+> = ESLintUtils.InferMessageIdsTypeFromRule<T>;
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
export {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
index 2e6c4711..e7e0991b 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
@@ -91,11 +91,11 @@ function getNameFromMember(
type ExcludeKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = { [k in Exclude<keyof TObj, TKeys>]: TObj[k] };
type RequireKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = ExcludeKeys<TObj, TKeys> & { [k in TKeys]-?: Exclude<TObj[k], undefined> };
function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
index 103caeb5..d67ff887 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
@@ -137,9 +137,10 @@ describe('Validating README.md', () => {
for (const [ruleName, rule] of notDeprecated) {
describe(`Checking rule ${ruleName}`, () => {
- const ruleRow: string[] | undefined = (rule.meta.docs?.extendsBaseRule
- ? rulesTables.extension.cells
- : rulesTables.base.cells
+ const ruleRow: string[] | undefined = (
+ rule.meta.docs?.extendsBaseRule
+ ? rulesTables.extension.cells
+ : rulesTables.base.cells
).find(row => row[0].includes(`/${ruleName}.md`));
if (!ruleRow) {
// rule is in the wrong table, the first two tests will catch this, so no point in creating noise;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index 5134d591..21fca6e6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -3804,7 +3804,7 @@ class Foo {
const sortedWithoutGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + multiple types
@@ -4182,7 +4182,7 @@ const foo = class Foo {
const sortedWithoutGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + multiple types --> Only member group order is checked (default config)
@@ -4392,7 +4392,7 @@ class Foo {
const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + multiple types --> Only member group order is checked (default config)
@@ -4629,7 +4629,7 @@ const foo = class Foo {
const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + multiple types
@@ -4864,7 +4864,7 @@ interface Foo {
const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + multiple types --> Only member group order is checked (default config)
@@ -5099,7 +5099,7 @@ type Foo = {
const sortedWithGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + default order + alphabetically
@@ -5494,7 +5494,7 @@ class Foo {
const sortedWithGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + alphabetically --> Default order applies
@@ -5636,7 +5636,7 @@ class Foo {
const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + alphabetically --> Default order applies
@@ -5783,7 +5783,7 @@ const foo = class Foo {
const sortedWithGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + default order + alphabetically
@@ -5939,7 +5939,7 @@ interface Foo {
const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + alphabetically --> Default order applies
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index 93173074..eb3bec70 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -18,10 +18,9 @@ const parserOptions = {
project: './tsconfig.json',
};
-const formatTestNames: Readonly<Record<
- PredefinedFormatsString,
- Record<'valid' | 'invalid', string[]>
->> = {
+const formatTestNames: Readonly<
+ Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>,
+> = {
camelCase: {
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index 0f7bb141..dd7d8cf4 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -74,7 +74,7 @@ const validTestCases = flatten(
);
const invalidTestCases: TSESLint.InvalidTestCase<
MessageIds,
- Options
+ Options,
>[] = flatten(
testCases.map(cas =>
cas.code.map(code => ({
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
index c0934982..67b9d22c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
@@ -21,7 +21,7 @@ const ruleTester = new RuleTester({
const hasExport = /^export/m;
// const hasImport = /^import .+? from ['"]/m;
function makeExternalModule<
- T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>
+ T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>,
>(tests: T[]): T[] {
return tests.map(t => {
if (!hasExport.test(t.code)) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index 80340828..2afa8616 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -144,7 +144,7 @@ const baseCases = [
],
} as TSESLint.InvalidTestCase<
InferMessageIdsTypeFromRule<typeof rule>,
- InferOptionsTypeFromRule<typeof rule>
+ InferOptionsTypeFromRule<typeof rule>,
>),
);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index 0cef8974..aefb7cd8 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1069,13 +1069,13 @@ function addOptional<TOptions extends Readonly<unknown[]>>(
): TSESLint.ValidTestCase<TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: TSESLint.InvalidTestCase<TMessageIds, TOptions>[],
): TSESLint.InvalidTestCase<TMessageIds, TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: (Case<TMessageIds, TOptions> | string)[],
): Case<TMessageIds, TOptions>[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
index 49e48541..2c35583c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -20,7 +20,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -40,7 +40,7 @@ declare module 'eslint/lib/rules/camelcase' {
],
{
Identifier(node: TSESTree.Identifier): void;
- }
+ },
>;
export = rule;
}
@@ -136,7 +136,7 @@ declare module 'eslint/lib/rules/indent' {
JSXOpeningElement(node: TSESTree.JSXOpeningElement): void;
JSXClosingElement(node: TSESTree.JSXClosingElement): void;
JSXExpressionContainer(node: TSESTree.JSXExpressionContainer): void;
- }
+ },
>;
export = rule;
}
@@ -154,7 +154,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
{
before?: boolean;
after?: boolean;
- }
+ },
>;
},
];
@@ -215,7 +215,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
ImportNamespaceSpecifier: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
MethodDefinition: RuleFunction<TSESTree.MethodDefinition>;
Property: RuleFunction<TSESTree.Property>;
- }
+ },
>;
export = rule;
}
@@ -231,7 +231,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
ClassBody(): void;
'ClassBody:exit'(): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -245,7 +245,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -263,7 +263,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -280,7 +280,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
[],
{
Program(node: TSESTree.Program): void;
- }
+ },
>;
export = rule;
}
@@ -295,7 +295,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -318,7 +318,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -335,7 +335,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -354,7 +354,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -373,7 +373,7 @@ declare module 'eslint/lib/rules/no-shadow' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -390,7 +390,7 @@ declare module 'eslint/lib/rules/no-undef' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -415,7 +415,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -434,7 +434,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
],
{
ExpressionStatement(node: TSESTree.ExpressionStatement): void;
- }
+ },
>;
export = rule;
}
@@ -454,7 +454,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -476,7 +476,7 @@ declare module 'eslint/lib/rules/strict' {
['never' | 'global' | 'function' | 'safe'],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -489,7 +489,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
[],
{
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -542,7 +542,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
WhileStatement(node: TSESTree.WhileStatement): void;
WithStatement(node: TSESTree.WithStatement): void;
YieldExpression(node: TSESTree.YieldExpression): void;
- }
+ },
>;
export = rule;
}
@@ -572,7 +572,7 @@ declare module 'eslint/lib/rules/semi' {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -592,7 +592,7 @@ declare module 'eslint/lib/rules/quotes' {
{
Literal(node: TSESTree.Literal): void;
TemplateLiteral(node: TSESTree.TemplateLiteral): void;
- }
+ },
>;
export = rule;
}
@@ -619,7 +619,7 @@ declare module 'eslint/lib/rules/brace-style' {
SwitchStatement(node: TSESTree.SwitchStatement): void;
IfStatement(node: TSESTree.IfStatement): void;
TryStatement(node: TSESTree.TryStatement): void;
- }
+ },
>;
export = rule;
}
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
EmptyStatement(node: TSESTree.EmptyStatement): void;
ClassBody(node: TSESTree.ClassBody): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -653,7 +653,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
],
{
ClassBody(node: TSESTree.ClassBody): void;
- }
+ },
>;
export = rule;
}
@@ -671,7 +671,7 @@ declare module 'eslint/lib/rules/init-declarations' {
],
{
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -694,7 +694,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
FunctionExpression(node: TSESTree.FunctionExpression): void;
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
ThisExpression(node: TSESTree.ThisExpression): void;
- }
+ },
>;
export = rule;
}
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/dot-notation' {
],
{
MemberExpression(node: TSESTree.MemberExpression): void;
- }
+ },
>;
export = rule;
}
@@ -726,7 +726,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
[],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -759,7 +759,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
node: TSESTree.TSTypeParameterDeclaration,
): void;
TSTupleType(node: TSESTree.TSTupleType): void;
- }
+ },
>;
export = rule;
}
@@ -785,7 +785,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration?(node: TSESTree.ExportNamedDeclaration): void;
ExportAllDeclaration?(node: TSESTree.ExportAllDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -807,7 +807,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
LogicalExpression(node: TSESTree.LogicalExpression): void;
ConditionalExpression(node: TSESTree.ConditionalExpression): void;
VariableDeclarator(node: TSESTree.VariableDeclarator): void;
- }
+ },
>;
export = rule;
}
@@ -826,7 +826,7 @@ declare module 'eslint/lib/rules/prefer-const' {
{
'Program:exit'(node: TSESTree.Program): void;
VariableDeclaration(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -851,7 +851,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
ObjectExpression(node: TSESTree.ObjectExpression): void;
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
- }
+ },
>;
export = rule;
}
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
index cbf83771..e88a7314 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
@@ -47,7 +47,7 @@ const isCommentToken = eslintUtils.isCommentToken as (
token: TSESTree.Token | TSESTree.Comment,
) => token is TSESTree.Comment;
const isNotCommentToken = eslintUtils.isNotCommentToken as <
- T extends TSESTree.Token | TSESTree.Comment
+ T extends TSESTree.Token | TSESTree.Comment,
>(
token: T,
) => token is Exclude<T, TSESTree.Comment>;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
index 1fd2e752..2b1584bc 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
@@ -5,7 +5,7 @@ import { RuleCreateFunction, RuleModule } from '../ts-eslint';
*/
type InferOptionsTypeFromRule<T> = T extends RuleModule<
infer _TMessageIds,
- infer TOptions
+ infer TOptions,
>
? TOptions
: T extends RuleCreateFunction<infer _TMessageIds, infer TOptions>
@@ -17,7 +17,7 @@ type InferOptionsTypeFromRule<T> = T extends RuleModule<
*/
type InferMessageIdsTypeFromRule<T> = T extends RuleModule<
infer TMessageIds,
- infer _TOptions
+ infer _TOptions,
>
? TMessageIds
: T extends RuleCreateFunction<infer TMessageIds, infer _TOptions>
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
index ca1cfb33..f02b7589 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
@@ -19,7 +19,7 @@ function RuleCreator(urlCreator: (ruleName: string) => string) {
return function createRule<
TOptions extends readonly unknown[],
TMessageIds extends string,
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>({
name,
meta,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
index 6ed25e4a..29a56671 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
@@ -24,13 +24,13 @@ function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(
*/
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
test: InvalidTestCase<TMessageIds, TOptions>,
): InvalidTestCase<TMessageIds, TOptions>[];
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
options: ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>,
): (ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>)[] {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
index 925d4976..27ad5792 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
@@ -9,7 +9,7 @@ const ERROR_MESSAGE =
*/
function getParserServices<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
allowWithoutFullTypeInformation = false,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
index fec56c17..dfcc2347 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
@@ -71,7 +71,7 @@ declare class CLIEngineBase {
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
////////////////////
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
index 9abefbab..ec79326d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
@@ -38,7 +38,7 @@ declare class LinterBase {
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(
rulesToDefine: Record<
string,
- RuleModule<TMessageIds, TOptions> | RuleCreateFunction
+ RuleModule<TMessageIds, TOptions> | RuleCreateFunction,
>,
): void;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
index 8ced374d..e9502e0b 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -115,9 +115,9 @@ interface RuleFixer {
type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
-type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
- TMessageIds
->[];
+type ReportSuggestionArray<
+ TMessageIds extends string,
+> = ReportDescriptorBase<TMessageIds>[];
interface ReportDescriptorBase<TMessageIds extends string> {
/**
@@ -163,13 +163,13 @@ interface ReportDescriptorLocOnly {
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
}
type ReportDescriptor<
- TMessageIds extends string
+ TMessageIds extends string,
> = ReportDescriptorWithSuggestion<TMessageIds> &
(ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
interface RuleContext<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> {
/**
* The rule ID.
@@ -328,29 +328,21 @@ interface RuleListener {
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
- TSAbstractMethodDefinition?: RuleFunction<
- TSESTree.TSAbstractMethodDefinition
- >;
+ TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
- TSCallSignatureDeclaration?: RuleFunction<
- TSESTree.TSCallSignatureDeclaration
- >;
+ TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
- TSConstructSignatureDeclaration?: RuleFunction<
- TSESTree.TSConstructSignatureDeclaration
- >;
+ TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
- TSEmptyBodyFunctionExpression?: RuleFunction<
- TSESTree.TSEmptyBodyFunctionExpression
- >;
+ TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +363,7 @@ interface RuleListener {
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
- TSNamespaceExportDeclaration?: RuleFunction<
- TSESTree.TSNamespaceExportDeclaration
- >;
+ TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +390,8 @@ interface RuleListener {
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
- TSTypeParameterDeclaration?: RuleFunction<
- TSESTree.TSTypeParameterDeclaration
- >;
- TSTypeParameterInstantiation?: RuleFunction<
- TSESTree.TSTypeParameterInstantiation
- >;
+ TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
+ TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
@@ -426,7 +412,7 @@ interface RuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> {
/**
* Metadata about the rule
@@ -444,7 +430,7 @@ type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
export {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
index 652567f6..e237586d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
@@ -59,7 +59,7 @@ interface SuggestionOutput<TMessageIds extends string> {
interface InvalidTestCase<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> extends ValidTestCase<TOptions> {
/**
* Expected errors.
@@ -111,7 +111,7 @@ interface TestCaseError<TMessageIds extends string> {
interface RunTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> {
// RuleTester.run also accepts strings for valid cases
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
index 1bfb569e..654b27bf 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
@@ -6,7 +6,7 @@ class CatchClauseDefinition extends DefinitionBase<
DefinitionType.CatchClause,
TSESTree.CatchClause,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']) {
super(DefinitionType.CatchClause, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
index 5d587b34..9279dd8b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
@@ -6,7 +6,7 @@ class ClassNameDefinition extends DefinitionBase<
DefinitionType.ClassName,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']) {
super(DefinitionType.ClassName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
index ed25a722..7147ebc6 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
@@ -8,7 +8,7 @@ abstract class DefinitionBase<
TType extends DefinitionType,
TNode extends TSESTree.Node,
TParent extends TSESTree.Node | null,
- TName extends TSESTree.Node = TSESTree.BindingName
+ TName extends TSESTree.Node = TSESTree.BindingName,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
index b4cf2405..80e83b7c 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
@@ -9,7 +9,7 @@ class FunctionNameDefinition extends DefinitionBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']) {
super(DefinitionType.FunctionName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
index 43012c0f..67cfbf3b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
@@ -6,7 +6,7 @@ class ImplicitGlobalVariableDefinition extends DefinitionBase<
DefinitionType.ImplicitGlobalVariable,
TSESTree.Node,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(
name: TSESTree.BindingName,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
index 874edadf..d4f11607 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
@@ -9,7 +9,7 @@ class ImportBindingDefinition extends DefinitionBase<
| TSESTree.ImportNamespaceSpecifier
| TSESTree.TSImportEqualsDeclaration,
TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
@@ -20,7 +20,7 @@ class ImportBindingDefinition extends DefinitionBase<
name: TSESTree.Identifier,
node: Exclude<
ImportBindingDefinition['node'],
- TSESTree.TSImportEqualsDeclaration
+ TSESTree.TSImportEqualsDeclaration,
>,
decl: TSESTree.ImportDeclaration,
);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
index b0c0ea32..fb73b081 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
@@ -15,7 +15,7 @@ class ParameterDefinition extends DefinitionBase<
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
/**
* Whether the parameter definition is a part of a rest parameter.
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
index cff6bbaa..3670d070 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumMemberDefinition extends DefinitionBase<
DefinitionType.TSEnumMember,
TSESTree.TSEnumMember,
null,
- TSESTree.Identifier | TSESTree.StringLiteral
+ TSESTree.Identifier | TSESTree.StringLiteral,
> {
constructor(
name: TSESTree.Identifier | TSESTree.StringLiteral,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
index 5374a562..36d74cb8 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumNameDefinition extends DefinitionBase<
DefinitionType.TSEnumName,
TSESTree.TSEnumDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']) {
super(DefinitionType.TSEnumName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
index 98f90778..5b0c0a75 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
@@ -6,7 +6,7 @@ class TSModuleNameDefinition extends DefinitionBase<
DefinitionType.TSModuleName,
TSESTree.TSModuleDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']) {
super(DefinitionType.TSModuleName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
index ad3b4368..45a61e12 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
@@ -8,7 +8,7 @@ class TypeDefinition extends DefinitionBase<
| TSESTree.TSTypeAliasDeclaration
| TSESTree.TSTypeParameter,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']) {
super(DefinitionType.Type, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
index 975c5886..4ab2ca18 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
@@ -6,7 +6,7 @@ class VariableDefinition extends DefinitionBase<
DefinitionType.Variable,
TSESTree.VariableDeclarator,
TSESTree.VariableDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
index 90cd98bb..dc8ed7a3 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
@@ -6,5 +6,5 @@ import { ImplicitLibVariableOptions } from '../variable';
export const webworker_importscripts = {} as Record<
string,
- ImplicitLibVariableOptions
+ ImplicitLibVariableOptions,
>;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
index 95904428..2a741d28 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class BlockScope extends ScopeBase<
ScopeType.block,
TSESTree.BlockStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
index 46b4005f..e6b5f95f 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class CatchScope extends ScopeBase<
ScopeType.catch,
TSESTree.CatchClause,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
index ee28a31a..e0ae2613 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ClassScope extends ScopeBase<
ScopeType.class,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
index c20f1217..c0d88231 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ConditionalTypeScope extends ScopeBase<
ScopeType.conditionalType,
TSESTree.TSConditionalType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
index 36703b5d..b7f25494 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ForScope extends ScopeBase<
ScopeType.for,
TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
index a84bc4b2..b1731c9d 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class FunctionExpressionNameScope extends ScopeBase<
ScopeType.functionExpressionName,
TSESTree.FunctionExpression,
- Scope
+ Scope,
> {
public readonly functionExpressionScope: true;
constructor(
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
index 18e12321..6c362639 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
@@ -14,7 +14,7 @@ class FunctionScope extends ScopeBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.Program,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
index d459070c..d3cc8c5b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -11,7 +11,7 @@ class FunctionTypeScope extends ScopeBase<
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
index 3da909c1..87b727fc 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
@@ -18,7 +18,7 @@ class GlobalScope extends ScopeBase<
/**
* The global scope has no parent.
*/
- null
+ null,
> {
// note this is accessed in used in the legacy eslint-scope tests, so it can't be true private
private readonly implicit: {
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
index 9b5c2a05..c9729031 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class MappedTypeScope extends ScopeBase<
ScopeType.mappedType,
TSESTree.TSMappedType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a..90e2c0fb 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
@@ -137,7 +137,7 @@ type AnyScope = ScopeBase<ScopeType, TSESTree.Node, Scope | null>;
abstract class ScopeBase<
TType extends ScopeType,
TBlock extends TSESTree.Node,
- TUpper extends Scope | null
+ TUpper extends Scope | null,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
index 7a684564..f18a1aae 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class SwitchScope extends ScopeBase<
ScopeType.switch,
TSESTree.SwitchStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
index 3962784a..ed79b3a9 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSEnumScope extends ScopeBase<
ScopeType.tsEnum,
TSESTree.TSEnumDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
index bdc7c7dc..3ca626f1 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSModuleScope extends ScopeBase<
ScopeType.tsModule,
TSESTree.TSModuleDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
index 7f21a60f..37c9cf78 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TypeScope extends ScopeBase<
ScopeType.type,
TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
index 84a3e4c7..b50fe2ba 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class WithScope extends ScopeBase<
ScopeType.with,
TSESTree.WithStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
index 69833caa..5255ed02 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
@@ -36,7 +36,7 @@ const QUOTED_STRING = /^["'](.+?)['"]$/;
type ALLOWED_VALUE = ['number' | 'boolean' | 'string', Set<unknown>?];
const ALLOWED_OPTIONS: Map<string, ALLOWED_VALUE> = new Map<
keyof AnalyzeOptions,
- ALLOWED_VALUE
+ ALLOWED_VALUE,
>([
['ecmaVersion', ['number']],
['globalReturn', ['boolean']],
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
index d20ab14f..8f04f4a8 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
@@ -3,11 +3,11 @@ import { simpleTraverse } from '@typescript-eslint/typescript-estree';
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(ast: TSESTree.Node, selector: TSelector): TNode;
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(
ast: TSESTree.Node,
selector: TSelector,
@@ -16,7 +16,7 @@ function getSpecificNode<
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
TNode extends Extract<TSESTree.Node, { type: TSelector }>,
- TReturnType extends TSESTree.Node
+ TReturnType extends TSESTree.Node,
>(
ast: TSESTree.Node,
selector: TSelector,
diff --git a/repos/typescript-eslint/packages/types/src/ts-estree.ts b/repos/typescript-eslint/packages/types/src/ts-estree.ts
index 4dd89c96..a17252d8 100644
--- a/repos/typescript-eslint/packages/types/src/ts-estree.ts
+++ b/repos/typescript-eslint/packages/types/src/ts-estree.ts
@@ -130,7 +130,7 @@ export type Token =
export type OptionalRangeAndLoc<T> = Pick<
T,
- Exclude<keyof T, 'range' | 'loc'>
+ Exclude<keyof T, 'range' | 'loc'>,
> & {
range?: Range;
loc?: SourceLocation;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
index a22eae1a..90f50b19 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
@@ -821,7 +821,7 @@ export class Converter {
const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node);
const result = this.createNode<
- TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration
+ TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration,
>(node, {
type:
isDeclare || !node.body
@@ -1002,7 +1002,7 @@ export class Converter {
case SyntaxKind.PropertyDeclaration: {
const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty
+ TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty,
>(node, {
type: isAbstract
? AST_NODE_TYPES.TSAbstractClassProperty
@@ -1050,7 +1050,7 @@ export class Converter {
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration: {
const method = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1112,7 +1112,7 @@ export class Converter {
: AST_NODE_TYPES.MethodDefinition;
result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
@@ -1161,7 +1161,7 @@ export class Converter {
node.getFirstToken()!;
const constructor = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1196,7 +1196,7 @@ export class Converter {
const isStatic = hasModifier(SyntaxKind.StaticKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: hasModifier(SyntaxKind.AbstractKeyword, node)
? AST_NODE_TYPES.TSAbstractMethodDefinition
@@ -1512,7 +1512,7 @@ export class Converter {
);
const result = this.createNode<
- TSESTree.ClassDeclaration | TSESTree.ClassExpression
+ TSESTree.ClassDeclaration | TSESTree.ClassExpression,
>(node, {
type: classNodeType,
id: this.convertChild(node.name),
@@ -1788,7 +1788,7 @@ export class Converter {
return this.createNode<
| TSESTree.AssignmentExpression
| TSESTree.LogicalExpression
- | TSESTree.BinaryExpression
+ | TSESTree.BinaryExpression,
>(node, {
type,
operator: getTextForTokenKind(node.operatorToken.kind),
@@ -2438,7 +2438,7 @@ export class Converter {
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSCallSignatureDeclaration
| TSESTree.TSFunctionType
- | TSESTree.TSConstructorType
+ | TSESTree.TSConstructorType,
>(node, {
type: type,
params: this.convertParameters(node.parameters),
@@ -2459,7 +2459,7 @@ export class Converter {
case SyntaxKind.ExpressionWithTypeArguments: {
const result = this.createNode<
- TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements
+ TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements,
>(node, {
type:
parent && parent.kind === SyntaxKind.InterfaceDeclaration
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
index e00663a1..a3f007a0 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
@@ -18,7 +18,7 @@ const log = debug('typescript-eslint:typescript-estree:createWatchProgram');
*/
const knownWatchProgramMap = new Map<
CanonicalPath,
- ts.WatchOfConfigFile<ts.BuilderProgram>
+ ts.WatchOfConfigFile<ts.BuilderProgram>,
>();
/**
@@ -27,11 +27,11 @@ const knownWatchProgramMap = new Map<
*/
const fileWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
const folderWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
/**
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
index 36ca3f80..a3758fff 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
@@ -191,7 +191,7 @@ export interface ParserWeakMap<TKey, TValueBase> {
}
export interface ParserWeakMapESTreeToTSNode<
- TKey extends TSESTree.Node = TSESTree.Node
+ TKey extends TSESTree.Node = TSESTree.Node,
> {
get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
has(key: unknown): boolean;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index 62053920..ff7aea73 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -281,5 +281,5 @@ export interface EstreeToTsNodeTypes {
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<
TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>,
// if this errors, it means that one of the AST_NODE_TYPES is not defined in the above interface
- EstreeToTsNodeTypes[T['type']]
+ EstreeToTsNodeTypes[T['type']],
>;
diff --git a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
index 1b386be1..1a6a815d 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
@@ -98,7 +98,7 @@ export function omitDeep<T = UnknownObject>(
keysToOmit: { key: string; predicate: (value: unknown) => boolean }[] = [],
selectors: Record<
string,
- (node: UnknownObject, parent: UnknownObject | null) => void
+ (node: UnknownObject, parent: UnknownObject | null) => void,
> = {},
): UnknownObject {
function shouldOmit(keyName: string, val: unknown): boolean {
diff --git a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
index 68c6b806..a9ed3cdb 100644
--- a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
+++ b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
@@ -7,7 +7,7 @@ interface VisitorKeys {
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
// strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs
run #10222
prettier/prettier#10222 VS prettier/prettier@main
Submodule repos/babel contains modified content
Submodule repos/babel b63be94..9f7dadf:
diff --git a/repos/babel/packages/babel-core/src/config/config-chain.js b/repos/babel/packages/babel-core/src/config/config-chain.js
index 350111a1a..6e586eeaf 100644
--- a/repos/babel/packages/babel-core/src/config/config-chain.js
+++ b/repos/babel/packages/babel-core/src/config/config-chain.js
@@ -76,17 +76,15 @@ export function* buildPresetChain(
};
}
-export const buildPresetChainWalker: (
- arg: PresetInstance,
- context: *,
-) => * = makeChainWalker({
- root: preset => loadPresetDescriptors(preset),
- env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
- overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
- overridesEnv: (preset, index, envName) =>
- loadPresetOverridesEnvDescriptors(preset)(index)(envName),
- createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
-});
+export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * =
+ makeChainWalker({
+ root: preset => loadPresetDescriptors(preset),
+ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
+ overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
+ overridesEnv: (preset, index, envName) =>
+ loadPresetOverridesEnvDescriptors(preset)(index)(envName),
+ createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
+ });
const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>
buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),
);
@@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
function dedupDescriptors(
items: Array<UnloadedDescriptor>,
): Array<UnloadedDescriptor> {
- const map: Map<
- Function,
- Map<string | void, { value: UnloadedDescriptor }>,
- > = new Map();
+ const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
+ new Map();
const descriptors = [];
diff --git a/repos/babel/packages/babel-core/src/config/files/plugins.js b/repos/babel/packages/babel-core/src/config/files/plugins.js
index 298843e2d..fde98cfd3 100644
--- a/repos/babel/packages/babel-core/src/config/files/plugins.js
+++ b/repos/babel/packages/babel-core/src/config/files/plugins.js
@@ -14,8 +14,10 @@ const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
-const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
-const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PLUGIN_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PRESET_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
export function resolvePlugin(name: string, dirname: string): string | null {
diff --git a/repos/babel/packages/babel-core/src/config/validation/options.js b/repos/babel/packages/babel-core/src/config/validation/options.js
index 27caf3bcc..529d6606d 100644
--- a/repos/babel/packages/babel-core/src/config/validation/options.js
+++ b/repos/babel/packages/babel-core/src/config/validation/options.js
@@ -369,10 +369,8 @@ function throwUnknownError(loc: OptionPath) {
const key = loc.name;
if (removed[key]) {
- const {
- message,
- version = 5,
- }: { message: string, version?: number } = removed[key];
+ const { message, version = 5 }: { message: string, version?: number } =
+ removed[key];
throw new Error(
`Using removed Babel ${version} option: ${msg(loc)} - ${message}`,
diff --git a/repos/babel/packages/babel-core/src/transformation/normalize-file.js b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
index aca84e1e4..8734534cc 100644
--- a/repos/babel/packages/babel-core/src/transformation/normalize-file.js
+++ b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
@@ -98,8 +98,10 @@ export default function* normalizeFile(
// but without // or /* at the beginning of the comment.
// eslint-disable-next-line max-len
-const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
-const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
+const INLINE_SOURCEMAP_REGEX =
+ /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
+const EXTERNAL_SOURCEMAP_REGEX =
+ /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
function extractCommentsFromList(regex, comments, lastComment) {
if (comments) {
diff --git a/repos/babel/packages/babel-core/test/api.js b/repos/babel/packages/babel-core/test/api.js
index d715b6386..a8aed41cc 100644
--- a/repos/babel/packages/babel-core/test/api.js
+++ b/repos/babel/packages/babel-core/test/api.js
@@ -308,9 +308,8 @@ describe("api", function () {
new Plugin({
visitor: {
Function: function (path) {
- const alias = path.scope
- .getProgramParent()
- .path.get("body")[0].node;
+ const alias =
+ path.scope.getProgramParent().path.get("body")[0].node;
if (!babel.types.isTypeAlias(alias)) return;
// In case of `passPerPreset` being `false`, the
diff --git a/repos/babel/packages/babel-core/test/config-chain.js b/repos/babel/packages/babel-core/test/config-chain.js
index 8de2bc99d..4b3c1d10b 100644
--- a/repos/babel/packages/babel-core/test/config-chain.js
+++ b/repos/babel/packages/babel-core/test/config-chain.js
@@ -94,7 +94,8 @@ async function loadOptionsAsyncInSpawedProcess({ filename, cwd }) {
},
);
- const EXPERIMENTAL_WARNING = /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
+ const EXPERIMENTAL_WARNING =
+ /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) {
throw new Error(
diff --git a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
index aca3cfa75..08fb1f6e0 100644
--- a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -200,14 +200,8 @@ const privateNameHandlerSpec = {
get(member) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- methodId,
- getId,
- setId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, methodId, getId, setId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
@@ -264,13 +258,8 @@ const privateNameHandlerSpec = {
set(member, value) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- setId,
- getId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, setId, getId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/index.js b/repos/babel/packages/babel-helper-module-transforms/src/index.js
index 164462ee0..77b6845c0 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/index.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/index.js
@@ -214,10 +214,8 @@ const buildReexportsFromMeta = (
true,
);
} else {
- NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(
- t.cloneNode(namespace),
- t.identifier(importName),
- );
+ NAMESPACE_IMPORT = NAMESPACE_IMPORT =
+ t.memberExpression(t.cloneNode(namespace), t.identifier(importName));
}
const astNodes = {
EXPORTS: meta.exportName,
@@ -243,23 +241,26 @@ function buildESModuleHeader(
metadata: ModuleMetadata,
enumerable: boolean = false,
) {
- return (enumerable
- ? template.statement`
+ return (
+ enumerable
+ ? template.statement`
EXPORTS.__esModule = true;
`
- : template.statement`
+ : template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
- `)({ EXPORTS: metadata.exportName });
+ `
+ )({ EXPORTS: metadata.exportName });
}
/**
* Create a re-export initialization loop for a specific imported namespace.
*/
function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose
- ? template.statement`
+ return (
+ loose
+ ? template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -268,13 +269,13 @@ function buildNamespaceReexport(metadata, namespace, loose) {
EXPORTS[key] = NAMESPACE[key];
});
`
- : // Also skip already assigned bindings if they are strictly equal
- // to be somewhat more spec-compliant when a file has multiple
- // namespace re-exports that would cause a binding to be exported
- // multiple times. However, multiple bindings of the same name that
- // export the same primitive value are silently skipped
- // (the spec requires an "ambigous bindings" early error here).
- template.statement`
+ : // Also skip already assigned bindings if they are strictly equal
+ // to be somewhat more spec-compliant when a file has multiple
+ // namespace re-exports that would cause a binding to be exported
+ // multiple times. However, multiple bindings of the same name that
+ // export the same primitive value are silently skipped
+ // (the spec requires an "ambigous bindings" early error here).
+ template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -287,7 +288,8 @@ function buildNamespaceReexport(metadata, namespace, loose) {
},
});
});
- `)({
+ `
+ )({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
index 4f31fd926..706d84efc 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
@@ -165,13 +165,8 @@ const buildImportThrow = localName => {
const rewriteReferencesVisitor = {
ReferencedIdentifier(path) {
- const {
- seen,
- buildImportReference,
- scope,
- imported,
- requeueInParent,
- } = this;
+ const { seen, buildImportReference, scope, imported, requeueInParent } =
+ this;
if (seen.has(path.node)) return;
seen.add(path.node);
diff --git a/repos/babel/packages/babel-parser/src/parser/statement.js b/repos/babel/packages/babel-parser/src/parser/statement.js
index 5827e5154..a1b0e5824 100644
--- a/repos/babel/packages/babel-parser/src/parser/statement.js
+++ b/repos/babel/packages/babel-parser/src/parser/statement.js
@@ -316,9 +316,8 @@ export default class StatementParser extends ExpressionParser {
}
takeDecorators(node: N.HasDecorators): void {
- const decorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const decorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (decorators.length) {
node.decorators = decorators;
this.resetStartLocationFromNode(node, decorators[0]);
@@ -331,9 +330,8 @@ export default class StatementParser extends ExpressionParser {
}
parseDecorators(allowExport?: boolean): void {
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
while (this.match(tt.at)) {
const decorator = this.parseDecorator();
currentContextDecorators.push(decorator);
@@ -2010,9 +2008,8 @@ export default class StatementParser extends ExpressionParser {
}
}
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
// If node.declaration is a class, it will take all decorators in the current context.
// Thus we should throw if we see non-empty decorators here.
if (currentContextDecorators.length) {
diff --git a/repos/babel/packages/babel-parser/src/plugins/flow.js b/repos/babel/packages/babel-parser/src/plugins/flow.js
index 0e00291fc..db810370f 100644
--- a/repos/babel/packages/babel-parser/src/plugins/flow.js
+++ b/repos/babel/packages/babel-parser/src/plugins/flow.js
@@ -2962,7 +2962,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.callee = base;
const result = this.tryParse(() => {
- node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ node.typeArguments =
+ this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
if (subscriptState.optionalChainMember) node.optional = false;
diff --git a/repos/babel/packages/babel-parser/src/tokenizer/context.js b/repos/babel/packages/babel-parser/src/tokenizer/context.js
index 5581e6b05..942f83b82 100644
--- a/repos/babel/packages/babel-parser/src/tokenizer/context.js
+++ b/repos/babel/packages/babel-parser/src/tokenizer/context.js
@@ -49,19 +49,23 @@ export const types: {
// When `=>` is eaten, the context update of `yield` is executed, however,
// `this.prodParam` still has `[Yield]` production because it is not yet updated
-tt.parenR.updateContext = tt.braceR.updateContext = function () {
- if (this.state.context.length === 1) {
- this.state.exprAllowed = true;
- return;
- }
+tt.parenR.updateContext = tt.braceR.updateContext =
+ function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
- let out = this.state.context.pop();
- if (out === types.braceStatement && this.curContext().token === "function") {
- out = this.state.context.pop();
- }
+ let out = this.state.context.pop();
+ if (
+ out === types.braceStatement &&
+ this.curContext().token === "function"
+ ) {
+ out = this.state.context.pop();
+ }
- this.state.exprAllowed = !out.isExpr;
-};
+ this.state.exprAllowed = !out.isExpr;
+ };
tt.name.updateContext = function (prevType) {
let allowed = false;
@@ -110,24 +114,25 @@ tt.incDec.updateContext = function () {
// tokExprAllowed stays unchanged
};
-tt._function.updateContext = tt._class.updateContext = function (prevType) {
- if (
- prevType.beforeExpr &&
- prevType !== tt.semi &&
- prevType !== tt._else &&
- !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
- !(
- (prevType === tt.colon || prevType === tt.braceL) &&
- this.curContext() === types.b_stat
- )
- ) {
- this.state.context.push(types.functionExpression);
- } else {
- this.state.context.push(types.functionStatement);
- }
+tt._function.updateContext = tt._class.updateContext =
+ function (prevType) {
+ if (
+ prevType.beforeExpr &&
+ prevType !== tt.semi &&
+ prevType !== tt._else &&
+ !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
+ !(
+ (prevType === tt.colon || prevType === tt.braceL) &&
+ this.curContext() === types.b_stat
+ )
+ ) {
+ this.state.context.push(types.functionExpression);
+ } else {
+ this.state.context.push(types.functionStatement);
+ }
- this.state.exprAllowed = false;
-};
+ this.state.exprAllowed = false;
+ };
tt.backQuote.updateContext = function () {
if (this.curContext() === types.template) {
diff --git a/repos/babel/packages/babel-parser/src/types.js b/repos/babel/packages/babel-parser/src/types.js
index d5a28729d..b75520a79 100644
--- a/repos/babel/packages/babel-parser/src/types.js
+++ b/repos/babel/packages/babel-parser/src/types.js
@@ -1137,9 +1137,10 @@ export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & {
typeAnnotation: ?TsTypeAnnotation,
};
-export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & {
- typeParameters: ?TsTypeParameterDeclaration,
-};
+export type TsSignatureDeclarationBase =
+ TsSignatureDeclarationOrIndexSignatureBase & {
+ typeParameters: ?TsTypeParameterDeclaration,
+ };
// ================
// TypeScript type members (for type literal / interface / class)
diff --git a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d860d884e..e19a77552 100644
--- a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet();
*/
function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
- const decorators = (path.isClass()
- ? [path].concat(path.get("body.body"))
- : path.get("properties")
+ const decorators = (
+ path.isClass()
+ ? [path].concat(path.get("body.body"))
+ : path.get("properties")
).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(
@@ -47,9 +48,8 @@ function applyEnsureOrdering(path) {
identDecorators
.map(decorator => {
const expression = decorator.expression;
- const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(
- "dec",
- ));
+ const id = (decorator.expression =
+ path.scope.generateDeclaredUidIdentifier("dec"));
return t.assignmentExpression("=", id, expression);
})
.concat([path.node]),
diff --git a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
index e1f9b7d51..387e2634c 100644
--- a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
+++ b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
@@ -357,11 +357,8 @@ export default declare((api, opts) => {
path.isObjectPattern(),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(objectPatternPath, file, ref);
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(objectPatternPath, file, ref);
if (loose) {
removeUnusedExcludedKeys(objectPatternPath);
@@ -440,11 +437,8 @@ export default declare((api, opts) => {
]),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(leftPath, file, t.identifier(refName));
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(leftPath, file, t.identifier(refName));
if (impureComputedPropertyDeclarators.length > 0) {
nodes.push(
diff --git a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
index cca55d21b..47dbd1ed3 100644
--- a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
@@ -4,11 +4,8 @@ import { types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);
- const {
- loose = false,
- useBuiltIns = false,
- allowArrayLike = false,
- } = options;
+ const { loose = false, useBuiltIns = false, allowArrayLike = false } =
+ options;
if (typeof loose !== "boolean") {
throw new Error(`.loose must be a boolean or undefined`);
@@ -296,10 +293,11 @@ export default declare((api, options) => {
const name = this.scope.generateUidIdentifierBasedOnNode(key);
this.nodes.push(this.buildVariableDeclaration(name, key));
if (!copiedPattern) {
- copiedPattern = pattern = {
- ...pattern,
- properties: pattern.properties.slice(),
- };
+ copiedPattern = pattern =
+ {
+ ...pattern,
+ properties: pattern.properties.slice(),
+ };
}
copiedPattern.properties[i] = {
...copiedPattern.properties[i],
diff --git a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
index 4608a225a..60989c943 100644
--- a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
+++ b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
@@ -37,8 +37,8 @@ const iifeVisitor = {
}
},
// type annotations don't use or introduce "real" bindings
- "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": path =>
- path.skip(),
+ "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration":
+ path => path.skip(),
};
// last 2 parameters are optional -- they are used by proposal-object-rest-spread/src/index.js
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
index 1cdbf6491..2d944d58c 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
@@ -10,8 +10,10 @@ const t = require("@babel/types");
const transformRuntime = require("../");
const runtimeVersion = require("@babel/runtime/package.json").version;
-const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default();
-const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default();
+const corejs2Definitions =
+ require("../lib/runtime-corejs2-definitions").default();
+const corejs3Definitions =
+ require("../lib/runtime-corejs3-definitions").default();
function outputFile(filePath, data) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
index 12c1a20b8..046cbceda 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
@@ -170,9 +170,9 @@ export default declare((api, options, dirname) => {
const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2
- ? getCoreJS2Definitions
- : getCoreJS3Definitions)(runtimeVersion);
+ const { BuiltIns, StaticProperties, InstanceProperties } = (
+ injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions
+ )(runtimeVersion);
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
diff --git a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
index 95ca9b119..baeca41a9 100644
--- a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
+++ b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
@@ -4,7 +4,7 @@
const proposalPlugins = new Set([
"proposal-class-properties",
- "proposal-private-methods"
+ "proposal-private-methods",
]);
// use intermediary object to enforce alphabetical key order
diff --git a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
index 0cd423af1..37370a9b6 100644
--- a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
+++ b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
@@ -39,13 +39,14 @@ const corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)
return memo;
}, {});
-const corejs3PolyfillsWithShippedProposals = (corejs3ShippedProposalsList: string[]).reduce(
- (memo, key) => {
- memo[key] = corejs3Polyfills[key];
- return memo;
- },
- { ...corejs3PolyfillsWithoutProposals },
-);
+const corejs3PolyfillsWithShippedProposals =
+ (corejs3ShippedProposalsList: string[]).reduce(
+ (memo, key) => {
+ memo[key] = corejs3Polyfills[key];
+ return memo;
+ },
+ { ...corejs3PolyfillsWithoutProposals },
+ );
export default function (
_: any,
diff --git a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
index ea0cd6950..1b9d8c7db 100644
--- a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
@@ -1,7 +1,7 @@
"use strict";
-const getOptionSpecificExcludesFor = require("../lib/get-option-specific-excludes")
- .default;
+const getOptionSpecificExcludesFor =
+ require("../lib/get-option-specific-excludes").default;
describe("defaults", () => {
describe("getOptionSpecificExcludesFor", () => {
diff --git a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
index 1958a7fa6..9b3541292 100644
--- a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
@@ -1,17 +1,16 @@
"use strict";
-const getCoreJS2PlatformSpecificDefaultFor = require("../lib/polyfills/corejs2/get-platform-specific-default")
- .default;
+const getCoreJS2PlatformSpecificDefaultFor =
+ require("../lib/polyfills/corejs2/get-platform-specific-default").default;
describe("defaults", () => {
describe("getCoreJS2PlatformSpecificDefaultFor", () => {
it("should return web polyfills for non-`node` platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
chrome: "63",
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toEqual([
"web.timers",
"web.immediate",
@@ -20,11 +19,10 @@ describe("defaults", () => {
});
it("shouldn't return web polyfills for node platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toBeNull();
});
});
diff --git a/repos/babel/packages/babel-preset-env/test/index.spec.js b/repos/babel/packages/babel-preset-env/test/index.spec.js
index 291bb26c7..e6a2d00c6 100644
--- a/repos/babel/packages/babel-preset-env/test/index.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/index.spec.js
@@ -1,18 +1,18 @@
"use strict";
const babelPresetEnv = require("../lib/index");
-const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin")
- .default;
-const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin")
- .default;
-const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin")
- .default;
-const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin")
- .default;
-const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin")
- .default;
-const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin")
- .default;
+const addCoreJS2UsagePlugin =
+ require("../lib/polyfills/corejs2/usage-plugin").default;
+const addCoreJS3UsagePlugin =
+ require("../lib/polyfills/corejs3/usage-plugin").default;
+const addRegeneratorUsagePlugin =
+ require("../lib/polyfills/regenerator/usage-plugin").default;
+const replaceCoreJS2EntryPlugin =
+ require("../lib/polyfills/corejs2/entry-plugin").default;
+const replaceCoreJS3EntryPlugin =
+ require("../lib/polyfills/corejs3/entry-plugin").default;
+const removeRegeneratorEntryPlugin =
+ require("../lib/polyfills/regenerator/entry-plugin").default;
const transformations = require("../lib/module-transformations").default;
const compatData = require("@babel/compat-data/plugins");
diff --git a/repos/babel/packages/babel-register/src/index.js b/repos/babel/packages/babel-register/src/index.js
index aea88df53..d9fefa1c4 100644
--- a/repos/babel/packages/babel-register/src/index.js
+++ b/repos/babel/packages/babel-register/src/index.js
@@ -4,9 +4,10 @@
* from a compiled Babel import.
*/
-exports = module.exports = function (...args) {
- return register(...args);
-};
+exports = module.exports =
+ function (...args) {
+ return register(...args);
+ };
exports.__esModule = true;
const node = require("./nodeWrapper");
diff --git a/repos/babel/packages/babel-standalone/src/generated/plugins.js b/repos/babel/packages/babel-standalone/src/generated/plugins.js
index 889f6a494..01a0ae395 100644
--- a/repos/babel/packages/babel-standalone/src/generated/plugins.js
+++ b/repos/babel/packages/babel-standalone/src/generated/plugins.js
@@ -259,7 +259,8 @@ export const all = {
"transform-new-target": transformNewTarget,
"transform-object-assign": transformObjectAssign,
"transform-object-super": transformObjectSuper,
- "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign,
+ "transform-object-set-prototype-of-to-assign":
+ transformObjectSetPrototypeOfToAssign,
"transform-parameters": transformParameters,
"transform-property-literals": transformPropertyLiterals,
"transform-property-mutators": transformPropertyMutators,
diff --git a/repos/babel/packages/babel-template/test/index.js b/repos/babel/packages/babel-template/test/index.js
index 7b893d7e4..63b821b0d 100644
--- a/repos/babel/packages/babel-template/test/index.js
+++ b/repos/babel/packages/babel-template/test/index.js
@@ -43,11 +43,12 @@ describe("@babel/template", function () {
describe("string-based", () => {
it("should handle replacing values from an object", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if (SOME_VAR === "") {}
`)({
- SOME_VAR: value,
- });
+ SOME_VAR: value,
+ });
expect(result.type).toBe("IfStatement");
expect(result.test.type).toBe("BinaryExpression");
@@ -56,7 +57,8 @@ describe("@babel/template", function () {
it("should handle replacing values given an array", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if ($0 === "") {}
`)([value]);
@@ -66,7 +68,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values with null to remove them", () => {
- const result = template(`
+ const result =
+ template(`
callee(ARG);
`)({ ARG: null });
@@ -76,7 +79,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values that are string content", () => {
- const result = template(`
+ const result =
+ template(`
("ARG");
`)({ ARG: "some new content" });
@@ -88,7 +92,8 @@ describe("@babel/template", function () {
it("should automatically clone nodes if they are injected twice", () => {
const id = t.identifier("someIdent");
- const result = template(`
+ const result =
+ template(`
ID;
ID;
`)({ ID: id });
@@ -277,23 +282,26 @@ describe("@babel/template", function () {
describe(".syntacticPlaceholders", () => {
it("works in function body", () => {
- const output = template(`function f() %%A%%`)({
- A: t.blockStatement([]),
- });
+ const output =
+ template(`function f() %%A%%`)({
+ A: t.blockStatement([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"function f() {}"`);
});
it("works in class body", () => {
- const output = template(`class C %%A%%`)({
- A: t.classBody([]),
- });
+ const output =
+ template(`class C %%A%%`)({
+ A: t.classBody([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"class C {}"`);
});
it("replaces lowercase names", () => {
- const output = template(`%%foo%%`)({
- foo: t.numericLiteral(1),
- });
+ const output =
+ template(`%%foo%%`)({
+ foo: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
@@ -372,23 +380,26 @@ describe("@babel/template", function () {
describe("undefined", () => {
it("allows placeholders", () => {
- const output = template(`%%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`%%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("replaces identifiers", () => {
- const output = template(`FOO`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("doesn't mix placeholder styles", () => {
- const output = template(`FOO + %%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO + %%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"FOO + 1;"`);
});
});
Submodule repos/eslint-plugin-vue contains modified content
Submodule repos/eslint-plugin-vue cc9c140..7e3c34f:
diff --git a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
index b54c206..ed4a3dc 100644
--- a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
+++ b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
@@ -164,7 +164,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLTagClose') {
return null
@@ -188,7 +189,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLSelfClosingTagClose') {
return null
diff --git a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
index 3f202fa..20c2593 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
@@ -176,7 +176,8 @@ function createForVueSyntax(context) {
}
return {
- "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
+ "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer":
+ verify,
'VElement > VExpressionContainer': verify
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
index 7c05083..1cfbd61 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
@@ -15,8 +15,10 @@ const utils = require('../utils')
// Constants
// ------------------------------------------------------------------------------
-const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
-const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
+const ALL_IRREGULARS =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
+const IRREGULAR_WHITESPACE =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu
// ------------------------------------------------------------------------------
@@ -195,7 +197,8 @@ module.exports = {
const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
...(skipHTMLAttributeValues
? {
- 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue
+ 'VAttribute[directive=false] > VLiteral':
+ removeInvalidNodeErrorsInHTMLAttributeValue
}
: {}),
...(skipHTMLTextContents
diff --git a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
index 02ac6e3..d15bb4c 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
diff --git a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
index 7c0639b..3d2d8f0 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
@@ -104,16 +104,17 @@ module.exports = {
}
const targetBody = scopeStack.body
- const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
- vueNode
- )).find((cp) => {
- return (
- cp.value &&
- node.loc.start.line >= cp.value.loc.start.line &&
- node.loc.end.line <= cp.value.loc.end.line &&
- targetBody === cp.value
- )
- })
+ const computedProperty =
+ /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
+ vueNode
+ )).find((cp) => {
+ return (
+ cp.value &&
+ node.loc.start.line >= cp.value.loc.start.line &&
+ node.loc.end.line <= cp.value.loc.end.line &&
+ targetBody === cp.value
+ )
+ })
if (computedProperty) {
if (!utils.isThis(node, context)) {
return
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
index b8a2057..709617e 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
@@ -19,9 +19,10 @@ function stripQuotesForHTML(text) {
return text.slice(1, -1)
}
- const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
- text
- )
+ const re =
+ /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
+ text
+ )
if (!re) {
return null
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
index 01549ca..c2440da 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
@@ -144,7 +144,8 @@ module.exports = {
}
return utils.defineTemplateBodyVisitor(context, {
- "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify
+ "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]":
+ verify
})
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
index ec35636..aac0924 100644
--- a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
+++ b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
@@ -451,14 +451,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: ['${nameNode.value}']`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: ['${nameNode.value}']${
@@ -488,14 +484,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: {'${nameNode.value}': null}`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: {'${nameNode.value}': null}${
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
index 9a790e9..e670fa3 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
@@ -20,7 +20,8 @@ module.exports = {
}
return {
- 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
+ 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer':
+ reportDynamicArgument
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
index c356a67..af7dbcd 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
@@ -23,7 +23,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope
+ "VAttribute[directive=true] > VDirectiveKey[name.name='scope']":
+ reportScope
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
index 1ce2748..ba59c6e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
@@ -128,7 +128,8 @@ module.exports = {
return {
"VAttribute[directive=false][key.name='slot']": reportSlot,
- "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
+ "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']":
+ reportVBindSlot
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
index 219d2b3..5a53a9e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
@@ -27,7 +27,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand
+ "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']":
+ reportPropModifierShorthand
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
index f0cbe36..1bb5f57 100644
--- a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
+++ b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
@@ -28,7 +28,10 @@ function normalizeOptions(options) {
}
if (typeof options === 'string') {
- normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options)
+ normalized.atComponent =
+ normalized.default =
+ normalized.named =
+ /** @type {"shorthand" | "longform"} */ (options)
} else if (options != null) {
/** @type {(keyof Options)[]} */
const keys = ['atComponent', 'default', 'named']
diff --git a/repos/eslint-plugin-vue/lib/utils/indent-common.js b/repos/eslint-plugin-vue/lib/utils/indent-common.js
index 9e6bfde..3f9f548 100644
--- a/repos/eslint-plugin-vue/lib/utils/indent-common.js
+++ b/repos/eslint-plugin-vue/lib/utils/indent-common.js
@@ -1078,9 +1078,8 @@ module.exports.defineVisitor = function create(
baseline.add(token)
} else if (baseline.has(offsetInfo.baseToken)) {
// The base token is a baseline token on this line, so inherit it.
- offsetInfo.expectedIndent = offsets.get(
- offsetInfo.baseToken
- ).expectedIndent
+ offsetInfo.expectedIndent =
+ offsets.get(offsetInfo.baseToken).expectedIndent
baseline.add(token)
} else {
// Otherwise, set the expected indent of this line.
@@ -1464,8 +1463,8 @@ module.exports.defineVisitor = function create(
ExportDefaultDeclaration(node) {
const exportToken = tokenStore.getFirstToken(node)
const defaultToken = tokenStore.getFirstToken(node, 1)
- const declarationToken = getFirstAndLastTokens(node.declaration)
- .firstToken
+ const declarationToken =
+ getFirstAndLastTokens(node.declaration).firstToken
setOffset([defaultToken, declarationToken], 1, exportToken)
},
/** @param {ExportNamedDeclaration} node */
@@ -1739,10 +1738,11 @@ module.exports.defineVisitor = function create(
'MemberExpression, MetaProperty'(node) {
const objectToken = tokenStore.getFirstToken(node)
if (node.type === 'MemberExpression' && node.computed) {
- const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore(
- node.property,
- isLeftBracket
- ))
+ const leftBracketToken =
+ /** @type {Token} */ (tokenStore.getTokenBefore(
+ node.property,
+ isLeftBracket
+ ))
const propertyToken = tokenStore.getTokenAfter(leftBracketToken)
const rightBracketToken = tokenStore.getTokenAfter(
node.property,
@@ -1777,10 +1777,11 @@ module.exports.defineVisitor = function create(
isLeftBracket
))
const keyToken = tokenStore.getTokenAfter(keyLeftToken)
- const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.key,
- isRightBracket
- )))
+ const keyRightToken = (lastKeyToken =
+ /** @type {Token} */ (tokenStore.getTokenAfter(
+ node.key,
+ isRightBracket
+ )))
if (hasPrefix) {
setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens)))
diff --git a/repos/eslint-plugin-vue/lib/utils/index.js b/repos/eslint-plugin-vue/lib/utils/index.js
index 0bcf801..460f3d4 100644
--- a/repos/eslint-plugin-vue/lib/utils/index.js
+++ b/repos/eslint-plugin-vue/lib/utils/index.js
@@ -838,11 +838,12 @@ module.exports = {
if (propValue.type === 'FunctionExpression') {
value = propValue.body
} else if (propValue.type === 'ObjectExpression') {
- const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
- propValue,
- 'get',
- (p) => p.value.type === 'FunctionExpression'
- ))
+ const get =
+ /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
+ propValue,
+ 'get',
+ (p) => p.value.type === 'FunctionExpression'
+ ))
value = get ? get.value.body : null
}
@@ -870,13 +871,14 @@ module.exports = {
}
if (arg.type === 'ObjectExpression') {
- const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
- arg,
- 'get',
- (p) =>
- p.value.type === 'FunctionExpression' ||
- p.value.type === 'ArrowFunctionExpression'
- ))
+ const getProperty =
+ /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
+ arg,
+ 'get',
+ (p) =>
+ p.value.type === 'FunctionExpression' ||
+ p.value.type === 'ArrowFunctionExpression'
+ ))
return getProperty ? getProperty.value : null
}
diff --git a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
index 85a0ad4..9c3a40c 100644
--- a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
@@ -11,9 +11,10 @@ const tester = new RuleTester({
parserOptions: { ecmaVersion: 2018 }
})
-const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
- ''
-)
+const IRREGULAR_WHITESPACES =
+ '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
+ ''
+ )
const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('')
const ALL_IRREGULAR_WHITESPACES = [].concat(
IRREGULAR_WHITESPACES,
Submodule repos/excalidraw 1973ae9..3f9b30e:
Submodule repos/prettier contains modified content
Submodule repos/prettier 2c1b8f6..d4bb853:
diff --git a/repos/prettier/scripts/release/steps/update-dependents-count.js b/repos/prettier/scripts/release/steps/update-dependents-count.js
index 1fb641bb6..b8e717537 100644
--- a/repos/prettier/scripts/release/steps/update-dependents-count.js
+++ b/repos/prettier/scripts/release/steps/update-dependents-count.js
@@ -23,9 +23,9 @@ async function update() {
const githubPage = await logPromise(
"Fetching github dependents count",
- fetch(
- "https://github.com/prettier/prettier/network/dependents"
- ).then((response) => response.text())
+ fetch("https://github.com/prettier/prettier/network/dependents").then(
+ (response) => response.text()
+ )
);
const dependentsCountGithub = Number(
githubPage
diff --git a/repos/prettier/src/language-html/conditional-comment.js b/repos/prettier/src/language-html/conditional-comment.js
index 228076446..f93551f98 100644
--- a/repos/prettier/src/language-html/conditional-comment.js
+++ b/repos/prettier/src/language-html/conditional-comment.js
@@ -7,7 +7,8 @@ const {
// https://css-tricks.com/how-to-create-an-ie-only-stylesheet
// <!--[if ... ]> ... <![endif]-->
-const IE_CONDITIONAL_START_END_COMMENT_REGEX = /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
+const IE_CONDITIONAL_START_END_COMMENT_REGEX =
+ /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
// <!--[if ... ]><!-->
const IE_CONDITIONAL_START_COMMENT_REGEX = /^\[if([^\]]*?)]><!$/;
// <!--<![endif]-->
diff --git a/repos/prettier/src/language-html/print-preprocess.js b/repos/prettier/src/language-html/print-preprocess.js
index 896d72bcd..600947b77 100644
--- a/repos/prettier/src/language-html/print-preprocess.js
+++ b/repos/prettier/src/language-html/print-preprocess.js
@@ -336,11 +336,8 @@ function extractWhitespaces(ast /*, options*/) {
const localChildren = [];
- const {
- leadingWhitespace,
- text,
- trailingWhitespace,
- } = getLeadingAndTrailingHtmlWhitespace(child.value);
+ const { leadingWhitespace, text, trailingWhitespace } =
+ getLeadingAndTrailingHtmlWhitespace(child.value);
if (leadingWhitespace) {
localChildren.push({ type: TYPE_WHITESPACE });
diff --git a/repos/prettier/src/language-html/syntax-vue.js b/repos/prettier/src/language-html/syntax-vue.js
index 0ce5bb005..48bc66d47 100644
--- a/repos/prettier/src/language-html/syntax-vue.js
+++ b/repos/prettier/src/language-html/syntax-vue.js
@@ -79,7 +79,8 @@ function isVueEventBindingExpression(eventBindingValue) {
// arrow function or anonymous function
const fnExpRE = /^([\w$]+|\([^)]*?\))\s*=>|^function\s*\(/;
// simple member expression chain (a, a.b, a['b'], a["b"], a[0], a[b])
- const simplePathRE = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
+ const simplePathRE =
+ /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
// https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
const value = eventBindingValue.trim();
diff --git a/repos/prettier/src/language-js/comments.js b/repos/prettier/src/language-js/comments.js
index e4e0caa09..d34fa03ce 100644
--- a/repos/prettier/src/language-js/comments.js
+++ b/repos/prettier/src/language-js/comments.js
@@ -588,10 +588,11 @@ function handleLastFunctionArgComments({
locEnd(getLast(parameters))
);
}
- const functionParamLeftParenIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- locEnd(enclosingNode.id)
- );
+ const functionParamLeftParenIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
+ text,
+ locEnd(enclosingNode.id)
+ );
return (
functionParamLeftParenIndex !== false &&
getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
diff --git a/repos/prettier/src/language-js/parse-postprocess.js b/repos/prettier/src/language-js/parse-postprocess.js
index be9dcd9dd..d74e063cc 100644
--- a/repos/prettier/src/language-js/parse-postprocess.js
+++ b/repos/prettier/src/language-js/parse-postprocess.js
@@ -21,10 +21,8 @@ function postprocess(ast, options) {
// Invalid decorators are removed since `@typescript-eslint/typescript-estree` v4
// https://github.com/typescript-eslint/typescript-eslint/pull/2375
if (options.parser === "typescript" && options.originalText.includes("@")) {
- const {
- esTreeNodeToTSNodeMap,
- tsNodeToESTreeNodeMap,
- } = options.tsParseResult;
+ const { esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } =
+ options.tsParseResult;
ast = visitNode(ast, (node) => {
const tsNode = esTreeNodeToTSNodeMap.get(node);
if (!tsNode) {
diff --git a/repos/prettier/src/language-js/parser-babel.js b/repos/prettier/src/language-js/parser-babel.js
index dad0eded4..b9f3282f7 100644
--- a/repos/prettier/src/language-js/parser-babel.js
+++ b/repos/prettier/src/language-js/parser-babel.js
@@ -62,10 +62,8 @@ function isFlowFile(text, options) {
text = text.slice(shebang.length);
}
- const firstNonSpaceNonCommentCharacterIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- 0
- );
+ const firstNonSpaceNonCommentCharacterIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, 0);
if (firstNonSpaceNonCommentCharacterIndex !== false) {
text = text.slice(0, firstNonSpaceNonCommentCharacterIndex);
diff --git a/repos/prettier/src/language-markdown/constants.evaluate.js b/repos/prettier/src/language-markdown/constants.evaluate.js
index 1b9ab9d09..45c799f9e 100644
--- a/repos/prettier/src/language-markdown/constants.evaluate.js
+++ b/repos/prettier/src/language-markdown/constants.evaluate.js
@@ -27,7 +27,8 @@ const kPattern = unicodeRegex({ Script: ["Hangul"] })
.toString();
// http://spec.commonmark.org/0.25/#ascii-punctuation-character
-const asciiPunctuationCharset = /* prettier-ignore */ regexpUtil.charset(
+const asciiPunctuationCharset =
+ /* prettier-ignore */ regexpUtil.charset(
"!", '"', "#", "$", "%", "&", "'", "(", ")", "*",
"+", ",", "-", ".", "/", ":", ";", "<", "=", ">",
"?", "@", "[", "\\", "]", "^", "_", "`", "{", "|",
diff --git a/repos/prettier/src/language-markdown/utils.js b/repos/prettier/src/language-markdown/utils.js
index de21b4e60..4b7d2608e 100644
--- a/repos/prettier/src/language-markdown/utils.js
+++ b/repos/prettier/src/language-markdown/utils.js
@@ -51,9 +51,13 @@ function splitText(text, options) {
/** @type {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} */
const nodes = [];
- const tokens = (options.proseWrap === "preserve"
- ? text
- : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
+ const tokens = (
+ options.proseWrap === "preserve"
+ ? text
+ : text.replace(
+ new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"),
+ "$1$2"
+ )
).split(/([\t\n ]+)/);
for (const [index, token] of tokens.entries()) {
// whitespace
diff --git a/repos/prettier/src/main/ast-to-doc.js b/repos/prettier/src/main/ast-to-doc.js
index 369e6fc50..3d5a5fec0 100644
--- a/repos/prettier/src/main/ast-to-doc.js
+++ b/repos/prettier/src/main/ast-to-doc.js
@@ -86,12 +86,8 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
}
function printPrettierIgnoredNode(node, options) {
- const {
- originalText,
- [Symbol.for("comments")]: comments,
- locStart,
- locEnd,
- } = options;
+ const { originalText, [Symbol.for("comments")]: comments, locStart, locEnd } =
+ options;
const start = locStart(node);
const end = locEnd(node);
diff --git a/repos/prettier/src/main/comments.js b/repos/prettier/src/main/comments.js
index 3903278c3..8dec303a2 100644
--- a/repos/prettier/src/main/comments.js
+++ b/repos/prettier/src/main/comments.js
@@ -313,10 +313,8 @@ function isOwnLineComment(text, options, decoratedComments, commentIndex) {
if (precedingNode) {
// Find first comment on the same line
for (let index = commentIndex - 1; index >= 0; index--) {
- const {
- comment,
- precedingNode: currentCommentPrecedingNode,
- } = decoratedComments[index];
+ const { comment, precedingNode: currentCommentPrecedingNode } =
+ decoratedComments[index];
if (
currentCommentPrecedingNode !== precedingNode ||
!isAllEmptyAndNoLineBreak(text.slice(locEnd(comment), start))
@@ -342,10 +340,8 @@ function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
index < decoratedComments.length;
index++
) {
- const {
- comment,
- followingNode: currentCommentFollowingNode,
- } = decoratedComments[index];
+ const { comment, followingNode: currentCommentFollowingNode } =
+ decoratedComments[index];
if (
currentCommentFollowingNode !== followingNode ||
!isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment)))
diff --git a/repos/prettier/tests_integration/__tests__/infer-parser.js b/repos/prettier/tests_integration/__tests__/infer-parser.js
index 5e27a6b09..88ea30065 100644
--- a/repos/prettier/tests_integration/__tests__/infer-parser.js
+++ b/repos/prettier/tests_integration/__tests__/infer-parser.js
@@ -163,11 +163,9 @@ describe("--write and --list-different with unknown path and no parser", () => {
});
describe("multiple files", () => {
- runPrettier("cli/infer-parser/", [
- "--list-different",
- "--write",
- "*",
- ]).test({ status: 0 });
+ runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
+ { status: 0 }
+ );
});
});
diff --git a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
index a420c561f..8622a9bce 100644
--- a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
+++ b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
@@ -3,14 +3,8 @@
/** @type {import('prettier')} */
const prettier = require("prettier-local");
-const {
- group,
- indent,
- line,
- lineSuffix,
- lineSuffixBoundary,
- softline,
-} = prettier.doc.builders;
+const { group, indent, line, lineSuffix, lineSuffixBoundary, softline } =
+ prettier.doc.builders;
const printDoc = require("../printDoc");
diff --git a/repos/prettier/website/README.md b/repos/prettier/website/README.md
index 53d5a2778..17c91ccbc 100644
--- a/repos/prettier/website/README.md
+++ b/repos/prettier/website/README.md
@@ -59,7 +59,6 @@ previous: doc0 # previous doc on sidebar for navigation
next: doc2 # next doc on the sidebar for navigation
# don’t include next if this is the last doc; don’t include previous if first doc
---
-
docs/
are published to https://prettier.io/docs/en/next/
and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from docs/
are copied to the website/versioned_docs/version-stable
directory, whose content is published to https://prettier.io/docs/en
.
@@ -73,7 +72,6 @@ title: Blog Post Title
author: Author Name
authorURL: http://github.com/author # (or some other link)-
In the blog post, you should include a line `<!--truncate-->`. This determines under which point text will be ignored when generating the preview of your blog post. Blog posts should have the file name format: `yyyy-mm-dd-your-file-name.md`.
diff --git a/repos/prettier/website/pages/playground-redirect.html b/repos/prettier/website/pages/playground-redirect.html
index e8bc4a40f..f03a9a573 100644
--- a/repos/prettier/website/pages/playground-redirect.html
+++ b/repos/prettier/website/pages/playground-redirect.html
@@ -16,9 +16,10 @@
/>
</p>
<script>
- const match = /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
- document.referrer
- );
+ const match =
+ /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
+ document.referrer
+ );
if (match != null) {
const [, /* url */ pr] = match;
location.replace(
diff --git a/repos/prettier/website/playground/util.js b/repos/prettier/website/playground/util.js
index b41bde90e..8a22a34df 100644
--- a/repos/prettier/website/playground/util.js
+++ b/repos/prettier/website/playground/util.js
@@ -55,7 +55,8 @@ export function getCodemirrorMode(parser) {
const astAutoFold = {
estree: /^\s*"(loc|start|end)":/,
postcss: /^\s*"(source|input|raws|file)":/,
- html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
+ html:
+ /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
mdast: /^\s*"position":/,
yaml: /^\s*"position":/,
glimmer: /^\s*"loc":/,
Submodule repos/typescript-eslint contains modified content
Submodule repos/typescript-eslint 7b701a3..1d7ff59:
diff --git a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index bc26d9d9..c38a8702 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -55,9 +55,8 @@ function getExpectedIndentForNode(
sourceCodeLines: string[],
): number {
const lineIdx = node.loc.start.line - 1;
- const indent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- sourceCodeLines[lineIdx],
- )![1];
+ const indent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(sourceCodeLines[lineIdx])![1];
return indent.length;
}
function doIndent(line: string, indent: number): string {
@@ -333,9 +332,8 @@ export default createRule<Options, MessageIds>({
// +2 because we expect the string contents are indented one level
const expectedIndent = parentIndent + 2;
- const firstLineIndent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- lines[0],
- )![1];
+ const firstLineIndent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(lines[0])![1];
const requiresIndent = firstLineIndent.length > 0;
if (requiresIndent) {
if (firstLineIndent.length !== expectedIndent) {
@@ -488,7 +486,8 @@ export default createRule<Options, MessageIds>({
return {
// valid
- 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest,
+ 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression':
+ checkValidTest,
// invalid - errors
[invalidTestsSelectorPath.join(' > ')]: checkInvalidTest,
// invalid - suggestions
@@ -502,7 +501,8 @@ export default createRule<Options, MessageIds>({
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
// special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest,
+ 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
+ checkInvalidTest,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
index b6da50bb..4e95b731 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -19,7 +19,7 @@ export type RawRulesConfig = Record<
| {
severity?: RuleSeverity | 'warn' | 'none' | 'default';
options?: unknown;
- }
+ },
>;
export type MessageIds = 'failure';
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 7c2f237c..4bf17c25 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -102,8 +102,10 @@ export default util.createRule<[Options], MessageIds>({
The regex used are taken from the ones used in the official TypeScript repo -
https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L281-L289
*/
- const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
- const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExSingleLine =
+ /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExMultiLine =
+ /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const sourceCode = context.getSourceCode();
return {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 4521fcb1..37dfefd3 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -3,7 +3,8 @@ import * as util from '../util';
// tslint regex
// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32
-const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
+const ENABLE_DISABLE_REGEX =
+ /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
const toText = (
text: string,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
index c9f03c89..2f2be15c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
@@ -13,7 +13,7 @@ type Types = Record<
| {
message: string;
fixWith?: string;
- }
+ },
>;
export type Options = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
index 7107bdf4..b1915bcb 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
@@ -26,10 +26,8 @@ export default createRule<Options, MessageIds>({
},
defaultOptions: ['1tbs'],
create(context) {
- const [
- style,
- { allowSingleLine } = { allowSingleLine: false },
- ] = context.options;
+ const [style, { allowSingleLine } = { allowSingleLine: false }] =
+ context.options;
const isAllmanStyle = style === 'allman';
const sourceCode = context.getSourceCode();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
index e0e06a67..be22b20c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -10,7 +10,7 @@ export type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
type Option = Options[0];
type NormalizedOptions = Required<
- Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>
+ Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>,
>;
const OPTION_VALUE_SCHEME = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 5d14576a..096deaff 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -225,9 +225,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';
// we have a mixed type/value import, so we need to split them out into multiple exports
- const importNames = (isTypeImport
- ? report.valueSpecifiers
- : report.typeSpecifiers
+ const importNames = (
+ isTypeImport
+ ? report.valueSpecifiers
+ : report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);
context.report({
node: report.node,
@@ -308,10 +309,11 @@ export default util.createRule<Options, MessageIds>({
(specifier): specifier is TSESTree.ImportNamespaceSpecifier =>
specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,
) ?? null;
- const namedSpecifiers: TSESTree.ImportSpecifier[] = node.specifiers.filter(
- (specifier): specifier is TSESTree.ImportSpecifier =>
- specifier.type === AST_NODE_TYPES.ImportSpecifier,
- );
+ const namedSpecifiers: TSESTree.ImportSpecifier[] =
+ node.specifiers.filter(
+ (specifier): specifier is TSESTree.ImportSpecifier =>
+ specifier.type === AST_NODE_TYPES.ImportSpecifier,
+ );
return {
defaultSpecifier,
namespaceSpecifier,
@@ -476,11 +478,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier && !defaultSpecifier) {
// e.g.
@@ -687,11 +686,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier) {
// e.g.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
index 2c9dd9f2..b2b980cd 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -78,8 +78,8 @@ export default createRule<Options, MessageIds>({
const objectSymbol = typeChecker.getSymbolAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node.property),
);
- const modifierKind = objectSymbol?.getDeclarations()?.[0]
- ?.modifiers?.[0].kind;
+ const modifierKind =
+ objectSymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind;
if (
(allowPrivateClassPropertyAccess &&
modifierKind == ts.SyntaxKind.PrivateKeyword) ||
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 05c35c7a..088849f2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -248,7 +248,7 @@ type MessageIds = 'wrongIndentation';
type AppliedOptions = ExcludeKeys<
// slight hack to make interface work with Record<string, unknown>
RequireKeys<Pick<IndentConfig, keyof IndentConfig>, keyof IndentConfig>,
- AST_NODE_TYPES.VariableDeclarator
+ AST_NODE_TYPES.VariableDeclarator,
> & {
VariableDeclarator: 'off' | VariableDeclaratorObj;
};
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
* 2. Don't set any offsets against the first token of the node.
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
*/
- const offsetListeners = Object.keys(baseOffsetListeners).reduce<
- TSESLint.RuleListener
- >(
+ const offsetListeners = Object.keys(
+ baseOffsetListeners,
+ ).reduce<TSESLint.RuleListener>(
/*
* Offset listener calls are deferred until traversal is finished, and are called as
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
* ignored nodes are known.
*/
(acc, key) => {
- const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const listener = baseOffsetListeners[
+ key
+ ] as TSESLint.RuleFunction<TSESTree.Node>;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
acc[key] = node => listenerCallQueue.push({ listener, node });
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
index de5b971f..fc28832e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -123,7 +123,7 @@ export const defaultOrder = [
];
const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce<
- string[]
+ string[],
>((all, type) => {
all.push(type);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
index 54e68b2c..4775a1fe 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -130,12 +130,13 @@ export default util.createRule<Options, MessageIds>({
? parent.members
: [];
- const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter(
- (element): element is TSESTree.TSMethodSignature =>
- element.type === AST_NODE_TYPES.TSMethodSignature &&
- element !== methodNode &&
- getMethodKey(element) === getMethodKey(methodNode),
- );
+ const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] =
+ members.filter(
+ (element): element is TSESTree.TSMethodSignature =>
+ element.type === AST_NODE_TYPES.TSMethodSignature &&
+ element !== methodNode &&
+ getMethodKey(element) === getMethodKey(methodNode),
+ );
const isParentModule = isNodeParentModuleDeclaration(methodNode);
if (duplicatedKeyMethodNodes.length > 0) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
index 2640aee6..833f8b00 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
return !wasUnderscore;
}
-const PredefinedFormatToCheckFunction: Readonly<Record<
- PredefinedFormats,
- (name: string) => boolean
->> = {
+const PredefinedFormatToCheckFunction: Readonly<
+ Record<PredefinedFormats, (name: string) => boolean>,
+> = {
[PredefinedFormats.PascalCase]: isPascalCase,
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[PredefinedFormats.camelCase]: isCamelCase,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index b58edd99..f507f372 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -32,8 +32,10 @@ export default util.createRule({
return {
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
- 'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
- 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
+ 'MemberExpression[optional = true] > TSNonNullExpression.object':
+ checkExtraNonNullAssertion,
+ 'CallExpression[optional = true] > TSNonNullExpression.callee':
+ checkExtraNonNullAssertion,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 0cb41337..1f45a489 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -84,9 +84,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
- let fullNumberNode:
- | TSESTree.Literal
- | TSESTree.UnaryExpression = node;
+ let fullNumberNode: TSESTree.Literal | TSESTree.UnaryExpression =
+ node;
let raw = node.raw;
if (
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
index fa67859f..21456319 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -73,7 +73,7 @@ export default util.createRule<Options, MessageIds>({
loc?: TSESTree.SourceLocation;
},
void,
- unknown
+ unknown,
> {
if (
options?.builtinGlobals &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index aee4963a..fcf11f3f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -443,9 +443,9 @@ export default createRule<Options, MessageId>({
// (Value to complexity ratio is dubious however)
}
// Otherwise just do type analysis on the function as a whole.
- const returnTypes = getCallSignaturesOfType(
- getNodeType(callback),
- ).map(sig => sig.getReturnType());
+ const returnTypes = getCallSignaturesOfType(getNodeType(callback)).map(
+ sig => sig.getReturnType(),
+ );
/* istanbul ignore if */ if (returnTypes.length === 0) {
// Not a callable function
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
index 395bbfdc..014b2c22 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
@@ -170,12 +170,16 @@ export default util.createRule({
return {
TSModuleDeclaration: enterDeclaration,
TSEnumDeclaration: enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]':
+ enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]':
+ enterDeclaration,
'TSModuleDeclaration:exit': exitDeclaration,
'TSEnumDeclaration:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit':
+ exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit':
+ exitDeclaration,
TSQualifiedName(node: TSESTree.TSQualifiedName): void {
visitNamespaceAccess(node, node.left, node.right);
},
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 6d5036c2..030f2748 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -11,7 +11,7 @@ type MakeRequired<Base, Key extends keyof Base> = Omit<Base, Key> &
type TypeParameterWithConstraint = MakeRequired<
TSESTree.TSTypeParameter,
- 'constraint'
+ 'constraint',
>;
const is3dot5 = semver.satisfies(
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index b326c754..12284640 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -72,7 +72,8 @@ export default util.createRule({
return {
// ignore MemberExpression if it's parent is TSClassImplements or TSInterfaceHeritage
- ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression': checkMemberExpression,
+ ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression':
+ checkMemberExpression,
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
index 2b0bb32c..59680863 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -5,7 +5,8 @@ import {
} from '@typescript-eslint/experimental-utils';
import * as util from '../util';
-const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
+const SENTINEL_TYPE =
+ /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
/**
* Parses a given value as options.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
index 581e7ac1..01721d44 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
@@ -170,8 +170,8 @@ export default createRule<Options, MessageIds>({
): void {
if (isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween!(first, second);
- const secondType = sourceCode.getNodeByRangeIndex(second.range[0])!
- .type;
+ const secondType =
+ sourceCode.getNodeByRangeIndex(second.range[0])!.type;
const openingCurlyBraceMustBeSpaced =
options.arraysInObjectsException &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
index f49b5385..d21b088d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -134,10 +134,11 @@ export default createRule({
].join(', ')](node: TSESTree.MemberExpression): void {
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent as TSESTree.CallExpression;
- const compareNode = (callNode.parent?.type ===
- AST_NODE_TYPES.ChainExpression
- ? callNode.parent.parent
- : callNode.parent) as TSESTree.BinaryExpression;
+ const compareNode = (
+ callNode.parent?.type === AST_NODE_TYPES.ChainExpression
+ ? callNode.parent.parent
+ : callNode.parent
+ ) as TSESTree.BinaryExpression;
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index cd886a9d..0e15bf8f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -65,10 +65,12 @@ export default util.createRule({
| TSESTree.MemberExpression,
): void {
// selector guarantees this cast
- const initialExpression = (initialIdentifierOrNotEqualsExpr.parent
- ?.type === AST_NODE_TYPES.ChainExpression
- ? initialIdentifierOrNotEqualsExpr.parent.parent
- : initialIdentifierOrNotEqualsExpr.parent) as TSESTree.LogicalExpression;
+ const initialExpression = (
+ initialIdentifierOrNotEqualsExpr.parent?.type ===
+ AST_NODE_TYPES.ChainExpression
+ ? initialIdentifierOrNotEqualsExpr.parent.parent
+ : initialIdentifierOrNotEqualsExpr.parent
+ ) as TSESTree.LogicalExpression;
if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) {
// the node(identifier or member expression) is not the deepest left node
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 27eb7dca..0d4c3a7a 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -267,11 +267,11 @@ const DIRECTLY_INSIDE_CONSTRUCTOR = 0;
class ClassScope {
private readonly privateModifiableMembers = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly privateModifiableStatics = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly memberVariableModifications = new Set<string>();
private readonly staticVariableModifications = new Set<string>();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
index 99c455cd..764ca63d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
@@ -146,7 +146,7 @@ export default util.createRule({
'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(
node: Exclude<
TSESTree.Node,
- TSESTree.BlockStatement | TSESTree.AwaitExpression
+ TSESTree.BlockStatement | TSESTree.AwaitExpression,
>,
): void {
const expression = parserServices.esTreeNodeToTSNodeMap.get(node);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
index e73fd4b5..eccc264e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
@@ -36,9 +36,8 @@ export default util.createRule<Options, MessageIds>({
],
create(context) {
const rules = baseRule.create(context);
- const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const checkForSemicolon =
+ rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
/*
The following nodes are handled by the member-delimiter-style rule
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
index 08c3ad62..525febe2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
@@ -94,7 +94,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
programNode = node;
- const referenceRegExp = /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
+ const referenceRegExp =
+ /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
const commentsBefore = sourceCode.getCommentsBefore(programNode);
commentsBefore.forEach(comment => {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index 19aaf335..2b9150a6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -9,11 +9,11 @@ import * as util from '.';
class UnusedVarsVisitor<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> extends Visitor {
private static readonly RESULTS_CACHE = new WeakMap<
TSESTree.Program,
- ReadonlySet<TSESLint.Scope.Variable>
+ ReadonlySet<TSESLint.Scope.Variable>,
>();
readonly #scopeManager: TSESLint.Scope.ScopeManager;
@@ -32,7 +32,7 @@ class UnusedVarsVisitor<
public static collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: TSESLint.RuleContext<TMessageIds, TOptions>,
): ReadonlySet<TSESLint.Scope.Variable> {
@@ -747,7 +747,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
*/
function collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
): ReadonlySet<TSESLint.Scope.Variable> {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
index 86e0ec23..fe531fec 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
@@ -12,15 +12,10 @@ export * from './requiresQuoting';
export * from './types';
// this is done for convenience - saves migrating all of the old rules
-const {
- applyDefault,
- deepMerge,
- isObjectNotArray,
- getParserServices,
-} = ESLintUtils;
-type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
- T
->;
+const { applyDefault, deepMerge, isObjectNotArray, getParserServices } =
+ ESLintUtils;
+type InferMessageIdsTypeFromRule<T> =
+ ESLintUtils.InferMessageIdsTypeFromRule<T>;
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
export {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
index 2e6c4711..e7e0991b 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
@@ -91,11 +91,11 @@ function getNameFromMember(
type ExcludeKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = { [k in Exclude<keyof TObj, TKeys>]: TObj[k] };
type RequireKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = ExcludeKeys<TObj, TKeys> & { [k in TKeys]-?: Exclude<TObj[k], undefined> };
function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
index 103caeb5..d67ff887 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
@@ -137,9 +137,10 @@ describe('Validating README.md', () => {
for (const [ruleName, rule] of notDeprecated) {
describe(`Checking rule ${ruleName}`, () => {
- const ruleRow: string[] | undefined = (rule.meta.docs?.extendsBaseRule
- ? rulesTables.extension.cells
- : rulesTables.base.cells
+ const ruleRow: string[] | undefined = (
+ rule.meta.docs?.extendsBaseRule
+ ? rulesTables.extension.cells
+ : rulesTables.base.cells
).find(row => row[0].includes(`/${ruleName}.md`));
if (!ruleRow) {
// rule is in the wrong table, the first two tests will catch this, so no point in creating noise;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index 5134d591..855e13a0 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -3804,7 +3804,7 @@ class Foo {
const sortedWithoutGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + multiple types
@@ -4182,7 +4182,7 @@ const foo = class Foo {
const sortedWithoutGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + multiple types --> Only member group order is checked (default config)
@@ -4392,7 +4392,7 @@ class Foo {
const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + multiple types --> Only member group order is checked (default config)
@@ -4629,7 +4629,7 @@ const foo = class Foo {
const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + multiple types
@@ -4864,7 +4864,7 @@ interface Foo {
const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + multiple types --> Only member group order is checked (default config)
@@ -5097,14 +5097,12 @@ type Foo = {
],
};
-const sortedWithGroupingDefaultOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // default option + interface + default order + alphabetically
- {
- code: `
+const sortedWithGroupingDefaultOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // default option + interface + default order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5121,14 +5119,14 @@ interface Foo {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + interface + custom order + alphabetically
- {
- code: `
+ // default option + interface + custom order + alphabetically
+ {
+ code: `
interface Foo {
new () : Bar;
@@ -5144,19 +5142,19 @@ interface Foo {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + default order + alphabetically
- {
- code: `
+ // default option + type literal + default order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5173,14 +5171,14 @@ type Foo = {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + type literal + custom order + alphabetically
- {
- code: `
+ // default option + type literal + custom order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5197,19 +5195,19 @@ type Foo = {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + default order + alphabetically
- {
- code: `
+ // default option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5222,13 +5220,13 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
- // default option + class + decorators + default order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
+ // default option + class + decorators + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5245,14 +5243,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class + custom order + alphabetically
- {
- code: `
+ // default option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5265,19 +5263,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + default order + alphabetically
- {
- code: `
+ // default option + class expression + default order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5290,14 +5288,14 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class expression + custom order + alphabetically
- {
- code: `
+ // default option + class expression + custom order + alphabetically
+ {
+ code: `
const foo = class Foo {
constructor() {}
@@ -5310,20 +5308,20 @@ const foo = class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
- },
- },
- ],
- },
- ],
- invalid: [
- // default option + interface + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ },
+ ],
+ invalid: [
+ // default option + interface + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5340,23 +5338,23 @@ interface Foo {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + type literal + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5373,23 +5371,23 @@ type Foo = {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5400,23 +5398,23 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class expression + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static c: string = "";
public static b: string = "";
@@ -5427,22 +5425,22 @@ const foo = class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
- },
- },
- ],
- },
- // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
+ },
+ ],
+ },
+ // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
@Dec() a1: string;
@Dec()
@@ -5459,47 +5457,45 @@ class Foo {
@Dec() d(): void
}
`,
- options: [
- {
- default: {
- memberTypes: [
- 'decorated-field',
- 'field',
- 'constructor',
- 'decorated-method',
- ],
- order: 'alphabetically',
- },
- },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b1',
- rank: 'constructor',
- },
- },
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b2',
- rank: 'constructor',
- },
- },
- ],
- },
- ],
-};
-
-const sortedWithGroupingClassesOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // classes option + interface + alphabetically --> Default order applies
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: [
+ 'decorated-field',
+ 'field',
+ 'constructor',
+ 'decorated-method',
+ ],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b1',
+ rank: 'constructor',
+ },
+ },
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b2',
+ rank: 'constructor',
+ },
+ },
+ ],
+ },
+ ],
+ };
+
+const sortedWithGroupingClassesOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // classes option + interface + alphabetically --> Default order applies
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5516,12 +5512,12 @@ interface Foo {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + type literal + alphabetically --> Default order applies
- {
- code: `
+ // classes option + type literal + alphabetically --> Default order applies
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5538,12 +5534,12 @@ type Foo = {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + class + default order + alphabetically
- {
- code: `
+ // classes option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5556,14 +5552,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // classes option + class + custom order + alphabetically
- {
- code: `
+ // classes option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5576,19 +5572,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- classes: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ classes: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // classes option + class expression + alphabetically --> Default order applies
- {
- code: `
+ // classes option + class expression + alphabetically --> Default order applies
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5601,13 +5597,13 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
- ],
- invalid: [
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
+ ],
+ invalid: [
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5618,25 +5614,25 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
- ],
-};
+ ],
+ },
+ ],
+ };
const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + alphabetically --> Default order applies
@@ -5783,7 +5779,7 @@ const foo = class Foo {
const sortedWithGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + default order + alphabetically
@@ -5939,7 +5935,7 @@ interface Foo {
const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + alphabetically --> Default order applies
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index 93173074..eb3bec70 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -18,10 +18,9 @@ const parserOptions = {
project: './tsconfig.json',
};
-const formatTestNames: Readonly<Record<
- PredefinedFormatsString,
- Record<'valid' | 'invalid', string[]>
->> = {
+const formatTestNames: Readonly<
+ Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>,
+> = {
camelCase: {
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index 0f7bb141..61caf073 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -72,27 +72,25 @@ const testCases = [
const validTestCases = flatten(
testCases.map(c => c.code.map(code => `const a = ${code}`)),
);
-const invalidTestCases: TSESLint.InvalidTestCase<
- MessageIds,
- Options
->[] = flatten(
- testCases.map(cas =>
- cas.code.map(code => ({
- code: `const a: ${cas.type} = ${code}`,
- output: `const a = ${code}`,
- errors: [
- {
- messageId: 'noInferrableType',
- data: {
- type: cas.type,
+const invalidTestCases: TSESLint.InvalidTestCase<MessageIds, Options>[] =
+ flatten(
+ testCases.map(cas =>
+ cas.code.map(code => ({
+ code: `const a: ${cas.type} = ${code}`,
+ output: `const a = ${code}`,
+ errors: [
+ {
+ messageId: 'noInferrableType',
+ data: {
+ type: cas.type,
+ },
+ line: 1,
+ column: 7,
},
- line: 1,
- column: 7,
- },
- ],
- })),
- ),
-);
+ ],
+ })),
+ ),
+ );
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
index c0934982..67b9d22c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
@@ -21,7 +21,7 @@ const ruleTester = new RuleTester({
const hasExport = /^export/m;
// const hasImport = /^import .+? from ['"]/m;
function makeExternalModule<
- T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>
+ T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>,
>(tests: T[]): T[] {
return tests.map(t => {
if (!hasExport.test(t.code)) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index 80340828..2afa8616 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -144,7 +144,7 @@ const baseCases = [
],
} as TSESLint.InvalidTestCase<
InferMessageIdsTypeFromRule<typeof rule>,
- InferOptionsTypeFromRule<typeof rule>
+ InferOptionsTypeFromRule<typeof rule>,
>),
);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index 0cef8974..aefb7cd8 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1069,13 +1069,13 @@ function addOptional<TOptions extends Readonly<unknown[]>>(
): TSESLint.ValidTestCase<TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: TSESLint.InvalidTestCase<TMessageIds, TOptions>[],
): TSESLint.InvalidTestCase<TMessageIds, TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: (Case<TMessageIds, TOptions> | string)[],
): Case<TMessageIds, TOptions>[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
index e78808aa..ed84f286 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
@@ -49,10 +49,8 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Map(
);
const EXTENDS = ['./configs/base', './configs/eslint-recommended'];
-const ruleEntries: [
- string,
- TSESLint.RuleModule<string, unknown[]>,
-][] = Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
+const ruleEntries: [string, TSESLint.RuleModule<string, unknown[]>][] =
+ Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
/**
* Helper function reduces records to key - value pairs.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
index 49e48541..2c35583c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -20,7 +20,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -40,7 +40,7 @@ declare module 'eslint/lib/rules/camelcase' {
],
{
Identifier(node: TSESTree.Identifier): void;
- }
+ },
>;
export = rule;
}
@@ -136,7 +136,7 @@ declare module 'eslint/lib/rules/indent' {
JSXOpeningElement(node: TSESTree.JSXOpeningElement): void;
JSXClosingElement(node: TSESTree.JSXClosingElement): void;
JSXExpressionContainer(node: TSESTree.JSXExpressionContainer): void;
- }
+ },
>;
export = rule;
}
@@ -154,7 +154,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
{
before?: boolean;
after?: boolean;
- }
+ },
>;
},
];
@@ -215,7 +215,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
ImportNamespaceSpecifier: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
MethodDefinition: RuleFunction<TSESTree.MethodDefinition>;
Property: RuleFunction<TSESTree.Property>;
- }
+ },
>;
export = rule;
}
@@ -231,7 +231,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
ClassBody(): void;
'ClassBody:exit'(): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -245,7 +245,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -263,7 +263,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -280,7 +280,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
[],
{
Program(node: TSESTree.Program): void;
- }
+ },
>;
export = rule;
}
@@ -295,7 +295,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -318,7 +318,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -335,7 +335,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -354,7 +354,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -373,7 +373,7 @@ declare module 'eslint/lib/rules/no-shadow' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -390,7 +390,7 @@ declare module 'eslint/lib/rules/no-undef' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -415,7 +415,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -434,7 +434,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
],
{
ExpressionStatement(node: TSESTree.ExpressionStatement): void;
- }
+ },
>;
export = rule;
}
@@ -454,7 +454,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -476,7 +476,7 @@ declare module 'eslint/lib/rules/strict' {
['never' | 'global' | 'function' | 'safe'],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -489,7 +489,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
[],
{
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -542,7 +542,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
WhileStatement(node: TSESTree.WhileStatement): void;
WithStatement(node: TSESTree.WithStatement): void;
YieldExpression(node: TSESTree.YieldExpression): void;
- }
+ },
>;
export = rule;
}
@@ -572,7 +572,7 @@ declare module 'eslint/lib/rules/semi' {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -592,7 +592,7 @@ declare module 'eslint/lib/rules/quotes' {
{
Literal(node: TSESTree.Literal): void;
TemplateLiteral(node: TSESTree.TemplateLiteral): void;
- }
+ },
>;
export = rule;
}
@@ -619,7 +619,7 @@ declare module 'eslint/lib/rules/brace-style' {
SwitchStatement(node: TSESTree.SwitchStatement): void;
IfStatement(node: TSESTree.IfStatement): void;
TryStatement(node: TSESTree.TryStatement): void;
- }
+ },
>;
export = rule;
}
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
EmptyStatement(node: TSESTree.EmptyStatement): void;
ClassBody(node: TSESTree.ClassBody): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -653,7 +653,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
],
{
ClassBody(node: TSESTree.ClassBody): void;
- }
+ },
>;
export = rule;
}
@@ -671,7 +671,7 @@ declare module 'eslint/lib/rules/init-declarations' {
],
{
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -694,7 +694,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
FunctionExpression(node: TSESTree.FunctionExpression): void;
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
ThisExpression(node: TSESTree.ThisExpression): void;
- }
+ },
>;
export = rule;
}
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/dot-notation' {
],
{
MemberExpression(node: TSESTree.MemberExpression): void;
- }
+ },
>;
export = rule;
}
@@ -726,7 +726,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
[],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -759,7 +759,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
node: TSESTree.TSTypeParameterDeclaration,
): void;
TSTupleType(node: TSESTree.TSTupleType): void;
- }
+ },
>;
export = rule;
}
@@ -785,7 +785,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration?(node: TSESTree.ExportNamedDeclaration): void;
ExportAllDeclaration?(node: TSESTree.ExportAllDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -807,7 +807,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
LogicalExpression(node: TSESTree.LogicalExpression): void;
ConditionalExpression(node: TSESTree.ConditionalExpression): void;
VariableDeclarator(node: TSESTree.VariableDeclarator): void;
- }
+ },
>;
export = rule;
}
@@ -826,7 +826,7 @@ declare module 'eslint/lib/rules/prefer-const' {
{
'Program:exit'(node: TSESTree.Program): void;
VariableDeclaration(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -851,7 +851,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
ObjectExpression(node: TSESTree.ObjectExpression): void;
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
- }
+ },
>;
export = rule;
}
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
index cbf83771..e88a7314 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
@@ -47,7 +47,7 @@ const isCommentToken = eslintUtils.isCommentToken as (
token: TSESTree.Token | TSESTree.Comment,
) => token is TSESTree.Comment;
const isNotCommentToken = eslintUtils.isNotCommentToken as <
- T extends TSESTree.Token | TSESTree.Comment
+ T extends TSESTree.Token | TSESTree.Comment,
>(
token: T,
) => token is Exclude<T, TSESTree.Comment>;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
index 1fd2e752..2b1584bc 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
@@ -5,7 +5,7 @@ import { RuleCreateFunction, RuleModule } from '../ts-eslint';
*/
type InferOptionsTypeFromRule<T> = T extends RuleModule<
infer _TMessageIds,
- infer TOptions
+ infer TOptions,
>
? TOptions
: T extends RuleCreateFunction<infer _TMessageIds, infer TOptions>
@@ -17,7 +17,7 @@ type InferOptionsTypeFromRule<T> = T extends RuleModule<
*/
type InferMessageIdsTypeFromRule<T> = T extends RuleModule<
infer TMessageIds,
- infer _TOptions
+ infer _TOptions,
>
? TMessageIds
: T extends RuleCreateFunction<infer TMessageIds, infer _TOptions>
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
index ca1cfb33..f02b7589 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
@@ -19,7 +19,7 @@ function RuleCreator(urlCreator: (ruleName: string) => string) {
return function createRule<
TOptions extends readonly unknown[],
TMessageIds extends string,
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>({
name,
meta,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
index 6ed25e4a..29a56671 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
@@ -24,13 +24,13 @@ function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(
*/
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
test: InvalidTestCase<TMessageIds, TOptions>,
): InvalidTestCase<TMessageIds, TOptions>[];
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
options: ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>,
): (ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>)[] {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
index 925d4976..27ad5792 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
@@ -9,7 +9,7 @@ const ERROR_MESSAGE =
*/
function getParserServices<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
allowWithoutFullTypeInformation = false,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
index 15c69bbf..1999c4f4 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
@@ -27,13 +27,14 @@ const Definition = ESLintDefinition as DefinitionConstructor;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ParameterDefinition extends Definition {}
-const ParameterDefinition = ESLintParameterDefinition as DefinitionConstructor & {
- new (
- name: TSESTree.Node,
- node: TSESTree.Node,
- index?: number | null,
- rest?: boolean,
- ): ParameterDefinition;
-};
+const ParameterDefinition =
+ ESLintParameterDefinition as DefinitionConstructor & {
+ new (
+ name: TSESTree.Node,
+ node: TSESTree.Node,
+ index?: number | null,
+ rest?: boolean,
+ ): ParameterDefinition;
+ };
export { Definition, ParameterDefinition };
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
index 49f1e11c..9b2c711d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
@@ -142,8 +142,9 @@ const ModuleScope = ESLintModuleScope as ScopeConstructor &
ScopeChildConstructorWithUpperScope<ModuleScope>;
interface FunctionExpressionNameScope extends Scope {}
-const FunctionExpressionNameScope = ESLintFunctionExpressionNameScope as ScopeConstructor &
- ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
+const FunctionExpressionNameScope =
+ ESLintFunctionExpressionNameScope as ScopeConstructor &
+ ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
interface CatchScope extends Scope {}
const CatchScope = ESLintCatchScope as ScopeConstructor &
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
index fec56c17..dfcc2347 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
@@ -71,7 +71,7 @@ declare class CLIEngineBase {
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
////////////////////
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
index 9abefbab..ec79326d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
@@ -38,7 +38,7 @@ declare class LinterBase {
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(
rulesToDefine: Record<
string,
- RuleModule<TMessageIds, TOptions> | RuleCreateFunction
+ RuleModule<TMessageIds, TOptions> | RuleCreateFunction,
>,
): void;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
index 8ced374d..076b1731 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -115,9 +115,8 @@ interface RuleFixer {
type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
-type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
- TMessageIds
->[];
+type ReportSuggestionArray<TMessageIds extends string> =
+ ReportDescriptorBase<TMessageIds>[];
interface ReportDescriptorBase<TMessageIds extends string> {
/**
@@ -162,14 +161,13 @@ interface ReportDescriptorLocOnly {
*/
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
}
-type ReportDescriptor<
- TMessageIds extends string
-> = ReportDescriptorWithSuggestion<TMessageIds> &
- (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
+type ReportDescriptor<TMessageIds extends string> =
+ ReportDescriptorWithSuggestion<TMessageIds> &
+ (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
interface RuleContext<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> {
/**
* The rule ID.
@@ -328,29 +326,21 @@ interface RuleListener {
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
- TSAbstractMethodDefinition?: RuleFunction<
- TSESTree.TSAbstractMethodDefinition
- >;
+ TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
- TSCallSignatureDeclaration?: RuleFunction<
- TSESTree.TSCallSignatureDeclaration
- >;
+ TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
- TSConstructSignatureDeclaration?: RuleFunction<
- TSESTree.TSConstructSignatureDeclaration
- >;
+ TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
- TSEmptyBodyFunctionExpression?: RuleFunction<
- TSESTree.TSEmptyBodyFunctionExpression
- >;
+ TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +361,7 @@ interface RuleListener {
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
- TSNamespaceExportDeclaration?: RuleFunction<
- TSESTree.TSNamespaceExportDeclaration
- >;
+ TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +388,8 @@ interface RuleListener {
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
- TSTypeParameterDeclaration?: RuleFunction<
- TSESTree.TSTypeParameterDeclaration
- >;
- TSTypeParameterInstantiation?: RuleFunction<
- TSESTree.TSTypeParameterInstantiation
- >;
+ TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
+ TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
@@ -426,7 +410,7 @@ interface RuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> {
/**
* Metadata about the rule
@@ -444,7 +428,7 @@ type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
export {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
index 652567f6..e237586d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
@@ -59,7 +59,7 @@ interface SuggestionOutput<TMessageIds extends string> {
interface InvalidTestCase<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> extends ValidTestCase<TOptions> {
/**
* Expected errors.
@@ -111,7 +111,7 @@ interface TestCaseError<TMessageIds extends string> {
interface RunTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> {
// RuleTester.run also accepts strings for valid cases
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
index 6907e229..bc3db012 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
@@ -19,7 +19,8 @@ namespace Scope {
export type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
export type ClassNameDefinition = scopeManager.ClassNameDefinition;
export type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
- export type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
+ export type ImplicitGlobalVariableDefinition =
+ scopeManager.ImplicitGlobalVariableDefinition;
export type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
export type ParameterDefinition = scopeManager.ParameterDefinition;
export type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
@@ -34,7 +35,8 @@ namespace Scope {
export type ClassScope = scopeManager.ClassScope;
export type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
export type ForScope = scopeManager.ForScope;
- export type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
+ export type FunctionExpressionNameScope =
+ scopeManager.FunctionExpressionNameScope;
export type FunctionScope = scopeManager.FunctionScope;
export type FunctionTypeScope = scopeManager.FunctionTypeScope;
export type GlobalScope = scopeManager.GlobalScope;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
index 1bfb569e..654b27bf 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
@@ -6,7 +6,7 @@ class CatchClauseDefinition extends DefinitionBase<
DefinitionType.CatchClause,
TSESTree.CatchClause,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']) {
super(DefinitionType.CatchClause, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
index 5d587b34..9279dd8b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
@@ -6,7 +6,7 @@ class ClassNameDefinition extends DefinitionBase<
DefinitionType.ClassName,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']) {
super(DefinitionType.ClassName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
index ed25a722..7147ebc6 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
@@ -8,7 +8,7 @@ abstract class DefinitionBase<
TType extends DefinitionType,
TNode extends TSESTree.Node,
TParent extends TSESTree.Node | null,
- TName extends TSESTree.Node = TSESTree.BindingName
+ TName extends TSESTree.Node = TSESTree.BindingName,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
index b4cf2405..80e83b7c 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
@@ -9,7 +9,7 @@ class FunctionNameDefinition extends DefinitionBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']) {
super(DefinitionType.FunctionName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
index 43012c0f..67cfbf3b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
@@ -6,7 +6,7 @@ class ImplicitGlobalVariableDefinition extends DefinitionBase<
DefinitionType.ImplicitGlobalVariable,
TSESTree.Node,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(
name: TSESTree.BindingName,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
index 874edadf..d4f11607 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
@@ -9,7 +9,7 @@ class ImportBindingDefinition extends DefinitionBase<
| TSESTree.ImportNamespaceSpecifier
| TSESTree.TSImportEqualsDeclaration,
TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
@@ -20,7 +20,7 @@ class ImportBindingDefinition extends DefinitionBase<
name: TSESTree.Identifier,
node: Exclude<
ImportBindingDefinition['node'],
- TSESTree.TSImportEqualsDeclaration
+ TSESTree.TSImportEqualsDeclaration,
>,
decl: TSESTree.ImportDeclaration,
);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
index b0c0ea32..fb73b081 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
@@ -15,7 +15,7 @@ class ParameterDefinition extends DefinitionBase<
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
/**
* Whether the parameter definition is a part of a rest parameter.
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
index cff6bbaa..3670d070 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumMemberDefinition extends DefinitionBase<
DefinitionType.TSEnumMember,
TSESTree.TSEnumMember,
null,
- TSESTree.Identifier | TSESTree.StringLiteral
+ TSESTree.Identifier | TSESTree.StringLiteral,
> {
constructor(
name: TSESTree.Identifier | TSESTree.StringLiteral,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
index 5374a562..36d74cb8 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumNameDefinition extends DefinitionBase<
DefinitionType.TSEnumName,
TSESTree.TSEnumDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']) {
super(DefinitionType.TSEnumName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
index 98f90778..5b0c0a75 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
@@ -6,7 +6,7 @@ class TSModuleNameDefinition extends DefinitionBase<
DefinitionType.TSModuleName,
TSESTree.TSModuleDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']) {
super(DefinitionType.TSModuleName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
index ad3b4368..45a61e12 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
@@ -8,7 +8,7 @@ class TypeDefinition extends DefinitionBase<
| TSESTree.TSTypeAliasDeclaration
| TSESTree.TSTypeParameter,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']) {
super(DefinitionType.Type, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
index 975c5886..4ab2ca18 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
@@ -6,7 +6,7 @@ class VariableDefinition extends DefinitionBase<
DefinitionType.Variable,
TSESTree.VariableDeclarator,
TSESTree.VariableDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
index 90cd98bb..dc8ed7a3 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
@@ -6,5 +6,5 @@ import { ImplicitLibVariableOptions } from '../variable';
export const webworker_importscripts = {} as Record<
string,
- ImplicitLibVariableOptions
+ ImplicitLibVariableOptions,
>;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
index 95904428..2a741d28 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class BlockScope extends ScopeBase<
ScopeType.block,
TSESTree.BlockStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
index 46b4005f..e6b5f95f 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class CatchScope extends ScopeBase<
ScopeType.catch,
TSESTree.CatchClause,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
index ee28a31a..e0ae2613 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ClassScope extends ScopeBase<
ScopeType.class,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
index c20f1217..c0d88231 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ConditionalTypeScope extends ScopeBase<
ScopeType.conditionalType,
TSESTree.TSConditionalType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
index 36703b5d..b7f25494 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ForScope extends ScopeBase<
ScopeType.for,
TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
index a84bc4b2..b1731c9d 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class FunctionExpressionNameScope extends ScopeBase<
ScopeType.functionExpressionName,
TSESTree.FunctionExpression,
- Scope
+ Scope,
> {
public readonly functionExpressionScope: true;
constructor(
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
index 18e12321..6c362639 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
@@ -14,7 +14,7 @@ class FunctionScope extends ScopeBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.Program,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
index d459070c..d3cc8c5b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -11,7 +11,7 @@ class FunctionTypeScope extends ScopeBase<
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
index 3da909c1..87b727fc 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
@@ -18,7 +18,7 @@ class GlobalScope extends ScopeBase<
/**
* The global scope has no parent.
*/
- null
+ null,
> {
// note this is accessed in used in the legacy eslint-scope tests, so it can't be true private
private readonly implicit: {
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
index 9b5c2a05..c9729031 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class MappedTypeScope extends ScopeBase<
ScopeType.mappedType,
TSESTree.TSMappedType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a..90e2c0fb 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
@@ -137,7 +137,7 @@ type AnyScope = ScopeBase<ScopeType, TSESTree.Node, Scope | null>;
abstract class ScopeBase<
TType extends ScopeType,
TBlock extends TSESTree.Node,
- TUpper extends Scope | null
+ TUpper extends Scope | null,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
index 7a684564..f18a1aae 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class SwitchScope extends ScopeBase<
ScopeType.switch,
TSESTree.SwitchStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
index 3962784a..ed79b3a9 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSEnumScope extends ScopeBase<
ScopeType.tsEnum,
TSESTree.TSEnumDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
index bdc7c7dc..3ca626f1 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSModuleScope extends ScopeBase<
ScopeType.tsModule,
TSESTree.TSModuleDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
index 7f21a60f..37c9cf78 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TypeScope extends ScopeBase<
ScopeType.type,
TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
index 84a3e4c7..b50fe2ba 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class WithScope extends ScopeBase<
ScopeType.with,
TSESTree.WithStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
index 69833caa..5255ed02 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
@@ -36,7 +36,7 @@ const QUOTED_STRING = /^["'](.+?)['"]$/;
type ALLOWED_VALUE = ['number' | 'boolean' | 'string', Set<unknown>?];
const ALLOWED_OPTIONS: Map<string, ALLOWED_VALUE> = new Map<
keyof AnalyzeOptions,
- ALLOWED_VALUE
+ ALLOWED_VALUE,
>([
['ecmaVersion', ['number']],
['globalReturn', ['boolean']],
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
index d20ab14f..8f04f4a8 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
@@ -3,11 +3,11 @@ import { simpleTraverse } from '@typescript-eslint/typescript-estree';
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(ast: TSESTree.Node, selector: TSelector): TNode;
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(
ast: TSESTree.Node,
selector: TSelector,
@@ -16,7 +16,7 @@ function getSpecificNode<
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
TNode extends Extract<TSESTree.Node, { type: TSelector }>,
- TReturnType extends TSESTree.Node
+ TReturnType extends TSESTree.Node,
>(
ast: TSESTree.Node,
selector: TSelector,
diff --git a/repos/typescript-eslint/packages/types/src/ts-estree.ts b/repos/typescript-eslint/packages/types/src/ts-estree.ts
index 4dd89c96..a17252d8 100644
--- a/repos/typescript-eslint/packages/types/src/ts-estree.ts
+++ b/repos/typescript-eslint/packages/types/src/ts-estree.ts
@@ -130,7 +130,7 @@ export type Token =
export type OptionalRangeAndLoc<T> = Pick<
T,
- Exclude<keyof T, 'range' | 'loc'>
+ Exclude<keyof T, 'range' | 'loc'>,
> & {
range?: Range;
loc?: SourceLocation;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
index a22eae1a..43bfd6ba 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
@@ -821,7 +821,7 @@ export class Converter {
const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node);
const result = this.createNode<
- TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration
+ TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration,
>(node, {
type:
isDeclare || !node.body
@@ -846,9 +846,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -1002,7 +1003,7 @@ export class Converter {
case SyntaxKind.PropertyDeclaration: {
const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty
+ TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty,
>(node, {
type: isAbstract
? AST_NODE_TYPES.TSAbstractClassProperty
@@ -1050,7 +1051,7 @@ export class Converter {
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration: {
const method = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1070,9 +1071,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- method.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ method.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(method, method.typeParameters.range);
}
@@ -1112,7 +1114,7 @@ export class Converter {
: AST_NODE_TYPES.MethodDefinition;
result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
@@ -1161,7 +1163,7 @@ export class Converter {
node.getFirstToken()!;
const constructor = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1177,9 +1179,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- constructor.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ constructor.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(constructor, constructor.typeParameters.range);
}
@@ -1196,7 +1199,7 @@ export class Converter {
const isStatic = hasModifier(SyntaxKind.StaticKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: hasModifier(SyntaxKind.AbstractKeyword, node)
? AST_NODE_TYPES.TSAbstractMethodDefinition
@@ -1234,9 +1237,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1332,9 +1336,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1439,10 +1444,11 @@ export class Converter {
let result: TSESTree.RestElement | TSESTree.AssignmentPattern;
if (node.dotDotDotToken) {
- parameter = result = this.createNode<TSESTree.RestElement>(node, {
- type: AST_NODE_TYPES.RestElement,
- argument: this.convertChild(node.name),
- });
+ parameter = result =
+ this.createNode<TSESTree.RestElement>(node, {
+ type: AST_NODE_TYPES.RestElement,
+ argument: this.convertChild(node.name),
+ });
} else if (node.initializer) {
parameter = this.convertChild(node.name) as TSESTree.BindingName;
result = this.createNode<TSESTree.AssignmentPattern>(node, {
@@ -1512,7 +1518,7 @@ export class Converter {
);
const result = this.createNode<
- TSESTree.ClassDeclaration | TSESTree.ClassExpression
+ TSESTree.ClassDeclaration | TSESTree.ClassExpression,
>(node, {
type: classNodeType,
id: this.convertChild(node.name),
@@ -1536,17 +1542,19 @@ export class Converter {
}
if (superClass.types[0]?.typeArguments) {
- result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(
- superClass.types[0].typeArguments,
- superClass.types[0],
- );
+ result.superTypeParameters =
+ this.convertTypeArgumentsToTypeParameters(
+ superClass.types[0].typeArguments,
+ superClass.types[0],
+ );
}
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (implementsClause) {
@@ -1788,7 +1796,7 @@ export class Converter {
return this.createNode<
| TSESTree.AssignmentExpression
| TSESTree.LogicalExpression
- | TSESTree.BinaryExpression
+ | TSESTree.BinaryExpression,
>(node, {
type,
operator: getTextForTokenKind(node.operatorToken.kind),
@@ -2313,9 +2321,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -2343,9 +2352,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
const accessibility = getTSNodeAccessibility(node);
@@ -2438,7 +2448,7 @@ export class Converter {
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSCallSignatureDeclaration
| TSESTree.TSFunctionType
- | TSESTree.TSConstructorType
+ | TSESTree.TSConstructorType,
>(node, {
type: type,
params: this.convertParameters(node.parameters),
@@ -2449,9 +2459,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
@@ -2459,7 +2470,7 @@ export class Converter {
case SyntaxKind.ExpressionWithTypeArguments: {
const result = this.createNode<
- TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements
+ TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements,
>(node, {
type:
parent && parent.kind === SyntaxKind.InterfaceDeclaration
@@ -2490,9 +2501,10 @@ export class Converter {
});
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (interfaceHeritageClauses.length > 0) {
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
index e00663a1..a3f007a0 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
@@ -18,7 +18,7 @@ const log = debug('typescript-eslint:typescript-estree:createWatchProgram');
*/
const knownWatchProgramMap = new Map<
CanonicalPath,
- ts.WatchOfConfigFile<ts.BuilderProgram>
+ ts.WatchOfConfigFile<ts.BuilderProgram>,
>();
/**
@@ -27,11 +27,11 @@ const knownWatchProgramMap = new Map<
*/
const fileWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
const folderWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
/**
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
index 36ca3f80..a3758fff 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
@@ -191,7 +191,7 @@ export interface ParserWeakMap<TKey, TValueBase> {
}
export interface ParserWeakMapESTreeToTSNode<
- TKey extends TSESTree.Node = TSESTree.Node
+ TKey extends TSESTree.Node = TSESTree.Node,
> {
get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
has(key: unknown): boolean;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index 62053920..ff7aea73 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -281,5 +281,5 @@ export interface EstreeToTsNodeTypes {
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<
TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>,
// if this errors, it means that one of the AST_NODE_TYPES is not defined in the above interface
- EstreeToTsNodeTypes[T['type']]
+ EstreeToTsNodeTypes[T['type']],
>;
diff --git a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 36726ac1..9ce5ca68 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -159,9 +159,8 @@ describe('semanticInfo', () => {
const computedPropertyString = ((parseResult.ast
.body[1] as TSESTree.ClassDeclaration).body
.body[0] as TSESTree.ClassProperty).key;
- const tsComputedPropertyString = parseResult.services.esTreeNodeToTSNodeMap.get(
- computedPropertyString,
- );
+ const tsComputedPropertyString =
+ parseResult.services.esTreeNodeToTSNodeMap.get(computedPropertyString);
expect(tsComputedPropertyString.kind).toEqual(ts.SyntaxKind.StringLiteral);
});
diff --git a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
index 1b386be1..1a6a815d 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
@@ -98,7 +98,7 @@ export function omitDeep<T = UnknownObject>(
keysToOmit: { key: string; predicate: (value: unknown) => boolean }[] = [],
selectors: Record<
string,
- (node: UnknownObject, parent: UnknownObject | null) => void
+ (node: UnknownObject, parent: UnknownObject | null) => void,
> = {},
): UnknownObject {
function shouldOmit(keyName: string, val: unknown): boolean {
diff --git a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
index 68c6b806..a9ed3cdb 100644
--- a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
+++ b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
@@ -7,7 +7,7 @@ interface VisitorKeys {
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
// strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs
diff --git a/repos/typescript-eslint/tools/generate-contributors.ts b/repos/typescript-eslint/tools/generate-contributors.ts
index 38c3690c..6bb908b3 100644
--- a/repos/typescript-eslint/tools/generate-contributors.ts
+++ b/repos/typescript-eslint/tools/generate-contributors.ts
@@ -42,9 +42,8 @@ async function* fetchUsers(page = 1): AsyncIterableIterator<Contributor[]> {
const response = await fetch(`${contributorsApiUrl}&page=${page}`, {
method: 'GET',
});
- const contributors:
- | Contributor[]
- | { message: string } = await response.json();
+ const contributors: Contributor[] | { message: string } =
+ await response.json();
if (!Array.isArray(contributors)) {
throw new Error(contributors.message);
run #10222 vs prettier/prettier#main
Error: Command failed with exit code 1: git checkout main
error: pathspec 'main?
' did not match any file(s) known to git
Something is not right. "#10222 vs main" shouldn't include those changes with trailing comma. Looks like "run #10222" compared PR 10222 not with the latest commit from main. Both 10222 and main include the TS trailing comma change, so it shouldn't have appeared in the diff.
E.g.:
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
@sosukesuzuki Can you have a look?
run #10222 vs prettier/prettier#6a55d91
prettier/prettier#10222 VS prettier/prettier@6a55d91
Submodule repos/babel contains modified content
Submodule repos/babel b63be94..6a12ee7:
diff --git a/repos/babel/packages/babel-core/src/config/config-chain.js b/repos/babel/packages/babel-core/src/config/config-chain.js
index 350111a1a..6e586eeaf 100644
--- a/repos/babel/packages/babel-core/src/config/config-chain.js
+++ b/repos/babel/packages/babel-core/src/config/config-chain.js
@@ -76,17 +76,15 @@ export function* buildPresetChain(
};
}
-export const buildPresetChainWalker: (
- arg: PresetInstance,
- context: *,
-) => * = makeChainWalker({
- root: preset => loadPresetDescriptors(preset),
- env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
- overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
- overridesEnv: (preset, index, envName) =>
- loadPresetOverridesEnvDescriptors(preset)(index)(envName),
- createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
-});
+export const buildPresetChainWalker: (arg: PresetInstance, context: *) => * =
+ makeChainWalker({
+ root: preset => loadPresetDescriptors(preset),
+ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
+ overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
+ overridesEnv: (preset, index, envName) =>
+ loadPresetOverridesEnvDescriptors(preset)(index)(envName),
+ createLogger: () => () => {}, // Currently we don't support logging how preset is expanded
+ });
const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>
buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),
);
@@ -705,10 +703,8 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
function dedupDescriptors(
items: Array<UnloadedDescriptor>,
): Array<UnloadedDescriptor> {
- const map: Map<
- Function,
- Map<string | void, { value: UnloadedDescriptor }>,
- > = new Map();
+ const map: Map<Function, Map<string | void, { value: UnloadedDescriptor }>> =
+ new Map();
const descriptors = [];
diff --git a/repos/babel/packages/babel-core/src/config/files/plugins.js b/repos/babel/packages/babel-core/src/config/files/plugins.js
index 298843e2d..fde98cfd3 100644
--- a/repos/babel/packages/babel-core/src/config/files/plugins.js
+++ b/repos/babel/packages/babel-core/src/config/files/plugins.js
@@ -14,8 +14,10 @@ const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/;
const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/;
const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/;
const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/;
-const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
-const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PLUGIN_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/;
+const OTHER_PRESET_ORG_RE =
+ /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/;
const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
export function resolvePlugin(name: string, dirname: string): string | null {
diff --git a/repos/babel/packages/babel-core/src/config/validation/options.js b/repos/babel/packages/babel-core/src/config/validation/options.js
index 27caf3bcc..529d6606d 100644
--- a/repos/babel/packages/babel-core/src/config/validation/options.js
+++ b/repos/babel/packages/babel-core/src/config/validation/options.js
@@ -369,10 +369,8 @@ function throwUnknownError(loc: OptionPath) {
const key = loc.name;
if (removed[key]) {
- const {
- message,
- version = 5,
- }: { message: string, version?: number } = removed[key];
+ const { message, version = 5 }: { message: string, version?: number } =
+ removed[key];
throw new Error(
`Using removed Babel ${version} option: ${msg(loc)} - ${message}`,
diff --git a/repos/babel/packages/babel-core/src/transformation/normalize-file.js b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
index aca84e1e4..8734534cc 100644
--- a/repos/babel/packages/babel-core/src/transformation/normalize-file.js
+++ b/repos/babel/packages/babel-core/src/transformation/normalize-file.js
@@ -98,8 +98,10 @@ export default function* normalizeFile(
// but without // or /* at the beginning of the comment.
// eslint-disable-next-line max-len
-const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
-const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
+const INLINE_SOURCEMAP_REGEX =
+ /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
+const EXTERNAL_SOURCEMAP_REGEX =
+ /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
function extractCommentsFromList(regex, comments, lastComment) {
if (comments) {
diff --git a/repos/babel/packages/babel-core/test/api.js b/repos/babel/packages/babel-core/test/api.js
index d715b6386..a8aed41cc 100644
--- a/repos/babel/packages/babel-core/test/api.js
+++ b/repos/babel/packages/babel-core/test/api.js
@@ -308,9 +308,8 @@ describe("api", function () {
new Plugin({
visitor: {
Function: function (path) {
- const alias = path.scope
- .getProgramParent()
- .path.get("body")[0].node;
+ const alias =
+ path.scope.getProgramParent().path.get("body")[0].node;
if (!babel.types.isTypeAlias(alias)) return;
// In case of `passPerPreset` being `false`, the
diff --git a/repos/babel/packages/babel-core/test/config-chain.js b/repos/babel/packages/babel-core/test/config-chain.js
index 8de2bc99d..4b3c1d10b 100644
--- a/repos/babel/packages/babel-core/test/config-chain.js
+++ b/repos/babel/packages/babel-core/test/config-chain.js
@@ -94,7 +94,8 @@ async function loadOptionsAsyncInSpawedProcess({ filename, cwd }) {
},
);
- const EXPERIMENTAL_WARNING = /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
+ const EXPERIMENTAL_WARNING =
+ /\(node:\d+\) ExperimentalWarning: The ESM module loader is experimental\./;
if (stderr.replace(EXPERIMENTAL_WARNING, "").trim()) {
throw new Error(
diff --git a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
index aca3cfa75..08fb1f6e0 100644
--- a/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
+++ b/repos/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
@@ -200,14 +200,8 @@ const privateNameHandlerSpec = {
get(member) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- methodId,
- getId,
- setId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, methodId, getId, setId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
@@ -264,13 +258,8 @@ const privateNameHandlerSpec = {
set(member, value) {
const { classRef, privateNamesMap, file } = this;
const { name } = member.node.property.id;
- const {
- id,
- static: isStatic,
- method: isMethod,
- setId,
- getId,
- } = privateNamesMap.get(name);
+ const { id, static: isStatic, method: isMethod, setId, getId } =
+ privateNamesMap.get(name);
const isAccessor = getId || setId;
if (isStatic) {
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/index.js b/repos/babel/packages/babel-helper-module-transforms/src/index.js
index 164462ee0..77b6845c0 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/index.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/index.js
@@ -214,10 +214,8 @@ const buildReexportsFromMeta = (
true,
);
} else {
- NAMESPACE_IMPORT = NAMESPACE_IMPORT = t.memberExpression(
- t.cloneNode(namespace),
- t.identifier(importName),
- );
+ NAMESPACE_IMPORT = NAMESPACE_IMPORT =
+ t.memberExpression(t.cloneNode(namespace), t.identifier(importName));
}
const astNodes = {
EXPORTS: meta.exportName,
@@ -243,23 +241,26 @@ function buildESModuleHeader(
metadata: ModuleMetadata,
enumerable: boolean = false,
) {
- return (enumerable
- ? template.statement`
+ return (
+ enumerable
+ ? template.statement`
EXPORTS.__esModule = true;
`
- : template.statement`
+ : template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
- `)({ EXPORTS: metadata.exportName });
+ `
+ )({ EXPORTS: metadata.exportName });
}
/**
* Create a re-export initialization loop for a specific imported namespace.
*/
function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose
- ? template.statement`
+ return (
+ loose
+ ? template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -268,13 +269,13 @@ function buildNamespaceReexport(metadata, namespace, loose) {
EXPORTS[key] = NAMESPACE[key];
});
`
- : // Also skip already assigned bindings if they are strictly equal
- // to be somewhat more spec-compliant when a file has multiple
- // namespace re-exports that would cause a binding to be exported
- // multiple times. However, multiple bindings of the same name that
- // export the same primitive value are silently skipped
- // (the spec requires an "ambigous bindings" early error here).
- template.statement`
+ : // Also skip already assigned bindings if they are strictly equal
+ // to be somewhat more spec-compliant when a file has multiple
+ // namespace re-exports that would cause a binding to be exported
+ // multiple times. However, multiple bindings of the same name that
+ // export the same primitive value are silently skipped
+ // (the spec requires an "ambigous bindings" early error here).
+ template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
@@ -287,7 +288,8 @@ function buildNamespaceReexport(metadata, namespace, loose) {
},
});
});
- `)({
+ `
+ )({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName
diff --git a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
index 4f31fd926..706d84efc 100644
--- a/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
+++ b/repos/babel/packages/babel-helper-module-transforms/src/rewrite-live-references.js
@@ -165,13 +165,8 @@ const buildImportThrow = localName => {
const rewriteReferencesVisitor = {
ReferencedIdentifier(path) {
- const {
- seen,
- buildImportReference,
- scope,
- imported,
- requeueInParent,
- } = this;
+ const { seen, buildImportReference, scope, imported, requeueInParent } =
+ this;
if (seen.has(path.node)) return;
seen.add(path.node);
diff --git a/repos/babel/packages/babel-parser/src/parser/statement.js b/repos/babel/packages/babel-parser/src/parser/statement.js
index 5827e5154..a1b0e5824 100644
--- a/repos/babel/packages/babel-parser/src/parser/statement.js
+++ b/repos/babel/packages/babel-parser/src/parser/statement.js
@@ -316,9 +316,8 @@ export default class StatementParser extends ExpressionParser {
}
takeDecorators(node: N.HasDecorators): void {
- const decorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const decorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (decorators.length) {
node.decorators = decorators;
this.resetStartLocationFromNode(node, decorators[0]);
@@ -331,9 +330,8 @@ export default class StatementParser extends ExpressionParser {
}
parseDecorators(allowExport?: boolean): void {
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
while (this.match(tt.at)) {
const decorator = this.parseDecorator();
currentContextDecorators.push(decorator);
@@ -2010,9 +2008,8 @@ export default class StatementParser extends ExpressionParser {
}
}
- const currentContextDecorators = this.state.decoratorStack[
- this.state.decoratorStack.length - 1
- ];
+ const currentContextDecorators =
+ this.state.decoratorStack[this.state.decoratorStack.length - 1];
// If node.declaration is a class, it will take all decorators in the current context.
// Thus we should throw if we see non-empty decorators here.
if (currentContextDecorators.length) {
diff --git a/repos/babel/packages/babel-parser/src/plugins/flow.js b/repos/babel/packages/babel-parser/src/plugins/flow.js
index 0e00291fc..db810370f 100644
--- a/repos/babel/packages/babel-parser/src/plugins/flow.js
+++ b/repos/babel/packages/babel-parser/src/plugins/flow.js
@@ -2962,7 +2962,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
node.callee = base;
const result = this.tryParse(() => {
- node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ node.typeArguments =
+ this.flowParseTypeParameterInstantiationCallOrNew();
this.expect(tt.parenL);
node.arguments = this.parseCallExpressionArguments(tt.parenR, false);
if (subscriptState.optionalChainMember) node.optional = false;
diff --git a/repos/babel/packages/babel-parser/src/tokenizer/context.js b/repos/babel/packages/babel-parser/src/tokenizer/context.js
index 5581e6b05..942f83b82 100644
--- a/repos/babel/packages/babel-parser/src/tokenizer/context.js
+++ b/repos/babel/packages/babel-parser/src/tokenizer/context.js
@@ -49,19 +49,23 @@ export const types: {
// When `=>` is eaten, the context update of `yield` is executed, however,
// `this.prodParam` still has `[Yield]` production because it is not yet updated
-tt.parenR.updateContext = tt.braceR.updateContext = function () {
- if (this.state.context.length === 1) {
- this.state.exprAllowed = true;
- return;
- }
+tt.parenR.updateContext = tt.braceR.updateContext =
+ function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
- let out = this.state.context.pop();
- if (out === types.braceStatement && this.curContext().token === "function") {
- out = this.state.context.pop();
- }
+ let out = this.state.context.pop();
+ if (
+ out === types.braceStatement &&
+ this.curContext().token === "function"
+ ) {
+ out = this.state.context.pop();
+ }
- this.state.exprAllowed = !out.isExpr;
-};
+ this.state.exprAllowed = !out.isExpr;
+ };
tt.name.updateContext = function (prevType) {
let allowed = false;
@@ -110,24 +114,25 @@ tt.incDec.updateContext = function () {
// tokExprAllowed stays unchanged
};
-tt._function.updateContext = tt._class.updateContext = function (prevType) {
- if (
- prevType.beforeExpr &&
- prevType !== tt.semi &&
- prevType !== tt._else &&
- !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
- !(
- (prevType === tt.colon || prevType === tt.braceL) &&
- this.curContext() === types.b_stat
- )
- ) {
- this.state.context.push(types.functionExpression);
- } else {
- this.state.context.push(types.functionStatement);
- }
+tt._function.updateContext = tt._class.updateContext =
+ function (prevType) {
+ if (
+ prevType.beforeExpr &&
+ prevType !== tt.semi &&
+ prevType !== tt._else &&
+ !(prevType === tt._return && this.hasPrecedingLineBreak()) &&
+ !(
+ (prevType === tt.colon || prevType === tt.braceL) &&
+ this.curContext() === types.b_stat
+ )
+ ) {
+ this.state.context.push(types.functionExpression);
+ } else {
+ this.state.context.push(types.functionStatement);
+ }
- this.state.exprAllowed = false;
-};
+ this.state.exprAllowed = false;
+ };
tt.backQuote.updateContext = function () {
if (this.curContext() === types.template) {
diff --git a/repos/babel/packages/babel-parser/src/types.js b/repos/babel/packages/babel-parser/src/types.js
index d5a28729d..b75520a79 100644
--- a/repos/babel/packages/babel-parser/src/types.js
+++ b/repos/babel/packages/babel-parser/src/types.js
@@ -1137,9 +1137,10 @@ export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & {
typeAnnotation: ?TsTypeAnnotation,
};
-export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & {
- typeParameters: ?TsTypeParameterDeclaration,
-};
+export type TsSignatureDeclarationBase =
+ TsSignatureDeclarationOrIndexSignatureBase & {
+ typeParameters: ?TsTypeParameterDeclaration,
+ };
// ================
// TypeScript type members (for type literal / interface / class)
diff --git a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
index d860d884e..e19a77552 100644
--- a/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
+++ b/repos/babel/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js
@@ -33,9 +33,10 @@ const WARNING_CALLS = new WeakSet();
*/
function applyEnsureOrdering(path) {
// TODO: This should probably also hoist computed properties.
- const decorators = (path.isClass()
- ? [path].concat(path.get("body.body"))
- : path.get("properties")
+ const decorators = (
+ path.isClass()
+ ? [path].concat(path.get("body.body"))
+ : path.get("properties")
).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);
const identDecorators = decorators.filter(
@@ -47,9 +48,8 @@ function applyEnsureOrdering(path) {
identDecorators
.map(decorator => {
const expression = decorator.expression;
- const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(
- "dec",
- ));
+ const id = (decorator.expression =
+ path.scope.generateDeclaredUidIdentifier("dec"));
return t.assignmentExpression("=", id, expression);
})
.concat([path.node]),
diff --git a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
index e1f9b7d51..387e2634c 100644
--- a/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
+++ b/repos/babel/packages/babel-plugin-proposal-object-rest-spread/src/index.js
@@ -357,11 +357,8 @@ export default declare((api, opts) => {
path.isObjectPattern(),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(objectPatternPath, file, ref);
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(objectPatternPath, file, ref);
if (loose) {
removeUnusedExcludedKeys(objectPatternPath);
@@ -440,11 +437,8 @@ export default declare((api, opts) => {
]),
);
- const [
- impureComputedPropertyDeclarators,
- argument,
- callExpression,
- ] = createObjectSpread(leftPath, file, t.identifier(refName));
+ const [impureComputedPropertyDeclarators, argument, callExpression] =
+ createObjectSpread(leftPath, file, t.identifier(refName));
if (impureComputedPropertyDeclarators.length > 0) {
nodes.push(
diff --git a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
index cca55d21b..47dbd1ed3 100644
--- a/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-destructuring/src/index.js
@@ -4,11 +4,8 @@ import { types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);
- const {
- loose = false,
- useBuiltIns = false,
- allowArrayLike = false,
- } = options;
+ const { loose = false, useBuiltIns = false, allowArrayLike = false } =
+ options;
if (typeof loose !== "boolean") {
throw new Error(`.loose must be a boolean or undefined`);
@@ -296,10 +293,11 @@ export default declare((api, options) => {
const name = this.scope.generateUidIdentifierBasedOnNode(key);
this.nodes.push(this.buildVariableDeclaration(name, key));
if (!copiedPattern) {
- copiedPattern = pattern = {
- ...pattern,
- properties: pattern.properties.slice(),
- };
+ copiedPattern = pattern =
+ {
+ ...pattern,
+ properties: pattern.properties.slice(),
+ };
}
copiedPattern.properties[i] = {
...copiedPattern.properties[i],
diff --git a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
index 4608a225a..60989c943 100644
--- a/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
+++ b/repos/babel/packages/babel-plugin-transform-parameters/src/params.js
@@ -37,8 +37,8 @@ const iifeVisitor = {
}
},
// type annotations don't use or introduce "real" bindings
- "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration": path =>
- path.skip(),
+ "TypeAnnotation|TSTypeAnnotation|TypeParameterDeclaration|TSTypeParameterDeclaration":
+ path => path.skip(),
};
// last 2 parameters are optional -- they are used by proposal-object-rest-spread/src/index.js
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
index 1cdbf6491..2d944d58c 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/scripts/build-dist.js
@@ -10,8 +10,10 @@ const t = require("@babel/types");
const transformRuntime = require("../");
const runtimeVersion = require("@babel/runtime/package.json").version;
-const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default();
-const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default();
+const corejs2Definitions =
+ require("../lib/runtime-corejs2-definitions").default();
+const corejs3Definitions =
+ require("../lib/runtime-corejs3-definitions").default();
function outputFile(filePath, data) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
diff --git a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
index 12c1a20b8..046cbceda 100644
--- a/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
+++ b/repos/babel/packages/babel-plugin-transform-runtime/src/index.js
@@ -170,9 +170,9 @@ export default declare((api, options, dirname) => {
const corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2
- ? getCoreJS2Definitions
- : getCoreJS3Definitions)(runtimeVersion);
+ const { BuiltIns, StaticProperties, InstanceProperties } = (
+ injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions
+ )(runtimeVersion);
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
diff --git a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
index 95ca9b119..baeca41a9 100644
--- a/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
+++ b/repos/babel/packages/babel-preset-env/data/shipped-proposals.js
@@ -4,7 +4,7 @@
const proposalPlugins = new Set([
"proposal-class-properties",
- "proposal-private-methods"
+ "proposal-private-methods",
]);
// use intermediary object to enforce alphabetical key order
diff --git a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
index 0cd423af1..37370a9b6 100644
--- a/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
+++ b/repos/babel/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js
@@ -39,13 +39,14 @@ const corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)
return memo;
}, {});
-const corejs3PolyfillsWithShippedProposals = (corejs3ShippedProposalsList: string[]).reduce(
- (memo, key) => {
- memo[key] = corejs3Polyfills[key];
- return memo;
- },
- { ...corejs3PolyfillsWithoutProposals },
-);
+const corejs3PolyfillsWithShippedProposals =
+ (corejs3ShippedProposalsList: string[]).reduce(
+ (memo, key) => {
+ memo[key] = corejs3Polyfills[key];
+ return memo;
+ },
+ { ...corejs3PolyfillsWithoutProposals },
+ );
export default function (
_: any,
diff --git a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
index ea0cd6950..1b9d8c7db 100644
--- a/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-option-specific-excludes.spec.js
@@ -1,7 +1,7 @@
"use strict";
-const getOptionSpecificExcludesFor = require("../lib/get-option-specific-excludes")
- .default;
+const getOptionSpecificExcludesFor =
+ require("../lib/get-option-specific-excludes").default;
describe("defaults", () => {
describe("getOptionSpecificExcludesFor", () => {
diff --git a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
index 1958a7fa6..9b3541292 100644
--- a/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/get-platform-specific-default.spec.js
@@ -1,17 +1,16 @@
"use strict";
-const getCoreJS2PlatformSpecificDefaultFor = require("../lib/polyfills/corejs2/get-platform-specific-default")
- .default;
+const getCoreJS2PlatformSpecificDefaultFor =
+ require("../lib/polyfills/corejs2/get-platform-specific-default").default;
describe("defaults", () => {
describe("getCoreJS2PlatformSpecificDefaultFor", () => {
it("should return web polyfills for non-`node` platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
chrome: "63",
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toEqual([
"web.timers",
"web.immediate",
@@ -20,11 +19,10 @@ describe("defaults", () => {
});
it("shouldn't return web polyfills for node platform", () => {
- const defaultWebIncludesForChromeAndNode = getCoreJS2PlatformSpecificDefaultFor(
- {
+ const defaultWebIncludesForChromeAndNode =
+ getCoreJS2PlatformSpecificDefaultFor({
node: "8",
- },
- );
+ });
expect(defaultWebIncludesForChromeAndNode).toBeNull();
});
});
diff --git a/repos/babel/packages/babel-preset-env/test/index.spec.js b/repos/babel/packages/babel-preset-env/test/index.spec.js
index 291bb26c7..e6a2d00c6 100644
--- a/repos/babel/packages/babel-preset-env/test/index.spec.js
+++ b/repos/babel/packages/babel-preset-env/test/index.spec.js
@@ -1,18 +1,18 @@
"use strict";
const babelPresetEnv = require("../lib/index");
-const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin")
- .default;
-const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin")
- .default;
-const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin")
- .default;
-const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin")
- .default;
-const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin")
- .default;
-const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin")
- .default;
+const addCoreJS2UsagePlugin =
+ require("../lib/polyfills/corejs2/usage-plugin").default;
+const addCoreJS3UsagePlugin =
+ require("../lib/polyfills/corejs3/usage-plugin").default;
+const addRegeneratorUsagePlugin =
+ require("../lib/polyfills/regenerator/usage-plugin").default;
+const replaceCoreJS2EntryPlugin =
+ require("../lib/polyfills/corejs2/entry-plugin").default;
+const replaceCoreJS3EntryPlugin =
+ require("../lib/polyfills/corejs3/entry-plugin").default;
+const removeRegeneratorEntryPlugin =
+ require("../lib/polyfills/regenerator/entry-plugin").default;
const transformations = require("../lib/module-transformations").default;
const compatData = require("@babel/compat-data/plugins");
diff --git a/repos/babel/packages/babel-register/src/index.js b/repos/babel/packages/babel-register/src/index.js
index aea88df53..d9fefa1c4 100644
--- a/repos/babel/packages/babel-register/src/index.js
+++ b/repos/babel/packages/babel-register/src/index.js
@@ -4,9 +4,10 @@
* from a compiled Babel import.
*/
-exports = module.exports = function (...args) {
- return register(...args);
-};
+exports = module.exports =
+ function (...args) {
+ return register(...args);
+ };
exports.__esModule = true;
const node = require("./nodeWrapper");
diff --git a/repos/babel/packages/babel-standalone/src/generated/plugins.js b/repos/babel/packages/babel-standalone/src/generated/plugins.js
index 889f6a494..01a0ae395 100644
--- a/repos/babel/packages/babel-standalone/src/generated/plugins.js
+++ b/repos/babel/packages/babel-standalone/src/generated/plugins.js
@@ -259,7 +259,8 @@ export const all = {
"transform-new-target": transformNewTarget,
"transform-object-assign": transformObjectAssign,
"transform-object-super": transformObjectSuper,
- "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign,
+ "transform-object-set-prototype-of-to-assign":
+ transformObjectSetPrototypeOfToAssign,
"transform-parameters": transformParameters,
"transform-property-literals": transformPropertyLiterals,
"transform-property-mutators": transformPropertyMutators,
diff --git a/repos/babel/packages/babel-template/test/index.js b/repos/babel/packages/babel-template/test/index.js
index 7b893d7e4..63b821b0d 100644
--- a/repos/babel/packages/babel-template/test/index.js
+++ b/repos/babel/packages/babel-template/test/index.js
@@ -43,11 +43,12 @@ describe("@babel/template", function () {
describe("string-based", () => {
it("should handle replacing values from an object", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if (SOME_VAR === "") {}
`)({
- SOME_VAR: value,
- });
+ SOME_VAR: value,
+ });
expect(result.type).toBe("IfStatement");
expect(result.test.type).toBe("BinaryExpression");
@@ -56,7 +57,8 @@ describe("@babel/template", function () {
it("should handle replacing values given an array", () => {
const value = t.stringLiteral("some string value");
- const result = template(`
+ const result =
+ template(`
if ($0 === "") {}
`)([value]);
@@ -66,7 +68,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values with null to remove them", () => {
- const result = template(`
+ const result =
+ template(`
callee(ARG);
`)({ ARG: null });
@@ -76,7 +79,8 @@ describe("@babel/template", function () {
});
it("should handle replacing values that are string content", () => {
- const result = template(`
+ const result =
+ template(`
("ARG");
`)({ ARG: "some new content" });
@@ -88,7 +92,8 @@ describe("@babel/template", function () {
it("should automatically clone nodes if they are injected twice", () => {
const id = t.identifier("someIdent");
- const result = template(`
+ const result =
+ template(`
ID;
ID;
`)({ ID: id });
@@ -277,23 +282,26 @@ describe("@babel/template", function () {
describe(".syntacticPlaceholders", () => {
it("works in function body", () => {
- const output = template(`function f() %%A%%`)({
- A: t.blockStatement([]),
- });
+ const output =
+ template(`function f() %%A%%`)({
+ A: t.blockStatement([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"function f() {}"`);
});
it("works in class body", () => {
- const output = template(`class C %%A%%`)({
- A: t.classBody([]),
- });
+ const output =
+ template(`class C %%A%%`)({
+ A: t.classBody([]),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"class C {}"`);
});
it("replaces lowercase names", () => {
- const output = template(`%%foo%%`)({
- foo: t.numericLiteral(1),
- });
+ const output =
+ template(`%%foo%%`)({
+ foo: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
@@ -372,23 +380,26 @@ describe("@babel/template", function () {
describe("undefined", () => {
it("allows placeholders", () => {
- const output = template(`%%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`%%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("replaces identifiers", () => {
- const output = template(`FOO`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"1;"`);
});
it("doesn't mix placeholder styles", () => {
- const output = template(`FOO + %%FOO%%`)({
- FOO: t.numericLiteral(1),
- });
+ const output =
+ template(`FOO + %%FOO%%`)({
+ FOO: t.numericLiteral(1),
+ });
expect(generator(output).code).toMatchInlineSnapshot(`"FOO + 1;"`);
});
});
Submodule repos/eslint-plugin-vue contains modified content
Submodule repos/eslint-plugin-vue cc9c140..d542ae7:
diff --git a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
index b54c206..ed4a3dc 100644
--- a/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
+++ b/repos/eslint-plugin-vue/lib/rules/html-self-closing.js
@@ -164,7 +164,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLTagClose') {
return null
@@ -188,7 +189,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLSelfClosingTagClose') {
return null
diff --git a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
index 3f202fa..20c2593 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-extra-parens.js
@@ -176,7 +176,8 @@ function createForVueSyntax(context) {
}
return {
- "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
+ "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer":
+ verify,
'VElement > VExpressionContainer': verify
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
index 7c05083..1cfbd61 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-irregular-whitespace.js
@@ -15,8 +15,10 @@ const utils = require('../utils')
// Constants
// ------------------------------------------------------------------------------
-const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
-const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
+const ALL_IRREGULARS =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
+const IRREGULAR_WHITESPACE =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu
// ------------------------------------------------------------------------------
@@ -195,7 +197,8 @@ module.exports = {
const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
...(skipHTMLAttributeValues
? {
- 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue
+ 'VAttribute[directive=false] > VLiteral':
+ removeInvalidNodeErrorsInHTMLAttributeValue
}
: {}),
...(skipHTMLTextContents
diff --git a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
index 02ac6e3..d15bb4c 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
diff --git a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
index 7c0639b..3d2d8f0 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-side-effects-in-computed-properties.js
@@ -104,16 +104,17 @@ module.exports = {
}
const targetBody = scopeStack.body
- const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
- vueNode
- )).find((cp) => {
- return (
- cp.value &&
- node.loc.start.line >= cp.value.loc.start.line &&
- node.loc.end.line <= cp.value.loc.end.line &&
- targetBody === cp.value
- )
- })
+ const computedProperty =
+ /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
+ vueNode
+ )).find((cp) => {
+ return (
+ cp.value &&
+ node.loc.start.line >= cp.value.loc.start.line &&
+ node.loc.end.line <= cp.value.loc.end.line &&
+ targetBody === cp.value
+ )
+ })
if (computedProperty) {
if (!utils.isThis(node, context)) {
return
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
index b8a2057..709617e 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-mustaches.js
@@ -19,9 +19,10 @@ function stripQuotesForHTML(text) {
return text.slice(1, -1)
}
- const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
- text
- )
+ const re =
+ /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
+ text
+ )
if (!re) {
return null
}
diff --git a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
index 01549ca..c2440da 100644
--- a/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
+++ b/repos/eslint-plugin-vue/lib/rules/no-useless-v-bind.js
@@ -144,7 +144,8 @@ module.exports = {
}
return utils.defineTemplateBodyVisitor(context, {
- "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify
+ "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]":
+ verify
})
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
index ec35636..aac0924 100644
--- a/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
+++ b/repos/eslint-plugin-vue/lib/rules/require-explicit-emits.js
@@ -451,14 +451,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: ['${nameNode.value}']`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: ['${nameNode.value}']${
@@ -488,14 +484,10 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: {'${nameNode.value}': null}`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace =
+ /** @type {Token} */ (sourceCode.getFirstToken(object, isLeftBrace))
+ const objectRightBrace =
+ /** @type {Token} */ (sourceCode.getLastToken(object, isRightBrace))
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: {'${nameNode.value}': null}${
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
index 9a790e9..e670fa3 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/dynamic-directive-arguments.js
@@ -20,7 +20,8 @@ module.exports = {
}
return {
- 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
+ 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer':
+ reportDynamicArgument
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
index c356a67..af7dbcd 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/scope-attribute.js
@@ -23,7 +23,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope
+ "VAttribute[directive=true] > VDirectiveKey[name.name='scope']":
+ reportScope
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
index 1ce2748..ba59c6e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/slot-attribute.js
@@ -128,7 +128,8 @@ module.exports = {
return {
"VAttribute[directive=false][key.name='slot']": reportSlot,
- "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
+ "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']":
+ reportVBindSlot
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
index 219d2b3..5a53a9e 100644
--- a/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
+++ b/repos/eslint-plugin-vue/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
@@ -27,7 +27,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand
+ "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']":
+ reportPropModifierShorthand
}
}
}
diff --git a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
index f0cbe36..1bb5f57 100644
--- a/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
+++ b/repos/eslint-plugin-vue/lib/rules/v-slot-style.js
@@ -28,7 +28,10 @@ function normalizeOptions(options) {
}
if (typeof options === 'string') {
- normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options)
+ normalized.atComponent =
+ normalized.default =
+ normalized.named =
+ /** @type {"shorthand" | "longform"} */ (options)
} else if (options != null) {
/** @type {(keyof Options)[]} */
const keys = ['atComponent', 'default', 'named']
diff --git a/repos/eslint-plugin-vue/lib/utils/indent-common.js b/repos/eslint-plugin-vue/lib/utils/indent-common.js
index 9e6bfde..3f9f548 100644
--- a/repos/eslint-plugin-vue/lib/utils/indent-common.js
+++ b/repos/eslint-plugin-vue/lib/utils/indent-common.js
@@ -1078,9 +1078,8 @@ module.exports.defineVisitor = function create(
baseline.add(token)
} else if (baseline.has(offsetInfo.baseToken)) {
// The base token is a baseline token on this line, so inherit it.
- offsetInfo.expectedIndent = offsets.get(
- offsetInfo.baseToken
- ).expectedIndent
+ offsetInfo.expectedIndent =
+ offsets.get(offsetInfo.baseToken).expectedIndent
baseline.add(token)
} else {
// Otherwise, set the expected indent of this line.
@@ -1464,8 +1463,8 @@ module.exports.defineVisitor = function create(
ExportDefaultDeclaration(node) {
const exportToken = tokenStore.getFirstToken(node)
const defaultToken = tokenStore.getFirstToken(node, 1)
- const declarationToken = getFirstAndLastTokens(node.declaration)
- .firstToken
+ const declarationToken =
+ getFirstAndLastTokens(node.declaration).firstToken
setOffset([defaultToken, declarationToken], 1, exportToken)
},
/** @param {ExportNamedDeclaration} node */
@@ -1739,10 +1738,11 @@ module.exports.defineVisitor = function create(
'MemberExpression, MetaProperty'(node) {
const objectToken = tokenStore.getFirstToken(node)
if (node.type === 'MemberExpression' && node.computed) {
- const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore(
- node.property,
- isLeftBracket
- ))
+ const leftBracketToken =
+ /** @type {Token} */ (tokenStore.getTokenBefore(
+ node.property,
+ isLeftBracket
+ ))
const propertyToken = tokenStore.getTokenAfter(leftBracketToken)
const rightBracketToken = tokenStore.getTokenAfter(
node.property,
@@ -1777,10 +1777,11 @@ module.exports.defineVisitor = function create(
isLeftBracket
))
const keyToken = tokenStore.getTokenAfter(keyLeftToken)
- const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.key,
- isRightBracket
- )))
+ const keyRightToken = (lastKeyToken =
+ /** @type {Token} */ (tokenStore.getTokenAfter(
+ node.key,
+ isRightBracket
+ )))
if (hasPrefix) {
setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens)))
diff --git a/repos/eslint-plugin-vue/lib/utils/index.js b/repos/eslint-plugin-vue/lib/utils/index.js
index 0bcf801..460f3d4 100644
--- a/repos/eslint-plugin-vue/lib/utils/index.js
+++ b/repos/eslint-plugin-vue/lib/utils/index.js
@@ -838,11 +838,12 @@ module.exports = {
if (propValue.type === 'FunctionExpression') {
value = propValue.body
} else if (propValue.type === 'ObjectExpression') {
- const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
- propValue,
- 'get',
- (p) => p.value.type === 'FunctionExpression'
- ))
+ const get =
+ /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
+ propValue,
+ 'get',
+ (p) => p.value.type === 'FunctionExpression'
+ ))
value = get ? get.value.body : null
}
@@ -870,13 +871,14 @@ module.exports = {
}
if (arg.type === 'ObjectExpression') {
- const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
- arg,
- 'get',
- (p) =>
- p.value.type === 'FunctionExpression' ||
- p.value.type === 'ArrowFunctionExpression'
- ))
+ const getProperty =
+ /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
+ arg,
+ 'get',
+ (p) =>
+ p.value.type === 'FunctionExpression' ||
+ p.value.type === 'ArrowFunctionExpression'
+ ))
return getProperty ? getProperty.value : null
}
diff --git a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
index 85a0ad4..9c3a40c 100644
--- a/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
+++ b/repos/eslint-plugin-vue/tests/lib/rules/no-irregular-whitespace.js
@@ -11,9 +11,10 @@ const tester = new RuleTester({
parserOptions: { ecmaVersion: 2018 }
})
-const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
- ''
-)
+const IRREGULAR_WHITESPACES =
+ '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
+ ''
+ )
const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('')
const ALL_IRREGULAR_WHITESPACES = [].concat(
IRREGULAR_WHITESPACES,
Submodule repos/excalidraw 1973ae9..029ebb7:
Submodule repos/prettier contains modified content
Submodule repos/prettier 2c1b8f6..54d0e2c:
diff --git a/repos/prettier/scripts/release/steps/update-dependents-count.js b/repos/prettier/scripts/release/steps/update-dependents-count.js
index 1fb641bb6..b8e717537 100644
--- a/repos/prettier/scripts/release/steps/update-dependents-count.js
+++ b/repos/prettier/scripts/release/steps/update-dependents-count.js
@@ -23,9 +23,9 @@ async function update() {
const githubPage = await logPromise(
"Fetching github dependents count",
- fetch(
- "https://github.com/prettier/prettier/network/dependents"
- ).then((response) => response.text())
+ fetch("https://github.com/prettier/prettier/network/dependents").then(
+ (response) => response.text()
+ )
);
const dependentsCountGithub = Number(
githubPage
diff --git a/repos/prettier/src/language-html/conditional-comment.js b/repos/prettier/src/language-html/conditional-comment.js
index 228076446..f93551f98 100644
--- a/repos/prettier/src/language-html/conditional-comment.js
+++ b/repos/prettier/src/language-html/conditional-comment.js
@@ -7,7 +7,8 @@ const {
// https://css-tricks.com/how-to-create-an-ie-only-stylesheet
// <!--[if ... ]> ... <![endif]-->
-const IE_CONDITIONAL_START_END_COMMENT_REGEX = /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
+const IE_CONDITIONAL_START_END_COMMENT_REGEX =
+ /^(\[if([^\]]*?)]>)([\S\s]*?)<!\s*\[endif]$/;
// <!--[if ... ]><!-->
const IE_CONDITIONAL_START_COMMENT_REGEX = /^\[if([^\]]*?)]><!$/;
// <!--<![endif]-->
diff --git a/repos/prettier/src/language-html/print-preprocess.js b/repos/prettier/src/language-html/print-preprocess.js
index 896d72bcd..600947b77 100644
--- a/repos/prettier/src/language-html/print-preprocess.js
+++ b/repos/prettier/src/language-html/print-preprocess.js
@@ -336,11 +336,8 @@ function extractWhitespaces(ast /*, options*/) {
const localChildren = [];
- const {
- leadingWhitespace,
- text,
- trailingWhitespace,
- } = getLeadingAndTrailingHtmlWhitespace(child.value);
+ const { leadingWhitespace, text, trailingWhitespace } =
+ getLeadingAndTrailingHtmlWhitespace(child.value);
if (leadingWhitespace) {
localChildren.push({ type: TYPE_WHITESPACE });
diff --git a/repos/prettier/src/language-html/syntax-vue.js b/repos/prettier/src/language-html/syntax-vue.js
index 0ce5bb005..48bc66d47 100644
--- a/repos/prettier/src/language-html/syntax-vue.js
+++ b/repos/prettier/src/language-html/syntax-vue.js
@@ -79,7 +79,8 @@ function isVueEventBindingExpression(eventBindingValue) {
// arrow function or anonymous function
const fnExpRE = /^([\w$]+|\([^)]*?\))\s*=>|^function\s*\(/;
// simple member expression chain (a, a.b, a['b'], a["b"], a[0], a[b])
- const simplePathRE = /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
+ const simplePathRE =
+ /^[$A-Z_a-z][\w$]*(?:\.[$A-Z_a-z][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[$A-Z_a-z][\w$]*])*$/;
// https://github.com/vuejs/vue/blob/v2.5.17/src/compiler/helpers.js#L104
const value = eventBindingValue.trim();
diff --git a/repos/prettier/src/language-js/comments.js b/repos/prettier/src/language-js/comments.js
index e4e0caa09..d34fa03ce 100644
--- a/repos/prettier/src/language-js/comments.js
+++ b/repos/prettier/src/language-js/comments.js
@@ -588,10 +588,11 @@ function handleLastFunctionArgComments({
locEnd(getLast(parameters))
);
}
- const functionParamLeftParenIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- locEnd(enclosingNode.id)
- );
+ const functionParamLeftParenIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
+ text,
+ locEnd(enclosingNode.id)
+ );
return (
functionParamLeftParenIndex !== false &&
getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
diff --git a/repos/prettier/src/language-js/parse-postprocess.js b/repos/prettier/src/language-js/parse-postprocess.js
index be9dcd9dd..d74e063cc 100644
--- a/repos/prettier/src/language-js/parse-postprocess.js
+++ b/repos/prettier/src/language-js/parse-postprocess.js
@@ -21,10 +21,8 @@ function postprocess(ast, options) {
// Invalid decorators are removed since `@typescript-eslint/typescript-estree` v4
// https://github.com/typescript-eslint/typescript-eslint/pull/2375
if (options.parser === "typescript" && options.originalText.includes("@")) {
- const {
- esTreeNodeToTSNodeMap,
- tsNodeToESTreeNodeMap,
- } = options.tsParseResult;
+ const { esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } =
+ options.tsParseResult;
ast = visitNode(ast, (node) => {
const tsNode = esTreeNodeToTSNodeMap.get(node);
if (!tsNode) {
diff --git a/repos/prettier/src/language-js/parser-babel.js b/repos/prettier/src/language-js/parser-babel.js
index dad0eded4..b9f3282f7 100644
--- a/repos/prettier/src/language-js/parser-babel.js
+++ b/repos/prettier/src/language-js/parser-babel.js
@@ -62,10 +62,8 @@ function isFlowFile(text, options) {
text = text.slice(shebang.length);
}
- const firstNonSpaceNonCommentCharacterIndex = getNextNonSpaceNonCommentCharacterIndexWithStartIndex(
- text,
- 0
- );
+ const firstNonSpaceNonCommentCharacterIndex =
+ getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, 0);
if (firstNonSpaceNonCommentCharacterIndex !== false) {
text = text.slice(0, firstNonSpaceNonCommentCharacterIndex);
diff --git a/repos/prettier/src/language-markdown/constants.evaluate.js b/repos/prettier/src/language-markdown/constants.evaluate.js
index 1b9ab9d09..45c799f9e 100644
--- a/repos/prettier/src/language-markdown/constants.evaluate.js
+++ b/repos/prettier/src/language-markdown/constants.evaluate.js
@@ -27,7 +27,8 @@ const kPattern = unicodeRegex({ Script: ["Hangul"] })
.toString();
// http://spec.commonmark.org/0.25/#ascii-punctuation-character
-const asciiPunctuationCharset = /* prettier-ignore */ regexpUtil.charset(
+const asciiPunctuationCharset =
+ /* prettier-ignore */ regexpUtil.charset(
"!", '"', "#", "$", "%", "&", "'", "(", ")", "*",
"+", ",", "-", ".", "/", ":", ";", "<", "=", ">",
"?", "@", "[", "\\", "]", "^", "_", "`", "{", "|",
diff --git a/repos/prettier/src/language-markdown/utils.js b/repos/prettier/src/language-markdown/utils.js
index de21b4e60..4b7d2608e 100644
--- a/repos/prettier/src/language-markdown/utils.js
+++ b/repos/prettier/src/language-markdown/utils.js
@@ -51,9 +51,13 @@ function splitText(text, options) {
/** @type {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} */
const nodes = [];
- const tokens = (options.proseWrap === "preserve"
- ? text
- : text.replace(new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"), "$1$2")
+ const tokens = (
+ options.proseWrap === "preserve"
+ ? text
+ : text.replace(
+ new RegExp(`(${cjkPattern})\n(${cjkPattern})`, "g"),
+ "$1$2"
+ )
).split(/([\t\n ]+)/);
for (const [index, token] of tokens.entries()) {
// whitespace
diff --git a/repos/prettier/src/main/ast-to-doc.js b/repos/prettier/src/main/ast-to-doc.js
index 369e6fc50..3d5a5fec0 100644
--- a/repos/prettier/src/main/ast-to-doc.js
+++ b/repos/prettier/src/main/ast-to-doc.js
@@ -86,12 +86,8 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
}
function printPrettierIgnoredNode(node, options) {
- const {
- originalText,
- [Symbol.for("comments")]: comments,
- locStart,
- locEnd,
- } = options;
+ const { originalText, [Symbol.for("comments")]: comments, locStart, locEnd } =
+ options;
const start = locStart(node);
const end = locEnd(node);
diff --git a/repos/prettier/src/main/comments.js b/repos/prettier/src/main/comments.js
index 3903278c3..8dec303a2 100644
--- a/repos/prettier/src/main/comments.js
+++ b/repos/prettier/src/main/comments.js
@@ -313,10 +313,8 @@ function isOwnLineComment(text, options, decoratedComments, commentIndex) {
if (precedingNode) {
// Find first comment on the same line
for (let index = commentIndex - 1; index >= 0; index--) {
- const {
- comment,
- precedingNode: currentCommentPrecedingNode,
- } = decoratedComments[index];
+ const { comment, precedingNode: currentCommentPrecedingNode } =
+ decoratedComments[index];
if (
currentCommentPrecedingNode !== precedingNode ||
!isAllEmptyAndNoLineBreak(text.slice(locEnd(comment), start))
@@ -342,10 +340,8 @@ function isEndOfLineComment(text, options, decoratedComments, commentIndex) {
index < decoratedComments.length;
index++
) {
- const {
- comment,
- followingNode: currentCommentFollowingNode,
- } = decoratedComments[index];
+ const { comment, followingNode: currentCommentFollowingNode } =
+ decoratedComments[index];
if (
currentCommentFollowingNode !== followingNode ||
!isAllEmptyAndNoLineBreak(text.slice(end, locStart(comment)))
diff --git a/repos/prettier/tests_integration/__tests__/infer-parser.js b/repos/prettier/tests_integration/__tests__/infer-parser.js
index 5e27a6b09..88ea30065 100644
--- a/repos/prettier/tests_integration/__tests__/infer-parser.js
+++ b/repos/prettier/tests_integration/__tests__/infer-parser.js
@@ -163,11 +163,9 @@ describe("--write and --list-different with unknown path and no parser", () => {
});
describe("multiple files", () => {
- runPrettier("cli/infer-parser/", [
- "--list-different",
- "--write",
- "*",
- ]).test({ status: 0 });
+ runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
+ { status: 0 }
+ );
});
});
diff --git a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
index a420c561f..8622a9bce 100644
--- a/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
+++ b/repos/prettier/tests_integration/__tests__/line-suffix-boundary.js
@@ -3,14 +3,8 @@
/** @type {import('prettier')} */
const prettier = require("prettier-local");
-const {
- group,
- indent,
- line,
- lineSuffix,
- lineSuffixBoundary,
- softline,
-} = prettier.doc.builders;
+const { group, indent, line, lineSuffix, lineSuffixBoundary, softline } =
+ prettier.doc.builders;
const printDoc = require("../printDoc");
diff --git a/repos/prettier/website/README.md b/repos/prettier/website/README.md
index 53d5a2778..17c91ccbc 100644
--- a/repos/prettier/website/README.md
+++ b/repos/prettier/website/README.md
@@ -59,7 +59,6 @@ previous: doc0 # previous doc on sidebar for navigation
next: doc2 # next doc on the sidebar for navigation
# don’t include next if this is the last doc; don’t include previous if first doc
---
-
docs/
are published to https://prettier.io/docs/en/next/
and are considered to be the docs of the next (not yet released) version of Prettier. When a release happens, the docs from docs/
are copied to the website/versioned_docs/version-stable
directory, whose content is published to https://prettier.io/docs/en
.
@@ -73,7 +72,6 @@ title: Blog Post Title
author: Author Name
authorURL: http://github.com/author # (or some other link)-
In the blog post, you should include a line `<!--truncate-->`. This determines under which point text will be ignored when generating the preview of your blog post. Blog posts should have the file name format: `yyyy-mm-dd-your-file-name.md`.
diff --git a/repos/prettier/website/pages/playground-redirect.html b/repos/prettier/website/pages/playground-redirect.html
index e8bc4a40f..f03a9a573 100644
--- a/repos/prettier/website/pages/playground-redirect.html
+++ b/repos/prettier/website/pages/playground-redirect.html
@@ -16,9 +16,10 @@
/>
</p>
<script>
- const match = /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
- document.referrer
- );
+ const match =
+ /^https:\/\/github\.com\/prettier\/prettier\/pull\/(\d+)/.exec(
+ document.referrer
+ );
if (match != null) {
const [, /* url */ pr] = match;
location.replace(
diff --git a/repos/prettier/website/playground/util.js b/repos/prettier/website/playground/util.js
index b41bde90e..8a22a34df 100644
--- a/repos/prettier/website/playground/util.js
+++ b/repos/prettier/website/playground/util.js
@@ -55,7 +55,8 @@ export function getCodemirrorMode(parser) {
const astAutoFold = {
estree: /^\s*"(loc|start|end)":/,
postcss: /^\s*"(source|input|raws|file)":/,
- html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
+ html:
+ /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
mdast: /^\s*"position":/,
yaml: /^\s*"position":/,
glimmer: /^\s*"loc":/,
Submodule repos/typescript-eslint contains modified content
Submodule repos/typescript-eslint 7b701a3..c71cb37:
diff --git a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index bc26d9d9..c38a8702 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -55,9 +55,8 @@ function getExpectedIndentForNode(
sourceCodeLines: string[],
): number {
const lineIdx = node.loc.start.line - 1;
- const indent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- sourceCodeLines[lineIdx],
- )![1];
+ const indent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(sourceCodeLines[lineIdx])![1];
return indent.length;
}
function doIndent(line: string, indent: number): string {
@@ -333,9 +332,8 @@ export default createRule<Options, MessageIds>({
// +2 because we expect the string contents are indented one level
const expectedIndent = parentIndent + 2;
- const firstLineIndent = START_OF_LINE_WHITESPACE_MATCHER.exec(
- lines[0],
- )![1];
+ const firstLineIndent =
+ START_OF_LINE_WHITESPACE_MATCHER.exec(lines[0])![1];
const requiresIndent = firstLineIndent.length > 0;
if (requiresIndent) {
if (firstLineIndent.length !== expectedIndent) {
@@ -488,7 +486,8 @@ export default createRule<Options, MessageIds>({
return {
// valid
- 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest,
+ 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression':
+ checkValidTest,
// invalid - errors
[invalidTestsSelectorPath.join(' > ')]: checkInvalidTest,
// invalid - suggestions
@@ -502,7 +501,8 @@ export default createRule<Options, MessageIds>({
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
// special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest,
+ 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
+ checkInvalidTest,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
index b6da50bb..4e95b731 100644
--- a/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -19,7 +19,7 @@ export type RawRulesConfig = Record<
| {
severity?: RuleSeverity | 'warn' | 'none' | 'default';
options?: unknown;
- }
+ },
>;
export type MessageIds = 'failure';
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 7c2f237c..4bf17c25 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -102,8 +102,10 @@ export default util.createRule<[Options], MessageIds>({
The regex used are taken from the ones used in the official TypeScript repo -
https://github.com/microsoft/TypeScript/blob/master/src/compiler/scanner.ts#L281-L289
*/
- const commentDirectiveRegExSingleLine = /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
- const commentDirectiveRegExMultiLine = /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExSingleLine =
+ /^\/*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
+ const commentDirectiveRegExMultiLine =
+ /^\s*(?:\/|\*)*\s*@ts-(expect-error|ignore|check|nocheck)(.*)/;
const sourceCode = context.getSourceCode();
return {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 4521fcb1..37dfefd3 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -3,7 +3,8 @@ import * as util from '../util';
// tslint regex
// https://github.com/palantir/tslint/blob/95d9d958833fd9dc0002d18cbe34db20d0fbf437/src/enableDisableRules.ts#L32
-const ENABLE_DISABLE_REGEX = /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
+const ENABLE_DISABLE_REGEX =
+ /^\s*tslint:(enable|disable)(?:-(line|next-line))?(:|\s|$)/;
const toText = (
text: string,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
index c9f03c89..2f2be15c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/ban-types.ts
@@ -13,7 +13,7 @@ type Types = Record<
| {
message: string;
fixWith?: string;
- }
+ },
>;
export type Options = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
index 7107bdf4..b1915bcb 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/brace-style.ts
@@ -26,10 +26,8 @@ export default createRule<Options, MessageIds>({
},
defaultOptions: ['1tbs'],
create(context) {
- const [
- style,
- { allowSingleLine } = { allowSingleLine: false },
- ] = context.options;
+ const [style, { allowSingleLine } = { allowSingleLine: false }] =
+ context.options;
const isAllmanStyle = style === 'allman';
const sourceCode = context.getSourceCode();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
index e0e06a67..be22b20c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -10,7 +10,7 @@ export type MessageIds = util.InferMessageIdsTypeFromRule<typeof baseRule>;
type Option = Options[0];
type NormalizedOptions = Required<
- Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>
+ Pick<Exclude<Option, string>, 'enums' | 'generics' | 'tuples'>,
>;
const OPTION_VALUE_SCHEME = [
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 5d14576a..096deaff 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -225,9 +225,10 @@ export default util.createRule<Options, MessageIds>({
const isTypeImport = report.node.importKind === 'type';
// we have a mixed type/value import, so we need to split them out into multiple exports
- const importNames = (isTypeImport
- ? report.valueSpecifiers
- : report.typeSpecifiers
+ const importNames = (
+ isTypeImport
+ ? report.valueSpecifiers
+ : report.typeSpecifiers
).map(specifier => `"${specifier.local.name}"`);
context.report({
node: report.node,
@@ -308,10 +309,11 @@ export default util.createRule<Options, MessageIds>({
(specifier): specifier is TSESTree.ImportNamespaceSpecifier =>
specifier.type === AST_NODE_TYPES.ImportNamespaceSpecifier,
) ?? null;
- const namedSpecifiers: TSESTree.ImportSpecifier[] = node.specifiers.filter(
- (specifier): specifier is TSESTree.ImportSpecifier =>
- specifier.type === AST_NODE_TYPES.ImportSpecifier,
- );
+ const namedSpecifiers: TSESTree.ImportSpecifier[] =
+ node.specifiers.filter(
+ (specifier): specifier is TSESTree.ImportSpecifier =>
+ specifier.type === AST_NODE_TYPES.ImportSpecifier,
+ );
return {
defaultSpecifier,
namespaceSpecifier,
@@ -476,11 +478,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier && !defaultSpecifier) {
// e.g.
@@ -687,11 +686,8 @@ export default util.createRule<Options, MessageIds>({
): IterableIterator<TSESLint.RuleFix> {
const { node } = report;
- const {
- defaultSpecifier,
- namespaceSpecifier,
- namedSpecifiers,
- } = classifySpecifier(node);
+ const { defaultSpecifier, namespaceSpecifier, namedSpecifiers } =
+ classifySpecifier(node);
if (namespaceSpecifier) {
// e.g.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
index 2c9dd9f2..b2b980cd 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -78,8 +78,8 @@ export default createRule<Options, MessageIds>({
const objectSymbol = typeChecker.getSymbolAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node.property),
);
- const modifierKind = objectSymbol?.getDeclarations()?.[0]
- ?.modifiers?.[0].kind;
+ const modifierKind =
+ objectSymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind;
if (
(allowPrivateClassPropertyAccess &&
modifierKind == ts.SyntaxKind.PrivateKeyword) ||
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 05c35c7a..088849f2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -248,7 +248,7 @@ type MessageIds = 'wrongIndentation';
type AppliedOptions = ExcludeKeys<
// slight hack to make interface work with Record<string, unknown>
RequireKeys<Pick<IndentConfig, keyof IndentConfig>, keyof IndentConfig>,
- AST_NODE_TYPES.VariableDeclarator
+ AST_NODE_TYPES.VariableDeclarator,
> & {
VariableDeclarator: 'off' | VariableDeclaratorObj;
};
@@ -1570,9 +1570,9 @@ export default createRule<Options, MessageIds>({
* 2. Don't set any offsets against the first token of the node.
* 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
*/
- const offsetListeners = Object.keys(baseOffsetListeners).reduce<
- TSESLint.RuleListener
- >(
+ const offsetListeners = Object.keys(
+ baseOffsetListeners,
+ ).reduce<TSESLint.RuleListener>(
/*
* Offset listener calls are deferred until traversal is finished, and are called as
* part of the final `Program:exit` listener. This is necessary because a node might
@@ -1590,9 +1590,9 @@ export default createRule<Options, MessageIds>({
* ignored nodes are known.
*/
(acc, key) => {
- const listener = baseOffsetListeners[key] as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const listener = baseOffsetListeners[
+ key
+ ] as TSESLint.RuleFunction<TSESTree.Node>;
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
acc[key] = node => listenerCallQueue.push({ listener, node });
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
index de5b971f..fc28832e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -123,7 +123,7 @@ export const defaultOrder = [
];
const allMemberTypes = ['signature', 'field', 'method', 'constructor'].reduce<
- string[]
+ string[],
>((all, type) => {
all.push(type);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
index 54e68b2c..4775a1fe 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -130,12 +130,13 @@ export default util.createRule<Options, MessageIds>({
? parent.members
: [];
- const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] = members.filter(
- (element): element is TSESTree.TSMethodSignature =>
- element.type === AST_NODE_TYPES.TSMethodSignature &&
- element !== methodNode &&
- getMethodKey(element) === getMethodKey(methodNode),
- );
+ const duplicatedKeyMethodNodes: TSESTree.TSMethodSignature[] =
+ members.filter(
+ (element): element is TSESTree.TSMethodSignature =>
+ element.type === AST_NODE_TYPES.TSMethodSignature &&
+ element !== methodNode &&
+ getMethodKey(element) === getMethodKey(methodNode),
+ );
const isParentModule = isNodeParentModuleDeclaration(methodNode);
if (duplicatedKeyMethodNodes.length > 0) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
index 2640aee6..833f8b00 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/naming-convention-utils/format.ts
@@ -96,10 +96,9 @@ function validateUnderscores(name: string): boolean {
return !wasUnderscore;
}
-const PredefinedFormatToCheckFunction: Readonly<Record<
- PredefinedFormats,
- (name: string) => boolean
->> = {
+const PredefinedFormatToCheckFunction: Readonly<
+ Record<PredefinedFormats, (name: string) => boolean>,
+> = {
[PredefinedFormats.PascalCase]: isPascalCase,
[PredefinedFormats.StrictPascalCase]: isStrictPascalCase,
[PredefinedFormats.camelCase]: isCamelCase,
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index b58edd99..f507f372 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -32,8 +32,10 @@ export default util.createRule({
return {
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
- 'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
- 'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
+ 'MemberExpression[optional = true] > TSNonNullExpression.object':
+ checkExtraNonNullAssertion,
+ 'CallExpression[optional = true] > TSNonNullExpression.callee':
+ checkExtraNonNullAssertion,
};
},
});
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 0cb41337..1f45a489 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -84,9 +84,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
- let fullNumberNode:
- | TSESTree.Literal
- | TSESTree.UnaryExpression = node;
+ let fullNumberNode: TSESTree.Literal | TSESTree.UnaryExpression =
+ node;
let raw = node.raw;
if (
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
index fa67859f..21456319 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -73,7 +73,7 @@ export default util.createRule<Options, MessageIds>({
loc?: TSESTree.SourceLocation;
},
void,
- unknown
+ unknown,
> {
if (
options?.builtinGlobals &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index aee4963a..fcf11f3f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -443,9 +443,9 @@ export default createRule<Options, MessageId>({
// (Value to complexity ratio is dubious however)
}
// Otherwise just do type analysis on the function as a whole.
- const returnTypes = getCallSignaturesOfType(
- getNodeType(callback),
- ).map(sig => sig.getReturnType());
+ const returnTypes = getCallSignaturesOfType(getNodeType(callback)).map(
+ sig => sig.getReturnType(),
+ );
/* istanbul ignore if */ if (returnTypes.length === 0) {
// Not a callable function
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
index 395bbfdc..014b2c22 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
@@ -170,12 +170,16 @@ export default util.createRule({
return {
TSModuleDeclaration: enterDeclaration,
TSEnumDeclaration: enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]':
+ enterDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]':
+ enterDeclaration,
'TSModuleDeclaration:exit': exitDeclaration,
'TSEnumDeclaration:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration,
- 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit':
+ exitDeclaration,
+ 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit':
+ exitDeclaration,
TSQualifiedName(node: TSESTree.TSQualifiedName): void {
visitNamespaceAccess(node, node.left, node.right);
},
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 6d5036c2..030f2748 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -11,7 +11,7 @@ type MakeRequired<Base, Key extends keyof Base> = Omit<Base, Key> &
type TypeParameterWithConstraint = MakeRequired<
TSESTree.TSTypeParameter,
- 'constraint'
+ 'constraint',
>;
const is3dot5 = semver.satisfies(
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index b326c754..12284640 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -72,7 +72,8 @@ export default util.createRule({
return {
// ignore MemberExpression if it's parent is TSClassImplements or TSInterfaceHeritage
- ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression': checkMemberExpression,
+ ':not(TSClassImplements, TSInterfaceHeritage) > MemberExpression':
+ checkMemberExpression,
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
index 2b0bb32c..59680863 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -5,7 +5,8 @@ import {
} from '@typescript-eslint/experimental-utils';
import * as util from '../util';
-const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
+const SENTINEL_TYPE =
+ /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/;
/**
* Parses a given value as options.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
index 581e7ac1..01721d44 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/object-curly-spacing.ts
@@ -170,8 +170,8 @@ export default createRule<Options, MessageIds>({
): void {
if (isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween!(first, second);
- const secondType = sourceCode.getNodeByRangeIndex(second.range[0])!
- .type;
+ const secondType =
+ sourceCode.getNodeByRangeIndex(second.range[0])!.type;
const openingCurlyBraceMustBeSpaced =
options.arraysInObjectsException &&
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
index f49b5385..d21b088d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -134,10 +134,11 @@ export default createRule({
].join(', ')](node: TSESTree.MemberExpression): void {
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent as TSESTree.CallExpression;
- const compareNode = (callNode.parent?.type ===
- AST_NODE_TYPES.ChainExpression
- ? callNode.parent.parent
- : callNode.parent) as TSESTree.BinaryExpression;
+ const compareNode = (
+ callNode.parent?.type === AST_NODE_TYPES.ChainExpression
+ ? callNode.parent.parent
+ : callNode.parent
+ ) as TSESTree.BinaryExpression;
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index cd886a9d..0e15bf8f 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -65,10 +65,12 @@ export default util.createRule({
| TSESTree.MemberExpression,
): void {
// selector guarantees this cast
- const initialExpression = (initialIdentifierOrNotEqualsExpr.parent
- ?.type === AST_NODE_TYPES.ChainExpression
- ? initialIdentifierOrNotEqualsExpr.parent.parent
- : initialIdentifierOrNotEqualsExpr.parent) as TSESTree.LogicalExpression;
+ const initialExpression = (
+ initialIdentifierOrNotEqualsExpr.parent?.type ===
+ AST_NODE_TYPES.ChainExpression
+ ? initialIdentifierOrNotEqualsExpr.parent.parent
+ : initialIdentifierOrNotEqualsExpr.parent
+ ) as TSESTree.LogicalExpression;
if (initialExpression.left !== initialIdentifierOrNotEqualsExpr) {
// the node(identifier or member expression) is not the deepest left node
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 27eb7dca..0d4c3a7a 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -267,11 +267,11 @@ const DIRECTLY_INSIDE_CONSTRUCTOR = 0;
class ClassScope {
private readonly privateModifiableMembers = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly privateModifiableStatics = new Map<
string,
- ParameterOrPropertyDeclaration
+ ParameterOrPropertyDeclaration,
>();
private readonly memberVariableModifications = new Set<string>();
private readonly staticVariableModifications = new Set<string>();
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
index 99c455cd..764ca63d 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/require-await.ts
@@ -146,7 +146,7 @@ export default util.createRule({
'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(
node: Exclude<
TSESTree.Node,
- TSESTree.BlockStatement | TSESTree.AwaitExpression
+ TSESTree.BlockStatement | TSESTree.AwaitExpression,
>,
): void {
const expression = parserServices.esTreeNodeToTSNodeMap.get(node);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
index e73fd4b5..eccc264e 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/semi.ts
@@ -36,9 +36,8 @@ export default util.createRule<Options, MessageIds>({
],
create(context) {
const rules = baseRule.create(context);
- const checkForSemicolon = rules.ExpressionStatement as TSESLint.RuleFunction<
- TSESTree.Node
- >;
+ const checkForSemicolon =
+ rules.ExpressionStatement as TSESLint.RuleFunction<TSESTree.Node>;
/*
The following nodes are handled by the member-delimiter-style rule
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
index 08c3ad62..525febe2 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/rules/triple-slash-reference.ts
@@ -94,7 +94,8 @@ export default util.createRule<Options, MessageIds>({
return;
}
programNode = node;
- const referenceRegExp = /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
+ const referenceRegExp =
+ /^\/\s*<reference\s*(types|path|lib)\s*=\s*["|'](.*)["|']/;
const commentsBefore = sourceCode.getCommentsBefore(programNode);
commentsBefore.forEach(comment => {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index 19aaf335..2b9150a6 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -9,11 +9,11 @@ import * as util from '.';
class UnusedVarsVisitor<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> extends Visitor {
private static readonly RESULTS_CACHE = new WeakMap<
TSESTree.Program,
- ReadonlySet<TSESLint.Scope.Variable>
+ ReadonlySet<TSESLint.Scope.Variable>,
>();
readonly #scopeManager: TSESLint.Scope.ScopeManager;
@@ -32,7 +32,7 @@ class UnusedVarsVisitor<
public static collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: TSESLint.RuleContext<TMessageIds, TOptions>,
): ReadonlySet<TSESLint.Scope.Variable> {
@@ -747,7 +747,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
*/
function collectUnusedVariables<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
): ReadonlySet<TSESLint.Scope.Variable> {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
index 86e0ec23..fe531fec 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/index.ts
@@ -12,15 +12,10 @@ export * from './requiresQuoting';
export * from './types';
// this is done for convenience - saves migrating all of the old rules
-const {
- applyDefault,
- deepMerge,
- isObjectNotArray,
- getParserServices,
-} = ESLintUtils;
-type InferMessageIdsTypeFromRule<T> = ESLintUtils.InferMessageIdsTypeFromRule<
- T
->;
+const { applyDefault, deepMerge, isObjectNotArray, getParserServices } =
+ ESLintUtils;
+type InferMessageIdsTypeFromRule<T> =
+ ESLintUtils.InferMessageIdsTypeFromRule<T>;
type InferOptionsTypeFromRule<T> = ESLintUtils.InferOptionsTypeFromRule<T>;
export {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
index 2e6c4711..e7e0991b 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/src/util/misc.ts
@@ -91,11 +91,11 @@ function getNameFromMember(
type ExcludeKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = { [k in Exclude<keyof TObj, TKeys>]: TObj[k] };
type RequireKeys<
TObj extends Record<string, unknown>,
- TKeys extends keyof TObj
+ TKeys extends keyof TObj,
> = ExcludeKeys<TObj, TKeys> & { [k in TKeys]-?: Exclude<TObj[k], undefined> };
function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
index 103caeb5..d67ff887 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/docs.test.ts
@@ -137,9 +137,10 @@ describe('Validating README.md', () => {
for (const [ruleName, rule] of notDeprecated) {
describe(`Checking rule ${ruleName}`, () => {
- const ruleRow: string[] | undefined = (rule.meta.docs?.extendsBaseRule
- ? rulesTables.extension.cells
- : rulesTables.base.cells
+ const ruleRow: string[] | undefined = (
+ rule.meta.docs?.extendsBaseRule
+ ? rulesTables.extension.cells
+ : rulesTables.base.cells
).find(row => row[0].includes(`/${ruleName}.md`));
if (!ruleRow) {
// rule is in the wrong table, the first two tests will catch this, so no point in creating noise;
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index 5134d591..855e13a0 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -3804,7 +3804,7 @@ class Foo {
const sortedWithoutGroupingDefaultOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// default option + interface + multiple types
@@ -4182,7 +4182,7 @@ const foo = class Foo {
const sortedWithoutGroupingClassesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classes option + interface + multiple types --> Only member group order is checked (default config)
@@ -4392,7 +4392,7 @@ class Foo {
const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + multiple types --> Only member group order is checked (default config)
@@ -4629,7 +4629,7 @@ const foo = class Foo {
const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + multiple types
@@ -4864,7 +4864,7 @@ interface Foo {
const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + multiple types --> Only member group order is checked (default config)
@@ -5097,14 +5097,12 @@ type Foo = {
],
};
-const sortedWithGroupingDefaultOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // default option + interface + default order + alphabetically
- {
- code: `
+const sortedWithGroupingDefaultOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // default option + interface + default order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5121,14 +5119,14 @@ interface Foo {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + interface + custom order + alphabetically
- {
- code: `
+ // default option + interface + custom order + alphabetically
+ {
+ code: `
interface Foo {
new () : Bar;
@@ -5144,19 +5142,19 @@ interface Foo {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + default order + alphabetically
- {
- code: `
+ // default option + type literal + default order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5173,14 +5171,14 @@ type Foo = {
() : Baz;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + type literal + custom order + alphabetically
- {
- code: `
+ // default option + type literal + custom order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5197,19 +5195,19 @@ type Foo = {
() : Baz;
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'method', 'field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'method', 'field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + default order + alphabetically
- {
- code: `
+ // default option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5222,13 +5220,13 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
- // default option + class + decorators + default order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
+ // default option + class + decorators + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5245,14 +5243,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class + custom order + alphabetically
- {
- code: `
+ // default option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5265,19 +5263,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + default order + alphabetically
- {
- code: `
+ // default option + class expression + default order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5290,14 +5288,14 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // default option + class expression + custom order + alphabetically
- {
- code: `
+ // default option + class expression + custom order + alphabetically
+ {
+ code: `
const foo = class Foo {
constructor() {}
@@ -5310,20 +5308,20 @@ const foo = class Foo {
private static c: string = "";
}
`,
- options: [
- {
- default: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
- },
- },
- ],
- },
- ],
- invalid: [
- // default option + interface + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ },
+ ],
+ invalid: [
+ // default option + interface + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5340,23 +5338,23 @@ interface Foo {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + type literal + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + type literal + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5373,23 +5371,23 @@ type Foo = {
new () : Bar;
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'new',
- rank: 'method',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'new',
+ rank: 'method',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5400,23 +5398,23 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
+ ],
+ },
- // default option + class expression + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ // default option + class expression + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
const foo = class Foo {
public static c: string = "";
public static b: string = "";
@@ -5427,22 +5425,22 @@ const foo = class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
- },
- },
- ],
- },
- // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
+ },
+ ],
+ },
+ // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
@Dec() a1: string;
@Dec()
@@ -5459,47 +5457,45 @@ class Foo {
@Dec() d(): void
}
`,
- options: [
- {
- default: {
- memberTypes: [
- 'decorated-field',
- 'field',
- 'constructor',
- 'decorated-method',
- ],
- order: 'alphabetically',
- },
- },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b1',
- rank: 'constructor',
- },
- },
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'b2',
- rank: 'constructor',
- },
- },
- ],
- },
- ],
-};
-
-const sortedWithGroupingClassesOption: TSESLint.RunTests<
- MessageIds,
- Options
-> = {
- valid: [
- // classes option + interface + alphabetically --> Default order applies
- {
- code: `
+ options: [
+ {
+ default: {
+ memberTypes: [
+ 'decorated-field',
+ 'field',
+ 'constructor',
+ 'decorated-method',
+ ],
+ order: 'alphabetically',
+ },
+ },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b1',
+ rank: 'constructor',
+ },
+ },
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'b2',
+ rank: 'constructor',
+ },
+ },
+ ],
+ },
+ ],
+ };
+
+const sortedWithGroupingClassesOption: TSESLint.RunTests<MessageIds, Options> =
+ {
+ valid: [
+ // classes option + interface + alphabetically --> Default order applies
+ {
+ code: `
interface Foo {
[a: string] : number;
@@ -5516,12 +5512,12 @@ interface Foo {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + type literal + alphabetically --> Default order applies
- {
- code: `
+ // classes option + type literal + alphabetically --> Default order applies
+ {
+ code: `
type Foo = {
[a: string] : number;
@@ -5538,12 +5534,12 @@ type Foo = {
() : Baz;
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
- // classes option + class + default order + alphabetically
- {
- code: `
+ // classes option + class + default order + alphabetically
+ {
+ code: `
class Foo {
public static a: string;
protected static b: string = "";
@@ -5556,14 +5552,14 @@ class Foo {
constructor() {}
}
`,
- options: [
- { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- },
+ options: [
+ { classes: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ },
- // classes option + class + custom order + alphabetically
- {
- code: `
+ // classes option + class + custom order + alphabetically
+ {
+ code: `
class Foo {
constructor() {}
@@ -5576,19 +5572,19 @@ class Foo {
private static c: string = "";
}
`,
- options: [
- {
- classes: {
- memberTypes: ['constructor', 'instance-field', 'static-field'],
- order: 'alphabetically',
+ options: [
+ {
+ classes: {
+ memberTypes: ['constructor', 'instance-field', 'static-field'],
+ order: 'alphabetically',
+ },
},
- },
- ],
- },
+ ],
+ },
- // classes option + class expression + alphabetically --> Default order applies
- {
- code: `
+ // classes option + class expression + alphabetically --> Default order applies
+ {
+ code: `
const foo = class Foo {
public static a: string;
protected static b: string = "";
@@ -5601,13 +5597,13 @@ const foo = class Foo {
constructor() {}
}
`,
- options: [{ classes: { order: 'alphabetically' } }],
- },
- ],
- invalid: [
- // default option + class + wrong order within group and wrong group order + alphabetically
- {
- code: `
+ options: [{ classes: { order: 'alphabetically' } }],
+ },
+ ],
+ invalid: [
+ // default option + class + wrong order within group and wrong group order + alphabetically
+ {
+ code: `
class Foo {
public static c: string = "";
public static b: string = "";
@@ -5618,25 +5614,25 @@ class Foo {
public d: string = "";
}
`,
- options: [
- { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
- ],
- errors: [
- {
- messageId: 'incorrectGroupOrder',
- data: {
- name: 'd',
- rank: 'public constructor',
+ options: [
+ { default: { memberTypes: defaultOrder, order: 'alphabetically' } },
+ ],
+ errors: [
+ {
+ messageId: 'incorrectGroupOrder',
+ data: {
+ name: 'd',
+ rank: 'public constructor',
+ },
},
- },
- ],
- },
- ],
-};
+ ],
+ },
+ ],
+ };
const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// classExpressions option + interface + alphabetically --> Default order applies
@@ -5783,7 +5779,7 @@ const foo = class Foo {
const sortedWithGroupingInterfacesOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// interfaces option + interface + default order + alphabetically
@@ -5939,7 +5935,7 @@ interface Foo {
const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests<
MessageIds,
- Options
+ Options,
> = {
valid: [
// typeLiterals option + interface + alphabetically --> Default order applies
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index 93173074..eb3bec70 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -18,10 +18,9 @@ const parserOptions = {
project: './tsconfig.json',
};
-const formatTestNames: Readonly<Record<
- PredefinedFormatsString,
- Record<'valid' | 'invalid', string[]>
->> = {
+const formatTestNames: Readonly<
+ Record<PredefinedFormatsString, Record<'valid' | 'invalid', string[]>>,
+> = {
camelCase: {
valid: ['strictCamelCase', 'lower', 'camelCaseUNSTRICT'],
invalid: ['snake_case', 'UPPER_CASE', 'UPPER', 'StrictPascalCase'],
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index 0f7bb141..61caf073 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -72,27 +72,25 @@ const testCases = [
const validTestCases = flatten(
testCases.map(c => c.code.map(code => `const a = ${code}`)),
);
-const invalidTestCases: TSESLint.InvalidTestCase<
- MessageIds,
- Options
->[] = flatten(
- testCases.map(cas =>
- cas.code.map(code => ({
- code: `const a: ${cas.type} = ${code}`,
- output: `const a = ${code}`,
- errors: [
- {
- messageId: 'noInferrableType',
- data: {
- type: cas.type,
+const invalidTestCases: TSESLint.InvalidTestCase<MessageIds, Options>[] =
+ flatten(
+ testCases.map(cas =>
+ cas.code.map(code => ({
+ code: `const a: ${cas.type} = ${code}`,
+ output: `const a = ${code}`,
+ errors: [
+ {
+ messageId: 'noInferrableType',
+ data: {
+ type: cas.type,
+ },
+ line: 1,
+ column: 7,
},
- line: 1,
- column: 7,
- },
- ],
- })),
- ),
-);
+ ],
+ })),
+ ),
+ );
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
index c0934982..67b9d22c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/no-unused-vars-experimental.test.ts
@@ -21,7 +21,7 @@ const ruleTester = new RuleTester({
const hasExport = /^export/m;
// const hasImport = /^import .+? from ['"]/m;
function makeExternalModule<
- T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>
+ T extends ValidTestCase<Options> | InvalidTestCase<MessageIds, Options>,
>(tests: T[]): T[] {
return tests.map(t => {
if (!hasExport.test(t.code)) {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index 80340828..2afa8616 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -144,7 +144,7 @@ const baseCases = [
],
} as TSESLint.InvalidTestCase<
InferMessageIdsTypeFromRule<typeof rule>,
- InferOptionsTypeFromRule<typeof rule>
+ InferOptionsTypeFromRule<typeof rule>,
>),
);
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index 0cef8974..aefb7cd8 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1069,13 +1069,13 @@ function addOptional<TOptions extends Readonly<unknown[]>>(
): TSESLint.ValidTestCase<TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: TSESLint.InvalidTestCase<TMessageIds, TOptions>[],
): TSESLint.InvalidTestCase<TMessageIds, TOptions>[];
function addOptional<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
cases: (Case<TMessageIds, TOptions> | string)[],
): Case<TMessageIds, TOptions>[] {
diff --git a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
index e78808aa..ed84f286 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/tools/generate-configs.ts
@@ -49,10 +49,8 @@ const BASE_RULES_TO_BE_OVERRIDDEN = new Map(
);
const EXTENDS = ['./configs/base', './configs/eslint-recommended'];
-const ruleEntries: [
- string,
- TSESLint.RuleModule<string, unknown[]>,
-][] = Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
+const ruleEntries: [string, TSESLint.RuleModule<string, unknown[]>][] =
+ Object.entries(rules).sort((a, b) => a[0].localeCompare(b[0]));
/**
* Helper function reduces records to key - value pairs.
diff --git a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
index 49e48541..2c35583c 100644
--- a/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/repos/typescript-eslint/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -20,7 +20,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -40,7 +40,7 @@ declare module 'eslint/lib/rules/camelcase' {
],
{
Identifier(node: TSESTree.Identifier): void;
- }
+ },
>;
export = rule;
}
@@ -136,7 +136,7 @@ declare module 'eslint/lib/rules/indent' {
JSXOpeningElement(node: TSESTree.JSXOpeningElement): void;
JSXClosingElement(node: TSESTree.JSXClosingElement): void;
JSXExpressionContainer(node: TSESTree.JSXExpressionContainer): void;
- }
+ },
>;
export = rule;
}
@@ -154,7 +154,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
{
before?: boolean;
after?: boolean;
- }
+ },
>;
},
];
@@ -215,7 +215,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
ImportNamespaceSpecifier: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
MethodDefinition: RuleFunction<TSESTree.MethodDefinition>;
Property: RuleFunction<TSESTree.Property>;
- }
+ },
>;
export = rule;
}
@@ -231,7 +231,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
ClassBody(): void;
'ClassBody:exit'(): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -245,7 +245,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -263,7 +263,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
{
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -280,7 +280,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
[],
{
Program(node: TSESTree.Program): void;
- }
+ },
>;
export = rule;
}
@@ -295,7 +295,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
FunctionExpression(node: TSESTree.FunctionExpression): void;
FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -318,7 +318,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -335,7 +335,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -354,7 +354,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -373,7 +373,7 @@ declare module 'eslint/lib/rules/no-shadow' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -390,7 +390,7 @@ declare module 'eslint/lib/rules/no-undef' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -415,7 +415,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -434,7 +434,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
],
{
ExpressionStatement(node: TSESTree.ExpressionStatement): void;
- }
+ },
>;
export = rule;
}
@@ -454,7 +454,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
)[],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -476,7 +476,7 @@ declare module 'eslint/lib/rules/strict' {
['never' | 'global' | 'function' | 'safe'],
{
ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void;
- }
+ },
>;
export = rule;
}
@@ -489,7 +489,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
[],
{
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -542,7 +542,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
WhileStatement(node: TSESTree.WhileStatement): void;
WithStatement(node: TSESTree.WithStatement): void;
YieldExpression(node: TSESTree.YieldExpression): void;
- }
+ },
>;
export = rule;
}
@@ -572,7 +572,7 @@ declare module 'eslint/lib/rules/semi' {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -592,7 +592,7 @@ declare module 'eslint/lib/rules/quotes' {
{
Literal(node: TSESTree.Literal): void;
TemplateLiteral(node: TSESTree.TemplateLiteral): void;
- }
+ },
>;
export = rule;
}
@@ -619,7 +619,7 @@ declare module 'eslint/lib/rules/brace-style' {
SwitchStatement(node: TSESTree.SwitchStatement): void;
IfStatement(node: TSESTree.IfStatement): void;
TryStatement(node: TSESTree.TryStatement): void;
- }
+ },
>;
export = rule;
}
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
EmptyStatement(node: TSESTree.EmptyStatement): void;
ClassBody(node: TSESTree.ClassBody): void;
MethodDefinition(node: TSESTree.MethodDefinition): void;
- }
+ },
>;
export = rule;
}
@@ -653,7 +653,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
],
{
ClassBody(node: TSESTree.ClassBody): void;
- }
+ },
>;
export = rule;
}
@@ -671,7 +671,7 @@ declare module 'eslint/lib/rules/init-declarations' {
],
{
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -694,7 +694,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
FunctionExpression(node: TSESTree.FunctionExpression): void;
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
ThisExpression(node: TSESTree.ThisExpression): void;
- }
+ },
>;
export = rule;
}
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/dot-notation' {
],
{
MemberExpression(node: TSESTree.MemberExpression): void;
- }
+ },
>;
export = rule;
}
@@ -726,7 +726,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
[],
{
Literal(node: TSESTree.Literal): void;
- }
+ },
>;
export = rule;
}
@@ -759,7 +759,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
node: TSESTree.TSTypeParameterDeclaration,
): void;
TSTupleType(node: TSESTree.TSTupleType): void;
- }
+ },
>;
export = rule;
}
@@ -785,7 +785,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration?(node: TSESTree.ExportNamedDeclaration): void;
ExportAllDeclaration?(node: TSESTree.ExportAllDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -807,7 +807,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
LogicalExpression(node: TSESTree.LogicalExpression): void;
ConditionalExpression(node: TSESTree.ConditionalExpression): void;
VariableDeclarator(node: TSESTree.VariableDeclarator): void;
- }
+ },
>;
export = rule;
}
@@ -826,7 +826,7 @@ declare module 'eslint/lib/rules/prefer-const' {
{
'Program:exit'(node: TSESTree.Program): void;
VariableDeclaration(node: TSESTree.VariableDeclaration): void;
- }
+ },
>;
export = rule;
}
@@ -851,7 +851,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
ObjectExpression(node: TSESTree.ObjectExpression): void;
ImportDeclaration(node: TSESTree.ImportDeclaration): void;
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
- }
+ },
>;
export = rule;
}
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
index cbf83771..e88a7314 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
@@ -47,7 +47,7 @@ const isCommentToken = eslintUtils.isCommentToken as (
token: TSESTree.Token | TSESTree.Comment,
) => token is TSESTree.Comment;
const isNotCommentToken = eslintUtils.isNotCommentToken as <
- T extends TSESTree.Token | TSESTree.Comment
+ T extends TSESTree.Token | TSESTree.Comment,
>(
token: T,
) => token is Exclude<T, TSESTree.Comment>;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
index 1fd2e752..2b1584bc 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
@@ -5,7 +5,7 @@ import { RuleCreateFunction, RuleModule } from '../ts-eslint';
*/
type InferOptionsTypeFromRule<T> = T extends RuleModule<
infer _TMessageIds,
- infer TOptions
+ infer TOptions,
>
? TOptions
: T extends RuleCreateFunction<infer _TMessageIds, infer TOptions>
@@ -17,7 +17,7 @@ type InferOptionsTypeFromRule<T> = T extends RuleModule<
*/
type InferMessageIdsTypeFromRule<T> = T extends RuleModule<
infer TMessageIds,
- infer _TOptions
+ infer _TOptions,
>
? TMessageIds
: T extends RuleCreateFunction<infer TMessageIds, infer _TOptions>
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
index ca1cfb33..f02b7589 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/RuleCreator.ts
@@ -19,7 +19,7 @@ function RuleCreator(urlCreator: (ruleName: string) => string) {
return function createRule<
TOptions extends readonly unknown[],
TMessageIds extends string,
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>({
name,
meta,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
index 6ed25e4a..29a56671 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
@@ -24,13 +24,13 @@ function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(
*/
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
test: InvalidTestCase<TMessageIds, TOptions>,
): InvalidTestCase<TMessageIds, TOptions>[];
function batchedSingleLineTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
>(
options: ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>,
): (ValidTestCase<TOptions> | InvalidTestCase<TMessageIds, TOptions>)[] {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
index 925d4976..27ad5792 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/eslint-utils/getParserServices.ts
@@ -9,7 +9,7 @@ const ERROR_MESSAGE =
*/
function getParserServices<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
>(
context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,
allowWithoutFullTypeInformation = false,
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
index 15c69bbf..1999c4f4 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Definition.ts
@@ -27,13 +27,14 @@ const Definition = ESLintDefinition as DefinitionConstructor;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ParameterDefinition extends Definition {}
-const ParameterDefinition = ESLintParameterDefinition as DefinitionConstructor & {
- new (
- name: TSESTree.Node,
- node: TSESTree.Node,
- index?: number | null,
- rest?: boolean,
- ): ParameterDefinition;
-};
+const ParameterDefinition =
+ ESLintParameterDefinition as DefinitionConstructor & {
+ new (
+ name: TSESTree.Node,
+ node: TSESTree.Node,
+ index?: number | null,
+ rest?: boolean,
+ ): ParameterDefinition;
+ };
export { Definition, ParameterDefinition };
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
index 49f1e11c..9b2c711d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint-scope/Scope.ts
@@ -142,8 +142,9 @@ const ModuleScope = ESLintModuleScope as ScopeConstructor &
ScopeChildConstructorWithUpperScope<ModuleScope>;
interface FunctionExpressionNameScope extends Scope {}
-const FunctionExpressionNameScope = ESLintFunctionExpressionNameScope as ScopeConstructor &
- ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
+const FunctionExpressionNameScope =
+ ESLintFunctionExpressionNameScope as ScopeConstructor &
+ ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
interface CatchScope extends Scope {}
const CatchScope = ESLintCatchScope as ScopeConstructor &
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
index fec56c17..dfcc2347 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/CLIEngine.ts
@@ -71,7 +71,7 @@ declare class CLIEngineBase {
TMessageIds extends string = string,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
////////////////////
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
index 9abefbab..ec79326d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Linter.ts
@@ -38,7 +38,7 @@ declare class LinterBase {
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(
rulesToDefine: Record<
string,
- RuleModule<TMessageIds, TOptions> | RuleCreateFunction
+ RuleModule<TMessageIds, TOptions> | RuleCreateFunction,
>,
): void;
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
index 8ced374d..076b1731 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -115,9 +115,8 @@ interface RuleFixer {
type ReportFixFunction = (
fixer: RuleFixer,
) => null | RuleFix | RuleFix[] | IterableIterator<RuleFix>;
-type ReportSuggestionArray<TMessageIds extends string> = ReportDescriptorBase<
- TMessageIds
->[];
+type ReportSuggestionArray<TMessageIds extends string> =
+ ReportDescriptorBase<TMessageIds>[];
interface ReportDescriptorBase<TMessageIds extends string> {
/**
@@ -162,14 +161,13 @@ interface ReportDescriptorLocOnly {
*/
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
}
-type ReportDescriptor<
- TMessageIds extends string
-> = ReportDescriptorWithSuggestion<TMessageIds> &
- (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
+type ReportDescriptor<TMessageIds extends string> =
+ ReportDescriptorWithSuggestion<TMessageIds> &
+ (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
interface RuleContext<
TMessageIds extends string,
- TOptions extends readonly unknown[]
+ TOptions extends readonly unknown[],
> {
/**
* The rule ID.
@@ -328,29 +326,21 @@ interface RuleListener {
TryStatement?: RuleFunction<TSESTree.TryStatement>;
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
- TSAbstractMethodDefinition?: RuleFunction<
- TSESTree.TSAbstractMethodDefinition
- >;
+ TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
- TSCallSignatureDeclaration?: RuleFunction<
- TSESTree.TSCallSignatureDeclaration
- >;
+ TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
- TSConstructSignatureDeclaration?: RuleFunction<
- TSESTree.TSConstructSignatureDeclaration
- >;
+ TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
- TSEmptyBodyFunctionExpression?: RuleFunction<
- TSESTree.TSEmptyBodyFunctionExpression
- >;
+ TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
@@ -371,9 +361,7 @@ interface RuleListener {
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
- TSNamespaceExportDeclaration?: RuleFunction<
- TSESTree.TSNamespaceExportDeclaration
- >;
+ TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
@@ -400,12 +388,8 @@ interface RuleListener {
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
- TSTypeParameterDeclaration?: RuleFunction<
- TSESTree.TSTypeParameterDeclaration
- >;
- TSTypeParameterInstantiation?: RuleFunction<
- TSESTree.TSTypeParameterInstantiation
- >;
+ TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
+ TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
@@ -426,7 +410,7 @@ interface RuleModule<
TMessageIds extends string,
TOptions extends readonly unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> {
/**
* Metadata about the rule
@@ -444,7 +428,7 @@ type RuleCreateFunction<
TMessageIds extends string = never,
TOptions extends readonly unknown[] = unknown[],
// for extending base rules
- TRuleListener extends RuleListener = RuleListener
+ TRuleListener extends RuleListener = RuleListener,
> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
export {
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
index 652567f6..e237586d 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/RuleTester.ts
@@ -59,7 +59,7 @@ interface SuggestionOutput<TMessageIds extends string> {
interface InvalidTestCase<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> extends ValidTestCase<TOptions> {
/**
* Expected errors.
@@ -111,7 +111,7 @@ interface TestCaseError<TMessageIds extends string> {
interface RunTests<
TMessageIds extends string,
- TOptions extends Readonly<unknown[]>
+ TOptions extends Readonly<unknown[]>,
> {
// RuleTester.run also accepts strings for valid cases
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
diff --git a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
index 6907e229..bc3db012 100644
--- a/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
+++ b/repos/typescript-eslint/packages/experimental-utils/src/ts-eslint/Scope.ts
@@ -19,7 +19,8 @@ namespace Scope {
export type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
export type ClassNameDefinition = scopeManager.ClassNameDefinition;
export type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
- export type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
+ export type ImplicitGlobalVariableDefinition =
+ scopeManager.ImplicitGlobalVariableDefinition;
export type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
export type ParameterDefinition = scopeManager.ParameterDefinition;
export type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
@@ -34,7 +35,8 @@ namespace Scope {
export type ClassScope = scopeManager.ClassScope;
export type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
export type ForScope = scopeManager.ForScope;
- export type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
+ export type FunctionExpressionNameScope =
+ scopeManager.FunctionExpressionNameScope;
export type FunctionScope = scopeManager.FunctionScope;
export type FunctionTypeScope = scopeManager.FunctionTypeScope;
export type GlobalScope = scopeManager.GlobalScope;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
index 1bfb569e..654b27bf 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/CatchClauseDefinition.ts
@@ -6,7 +6,7 @@ class CatchClauseDefinition extends DefinitionBase<
DefinitionType.CatchClause,
TSESTree.CatchClause,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(name: TSESTree.BindingName, node: CatchClauseDefinition['node']) {
super(DefinitionType.CatchClause, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
index 5d587b34..9279dd8b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ClassNameDefinition.ts
@@ -6,7 +6,7 @@ class ClassNameDefinition extends DefinitionBase<
DefinitionType.ClassName,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']) {
super(DefinitionType.ClassName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
index ed25a722..7147ebc6 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/DefinitionBase.ts
@@ -8,7 +8,7 @@ abstract class DefinitionBase<
TType extends DefinitionType,
TNode extends TSESTree.Node,
TParent extends TSESTree.Node | null,
- TName extends TSESTree.Node = TSESTree.BindingName
+ TName extends TSESTree.Node = TSESTree.BindingName,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
index b4cf2405..80e83b7c 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/FunctionNameDefinition.ts
@@ -9,7 +9,7 @@ class FunctionNameDefinition extends DefinitionBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']) {
super(DefinitionType.FunctionName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
index 43012c0f..67cfbf3b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts
@@ -6,7 +6,7 @@ class ImplicitGlobalVariableDefinition extends DefinitionBase<
DefinitionType.ImplicitGlobalVariable,
TSESTree.Node,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
constructor(
name: TSESTree.BindingName,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
index 874edadf..d4f11607 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ImportBindingDefinition.ts
@@ -9,7 +9,7 @@ class ImportBindingDefinition extends DefinitionBase<
| TSESTree.ImportNamespaceSpecifier
| TSESTree.TSImportEqualsDeclaration,
TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
@@ -20,7 +20,7 @@ class ImportBindingDefinition extends DefinitionBase<
name: TSESTree.Identifier,
node: Exclude<
ImportBindingDefinition['node'],
- TSESTree.TSImportEqualsDeclaration
+ TSESTree.TSImportEqualsDeclaration,
>,
decl: TSESTree.ImportDeclaration,
);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
index b0c0ea32..fb73b081 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/ParameterDefinition.ts
@@ -15,7 +15,7 @@ class ParameterDefinition extends DefinitionBase<
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
null,
- TSESTree.BindingName
+ TSESTree.BindingName,
> {
/**
* Whether the parameter definition is a part of a rest parameter.
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
index cff6bbaa..3670d070 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumMemberDefinition extends DefinitionBase<
DefinitionType.TSEnumMember,
TSESTree.TSEnumMember,
null,
- TSESTree.Identifier | TSESTree.StringLiteral
+ TSESTree.Identifier | TSESTree.StringLiteral,
> {
constructor(
name: TSESTree.Identifier | TSESTree.StringLiteral,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
index 5374a562..36d74cb8 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSEnumNameDefinition.ts
@@ -6,7 +6,7 @@ class TSEnumNameDefinition extends DefinitionBase<
DefinitionType.TSEnumName,
TSESTree.TSEnumDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']) {
super(DefinitionType.TSEnumName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
index 98f90778..5b0c0a75 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TSModuleNameDefinition.ts
@@ -6,7 +6,7 @@ class TSModuleNameDefinition extends DefinitionBase<
DefinitionType.TSModuleName,
TSESTree.TSModuleDeclaration,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']) {
super(DefinitionType.TSModuleName, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
index ad3b4368..45a61e12 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/TypeDefinition.ts
@@ -8,7 +8,7 @@ class TypeDefinition extends DefinitionBase<
| TSESTree.TSTypeAliasDeclaration
| TSESTree.TSTypeParameter,
null,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']) {
super(DefinitionType.Type, name, node, null);
diff --git a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
index 975c5886..4ab2ca18 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/definition/VariableDefinition.ts
@@ -6,7 +6,7 @@ class VariableDefinition extends DefinitionBase<
DefinitionType.Variable,
TSESTree.VariableDeclarator,
TSESTree.VariableDeclaration,
- TSESTree.Identifier
+ TSESTree.Identifier,
> {
constructor(
name: TSESTree.Identifier,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
index 90cd98bb..dc8ed7a3 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/lib/webworker.importscripts.ts
@@ -6,5 +6,5 @@ import { ImplicitLibVariableOptions } from '../variable';
export const webworker_importscripts = {} as Record<
string,
- ImplicitLibVariableOptions
+ ImplicitLibVariableOptions,
>;
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
index 95904428..2a741d28 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/BlockScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class BlockScope extends ScopeBase<
ScopeType.block,
TSESTree.BlockStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
index 46b4005f..e6b5f95f 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/CatchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class CatchScope extends ScopeBase<
ScopeType.catch,
TSESTree.CatchClause,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
index ee28a31a..e0ae2613 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ClassScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ClassScope extends ScopeBase<
ScopeType.class,
TSESTree.ClassDeclaration | TSESTree.ClassExpression,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
index c20f1217..c0d88231 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ConditionalTypeScope extends ScopeBase<
ScopeType.conditionalType,
TSESTree.TSConditionalType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
index 36703b5d..b7f25494 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ForScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class ForScope extends ScopeBase<
ScopeType.for,
TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
index a84bc4b2..b1731c9d 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class FunctionExpressionNameScope extends ScopeBase<
ScopeType.functionExpressionName,
TSESTree.FunctionExpression,
- Scope
+ Scope,
> {
public readonly functionExpressionScope: true;
constructor(
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
index 18e12321..6c362639 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionScope.ts
@@ -14,7 +14,7 @@ class FunctionScope extends ScopeBase<
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.Program,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
index d459070c..d3cc8c5b 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -11,7 +11,7 @@ class FunctionTypeScope extends ScopeBase<
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSFunctionType
| TSESTree.TSMethodSignature,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
index 3da909c1..87b727fc 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/GlobalScope.ts
@@ -18,7 +18,7 @@ class GlobalScope extends ScopeBase<
/**
* The global scope has no parent.
*/
- null
+ null,
> {
// note this is accessed in used in the legacy eslint-scope tests, so it can't be true private
private readonly implicit: {
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
index 9b5c2a05..c9729031 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class MappedTypeScope extends ScopeBase<
ScopeType.mappedType,
TSESTree.TSMappedType,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a..90e2c0fb 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/ScopeBase.ts
@@ -137,7 +137,7 @@ type AnyScope = ScopeBase<ScopeType, TSESTree.Node, Scope | null>;
abstract class ScopeBase<
TType extends ScopeType,
TBlock extends TSESTree.Node,
- TUpper extends Scope | null
+ TUpper extends Scope | null,
> {
/**
* A unique ID for this instance - primarily used to help debugging and testing
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
index 7a684564..f18a1aae 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/SwitchScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class SwitchScope extends ScopeBase<
ScopeType.switch,
TSESTree.SwitchStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
index 3962784a..ed79b3a9 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSEnumScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSEnumScope extends ScopeBase<
ScopeType.tsEnum,
TSESTree.TSEnumDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
index bdc7c7dc..3ca626f1 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TSModuleScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TSModuleScope extends ScopeBase<
ScopeType.tsModule,
TSESTree.TSModuleDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
index 7f21a60f..37c9cf78 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/TypeScope.ts
@@ -7,7 +7,7 @@ import { ScopeManager } from '../ScopeManager';
class TypeScope extends ScopeBase<
ScopeType.type,
TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
index 84a3e4c7..b50fe2ba 100644
--- a/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
+++ b/repos/typescript-eslint/packages/scope-manager/src/scope/WithScope.ts
@@ -8,7 +8,7 @@ import { ScopeManager } from '../ScopeManager';
class WithScope extends ScopeBase<
ScopeType.with,
TSESTree.WithStatement,
- Scope
+ Scope,
> {
constructor(
scopeManager: ScopeManager,
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
index 69833caa..5255ed02 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/fixtures.test.ts
@@ -36,7 +36,7 @@ const QUOTED_STRING = /^["'](.+?)['"]$/;
type ALLOWED_VALUE = ['number' | 'boolean' | 'string', Set<unknown>?];
const ALLOWED_OPTIONS: Map<string, ALLOWED_VALUE> = new Map<
keyof AnalyzeOptions,
- ALLOWED_VALUE
+ ALLOWED_VALUE,
>([
['ecmaVersion', ['number']],
['globalReturn', ['boolean']],
diff --git a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
index d20ab14f..8f04f4a8 100644
--- a/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
+++ b/repos/typescript-eslint/packages/scope-manager/tests/util/getSpecificNode.ts
@@ -3,11 +3,11 @@ import { simpleTraverse } from '@typescript-eslint/typescript-estree';
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(ast: TSESTree.Node, selector: TSelector): TNode;
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
- TNode extends Extract<TSESTree.Node, { type: TSelector }>
+ TNode extends Extract<TSESTree.Node, { type: TSelector }>,
>(
ast: TSESTree.Node,
selector: TSelector,
@@ -16,7 +16,7 @@ function getSpecificNode<
function getSpecificNode<
TSelector extends AST_NODE_TYPES,
TNode extends Extract<TSESTree.Node, { type: TSelector }>,
- TReturnType extends TSESTree.Node
+ TReturnType extends TSESTree.Node,
>(
ast: TSESTree.Node,
selector: TSelector,
diff --git a/repos/typescript-eslint/packages/types/src/ts-estree.ts b/repos/typescript-eslint/packages/types/src/ts-estree.ts
index 4dd89c96..a17252d8 100644
--- a/repos/typescript-eslint/packages/types/src/ts-estree.ts
+++ b/repos/typescript-eslint/packages/types/src/ts-estree.ts
@@ -130,7 +130,7 @@ export type Token =
export type OptionalRangeAndLoc<T> = Pick<
T,
- Exclude<keyof T, 'range' | 'loc'>
+ Exclude<keyof T, 'range' | 'loc'>,
> & {
range?: Range;
loc?: SourceLocation;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
index a22eae1a..43bfd6ba 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/convert.ts
@@ -821,7 +821,7 @@ export class Converter {
const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node);
const result = this.createNode<
- TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration
+ TSESTree.TSDeclareFunction | TSESTree.FunctionDeclaration,
>(node, {
type:
isDeclare || !node.body
@@ -846,9 +846,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -1002,7 +1003,7 @@ export class Converter {
case SyntaxKind.PropertyDeclaration: {
const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty
+ TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty,
>(node, {
type: isAbstract
? AST_NODE_TYPES.TSAbstractClassProperty
@@ -1050,7 +1051,7 @@ export class Converter {
case SyntaxKind.SetAccessor:
case SyntaxKind.MethodDeclaration: {
const method = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1070,9 +1071,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- method.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ method.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(method, method.typeParameters.range);
}
@@ -1112,7 +1114,7 @@ export class Converter {
: AST_NODE_TYPES.MethodDefinition;
result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
@@ -1161,7 +1163,7 @@ export class Converter {
node.getFirstToken()!;
const constructor = this.createNode<
- TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression
+ TSESTree.TSEmptyBodyFunctionExpression | TSESTree.FunctionExpression,
>(node, {
type: !node.body
? AST_NODE_TYPES.TSEmptyBodyFunctionExpression
@@ -1177,9 +1179,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- constructor.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ constructor.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
this.fixParentLocation(constructor, constructor.typeParameters.range);
}
@@ -1196,7 +1199,7 @@ export class Converter {
const isStatic = hasModifier(SyntaxKind.StaticKeyword, node);
const result = this.createNode<
- TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition
+ TSESTree.TSAbstractMethodDefinition | TSESTree.MethodDefinition,
>(node, {
type: hasModifier(SyntaxKind.AbstractKeyword, node)
? AST_NODE_TYPES.TSAbstractMethodDefinition
@@ -1234,9 +1237,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1332,9 +1336,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
}
@@ -1439,10 +1444,11 @@ export class Converter {
let result: TSESTree.RestElement | TSESTree.AssignmentPattern;
if (node.dotDotDotToken) {
- parameter = result = this.createNode<TSESTree.RestElement>(node, {
- type: AST_NODE_TYPES.RestElement,
- argument: this.convertChild(node.name),
- });
+ parameter = result =
+ this.createNode<TSESTree.RestElement>(node, {
+ type: AST_NODE_TYPES.RestElement,
+ argument: this.convertChild(node.name),
+ });
} else if (node.initializer) {
parameter = this.convertChild(node.name) as TSESTree.BindingName;
result = this.createNode<TSESTree.AssignmentPattern>(node, {
@@ -1512,7 +1518,7 @@ export class Converter {
);
const result = this.createNode<
- TSESTree.ClassDeclaration | TSESTree.ClassExpression
+ TSESTree.ClassDeclaration | TSESTree.ClassExpression,
>(node, {
type: classNodeType,
id: this.convertChild(node.name),
@@ -1536,17 +1542,19 @@ export class Converter {
}
if (superClass.types[0]?.typeArguments) {
- result.superTypeParameters = this.convertTypeArgumentsToTypeParameters(
- superClass.types[0].typeArguments,
- superClass.types[0],
- );
+ result.superTypeParameters =
+ this.convertTypeArgumentsToTypeParameters(
+ superClass.types[0].typeArguments,
+ superClass.types[0],
+ );
}
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (implementsClause) {
@@ -1788,7 +1796,7 @@ export class Converter {
return this.createNode<
| TSESTree.AssignmentExpression
| TSESTree.LogicalExpression
- | TSESTree.BinaryExpression
+ | TSESTree.BinaryExpression,
>(node, {
type,
operator: getTextForTokenKind(node.operatorToken.kind),
@@ -2313,9 +2321,10 @@ export class Converter {
// Process typeParameters
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
// check for exports
@@ -2343,9 +2352,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
const accessibility = getTSNodeAccessibility(node);
@@ -2438,7 +2448,7 @@ export class Converter {
| TSESTree.TSConstructSignatureDeclaration
| TSESTree.TSCallSignatureDeclaration
| TSESTree.TSFunctionType
- | TSESTree.TSConstructorType
+ | TSESTree.TSConstructorType,
>(node, {
type: type,
params: this.convertParameters(node.parameters),
@@ -2449,9 +2459,10 @@ export class Converter {
}
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
return result;
@@ -2459,7 +2470,7 @@ export class Converter {
case SyntaxKind.ExpressionWithTypeArguments: {
const result = this.createNode<
- TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements
+ TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements,
>(node, {
type:
parent && parent.kind === SyntaxKind.InterfaceDeclaration
@@ -2490,9 +2501,10 @@ export class Converter {
});
if (node.typeParameters) {
- result.typeParameters = this.convertTSTypeParametersToTypeParametersDeclaration(
- node.typeParameters,
- );
+ result.typeParameters =
+ this.convertTSTypeParametersToTypeParametersDeclaration(
+ node.typeParameters,
+ );
}
if (interfaceHeritageClauses.length > 0) {
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
index e00663a1..a3f007a0 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/create-program/createWatchProgram.ts
@@ -18,7 +18,7 @@ const log = debug('typescript-eslint:typescript-estree:createWatchProgram');
*/
const knownWatchProgramMap = new Map<
CanonicalPath,
- ts.WatchOfConfigFile<ts.BuilderProgram>
+ ts.WatchOfConfigFile<ts.BuilderProgram>,
>();
/**
@@ -27,11 +27,11 @@ const knownWatchProgramMap = new Map<
*/
const fileWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
const folderWatchCallbackTrackingMap = new Map<
CanonicalPath,
- Set<ts.FileWatcherCallback>
+ Set<ts.FileWatcherCallback>,
>();
/**
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
index 36ca3f80..a3758fff 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/parser-options.ts
@@ -191,7 +191,7 @@ export interface ParserWeakMap<TKey, TValueBase> {
}
export interface ParserWeakMapESTreeToTSNode<
- TKey extends TSESTree.Node = TSESTree.Node
+ TKey extends TSESTree.Node = TSESTree.Node,
> {
get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
has(key: unknown): boolean;
diff --git a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index 62053920..ff7aea73 100644
--- a/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -281,5 +281,5 @@ export interface EstreeToTsNodeTypes {
export type TSESTreeToTSNode<T extends TSESTree.Node = TSESTree.Node> = Extract<
TSNode | ts.Token<ts.SyntaxKind.NewKeyword | ts.SyntaxKind.ImportKeyword>,
// if this errors, it means that one of the AST_NODE_TYPES is not defined in the above interface
- EstreeToTsNodeTypes[T['type']]
+ EstreeToTsNodeTypes[T['type']],
>;
diff --git a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
index 36726ac1..9ce5ca68 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tests/lib/semanticInfo.test.ts
@@ -159,9 +159,8 @@ describe('semanticInfo', () => {
const computedPropertyString = ((parseResult.ast
.body[1] as TSESTree.ClassDeclaration).body
.body[0] as TSESTree.ClassProperty).key;
- const tsComputedPropertyString = parseResult.services.esTreeNodeToTSNodeMap.get(
- computedPropertyString,
- );
+ const tsComputedPropertyString =
+ parseResult.services.esTreeNodeToTSNodeMap.get(computedPropertyString);
expect(tsComputedPropertyString.kind).toEqual(ts.SyntaxKind.StringLiteral);
});
diff --git a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
index 1b386be1..1a6a815d 100644
--- a/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
+++ b/repos/typescript-eslint/packages/typescript-estree/tools/test-utils.ts
@@ -98,7 +98,7 @@ export function omitDeep<T = UnknownObject>(
keysToOmit: { key: string; predicate: (value: unknown) => boolean }[] = [],
selectors: Record<
string,
- (node: UnknownObject, parent: UnknownObject | null) => void
+ (node: UnknownObject, parent: UnknownObject | null) => void,
> = {},
): UnknownObject {
function shouldOmit(keyName: string, val: unknown): boolean {
diff --git a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
index 68c6b806..a9ed3cdb 100644
--- a/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
+++ b/repos/typescript-eslint/packages/visitor-keys/src/visitor-keys.ts
@@ -7,7 +7,7 @@ interface VisitorKeys {
type GetNodeTypeKeys<T extends AST_NODE_TYPES> = Exclude<
keyof Extract<TSESTree.Node, { type: T }>,
- 'type' | 'loc' | 'range' | 'parent'
+ 'type' | 'loc' | 'range' | 'parent',
>;
// strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs
diff --git a/repos/typescript-eslint/tools/generate-contributors.ts b/repos/typescript-eslint/tools/generate-contributors.ts
index 38c3690c..6bb908b3 100644
--- a/repos/typescript-eslint/tools/generate-contributors.ts
+++ b/repos/typescript-eslint/tools/generate-contributors.ts
@@ -42,9 +42,8 @@ async function* fetchUsers(page = 1): AsyncIterableIterator<Contributor[]> {
const response = await fetch(`${contributorsApiUrl}&page=${page}`, {
method: 'GET',
});
- const contributors:
- | Contributor[]
- | { message: string } = await response.json();
+ const contributors: Contributor[] | { message: string } =
+ await response.json();
if (!Array.isArray(contributors)) {
throw new Error(contributors.message);
run #10222 vs 2.2.1