diff --git a/azure/packages/azure-local-service/.eslintrc.cjs b/azure/packages/azure-local-service/.eslintrc.cjs index d14fd54d9ab9..7f18319d8c4b 100644 --- a/azure/packages/azure-local-service/.eslintrc.cjs +++ b/azure/packages/azure-local-service/.eslintrc.cjs @@ -4,7 +4,10 @@ */ module.exports = { - extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"], + extends: [ + require.resolve("@fluidframework/eslint-config-fluid/strict"), + "prettier", + ], parserOptions: { project: ["./tsconfig.eslint.json"], }, diff --git a/azure/packages/azure-local-service/biome.jsonc b/azure/packages/azure-local-service/biome.jsonc index 4b65e1c0aea2..bff6a48b6caf 100644 --- a/azure/packages/azure-local-service/biome.jsonc +++ b/azure/packages/azure-local-service/biome.jsonc @@ -1,4 +1,4 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"] + "root": false, + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json" } diff --git a/azure/packages/azure-local-service/tsconfig.eslint.json b/azure/packages/azure-local-service/tsconfig.eslint.json index 3339cc9f8d53..49fa321e2af2 100644 --- a/azure/packages/azure-local-service/tsconfig.eslint.json +++ b/azure/packages/azure-local-service/tsconfig.eslint.json @@ -4,6 +4,6 @@ "extends": "../../../common/build/build-common/tsconfig.node16.json", "include": ["index.js"], "compilerOptions": { - "noEmit": true, - }, + "noEmit": true + } } diff --git a/azure/packages/azure-service-utils/.eslintrc.cjs b/azure/packages/azure-service-utils/.eslintrc.cjs index 5059dc55a9d8..4323b4aa7c4d 100644 --- a/azure/packages/azure-service-utils/.eslintrc.cjs +++ b/azure/packages/azure-service-utils/.eslintrc.cjs @@ -4,7 +4,10 @@ */ module.exports = { - extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"], + extends: [ + require.resolve("@fluidframework/eslint-config-fluid/strict"), + "prettier", + ], parserOptions: { project: ["./tsconfig.json", "./src/test/tsconfig.json"], }, diff --git a/azure/packages/azure-service-utils/biome.jsonc b/azure/packages/azure-service-utils/biome.jsonc index 4b65e1c0aea2..bff6a48b6caf 100644 --- a/azure/packages/azure-service-utils/biome.jsonc +++ b/azure/packages/azure-service-utils/biome.jsonc @@ -1,4 +1,4 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"] + "root": false, + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json" } diff --git a/azure/packages/azure-service-utils/src/generateToken.ts b/azure/packages/azure-service-utils/src/generateToken.ts index 54fc24b2f6e3..4ad3f599809c 100644 --- a/azure/packages/azure-service-utils/src/generateToken.ts +++ b/azure/packages/azure-service-utils/src/generateToken.ts @@ -4,7 +4,10 @@ */ import type { IUser } from "@fluidframework/driver-definitions"; -import type { ITokenClaims, ScopeType } from "@fluidframework/driver-definitions/internal"; +import type { + ITokenClaims, + ScopeType, +} from "@fluidframework/driver-definitions/internal"; import { KJUR as jsrsasign } from "jsrsasign"; import { v4 as uuid } from "uuid"; diff --git a/azure/packages/azure-service-utils/src/test/tsconfig.cjs.json b/azure/packages/azure-service-utils/src/test/tsconfig.cjs.json index f966e4a2484f..33c8a06c7a09 100644 --- a/azure/packages/azure-service-utils/src/test/tsconfig.cjs.json +++ b/azure/packages/azure-service-utils/src/test/tsconfig.cjs.json @@ -2,11 +2,11 @@ // This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.) "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "../../dist/test", + "outDir": "../../dist/test" }, "references": [ { - "path": "../../tsconfig.cjs.json", - }, - ], + "path": "../../tsconfig.cjs.json" + } + ] } diff --git a/azure/packages/azure-service-utils/src/test/tsconfig.json b/azure/packages/azure-service-utils/src/test/tsconfig.json index b09a1e616d6f..85fe9b267f86 100644 --- a/azure/packages/azure-service-utils/src/test/tsconfig.json +++ b/azure/packages/azure-service-utils/src/test/tsconfig.json @@ -3,12 +3,12 @@ "compilerOptions": { "rootDir": "./", "outDir": "../../lib/test", - "types": [], + "types": [] }, "include": ["./**/*"], "references": [ { - "path": "../..", - }, - ], + "path": "../.." + } + ] } diff --git a/azure/packages/azure-service-utils/src/test/types/validateAzureServiceUtilsPrevious.generated.ts b/azure/packages/azure-service-utils/src/test/types/validateAzureServiceUtilsPrevious.generated.ts index ea26badfe0d3..ebddb11e97d8 100644 --- a/azure/packages/azure-service-utils/src/test/types/validateAzureServiceUtilsPrevious.generated.ts +++ b/azure/packages/azure-service-utils/src/test/types/validateAzureServiceUtilsPrevious.generated.ts @@ -9,11 +9,22 @@ */ import type * as old from "@fluidframework/azure-service-utils-previous/internal"; -import type { TypeOnly, MinimalType, FullType, requireAssignableTo } from "@fluidframework/build-tools"; +import type { + TypeOnly, + MinimalType, + FullType, + requireAssignableTo, +} from "@fluidframework/build-tools"; import type * as current from "../../index.js"; -declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | FullType | typeof old | typeof current | requireAssignableTo; +declare type MakeUnusedImportErrorsGoAway = + | TypeOnly + | MinimalType + | FullType + | typeof old + | typeof current + | requireAssignableTo; /* * Validate forward compatibility by using the old type in place of the current type. @@ -22,7 +33,10 @@ declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | Fu * typeValidation.broken: * "Enum_ScopeType": {"forwardCompat": false} */ -declare type old_as_current_for_Enum_ScopeType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_ScopeType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -31,7 +45,10 @@ declare type old_as_current_for_Enum_ScopeType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_ScopeType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -40,7 +57,10 @@ declare type current_as_old_for_Enum_ScopeType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_generateToken = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -49,7 +69,10 @@ declare type current_as_old_for_Function_generateToken = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IUser = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -58,4 +81,7 @@ declare type old_as_current_for_Interface_IUser = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IUser = requireAssignableTo< + TypeOnly, + TypeOnly +>; diff --git a/azure/packages/azure-service-utils/tsconfig.cjs.json b/azure/packages/azure-service-utils/tsconfig.cjs.json index 773d0806da58..f1404a60ed38 100644 --- a/azure/packages/azure-service-utils/tsconfig.cjs.json +++ b/azure/packages/azure-service-utils/tsconfig.cjs.json @@ -2,6 +2,6 @@ // This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.) "extends": "./tsconfig.json", "compilerOptions": { - "outDir": "./dist", - }, + "outDir": "./dist" + } } diff --git a/azure/packages/azure-service-utils/tsconfig.json b/azure/packages/azure-service-utils/tsconfig.json index dd5ebc442f49..bd9d0f2fa050 100644 --- a/azure/packages/azure-service-utils/tsconfig.json +++ b/azure/packages/azure-service-utils/tsconfig.json @@ -4,6 +4,6 @@ "exclude": ["src/test/**/*"], "compilerOptions": { "rootDir": "./src", - "outDir": "./lib", - }, + "outDir": "./lib" + } } diff --git a/biome.jsonc b/biome.jsonc index 78f0d068ce12..ae6a735e736c 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,4 +1,5 @@ { + "root": true, "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", "vcs": { "enabled": true, @@ -9,118 +10,8 @@ }, "files": { "ignoreUnknown": true, - - "ignore": [ - // Build output - "**/dist/*", - "**/lib/*", - "examples/**/build/*", - "**/*.done.build.log", - "**/.next", // NextJS - - // test collateral - "**/_package.json", - "**/fluid-runner/src/test/localOdspSnapshots/**", - "**/fluid-runner/src/test/telemetryExpectedOutputs/**", - "**/snapshots/*.json", - "**/snapshots/content", - - // Generated files - "**/src/**/test/types/*.generated.ts", - "**/src/packageVersion.ts", - - // Dependencies - "**/node_modules/*", - - // Used by API-Extractor - "**/_api-extractor-temp/*", - "**/api-report/*", - "**/*.api.md", - - // Templates - ".changeset/templates/", - "*.hbs", - - // Test json - "build-tools/packages/build-tools/src/test/data/biome/empty.jsonc", - "experimental/dds/tree/src/test/documents/**", - "packages/dds/map/src/test/mocha/snapshots/**/*.json", - "packages/dds/matrix/src/test/results/**/*.json", - "packages/dds/merge-tree/src/test/literature/*.txt", - "packages/dds/merge-tree/src/test/results/*.json", - "packages/dds/sequence/src/test/snapshots/**/*.json", - "packages/dds/sequence/src/test/results/**/*.json", - "packages/dds/sequence/src/test/fuzz/**/*.json", - "packages/dds/tree/src/test/snapshots/**/*.json", - "packages/dds/tree/src/test/shared-tree/fuzz/failures/**/*.json", - "packages/drivers/odsp-driver/src/test/**/*.json", - "packages/framework/attributor/src/test/attribution/documents/**/*.json", - "packages/test/snapshots/content/**", - "packages/tools/fluid-runner/src/test/localOdspSnapshots/**", - "packages/tools/fluid-runner/src/test/telemetryExpectedOutputs/**", - "tools/api-markdown-documenter/src/test/snapshots/**", - // TODO: why does examples/apps/tree-cli-app/*.json not work? - "**/data/*.json", - - // Generated type-tests - "**/*.generated.ts", - - // Generated bundle analysis files - "**/bundleAnalysis/**", - - // Generated oclif manifest files - "**/oclif.manifest.json", - - // es5 build output - "packages/framework/data-object-base/es5", - - // Test coverage reports - "**/coverage/*", - "**/nyc/*", - - // Git configuration file - ".git-blame-ignore-revs", - - // Generated by policy-check - "**/assertionShortCodesMap.ts", - - // These are actually templates, not pure YAML files - "**/templates/*.yaml", - - // These files are auto-generated according to the comments in the files - "**/charts/**/Chart.yaml", - - // Reports generated by dependency-cruiser - "**/.dependency-cruiser-known-violations.json", - - // Reports generated by our benchmark tests - ".timeTestsOutput/**", - ".memoryTestsOutput/**", - ".customBenchmarksOutput/**", - - // The paths below are not formatted by Biome. We ignore them explicitly so other tools that read this ignore - // list, like fluid-build, know to ignore these files as well. - "**/*.md", - "**/.gitignore", - "**/.npmignore", - "**/LICENSE", - "**/.changeset/**", - - // Paths below are outside the client release group and aren't configured for biome. - "common/build/**", - "common/lib/**", - "docs/**", - "server/**", - "tools/benchmark/**", - "tools/getkeys/**", - "tools/pipelines/**", - "tools/test-tools/**" - ], "maxSize": 2097152 }, - "organizeImports": { - "enabled": false - }, "linter": { "enabled": false, "rules": { @@ -129,7 +20,6 @@ }, "formatter": { "enabled": true, - "ignore": ["**/dist/**", "**/lib/**"], "formatWithErrors": true, "indentStyle": "tab", "lineWidth": 95, @@ -159,7 +49,7 @@ // of the repo. // // This configuration should be kept up-to-date with the settings in `experimental/dds/tree/biome.jsonc`. - "include": ["experimental/dds/tree/**"], + "includes": ["experimental/dds/tree/**"], "formatter": { "lineWidth": 120 }, @@ -178,7 +68,7 @@ // format them conservatively without trailing commas. // // See also: https://github.com/microsoft/vscode/issues/102061 - "include": [ + "includes": [ "**/*.jsonc", // Tools reading api-extractor config files do not consistently support trailing commas. @@ -206,7 +96,7 @@ { // JSONC WITH TRAILING COMMAS // These JSONC files are known to support trailing commas. - "include": [ + "includes": [ // vscode config files all support trailing commas. "**/.vscode/*.json", @@ -227,7 +117,7 @@ // PACKAGE.JSON // These settings are used to format package.json files in the way npm itself does, with the exception of using // tabs instead of spaces. - "include": ["**/package.json"], + "includes": ["**/package.json"], "json": { "formatter": { "lineWidth": 1 diff --git a/build-tools/biome.jsonc b/build-tools/biome.jsonc index d6a00e2ceb43..d059a7e3bc73 100644 --- a/build-tools/biome.jsonc +++ b/build-tools/biome.jsonc @@ -1,13 +1,7 @@ { + "root": false, "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../biome.jsonc"], - "organizeImports": { - "enabled": true - }, "formatter": { "enabled": true - }, - "files": { - "ignore": ["packages/build-tools/src/test/data/biome/empty.jsonc"] } } diff --git a/build-tools/package.json b/build-tools/package.json index 859b2bb5d7c0..14306a3b8cad 100644 --- a/build-tools/package.json +++ b/build-tools/package.json @@ -71,7 +71,7 @@ "temp-directory": "nyc/.nyc_output" }, "devDependencies": { - "@biomejs/biome": "~1.9.3", + "@biomejs/biome": "~2.2.5", "@commitlint/cli": "^17.8.1", "@commitlint/config-conventional": "^17.8.1", "@commitlint/cz-commitlint": "^17.8.1", diff --git a/build-tools/packages/build-cli/src/BasePackageCommand.ts b/build-tools/packages/build-cli/src/BasePackageCommand.ts index 246887d6e8a4..cc3081616d00 100644 --- a/build-tools/packages/build-cli/src/BasePackageCommand.ts +++ b/build-tools/packages/build-cli/src/BasePackageCommand.ts @@ -16,7 +16,11 @@ import { parsePackageSelectionFlags, selectAndFilterPackages, } from "./filter.js"; -import { type PackageSelectionDefault, filterFlags, selectionFlags } from "./flags.js"; +import { + type PackageSelectionDefault, + filterFlags, + selectionFlags, +} from "./flags.js"; import { BaseCommand } from "./library/index.js"; /** @@ -73,7 +77,10 @@ export abstract class PackageCommand< ): Promise; protected parseFlags(): void { - this.selectionOptions = parsePackageSelectionFlags(this.flags, this.defaultSelection); + this.selectionOptions = parsePackageSelectionFlags( + this.flags, + this.defaultSelection, + ); this.filterOptions = parsePackageFilterFlags(this.flags); } @@ -95,13 +102,22 @@ export abstract class PackageCommand< public async run(): Promise { this.parseFlags(); - assert(this.selectionOptions !== undefined, "selectionOptions is undefined"); + assert( + this.selectionOptions !== undefined, + "selectionOptions is undefined", + ); assert(this.filterOptions !== undefined, "filterOptions is undefined"); await this.selectAndFilterPackages(); - assert(this.selectedPackages !== undefined, "selectedPackages is undefined"); - assert(this.filteredPackages !== undefined, "filteredPackages is undefined"); + assert( + this.selectedPackages !== undefined, + "selectedPackages is undefined", + ); + assert( + this.filteredPackages !== undefined, + "filteredPackages is undefined", + ); this.info( `Filtered ${this.selectedPackages.length} packages to ${listNames( @@ -126,7 +142,9 @@ export abstract class PackageCommand< * * @returns An array of error strings. If the array is not empty, at least one of the calls to processPackage failed. */ - protected async processPackages(packages: PackageWithKind[]): Promise { + protected async processPackages( + packages: PackageWithKind[], + ): Promise { let started = 0; let finished = 0; let succeeded = 0; @@ -151,27 +169,33 @@ export abstract class PackageCommand< } try { - await async.mapLimit(packages, this.flags.concurrency, async (pkg: PackageWithKind) => { - started += 1; - updateStatus(); - try { - await this.processPackage(pkg, pkg.kind); - succeeded += 1; - } catch (error: unknown) { - const errorString = `Error updating ${pkg.name}: '${error}'\nStack: ${ - (error as Error).stack - }`; - errors.push(errorString); - this.verbose(errorString); - } finally { - finished += 1; + await async.mapLimit( + packages, + this.flags.concurrency, + async (pkg: PackageWithKind) => { + started += 1; updateStatus(); - } - }); + try { + await this.processPackage(pkg, pkg.kind); + succeeded += 1; + } catch (error: unknown) { + const errorString = `Error updating ${pkg.name}: '${error}'\nStack: ${ + (error as Error).stack + }`; + errors.push(errorString); + this.verbose(errorString); + } finally { + finished += 1; + updateStatus(); + } + }, + ); } finally { // Stop the spinner if needed. if (!verbose) { - ux.action.stop(`Done. ${packages.length} Packages. ${finished - succeeded} Errors`); + ux.action.stop( + `Done. ${packages.length} Packages. ${finished - succeeded} Errors`, + ); } } return errors; diff --git a/build-tools/packages/build-cli/src/args.ts b/build-tools/packages/build-cli/src/args.ts index f325293cef44..ba1b53c3ce71 100644 --- a/build-tools/packages/build-cli/src/args.ts +++ b/build-tools/packages/build-cli/src/args.ts @@ -35,7 +35,9 @@ export const findPackageOrReleaseGroup = ( return ( context.fullPackageMap.get(name) ?? - context.independentPackages.find((pkg) => PackageName.getUnscopedName(pkg.name) === name) + context.independentPackages.find( + (pkg) => PackageName.getUnscopedName(pkg.name) === name, + ) ); }; diff --git a/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts b/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts index 14cf8bdf7105..879bef2b9019 100644 --- a/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts +++ b/build-tools/packages/build-cli/src/codeCoverage/codeCoveragePr.ts @@ -11,7 +11,10 @@ import { getBuildArtifactForSpecificBuild, } from "../library/azureDevops/getBaselineBuildMetrics.js"; import type { CommandLogger } from "../logging.js"; -import { type CodeCoverageComparison, compareCodeCoverage } from "./compareCodeCoverage.js"; +import { + type CodeCoverageComparison, + compareCodeCoverage, +} from "./compareCodeCoverage.js"; import { getCoverageMetricsFromArtifact } from "./getCoverageMetrics.js"; /** @@ -44,7 +47,10 @@ export async function getCodeCoverageReport( changedFiles: string[], logger?: CommandLogger, ): Promise { - const adoConnection = getAzureDevopsApi(adoToken, codeCoverageConstantsBaseline.orgUrl); + const adoConnection = getAzureDevopsApi( + adoToken, + codeCoverageConstantsBaseline.orgUrl, + ); const baselineBuildInfo = await getBaselineBuildMetrics( codeCoverageConstantsBaseline, @@ -55,7 +61,10 @@ export async function getCodeCoverageReport( throw error; }); - const adoConnectionForPR = getAzureDevopsApi(adoToken, codeCoverageConstantsPR.orgUrl); + const adoConnectionForPR = getAzureDevopsApi( + adoToken, + codeCoverageConstantsPR.orgUrl, + ); const prBuildInfo = await getBuildArtifactForSpecificBuild( codeCoverageConstantsPR, diff --git a/build-tools/packages/build-cli/src/codeCoverage/compareCodeCoverage.ts b/build-tools/packages/build-cli/src/codeCoverage/compareCodeCoverage.ts index 89113bdd382f..9b9f86e175cc 100644 --- a/build-tools/packages/build-cli/src/codeCoverage/compareCodeCoverage.ts +++ b/build-tools/packages/build-cli/src/codeCoverage/compareCodeCoverage.ts @@ -156,7 +156,9 @@ export function getPackagesWithCodeCoverageChanges( const newPackagesIdentifiedByCodeCoverage = codeCoverageComparisonData.filter( (codeCoverageReport) => codeCoverageReport.isNewPackage, ); - logger?.verbose(`Found ${newPackagesIdentifiedByCodeCoverage.length} new packages`); + logger?.verbose( + `Found ${newPackagesIdentifiedByCodeCoverage.length} new packages`, + ); // Find existing packages that have reported a change in coverage for the current PR const existingPackagesWithCoverageChange = codeCoverageComparisonData.filter( @@ -168,7 +170,8 @@ export function getPackagesWithCodeCoverageChanges( return { codeCoverageComparisonForNewPackages: newPackagesIdentifiedByCodeCoverage, - codeCoverageComparisonForExistingPackages: existingPackagesWithCoverageChange, + codeCoverageComparisonForExistingPackages: + existingPackagesWithCoverageChange, }; } @@ -181,20 +184,25 @@ export function isCodeCoverageCriteriaPassed( codeCoverageChangeForPackages: CodeCoverageChangeForPackages, logger?: CommandLogger, ): boolean { - const { codeCoverageComparisonForNewPackages, codeCoverageComparisonForExistingPackages } = - codeCoverageChangeForPackages; - const packagesWithNotableRegressions = codeCoverageComparisonForExistingPackages.filter( - (codeCoverageReport: CodeCoverageComparison) => codeCoverageReport.branchCoverageDiff < -1, - ); + const { + codeCoverageComparisonForNewPackages, + codeCoverageComparisonForExistingPackages, + } = codeCoverageChangeForPackages; + const packagesWithNotableRegressions = + codeCoverageComparisonForExistingPackages.filter( + (codeCoverageReport: CodeCoverageComparison) => + codeCoverageReport.branchCoverageDiff < -1, + ); logger?.verbose( `Found ${packagesWithNotableRegressions.length} existing packages with notable regressions`, ); // Code coverage for the newly added package should be less than 50% to fail. - const newPackagesWithNotableRegressions = codeCoverageComparisonForNewPackages.filter( - (codeCoverageReport) => codeCoverageReport.branchCoverageInPr < 50, - ); + const newPackagesWithNotableRegressions = + codeCoverageComparisonForNewPackages.filter( + (codeCoverageReport) => codeCoverageReport.branchCoverageInPr < 50, + ); logger?.verbose( `Found ${newPackagesWithNotableRegressions.length} new packages with notable regressions`, diff --git a/build-tools/packages/build-cli/src/codeCoverage/getCommentForCodeCoverage.ts b/build-tools/packages/build-cli/src/codeCoverage/getCommentForCodeCoverage.ts index cb03f7eac83c..1438f5c7d2ad 100644 --- a/build-tools/packages/build-cli/src/codeCoverage/getCommentForCodeCoverage.ts +++ b/build-tools/packages/build-cli/src/codeCoverage/getCommentForCodeCoverage.ts @@ -23,8 +23,10 @@ export function getCommentForCodeCoverageDiff( baselineBuildInfo: IBuildMetrics, success: boolean, ): string { - const { codeCoverageComparisonForNewPackages, codeCoverageComparisonForExistingPackages } = - packagesListWithCodeCoverageChanges; + const { + codeCoverageComparisonForNewPackages, + codeCoverageComparisonForExistingPackages, + } = packagesListWithCodeCoverageChanges; let coverageSummaryForImpactedPackages = ""; let coverageSummaryForNewPackages = ""; @@ -82,7 +84,9 @@ const getCodeCoverageSummary = ( return summary; }; -const getCodeCoverageSummaryForPackages = (coverageReport: CodeCoverageComparison): string => { +const getCodeCoverageSummaryForPackages = ( + coverageReport: CodeCoverageComparison, +): string => { const metrics = codeCoverageDetailsHeader + getMetricRows(coverageReport); return `
${getGlyphForHtml(coverageReport.branchCoverageDiff)} ${ @@ -111,7 +115,9 @@ const formatDiff = (coverageDiff: number): string => { return `${coverageDiff.toFixed(2)}%`; }; -const getMetricRows = (codeCoverageComparisonReport: CodeCoverageComparison): string => { +const getMetricRows = ( + codeCoverageComparisonReport: CodeCoverageComparison, +): string => { const glyphForBranchCoverage = getGlyphForHtml( codeCoverageComparisonReport.branchCoverageDiff, ); diff --git a/build-tools/packages/build-cli/src/codeCoverage/getCoverageMetrics.ts b/build-tools/packages/build-cli/src/codeCoverage/getCoverageMetrics.ts index ce823da853de..950d39ecdcbf 100644 --- a/build-tools/packages/build-cli/src/codeCoverage/getCoverageMetrics.ts +++ b/build-tools/packages/build-cli/src/codeCoverage/getCoverageMetrics.ts @@ -24,7 +24,7 @@ interface XmlCoverageReportSchema { interface XmlCoverageReportSchemaForPackage { package: [ { - "$": { + $: { name: string; "line-rate": string; "branch-rate": string; @@ -42,9 +42,15 @@ const extractCoverageMetrics = ( for (const coverageForPackage of coverageForPackagesResult) { const packagePath = coverageForPackage.$.name; - const lineCoverage = Number.parseFloat(coverageForPackage.$["line-rate"]) * 100; - const branchCoverage = Number.parseFloat(coverageForPackage.$["branch-rate"]) * 100; - if (packagePath && !Number.isNaN(lineCoverage) && !Number.isNaN(branchCoverage)) { + const lineCoverage = + Number.parseFloat(coverageForPackage.$["line-rate"]) * 100; + const branchCoverage = + Number.parseFloat(coverageForPackage.$["branch-rate"]) * 100; + if ( + packagePath && + !Number.isNaN(lineCoverage) && + !Number.isNaN(branchCoverage) + ) { report.set(packagePath, { lineCoverage, branchCoverage, @@ -92,7 +98,9 @@ export const getCoverageMetricsFromArtifact = async ( coverageReportXML, (err: Error | null, result: unknown): void => { if (err) { - console.warn(`Error processing file ${coverageReportFile}: ${err}`); + console.warn( + `Error processing file ${coverageReportFile}: ${err}`, + ); return; } coverageMetricsForBaseline = extractCoverageMetrics( @@ -109,6 +117,8 @@ export const getCoverageMetricsFromArtifact = async ( logger?.warning(`Error encountered with reading files: ${error}`); } - logger?.info(`${coverageMetricsForBaseline.size} packages with coverage data found.`); + logger?.info( + `${coverageMetricsForBaseline.size} packages with coverage data found.`, + ); return coverageMetricsForBaseline; }; diff --git a/build-tools/packages/build-cli/src/commands/bump.ts b/build-tools/packages/build-cli/src/commands/bump.ts index c97c3b6e08ba..f99197267ab1 100644 --- a/build-tools/packages/build-cli/src/commands/bump.ts +++ b/build-tools/packages/build-cli/src/commands/bump.ts @@ -24,9 +24,17 @@ import { isInterdependencyRange, } from "@fluid-tools/version-tools"; -import { findPackageOrReleaseGroup, packageOrReleaseGroupArg } from "../args.js"; +import { + findPackageOrReleaseGroup, + packageOrReleaseGroupArg, +} from "../args.js"; import { getDefaultInterdependencyRange } from "../config.js"; -import { bumpTypeFlag, checkFlags, skipCheckFlag, versionSchemeFlag } from "../flags.js"; +import { + bumpTypeFlag, + checkFlags, + skipCheckFlag, + versionSchemeFlag, +} from "../flags.js"; import { BaseCommand, generateBumpVersionBranchName, @@ -58,7 +66,8 @@ export default class BumpCommand extends BaseCommand { exclusive: ["bumpType", "scheme"], }), scheme: versionSchemeFlag({ - description: "Override the version scheme used by the release group or package.", + description: + "Override the version scheme used by the release group or package.", required: false, exclusive: ["exact"], }), @@ -68,7 +77,8 @@ export default class BumpCommand extends BaseCommand { options: [...RangeOperators, ...WorkspaceRanges], deprecated: { to: "interdependencyRange", - message: "The exactDepType flag is deprecated. Use interdependencyRange instead.", + message: + "The exactDepType flag is deprecated. Use interdependencyRange instead.", version: "0.16.0", }, }), @@ -92,18 +102,22 @@ export default class BumpCommand extends BaseCommand { static readonly examples = [ { - description: "Bump @fluidframework/build-common to the next minor version.", - command: "<%= config.bin %> <%= command.id %> @fluidframework/build-common -t minor", + description: + "Bump @fluidframework/build-common to the next minor version.", + command: + "<%= config.bin %> <%= command.id %> @fluidframework/build-common -t minor", }, { description: "Bump the server release group to the next major version, forcing the semver version scheme.", - command: "<%= config.bin %> <%= command.id %> server -t major --scheme semver", + command: + "<%= config.bin %> <%= command.id %> server -t major --scheme semver", }, { description: "By default, the bump command will run npm install in any affected packages and commit the results to a new branch. You can skip these steps using the --no-commit and --no-install flags.", - command: "<%= config.bin %> <%= command.id %> server -t major --no-commit --no-install", + command: + "<%= config.bin %> <%= command.id %> server -t major --no-commit --no-install", }, { description: @@ -134,11 +148,8 @@ export default class BumpCommand extends BaseCommand { // Fall back to the deprecated --exactDepType flag value if the new one isn't provided const interdepRangeFlag = flags.interdependencyRange ?? flags.exactDepType; - let interdependencyRange: InterdependencyRange | undefined = isInterdependencyRange( - interdepRangeFlag, - ) - ? interdepRangeFlag - : undefined; + let interdependencyRange: InterdependencyRange | undefined = + isInterdependencyRange(interdepRangeFlag) ? interdepRangeFlag : undefined; const context = await this.getContext(); const { bumpType } = flags; @@ -153,7 +164,10 @@ export default class BumpCommand extends BaseCommand { this.error("No dependency provided."); } - const rgOrPackage = findPackageOrReleaseGroup(args.package_or_release_group, context); + const rgOrPackage = findPackageOrReleaseGroup( + args.package_or_release_group, + context, + ); if (rgOrPackage === undefined) { this.error(`Package not found: ${args.package_or_release_group}`); } @@ -174,13 +188,17 @@ export default class BumpCommand extends BaseCommand { if (rgOrPackage instanceof MonoRepo) { const releaseRepo = rgOrPackage; - assert(releaseRepo !== undefined, `Release repo not found for ${rgOrPackage.name}`); + assert( + releaseRepo !== undefined, + `Release repo not found for ${rgOrPackage.name}`, + ); repoVersion = releaseRepo.version; scheme = flags.scheme ?? detectVersionScheme(repoVersion); // Update the interdependency range to the configured default if the one provided isn't valid interdependencyRange = - interdependencyRange ?? getDefaultInterdependencyRange(releaseRepo, context); + interdependencyRange ?? + getDefaultInterdependencyRange(releaseRepo, context); updatedPackages.push(...releaseRepo.packages); packageOrReleaseGroup = releaseRepo; } else { @@ -188,7 +206,9 @@ export default class BumpCommand extends BaseCommand { if (releasePackage.monoRepo !== undefined) { const rg = releasePackage.monoRepo.kind; - this.errorLog(`${releasePackage.name} is part of the ${rg} release group.`); + this.errorLog( + `${releasePackage.name} is part of the ${rg} release group.`, + ); this.errorLog( `If you want to bump that package, run the following command to bump the whole release group:\n\n ${ this.config.bin @@ -225,7 +245,9 @@ export default class BumpCommand extends BaseCommand { this.log(`Release group/package: ${chalk.blueBright(rgOrPackage.name)}`); this.log(`Bump type: ${chalk.blue(bumpType ?? "exact")}`); this.log(`Scheme: ${chalk.cyan(scheme)}`); - this.log(`Workspace protocol: ${workspaceProtocol === true ? chalk.green("yes") : "no"}`); + this.log( + `Workspace protocol: ${workspaceProtocol === true ? chalk.green("yes") : "no"}`, + ); this.log(`Versions: ${newVersion.version} <== ${repoVersion}`); this.log( `Interdependency range: ${interdependencyRange === "" ? "exact" : interdependencyRange}`, diff --git a/build-tools/packages/build-cli/src/commands/bump/deps.ts b/build-tools/packages/build-cli/src/commands/bump/deps.ts index 711bdffebe67..5f838f66aba4 100644 --- a/build-tools/packages/build-cli/src/commands/bump/deps.ts +++ b/build-tools/packages/build-cli/src/commands/bump/deps.ts @@ -10,7 +10,10 @@ import stripAnsi from "strip-ansi"; import { FluidRepo, MonoRepo } from "@fluidframework/build-tools"; -import { findPackageOrReleaseGroup, packageOrReleaseGroupArg } from "../../args.js"; +import { + findPackageOrReleaseGroup, + packageOrReleaseGroupArg, +} from "../../args.js"; import { checkFlags, dependencyUpdateTypeFlag, @@ -54,7 +57,8 @@ export default class DepsCommand extends BaseCommand { updateType: dependencyUpdateTypeFlag({ char: "t", default: "minor", - description: "Bump the current version of the dependency according to this bump type.", + description: + "Bump the current version of the dependency according to this bump type.", }), prerelease: Flags.boolean({ dependsOn: ["updateType"], @@ -89,7 +93,8 @@ export default class DepsCommand extends BaseCommand { { description: "Bump dependencies on @fluidframework/build-common to the latest release version across all release groups.", - command: "<%= config.bin %> <%= command.id %> @fluidframework/build-common -t latest", + command: + "<%= config.bin %> <%= command.id %> @fluidframework/build-common -t latest", }, { description: @@ -100,7 +105,8 @@ export default class DepsCommand extends BaseCommand { { description: "Bump dependencies on packages in the server release group to the greatest released version in the client release group. Include pre-release versions.", - command: "<%= config.bin %> <%= command.id %> server -g client -t greatest --prerelease", + command: + "<%= config.bin %> <%= command.id %> server -g client -t greatest --prerelease", }, { description: @@ -129,10 +135,15 @@ export default class DepsCommand extends BaseCommand { } if (flags.testMode) { - this.log(chalk.yellowBright(`Running in test mode. No changes will be made.`)); + this.log( + chalk.yellowBright(`Running in test mode. No changes will be made.`), + ); } - const rgOrPackage = findPackageOrReleaseGroup(args.package_or_release_group, context); + const rgOrPackage = findPackageOrReleaseGroup( + args.package_or_release_group, + context, + ); if (rgOrPackage === undefined) { this.error(`Package not found: ${args.package_or_release_group}`); } @@ -141,7 +152,10 @@ export default class DepsCommand extends BaseCommand { const branchName = await gitRepo.getCurrentBranchName(); // eslint-disable-next-line import/no-deprecated - if (args.package_or_release_group === MonoRepoKind.Server && branchName !== "next") { + if ( + args.package_or_release_group === MonoRepoKind.Server && + branchName !== "next" + ) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const { confirmed } = await prompts({ type: "confirm", @@ -178,7 +192,9 @@ export default class DepsCommand extends BaseCommand { ); } else { if (rgOrPackage.packageJson.private === true) { - this.error(`${rgOrPackage.name} is a private package; ignoring.`, { exit: 1 }); + this.error(`${rgOrPackage.name} is a private package; ignoring.`, { + exit: 1, + }); } depsToUpdate.push(rgOrPackage.name); @@ -210,7 +226,10 @@ export default class DepsCommand extends BaseCommand { this.logHr(); this.log(""); - if (!isDependencyUpdateType(flags.updateType) || flags.updateType === undefined) { + if ( + !isDependencyUpdateType(flags.updateType) || + flags.updateType === undefined + ) { this.error(`Unknown dependency update type: ${flags.updateType}`); } @@ -220,7 +239,9 @@ export default class DepsCommand extends BaseCommand { context, flags.releaseGroup ?? flags.package, // if undefined the whole repo will be checked depsToUpdate, - rgOrPackage instanceof MonoRepo ? rgOrPackage.releaseGroup : undefined, + rgOrPackage instanceof MonoRepo + ? rgOrPackage.releaseGroup + : undefined, /* prerelease */ flags.prerelease, /* writeChanges */ !flags.testMode, this.logger, @@ -229,7 +250,9 @@ export default class DepsCommand extends BaseCommand { context, flags.releaseGroup ?? flags.package, // if undefined the whole repo will be checked depsToUpdate, - rgOrPackage instanceof MonoRepo ? rgOrPackage.releaseGroup : undefined, + rgOrPackage instanceof MonoRepo + ? rgOrPackage.releaseGroup + : undefined, flags.updateType, /* prerelease */ flags.prerelease, /* writeChanges */ !flags.testMode, @@ -273,7 +296,9 @@ export default class DepsCommand extends BaseCommand { ); for (const [pkgName, ver] of Object.entries(updatedDependencies)) { - changedVersionsString.push(indentString(`${pkgName}: ${chalk.bold(ver)}`)); + changedVersionsString.push( + indentString(`${pkgName}: ${chalk.bold(ver)}`), + ); } const changedVersionMessage = changedVersionsString.join("\n"); @@ -298,7 +323,9 @@ export default class DepsCommand extends BaseCommand { `You can now create a PR for branch ${bumpBranch} targeting ${gitRepo.originalBranchName}`, ); } else { - this.warning(`Skipping commit. You'll need to manually commit changes.`); + this.warning( + `Skipping commit. You'll need to manually commit changes.`, + ); } this.finalMessages.push( diff --git a/build-tools/packages/build-cli/src/commands/check/buildVersion.ts b/build-tools/packages/build-cli/src/commands/check/buildVersion.ts index 643c20c29a29..1aa17fa4eb3c 100644 --- a/build-tools/packages/build-cli/src/commands/check/buildVersion.ts +++ b/build-tools/packages/build-cli/src/commands/check/buildVersion.ts @@ -44,7 +44,10 @@ export default class CheckBuildVersionCommand extends PackageCommand< if (this.flags.path === undefined) { this.error("Either version or path must be specified."); } - const pkg = new Package(path.join(this.flags.path, "package.json"), "none"); + const pkg = new Package( + path.join(this.flags.path, "package.json"), + "none", + ); this.versionToCheck = pkg.version; } else { this.versionToCheck = this.flags.version.version; diff --git a/build-tools/packages/build-cli/src/commands/check/changeset.ts b/build-tools/packages/build-cli/src/commands/check/changeset.ts index 3ad5c13d6ba4..3673eae6df18 100644 --- a/build-tools/packages/build-cli/src/commands/check/changeset.ts +++ b/build-tools/packages/build-cli/src/commands/check/changeset.ts @@ -9,7 +9,9 @@ import { sortPackageJson as sortJson } from "sort-package-json"; import { BaseCommand } from "../../library/index.js"; -export default class CheckChangesetCommand extends BaseCommand { +export default class CheckChangesetCommand extends BaseCommand< + typeof CheckChangesetCommand +> { static readonly summary = `Checks if a changeset was added when compared against a branch. This is used in CI to enforce that changesets are present for a PR.`; @@ -26,11 +28,13 @@ export default class CheckChangesetCommand extends BaseCommand <%= command.id %> -b main", }, { - description: "Check if a changeset was added when compared to the 'next' branch.", + description: + "Check if a changeset was added when compared to the 'next' branch.", command: "<%= config.bin %> <%= command.id %> -b next", }, ]; @@ -53,10 +57,14 @@ export default class CheckChangesetCommand extends BaseCommand changesetPathRegex.test(file)); + const changedChangesetFiles = files.filter((file) => + changesetPathRegex.test(file), + ); if (changedChangesetFiles.length === 0) { - this.errorLog(`No changeset files were added when compared to ${branch}.`); + this.errorLog( + `No changeset files were added when compared to ${branch}.`, + ); this.verbose(`Changed files: ${JSON.stringify(files, undefined, 2)}`); // When we output JSON, we don't want to exit with a failure error code. Instead we return the failure as part of @@ -70,7 +78,9 @@ export default class CheckChangesetCommand extends BaseCommand { +export default class LatestVersionsCommand extends BaseCommand< + typeof LatestVersionsCommand +> { static readonly summary = "Determines if an input version matches a latest minor release version. Intended to be used in the Fluid Framework CI pipeline only."; @@ -34,7 +40,10 @@ export default class LatestVersionsCommand extends BaseCommand { this.verbose("Package scan completed"); - const layerGraph = LayerGraph.load(resolvedRoot, packages.packages, flags.info); + const layerGraph = LayerGraph.load( + resolvedRoot, + packages.packages, + flags.info, + ); // Write human-readable package list organized by layer if (flags.md !== undefined) { - const packagesMdFilePath: string = path.join(resolvedRoot, flags.md, packagesMdFileName); + const packagesMdFilePath: string = path.join( + resolvedRoot, + flags.md, + packagesMdFileName, + ); await writeFileWithLineFeeds( packagesMdFilePath, layerGraph.generatePackageLayersMarkdown(resolvedRoot), diff --git a/build-tools/packages/build-cli/src/commands/check/policy.ts b/build-tools/packages/build-cli/src/commands/check/policy.ts index 01c736ce5871..6030d52802e0 100644 --- a/build-tools/packages/build-cli/src/commands/check/policy.ts +++ b/build-tools/packages/build-cli/src/commands/check/policy.ts @@ -115,7 +115,10 @@ export class CheckPolicy extends BaseCommand { async run(): Promise { let handlersToRun: Handler[] = policyHandlers.filter((h) => { - if (this.flags.excludeHandler === undefined || this.flags.excludeHandler.length === 0) { + if ( + this.flags.excludeHandler === undefined || + this.flags.excludeHandler.length === 0 + ) { return true; } const shouldRun = this.flags.excludeHandler?.includes(h.name) === false; @@ -171,7 +174,9 @@ export class CheckPolicy extends BaseCommand { const handlerExclusions: HandlerExclusions = {}; if (rawHandlerExclusions) { for (const rule of Object.keys(rawHandlerExclusions)) { - handlerExclusions[rule] = rawHandlerExclusions[rule].map((e) => new RegExp(e, "i")); + handlerExclusions[rule] = rawHandlerExclusions[rule].map( + (e) => new RegExp(e, "i"), + ); } } @@ -184,7 +189,10 @@ export class CheckPolicy extends BaseCommand { filePathsToCheck.push(...stdInput.split("\n")); } } else { - const repo = new Repository({ baseDir: gitRoot }, "microsoft/FluidFramework"); + const repo = new Repository( + { baseDir: gitRoot }, + "microsoft/FluidFramework", + ); const gitFiles = await repo.getFiles("."); filePathsToCheck.push(...gitFiles); } @@ -239,19 +247,30 @@ export class CheckPolicy extends BaseCommand { .filter((handler) => { // doing exclusion per handler const exclusions = handlerExclusions[handler.name]; - if (exclusions !== undefined && !exclusions.every((regex) => !regex.test(relPath))) { + if ( + exclusions !== undefined && + !exclusions.every((regex) => !regex.test(relPath)) + ) { this.verbose(`Excluded ${handler.name} handler: ${relPath}`); return false; } return true; }) - .map(async (handler): Promise<{ handler: Handler; result: string | undefined }> => { - const result = await runWithPerf(handler.name, "handle", async () => { - // Pass the handler the absolute file path and the absolute path to the git root - return handler.handler(file, gitRoot); - }); - return { handler, result }; - }), + .map( + async ( + handler, + ): Promise<{ handler: Handler; result: string | undefined }> => { + const result = await runWithPerf( + handler.name, + "handle", + async () => { + // Pass the handler the absolute file path and the absolute path to the git root + return handler.handler(file, gitRoot); + }, + ); + return { handler, result }; + }, + ), ); // Now that all handlers have completed, we can react to results which might include running resolvers @@ -264,9 +283,12 @@ export class CheckPolicy extends BaseCommand { output += `${newline}attempting to resolve: ${relPath}`; // Resolvers are expected to be run serially to avoid any conflicts. // eslint-disable-next-line no-await-in-loop - const resolveResult = await runWithPerf(handler.name, "resolve", async () => - // Pass the resolver the absolute file path and the absolute path to the git root - resolver(file, gitRoot), + const resolveResult = await runWithPerf( + handler.name, + "resolve", + async () => + // Pass the resolver the absolute file path and the absolute path to the git root + resolver(file, gitRoot), ); if (resolveResult?.message !== undefined) { @@ -343,7 +365,8 @@ async function runWithPerf( action: policyAction, run: () => Promise, ): Promise { - const actionMap = handlerPerformanceData.get(action) ?? new Map(); + const actionMap = + handlerPerformanceData.get(action) ?? new Map(); let dur = actionMap.get(name) ?? 0; const start = Date.now(); @@ -368,7 +391,9 @@ async function runFinalHandlers( const { final } = h; if (final) { // eslint-disable-next-line no-await-in-loop - const result = await runWithPerf(h.name, "final", async () => final(gitRoot, fix)); + const result = await runWithPerf(h.name, "final", async () => + final(gitRoot, fix), + ); // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (result?.error) { throw new Error(result.error); diff --git a/build-tools/packages/build-cli/src/commands/generate/assertTags.ts b/build-tools/packages/build-cli/src/commands/generate/assertTags.ts index 4ec648920bd8..0e1c9c0b1dc0 100644 --- a/build-tools/packages/build-cli/src/commands/generate/assertTags.ts +++ b/build-tools/packages/build-cli/src/commands/generate/assertTags.ts @@ -68,7 +68,9 @@ interface PackageData { const configName = "assertTagging"; const searchPlaces = [`${configName}.config.mjs`]; -export class TagAssertsCommand extends PackageCommand { +export class TagAssertsCommand extends PackageCommand< + typeof TagAssertsCommand +> { static readonly summary = "Tags asserts by replacing their message with a unique numerical value."; @@ -140,11 +142,15 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" ); if (!fs.existsSync(tsconfigPath)) { - this.verbose(`Skipping '${pkg.name}' because '${tsconfigPath}' doesn't exist.`); + this.verbose( + `Skipping '${pkg.name}' because '${tsconfigPath}' doesn't exist.`, + ); return false; } if (assertTaggingEnabledPaths !== undefined) { - if (assertTaggingEnabledPaths.some((regex) => regex.test(tsconfigPath))) { + if ( + assertTaggingEnabledPaths.some((regex) => regex.test(tsconfigPath)) + ) { return true; } this.verbose( @@ -173,7 +179,9 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" throw new Error("Method not implemented."); } - protected override async processPackages(packages: PackageWithKind[]): Promise { + protected override async processPackages( + packages: PackageWithKind[], + ): Promise { const errors: string[] = []; const collected: CollectedData = { @@ -249,7 +257,10 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" // walk all the files in the project for (const sourceFile of project.getSourceFiles()) { // walk the assert message params in the file - for (const msg of getAssertMessageParams(sourceFile, assertionFunctions)) { + for (const msg of getAssertMessageParams( + sourceFile, + assertionFunctions, + )) { const nodeKind = msg.getKind(); switch (nodeKind) { // If it's a number, validate it's a shortcode @@ -278,7 +289,10 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" } collected.shortCodes.set(numLitValue, numLit); // calculate the maximun short code to ensure we don't duplicate - collected.maxShortCode = Math.max(numLitValue, collected.maxShortCode); + collected.maxShortCode = Math.max( + numLitValue, + collected.maxShortCode, + ); // If comment already exists, extract it for the mapping file const comments = msg.getTrailingCommentRanges(); @@ -293,10 +307,14 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" // Only do it if the initial and final characters in the string are the only occurrences of // the double quotes / backticks, to avoid messing up comments that use them in a different // way. If we clean up the assert comments that have them, this code could go away. - const shouldRemoveSurroundingQuotes = (input: string): boolean => { + const shouldRemoveSurroundingQuotes = ( + input: string, + ): boolean => { return ( - (input.startsWith('"') && input.indexOf('"', 1) === input.length - 1) || - (input.startsWith("`") && input.indexOf("`", 1) === input.length - 1) + (input.startsWith('"') && + input.indexOf('"', 1) === input.length - 1) || + (input.startsWith("`") && + input.indexOf("`", 1) === input.length - 1) ); }; @@ -349,7 +367,9 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" if (otherErrors.length > 0) { errorMessages.push( `Unsupported argument kind:\n${otherErrors - .map((msg) => `${SyntaxKind[msg.getKind()]}: ${getCallsiteString(msg)}`) + .map( + (msg) => `${SyntaxKind[msg.getKind()]}: ${getCallsiteString(msg)}`, + ) .join("\n")}`, ); } @@ -365,11 +385,16 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" * * @returns array of error strings. */ - private tagAsserts(collected: CollectedData, packageData: PackageData): string[] { + private tagAsserts( + collected: CollectedData, + packageData: PackageData, + ): string[] { const errors: string[] = []; // eslint-disable-next-line unicorn/consistent-function-scoping - function isStringLiteral(msg: Node): msg is StringLiteral | NoSubstitutionTemplateLiteral { + function isStringLiteral( + msg: Node, + ): msg is StringLiteral | NoSubstitutionTemplateLiteral { const kind = msg.getKind(); return ( kind === SyntaxKind.StringLiteral || @@ -382,7 +407,10 @@ The format of the configuration is specified by the "AssertTaggingPackageConfig" for (const s of packageData.newAssertFiles) { // another policy may have changed the file, so reload it s.refreshFromFileSystemSync(); - for (const msg of getAssertMessageParams(s, packageData.assertionFunctions)) { + for (const msg of getAssertMessageParams( + s, + packageData.assertionFunctions, + )) { // here we only want to look at those messages that are strings, // as we validated existing short codes above if (isStringLiteral(msg)) { @@ -473,7 +501,11 @@ function writeShortCodeMappingFile(codeToMsgMap: Map): void { export const shortCodeMap = ${JSON.stringify(mapContents, undefined, "\t")}; `; - fs.writeFileSync(path.join(targetFolder, "assertionShortCodesMap.ts"), fileContents, { - encoding: "utf8", - }); + fs.writeFileSync( + path.join(targetFolder, "assertionShortCodesMap.ts"), + fileContents, + { + encoding: "utf8", + }, + ); } diff --git a/build-tools/packages/build-cli/src/commands/generate/buildVersion.ts b/build-tools/packages/build-cli/src/commands/generate/buildVersion.ts index e62b4e2ccd84..18c3e529de97 100644 --- a/build-tools/packages/build-cli/src/commands/generate/buildVersion.ts +++ b/build-tools/packages/build-cli/src/commands/generate/buildVersion.ts @@ -44,7 +44,8 @@ export default class GenerateBuildVersionCommand extends BaseCommand< env: "VERSION_PATCH", }), base: Flags.string({ - description: "The base version. This will be read from package.json if not provided.", + description: + "The base version. This will be read from package.json if not provided.", }), tag: Flags.string({ description: "The tag name to use.", @@ -139,7 +140,9 @@ export default class GenerateBuildVersionCommand extends BaseCommand< ? `${simpleVersion}-test-${alphabetaTypePrefix}` : `${simpleVersion}-test`; this.log(`codeVersion=${codeVersion}`); - this.log(`##vso[task.setvariable variable=codeVersion;isOutput=true]${codeVersion}`); + this.log( + `##vso[task.setvariable variable=codeVersion;isOutput=true]${codeVersion}`, + ); } if (isAlphaOrBetaTypes) { @@ -155,13 +158,22 @@ export default class GenerateBuildVersionCommand extends BaseCommand< } this.log(`version=${version}`); - this.log(`##vso[task.setvariable variable=version;isOutput=true]${version}`); + this.log( + `##vso[task.setvariable variable=version;isOutput=true]${version}`, + ); if (flags.tag !== undefined) { - const isLatest = getIsLatest(flags.tag, version, tags, shouldIncludeInternalVersions); + const isLatest = getIsLatest( + flags.tag, + version, + tags, + shouldIncludeInternalVersions, + ); this.log(`isLatest=${isLatest}`); if (isRelease && isLatest === true) { - this.log(`##vso[task.setvariable variable=isLatest;isOutput=true]${isLatest}`); + this.log( + `##vso[task.setvariable variable=isLatest;isOutput=true]${isLatest}`, + ); } } } @@ -170,7 +182,8 @@ export default class GenerateBuildVersionCommand extends BaseCommand< if (fs.existsSync("./package.json")) { return ( // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - JSON.parse(fs.readFileSync("./package.json", { encoding: "utf8" })).version as string + JSON.parse(fs.readFileSync("./package.json", { encoding: "utf8" })) + .version as string ); } diff --git a/build-tools/packages/build-cli/src/commands/generate/bundleStats.ts b/build-tools/packages/build-cli/src/commands/generate/bundleStats.ts index 843812a787a7..14d6afcdc603 100644 --- a/build-tools/packages/build-cli/src/commands/generate/bundleStats.ts +++ b/build-tools/packages/build-cli/src/commands/generate/bundleStats.ts @@ -11,7 +11,9 @@ import { copySync, readJson } from "fs-extra/esm"; import { BaseCommand } from "../../library/index.js"; import { type PnpmListEntry, pnpmList } from "../../pnpm.js"; -export default class GenerateBundlestats extends BaseCommand { +export default class GenerateBundlestats extends BaseCommand< + typeof GenerateBundlestats +> { static readonly description = `Find all bundle analysis artifacts and copy them into a central location to upload as build artifacts for later consumption`; @@ -43,11 +45,16 @@ export default class GenerateBundlestats extends BaseCommand { - static readonly description = "Generate a changelog for packages based on changesets."; + static readonly description = + "Generate a changelog for packages based on changesets."; static readonly flags = { releaseGroup: releaseGroupFlag({ @@ -94,7 +99,9 @@ export default class GenerateChangeLogCommand extends BaseCommand< * **Note that this is a lossy action!** The metadata is completely removed. Changesets are typically in source * control so changes can usually be reverted. */ - private async canonicalizeChangesets(releaseGroupRootDir: string): Promise { + private async canonicalizeChangesets( + releaseGroupRootDir: string, + ): Promise { const changesetDir = path.join(releaseGroupRootDir, DEFAULT_CHANGESET_PATH); const changesets = await loadChangesets(changesetDir, this.logger); @@ -138,9 +145,13 @@ export default class GenerateChangeLogCommand extends BaseCommand< } const monorepo = - releaseGroup === undefined ? undefined : context.repo.releaseGroups.get(releaseGroup); + releaseGroup === undefined + ? undefined + : context.repo.releaseGroups.get(releaseGroup); if (monorepo === undefined) { - this.error(`Release group ${releaseGroup} not found in repo config`, { exit: 1 }); + this.error(`Release group ${releaseGroup} not found in repo config`, { + exit: 1, + }); } const releaseGroupRoot = monorepo?.directory ?? gitRoot; diff --git a/build-tools/packages/build-cli/src/commands/generate/changeset.ts b/build-tools/packages/build-cli/src/commands/generate/changeset.ts index 4dec0b0e1e70..396ec7f4fa54 100644 --- a/build-tools/packages/build-cli/src/commands/generate/changeset.ts +++ b/build-tools/packages/build-cli/src/commands/generate/changeset.ts @@ -35,7 +35,11 @@ Enter: Done`; * Package scopes that will be excluded by default. The default list contains scopes that are not typically published to * a public registry, and thus are the least likely to have a changeset-relevant change. */ -const excludedScopes = new Set(["@fluid-example", "@fluid-internal", "@fluid-test"]); +const excludedScopes = new Set([ + "@fluid-example", + "@fluid-internal", + "@fluid-test", +]); /** * Represents a choice in the CLI prompt UX. @@ -117,9 +121,13 @@ export default class GenerateChangesetCommand extends BaseCommand< let { branch } = this.flags; const monorepo = - releaseGroup === undefined ? undefined : context.repo.releaseGroups.get(releaseGroup); + releaseGroup === undefined + ? undefined + : context.repo.releaseGroups.get(releaseGroup); if (monorepo === undefined) { - this.error(`Release group ${releaseGroup} not found in repo config`, { exit: 1 }); + this.error(`Release group ${releaseGroup} not found in repo config`, { + exit: 1, + }); } if (empty) { @@ -146,7 +154,9 @@ export default class GenerateChangesetCommand extends BaseCommand< exit: 1, }); } - this.log(`Remote for ${repo.upstreamRemotePartialUrl} is: ${chalk.bold(remote)}`); + this.log( + `Remote for ${repo.upstreamRemotePartialUrl} is: ${chalk.bold(remote)}`, + ); ux.action.start(`Comparing local changes to remote for branch ${branch}`); let { @@ -162,8 +172,12 @@ export default class GenerateChangesetCommand extends BaseCommand< // If the branch flag was passed explicitly, we don't want to prompt the user to select one. We can't check for // undefined because there's a default value for the flag. - const usedBranchFlag = this.argv.includes("--branch") || this.argv.includes("-b"); - if (!usedBranchFlag && initialBranchChangedPackages.length > BRANCH_PROMPT_LIMIT) { + const usedBranchFlag = + this.argv.includes("--branch") || this.argv.includes("-b"); + if ( + !usedBranchFlag && + initialBranchChangedPackages.length > BRANCH_PROMPT_LIMIT + ) { const answer = await prompts({ type: "select", name: "selectedBranch", @@ -184,7 +198,11 @@ export default class GenerateChangesetCommand extends BaseCommand< ux.action.start( `Branch changed. Comparing local changes to remote for branch ${branch}`, ); - const newChanges = await repo.getChangedSinceRef(branch, remote, context); + const newChanges = await repo.getChangedSinceRef( + branch, + remote, + context, + ); ux.action.stop(); changedPackages = newChanges.packages; @@ -236,13 +254,19 @@ export default class GenerateChangesetCommand extends BaseCommand< .map((pkg) => { const changed = changedPackages.some((cp) => cp.name === pkg.name); return { - title: changed ? `${pkg.name} ${chalk.red(chalk.bold("(changed)"))}` : pkg.name, + title: changed + ? `${pkg.name} ${chalk.red(chalk.bold("(changed)"))}` + : pkg.name, value: pkg, selected: changed, }; }), // Next list independent packages in a group - { title: chalk.bold("Independent Packages"), heading: true, disabled: true }, + { + title: chalk.bold("Independent Packages"), + heading: true, + disabled: true, + }, ); for (const pkg of context.independentPackages) { @@ -251,7 +275,9 @@ export default class GenerateChangesetCommand extends BaseCommand< } const changed = changedPackages.some((cp) => cp.name === pkg.name); packageChoices.push({ - title: changed ? `${pkg.name} ${chalk.red(chalk.bold("(changed)"))}` : pkg.name, + title: changed + ? `${pkg.name} ${chalk.red(chalk.bold("(changed)"))}` + : pkg.name, value: pkg, selected: changed, }); @@ -331,9 +357,13 @@ export default class GenerateChangesetCommand extends BaseCommand< : uiMode === "default" ? "autocompleteMultiselect" : "multiselect", - choices: [...packageChoices, { title: " ", heading: true, disabled: true }], + choices: [ + ...packageChoices, + { title: " ", heading: true, disabled: true }, + ], instructions: INSTRUCTIONS, - message: "Choose which packages to include in the changeset. Type to filter the list.", + message: + "Choose which packages to include in the changeset. Type to filter the list.", optionsPerPage: 5, onState: (state: PromptState): void => { if (state.aborted) { @@ -381,8 +411,10 @@ export default class GenerateChangesetCommand extends BaseCommand< const response = await prompts(questions); // The response.selectedPackages value will be undefined if the question was skipped, so default to an empty array // in that case. - const selectedPackages: Package[] = (response.selectedPackages ?? []) as Package[]; - const bumpType = getDefaultBumpTypeForBranch(branch, releaseGroup) ?? "minor"; + const selectedPackages: Package[] = (response.selectedPackages ?? + []) as Package[]; + const bumpType = + getDefaultBumpTypeForBranch(branch, releaseGroup) ?? "minor"; const newFile = await createChangesetFile( monorepo.directory ?? context.root, @@ -410,7 +442,11 @@ async function createChangesetFile( ): Promise { const changesetID = humanId({ separator: "-", capitalize: false }); const changesetPath = path.join(rootPath, ".changeset", `${changesetID}.md`); - const changesetContent = createChangesetContent(packages, body, additionalMetadata); + const changesetContent = createChangesetContent( + packages, + body, + additionalMetadata, + ); await writeFile(changesetPath, changesetContent); return changesetPath; } @@ -444,7 +480,10 @@ function createChangesetContent( } function isIncludedByDefault(pkg: Package): boolean { - if (pkg.packageJson.private === true || excludedScopes.has(PackageName.getScope(pkg.name))) { + if ( + pkg.packageJson.private === true || + excludedScopes.has(PackageName.getScope(pkg.name)) + ) { return false; } @@ -458,7 +497,11 @@ function isIncludedByDefault(pkg: Package): boolean { * @param b - The second package to compare. * @param changedPackages - An array of changed packages. */ -function packageComparer(a: Package, b: Package, changedPackages: Package[]): number { +function packageComparer( + a: Package, + b: Package, + changedPackages: Package[], +): number { const aChanged = changedPackages.some((cp) => cp.name === a.name); const bChanged = changedPackages.some((cp) => cp.name === b.name); @@ -473,7 +516,8 @@ function packageComparer(a: Package, b: Package, changedPackages: Package[]): nu } // Otherwise, compare by name. - return PackageName.getUnscopedName(a.name) < PackageName.getUnscopedName(b.name) + return PackageName.getUnscopedName(a.name) < + PackageName.getUnscopedName(b.name) ? -1 : a.name === b.name ? 0 diff --git a/build-tools/packages/build-cli/src/commands/generate/node10Entrypoints.ts b/build-tools/packages/build-cli/src/commands/generate/node10Entrypoints.ts index 9245a18371ca..bb182c52ede7 100644 --- a/build-tools/packages/build-cli/src/commands/generate/node10Entrypoints.ts +++ b/build-tools/packages/build-cli/src/commands/generate/node10Entrypoints.ts @@ -47,7 +47,10 @@ export default class GenerateNode10EntrypointsCommand extends BaseCommand< ); } - await generateNode10TypeEntrypoints(mapNode10CompatExportPathToData, this.logger); + await generateNode10TypeEntrypoints( + mapNode10CompatExportPathToData, + this.logger, + ); } } @@ -106,7 +109,10 @@ async function generateNode10TypeEntrypoints( */ const fileSavePromises: Promise[] = []; - for (const [outFile, { relPath, isTypeOnly }] of mapExportPathToData.entries()) { + for (const [ + outFile, + { relPath, isTypeOnly }, + ] of mapExportPathToData.entries()) { log.info(`\tGenerating ${outFile}`); const jsImport = relPath.replace(/\.d\.([cm]?)ts/, ".$1js"); fileSavePromises.push( diff --git a/build-tools/packages/build-cli/src/commands/generate/releaseNotes.ts b/build-tools/packages/build-cli/src/commands/generate/releaseNotes.ts index 411b850a8838..d5c9a4623cd7 100644 --- a/build-tools/packages/build-cli/src/commands/generate/releaseNotes.ts +++ b/build-tools/packages/build-cli/src/commands/generate/releaseNotes.ts @@ -36,7 +36,8 @@ import { RELEASE_NOTES_TOC_LINK_TEXT } from "../../library/releaseNotes.js"; export default class GenerateReleaseNotesCommand extends BaseCommand< typeof GenerateReleaseNotesCommand > { - static readonly summary = `Generates release notes from individual changeset files.`; + static readonly summary = + `Generates release notes from individual changeset files.`; // Enables the global JSON flag in oclif. static readonly enableJsonFlag = true; @@ -47,7 +48,8 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< }), releaseType: Flags.custom<"major" | "minor">({ char: "t", - description: "The type of release for which the release notes are being generated.", + description: + "The type of release for which the release notes are being generated.", options: ["major", "minor"], required: true, parse: async (input) => { @@ -115,7 +117,10 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< ); } - const changesetDir = path.join(releaseGroup.directory, DEFAULT_CHANGESET_PATH); + const changesetDir = path.join( + releaseGroup.directory, + DEFAULT_CHANGESET_PATH, + ); const changesets = await loadChangesets(changesetDir, logger); const { version } = releaseGroup; @@ -147,14 +152,19 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< } const sectionsInChangesets = new Set(bySection.keys()); - const configuredSections = new Set(Object.keys(releaseNotesConfig.sections)); - const unknownSections = difference(sectionsInChangesets, configuredSections).add( - UNKNOWN_SECTION, + const configuredSections = new Set( + Object.keys(releaseNotesConfig.sections), ); + const unknownSections = difference( + sectionsInChangesets, + configuredSections, + ).add(UNKNOWN_SECTION); if (flags.includeUnknown) { for (const sectionName of unknownSections) { - sectionsToBuild.set(sectionName, { heading: `Unknown section: ${sectionName}` }); + sectionsToBuild.set(sectionName, { + heading: `Unknown section: ${sectionName}`, + }); } } else { for (const section of unknownSections) { @@ -175,7 +185,8 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< (change) => // filter out changes that shouldn't be in the release notes (change.additionalMetadata?.includeInReleaseNotes ?? - fluidCustomChangeSetMetadataDefaults.includeInReleaseNotes) === true, + fluidCustomChangeSetMetadataDefaults.includeInReleaseNotes) === + true, ); if (changes === undefined || changes.length === 0) { this.info(`No changes in section "${name}", so it will be omitted.`); @@ -193,7 +204,8 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< change.changeTypes.includes(flags.releaseType) ) { const pr = change.commit?.githubPullRequest; - const changeTitle = pr === undefined ? change.summary : `${change.summary} (#${pr})`; + const changeTitle = + pr === undefined ? change.summary : `${change.summary} (#${pr})`; body.append(`### ${changeTitle}\n\n${change.body}\n\n`); body.append(`#### Change details\n\n`); @@ -242,10 +254,14 @@ export default class GenerateReleaseNotesCommand extends BaseCommand< }, }); - const processor = flags.headingLinks ? baseProcessor.use(addHeadingLinks) : baseProcessor; + const processor = flags.headingLinks + ? baseProcessor.use(addHeadingLinks) + : baseProcessor; const contents = String( - await processor.process(`${header}\n\n${intro}\n\n${body.toString()}\n\n${footer}`), + await processor.process( + `${header}\n\n${intro}\n\n${body.toString()}\n\n${footer}`, + ), ); const outputPath = path.join(context.repo.resolvedRoot, flags.outFile); diff --git a/build-tools/packages/build-cli/src/commands/generate/typetests.ts b/build-tools/packages/build-cli/src/commands/generate/typetests.ts index 0c559c7cf702..46edc5060481 100644 --- a/build-tools/packages/build-cli/src/commands/generate/typetests.ts +++ b/build-tools/packages/build-cli/src/commands/generate/typetests.ts @@ -39,7 +39,10 @@ import { import { getTypesPathFromPackage } from "../../library/packageExports.js"; // AB#8118 tracks removing the barrel files and importing directly from the submodules, including disabling this rule. // eslint-disable-next-line import/no-internal-modules -import { type TestCaseTypeData, buildTestCase } from "../../typeValidator/testGeneration.js"; +import { + type TestCaseTypeData, + buildTestCase, +} from "../../typeValidator/testGeneration.js"; // AB#8118 tracks removing the barrel files and importing directly from the submodules, including disabling this rule. // eslint-disable-next-line import/no-internal-modules import type { TypeData } from "../../typeValidator/typeData.js"; @@ -55,7 +58,8 @@ import { export default class GenerateTypetestsCommand extends PackageCommand< typeof GenerateTypetestsCommand > { - static readonly description = "Generates type tests for a package or group of packages."; + static readonly description = + "Generates type tests for a package or group of packages."; static readonly flags = { entrypoint: Flags.custom({ @@ -91,7 +95,9 @@ export default class GenerateTypetestsCommand extends PackageCommand< entrypointFlag ?? pkgJson.typeValidation?.entrypoint ?? defaultTypeValidationConfig.entrypoint; - const fallbackLevel = this.flags.publicFallback ? ApiLevel.public : undefined; + const fallbackLevel = this.flags.publicFallback + ? ApiLevel.public + : undefined; this.verbose( `${pkg.nameColored}: Generating type tests for "${entrypoint}" entrypoint with "${fallbackLevel}" as a fallback.`, @@ -102,8 +108,10 @@ export default class GenerateTypetestsCommand extends PackageCommand< // Do not catch error from opening file since the default behavior is fine (exits process with error showing useful message) const currentPackageJson: PackageWithTypeTestSettings = pkg.packageJson; - const { name: previousPackageName, packageJsonPath: previousPackageJsonPath } = - getTypeTestPreviousPackageDetails(pkg); + const { + name: previousPackageName, + packageJsonPath: previousPackageJsonPath, + } = getTypeTestPreviousPackageDetails(pkg); const previousBasePath = path.dirname(previousPackageJsonPath); const typeTestOutputFile = getTypeTestFilePath(pkg, outDir, outFile); @@ -123,16 +131,27 @@ export default class GenerateTypetestsCommand extends PackageCommand< } ensureDevDependencyExists(currentPackageJson, previousPackageName); - this.verbose(`${pkg.nameColored}: Reading package.json at ${previousPackageJsonPath}`); - const previousPackageJson = (await readJson(previousPackageJsonPath)) as PackageJson; + this.verbose( + `${pkg.nameColored}: Reading package.json at ${previousPackageJsonPath}`, + ); + const previousPackageJson = (await readJson( + previousPackageJsonPath, + )) as PackageJson; // Set the name in the JSON to the calculated previous package name, since the name in the previous package.json is // the same as current. This enables us to pass the package.json object to more general functions but ensure those // functions use the correct name. For example, when we write the `import { foo } from /internal` // statements into the type test file, we need to use the previous version name. previousPackageJson.name = previousPackageName; - const { typesPath: previousTypesPathRelative, entrypointUsed: previousEntrypoint } = - getTypesPathWithFallback(previousPackageJson, entrypoint, this.logger, fallbackLevel); + const { + typesPath: previousTypesPathRelative, + entrypointUsed: previousEntrypoint, + } = getTypesPathWithFallback( + previousPackageJson, + entrypoint, + this.logger, + fallbackLevel, + ); const previousTypesPath = path.resolve( path.join(previousBasePath, previousTypesPathRelative), ); @@ -183,7 +202,10 @@ declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | Fu `, ]; - const testCases = generateCompatibilityTestCases(typeMap, currentPackageJson); + const testCases = generateCompatibilityTestCases( + typeMap, + currentPackageJson, + ); const output = [...fileHeader, ...testCases].join("\n"); await mkdir(outDir, { recursive: true }); @@ -207,7 +229,11 @@ function getTypesPathWithFallback( ): { typesPath: string; entrypointUsed: ApiLevel } { let chosenEntrypoint: ApiLevel = entrypoint; // First try the requested paths, but fall back to public otherwise if configured. - let typesPath: string | undefined = getTypesPathFromPackage(packageJson, entrypoint, log); + let typesPath: string | undefined = getTypesPathFromPackage( + packageJson, + entrypoint, + log, + ); if (typesPath === undefined) { // Try the public types if configured to do so. If public types are found adjust the level accordingly. @@ -234,7 +260,11 @@ function getTypesPathWithFallback( * * @returns The path to write generated files to. */ -function getTypeTestFilePath(pkg: Package, outDir: string, outFile: string): string { +function getTypeTestFilePath( + pkg: Package, + outDir: string, + outFile: string, +): string { return path.join( pkg.directory, outDir, @@ -294,19 +324,30 @@ function addScope( node: NameableNodeSpecific | NamedNodeSpecificBase, ): string { const scope = node.getName(); - if (scope === undefined) throw new Error("Missing scope where one was expected"); + if (scope === undefined) + throw new Error("Missing scope where one was expected"); return addStringScope(namespacePrefix, scope); } /** * Prefix `innerName` name with `namespacePrefix` to produce a qualified name. */ -function addStringScope(namespacePrefix: string | undefined, innerName: string): string { - const name = namespacePrefix === undefined ? innerName : `${namespacePrefix}.${innerName}`; +function addStringScope( + namespacePrefix: string | undefined, + innerName: string, +): string { + const name = + namespacePrefix === undefined + ? innerName + : `${namespacePrefix}.${innerName}`; return name; } -function getNodeTypeData(node: Node, log: Logger, exportedName: string): TypeData[] { +function getNodeTypeData( + node: Node, + log: Logger, + exportedName: string, +): TypeData[] { /* handles namespaces e.g. export namespace foo{ @@ -357,7 +398,9 @@ function getNodeTypeData(node: Node, log: Logger, exportedName: string): TypeDat Node.isFunctionDeclaration(node) ) { const docs = Node.isVariableDeclaration(node) - ? node.getFirstAncestorByKindOrThrow(SyntaxKind.VariableStatement).getJsDocs() + ? node + .getFirstAncestorByKindOrThrow(SyntaxKind.VariableStatement) + .getJsDocs() : node.getJsDocs(); const typeData: TypeData[] = []; @@ -463,10 +506,14 @@ export function generateCompatibilityTestCases( // Convert Map entries to an array and sort by key. This is not strictly needed since Maps are iterated in insertion // order, so the type tests should generate in the same order each time. However, explicitly sorting by the test case // name is clearer. - const sortedEntries = [...typeMap.entries()].sort((a, b) => a[0].localeCompare(b[0])); + const sortedEntries = [...typeMap.entries()].sort((a, b) => + a[0].localeCompare(b[0]), + ); for (const [testCaseName, typeData] of sortedEntries) { - testString.push(...generateCompatibilityTestCase(typeData, broken[testCaseName])); + testString.push( + ...generateCompatibilityTestCase(typeData, broken[testCaseName]), + ); } return testString; } @@ -558,7 +605,9 @@ export function generateCompatibilityTestCase( /** * Returns the name of the type preprocessing type meta-function to use, or undefined if no type test should be generated. */ -function selectTypePreprocessor(typeData: Omit): string | undefined { +function selectTypePreprocessor( + typeData: Omit, +): string | undefined { if (typeData.tags.has("system")) { return undefined; } diff --git a/build-tools/packages/build-cli/src/commands/generate/upcoming.ts b/build-tools/packages/build-cli/src/commands/generate/upcoming.ts index ddaa14ec0f86..18930ce23c22 100644 --- a/build-tools/packages/build-cli/src/commands/generate/upcoming.ts +++ b/build-tools/packages/build-cli/src/commands/generate/upcoming.ts @@ -10,7 +10,11 @@ import { Flags } from "@oclif/core"; import { format as prettier } from "prettier"; import { releaseGroupFlag } from "../../flags.js"; -import { BaseCommand, DEFAULT_CHANGESET_PATH, loadChangesets } from "../../library/index.js"; +import { + BaseCommand, + DEFAULT_CHANGESET_PATH, + loadChangesets, +} from "../../library/index.js"; const DEFAULT_FILE = "UPCOMING.md"; @@ -42,7 +46,8 @@ export default class GenerateUpcomingCommand extends BaseCommand< }), releaseType: Flags.custom<"major" | "minor">({ char: "t", - description: "The type of release for which the upcoming file is being generated.", + description: + "The type of release for which the upcoming file is being generated.", options: ["major", "minor"], required: true, parse: async (input) => { @@ -67,7 +72,8 @@ export default class GenerateUpcomingCommand extends BaseCommand< }, { description: `You can output a different file using the --out flag.`, - command: "<%= config.bin %> <%= command.id %> -g client -t minor --out testOutput.md", + command: + "<%= config.bin %> <%= command.id %> -g client -t minor --out testOutput.md", }, ]; @@ -81,7 +87,10 @@ export default class GenerateUpcomingCommand extends BaseCommand< this.exit(2); } - const changesetDir = path.join(releaseGroup.directory, DEFAULT_CHANGESET_PATH); + const changesetDir = path.join( + releaseGroup.directory, + DEFAULT_CHANGESET_PATH, + ); const changes = await loadChangesets(changesetDir, logger); const { version } = releaseGroup; @@ -93,7 +102,10 @@ export default class GenerateUpcomingCommand extends BaseCommand< let body: string = ""; for (const change of changes) { - if (change.changeTypes.includes("minor") || flags.releaseType === "major") { + if ( + change.changeTypes.includes("minor") || + flags.releaseType === "major" + ) { body += `## ${change.summary}\n\n${change.body}\n\n`; } else { this.info( diff --git a/build-tools/packages/build-cli/src/commands/info.ts b/build-tools/packages/build-cli/src/commands/info.ts index 4e9a63427785..ef48b30914ff 100644 --- a/build-tools/packages/build-cli/src/commands/info.ts +++ b/build-tools/packages/build-cli/src/commands/info.ts @@ -50,7 +50,8 @@ const nameToColumnInfo: Record> = { style: { alignment: "center" }, }, version: { - getValue: (pkg: Package) => (pkg.monoRepo ? pkg.monoRepo.version : pkg.version), + getValue: (pkg: Package) => + pkg.monoRepo ? pkg.monoRepo.version : pkg.version, style: { alignment: "left" }, }, path: { @@ -63,7 +64,8 @@ const nameToColumnInfo: Record> = { * The root `info` command. */ export default class InfoCommand extends BaseCommand { - static readonly description = "Get info about the repo, release groups, and packages."; + static readonly description = + "Get info about the repo, release groups, and packages."; static readonly flags = { releaseGroup: releaseGroupFlag({ @@ -104,7 +106,8 @@ export default class InfoCommand extends BaseCommand { // Sort by packages by name (invariant sort by codepoints). // (See https://stackoverflow.com/a/40355107) packages.sort( - (left, right) => Number(left.name > right.name) || -(left.name < right.name), + (left, right) => + Number(left.name > right.name) || -(left.name < right.name), ); // Filter out private packages diff --git a/build-tools/packages/build-cli/src/commands/list.ts b/build-tools/packages/build-cli/src/commands/list.ts index c64036c17106..7e6c1334b129 100644 --- a/build-tools/packages/build-cli/src/commands/list.ts +++ b/build-tools/packages/build-cli/src/commands/list.ts @@ -8,7 +8,10 @@ import path from "node:path"; import { MonoRepo, Package } from "@fluidframework/build-tools"; import { Flags } from "@oclif/core"; import { mkdirpSync } from "fs-extra"; -import { findPackageOrReleaseGroup, packageOrReleaseGroupArg } from "../args.js"; +import { + findPackageOrReleaseGroup, + packageOrReleaseGroupArg, +} from "../args.js"; import { filterPackages, parsePackageFilterFlags } from "../filter.js"; import { filterFlags, releaseGroupFlag } from "../flags.js"; import { BaseCommand, getTarballName } from "../library/index.js"; @@ -33,7 +36,8 @@ interface ListItem extends PnpmListEntry { * seeing errors if they happen to be installing packages while we are publishing a new release. */ export default class ListCommand extends BaseCommand { - static readonly description = `List packages in a release group in topological order.`; + static readonly description = + `List packages in a release group in topological order.`; static readonly enableJsonFlag = true; static readonly args = { @@ -83,7 +87,12 @@ export default class ListCommand extends BaseCommand { }; public async run(): Promise { - const { feed, outFile, releaseGroup: releaseGroupName, tarball } = this.flags; + const { + feed, + outFile, + releaseGroup: releaseGroupName, + tarball, + } = this.flags; const context = await this.getContext(); const lookupName = releaseGroupName ?? this.args.package_or_release_group; if (lookupName === undefined) { @@ -98,7 +107,10 @@ export default class ListCommand extends BaseCommand { } if (rgOrPackage === undefined || !(rgOrPackage instanceof MonoRepo)) { - this.error(`No release group or package found using name '${lookupName}'.`, { exit: 1 }); + this.error( + `No release group or package found using name '${lookupName}'.`, + { exit: 1 }, + ); } const filterOptions = parsePackageFilterFlags(this.flags); diff --git a/build-tools/packages/build-cli/src/commands/merge/branches.ts b/build-tools/packages/build-cli/src/commands/merge/branches.ts index 246948e8c83d..85f6f134cf61 100644 --- a/build-tools/packages/build-cli/src/commands/merge/branches.ts +++ b/build-tools/packages/build-cli/src/commands/merge/branches.ts @@ -28,7 +28,8 @@ interface CleanupBranch { * Later, it creates a pull request based on the batch size passed. */ export default class MergeBranch extends BaseCommand { - static readonly description = "Sync branches depending on the batch size passed"; + static readonly description = + "Sync branches depending on the batch size passed"; // This command is deprecated and should no longer be used. static readonly state = "deprecated"; @@ -67,13 +68,15 @@ export default class MergeBranch extends BaseCommand { multiple: true, }), createPr: Flags.boolean({ - description: "Use --no-createPr to skip creating a PR. Useful for testing.", + description: + "Use --no-createPr to skip creating a PR. Useful for testing.", hidden: true, default: true, allowNo: true, }), checkPr: Flags.boolean({ - description: "Use --no-checkPr to skip checking for a PR. Useful for testing.", + description: + "Use --no-checkPr to skip checking for a PR. Useful for testing.", hidden: true, default: true, allowNo: true, @@ -119,7 +122,9 @@ export default class MergeBranch extends BaseCommand { // eslint-disable-next-line unicorn/no-await-expression-member this.initialBranch = (await gitRepo.gitClient.status()).current ?? "main"; - this.remote = flags.remote ?? (await gitRepo.getRemote(gitRepo.upstreamRemotePartialUrl)); + this.remote = + flags.remote ?? + (await gitRepo.getRemote(gitRepo.upstreamRemotePartialUrl)); if (this.remote === undefined) { this.error("Remote for upstream repo not found", { exit: 1 }); } @@ -127,7 +132,13 @@ export default class MergeBranch extends BaseCommand { if (flags.checkPr) { // Check if a branch integration PR exists already, based on its **name**. - const prData = await pullRequestExists(flags.pat, prTitle, owner, repo, this.logger); + const prData = await pullRequestExists( + flags.pat, + prTitle, + owner, + repo, + this.logger, + ); if (prData.found) { this.log(`Found open PR #${prData.number} at ${prData.url}`); @@ -153,7 +164,10 @@ export default class MergeBranch extends BaseCommand { `${lastMergedCommit} is the last merged commit id between ${flags.source} and ${flags.target}`, ); - const unmergedCommitList: string[] = await gitRepo.revList(lastMergedCommit, flags.source); + const unmergedCommitList: string[] = await gitRepo.revList( + lastMergedCommit, + flags.source, + ); if (unmergedCommitList.length === 0) { this.log( @@ -167,7 +181,9 @@ export default class MergeBranch extends BaseCommand { this.log( `There are ${unmergedCommitList.length} unmerged commits between the ${flags.source} and ${flags.target} branches`, ); - this.verbose(`Unmerged commit list: ${unmergedCommitList.map((c) => shortCommit(c))}`); + this.verbose( + `Unmerged commit list: ${unmergedCommitList.map((c) => shortCommit(c))}`, + ); /** * tempBranchToCheckConflicts is used to check the conflicts of each commit with the target branch. @@ -196,9 +212,15 @@ export default class MergeBranch extends BaseCommand { ); // Check out a new temp branch at the same commit as the target branch. - await gitRepo.gitClient.checkoutBranch(tempBranchToCheckConflicts, remoteTargetBranch); + await gitRepo.gitClient.checkoutBranch( + tempBranchToCheckConflicts, + remoteTargetBranch, + ); - const commitBatchSize = Math.min(flags.batchSize, unmergedCommitList.length); + const commitBatchSize = Math.min( + flags.batchSize, + unmergedCommitList.length, + ); const [commitListHasConflicts, conflictingCommitIndex] = await hasConflicts( unmergedCommitList.slice(0, commitBatchSize), gitRepo, @@ -245,12 +267,20 @@ export default class MergeBranch extends BaseCommand { ); await gitRepo.gitClient.checkoutBranch(mergeBranch, prHeadCommit); // Clean up the local mergeBranch in case of a failure. - this.branchesToCleanup.push({ branch: mergeBranch, local: true, remote: false }); + this.branchesToCleanup.push({ + branch: mergeBranch, + local: true, + remote: false, + }); // Delete the temp branch we created earlier. It's safe to delete the branch now because we checked out a new branch // in the previous step. this.verbose(`Deleting temp branch: ${tempBranchToCheckConflicts}`); - await gitRepo.gitClient.branch(["--delete", tempBranchToCheckConflicts, "--force"]); + await gitRepo.gitClient.branch([ + "--delete", + tempBranchToCheckConflicts, + "--force", + ]); // If we determined that the PR won't conflict, check out the target branch (with a temp branch) and merge that with // mergeBranch, which is the source branch we want to merge. We will create the PR at the new merge commit; in other @@ -310,7 +340,9 @@ export default class MergeBranch extends BaseCommand { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const assignee: string = commitInfo?.data.author.login; - this.info(`Creating PR for commit id ${prHeadCommit} assigned to ${assignee}`); + this.info( + `Creating PR for commit id ${prHeadCommit} assigned to ${assignee}`, + ); const prObject = { token: flags.pat, owner, @@ -337,7 +369,11 @@ export default class MergeBranch extends BaseCommand { } catch (error: unknown) { // There was an error when creating the pull request, so clean up the remote branch. this.errorLog(`Error creating pull request: ${error}`); - this.branchesToCleanup.push({ branch: mergeBranch, local: true, remote: true }); + this.branchesToCleanup.push({ + branch: mergeBranch, + local: true, + remote: true, + }); throw error; } this.log(`Opened pull request ${prNumber} for commit id ${prHeadCommit}`); @@ -361,7 +397,11 @@ export default class MergeBranch extends BaseCommand { throw err; } - if (this.flags.cleanup === true && err.exitCode !== undefined && err.exitCode !== 0) { + if ( + this.flags.cleanup === true && + err.exitCode !== undefined && + err.exitCode !== 0 + ) { await this.doCleanup(); } @@ -397,7 +437,9 @@ export default class MergeBranch extends BaseCommand { try { await gitRepo?.gitClient.push(this.remote, branch, ["--delete"]); } catch { - this.verbose(`CLEANUP: FAILED to delete remote branch ${this.remote}/${branch}`); + this.verbose( + `CLEANUP: FAILED to delete remote branch ${this.remote}/${branch}`, + ); } }; for (const branch of this.branchesToCleanup.filter((b) => b.remote)) { diff --git a/build-tools/packages/build-cli/src/commands/merge/info.ts b/build-tools/packages/build-cli/src/commands/merge/info.ts index 659ae7b1820a..c645e91b2ff2 100644 --- a/build-tools/packages/build-cli/src/commands/merge/info.ts +++ b/build-tools/packages/build-cli/src/commands/merge/info.ts @@ -28,7 +28,9 @@ interface BranchMergeInfo { commits: string[]; } -export default class MergeInfoCommand extends BaseCommand { +export default class MergeInfoCommand extends BaseCommand< + typeof MergeInfoCommand +> { static readonly description = `Get info about the merge status of branches in the repo. Uses "main" and "next" if no branch names are provided. Output the data as JSON using --json.`; @@ -45,7 +47,8 @@ export default class MergeInfoCommand extends BaseCommand <%= command.id %>", }, { @@ -100,7 +103,10 @@ export default class MergeInfoCommand extends BaseCommand = new Set(["fluid-framework", "tinylicious"]); +const unscopedFFPackages: ReadonlySet = new Set([ + "fluid-framework", + "tinylicious", +]); /** * Rewrite imports for Fluid Framework APIs to use the correct subpath import (/beta, /legacy, etc.). @@ -95,7 +108,8 @@ export default class UpdateFluidImportsCommand extends BaseCommand< exists: true, }), onlyInternal: Flags.boolean({ - description: "Use /internal for all non-public APIs instead of /beta or /legacy.", + description: + "Use /internal for all non-public APIs instead of /beta or /legacy.", }), ...BaseCommand.flags, }; @@ -115,9 +129,15 @@ export default class UpdateFluidImportsCommand extends BaseCommand< this.error(`No config files found.`, { exit: 1 }); } - const apiLevelData = data === undefined ? undefined : await loadData(data, onlyInternal); + const apiLevelData = + data === undefined ? undefined : await loadData(data, onlyInternal); const packagesRegex = new RegExp(packageRegex ?? ""); - const apiMap = new ApiLevelReader(this.logger, packagesRegex, onlyInternal, apiLevelData); + const apiMap = new ApiLevelReader( + this.logger, + packagesRegex, + onlyInternal, + apiLevelData, + ); // Note that while there is a queue here it is only really a queue for file saves // which are the only async aspect currently and aren't expected to take so long. @@ -228,7 +248,12 @@ class FluidImportManager { * This ensures aliases and individual type-only imports are maintained when rewritten. */ const fullImportSpecifierText = importSpecifier.getFullText().trim(); - const expectedPath = getPathForImportName(name, data, ExportPath.Public, this.log); + const expectedPath = getPathForImportName( + name, + data, + ExportPath.Public, + this.log, + ); const modificationRequired = path !== expectedPath; @@ -265,7 +290,9 @@ class FluidImportManager { this.log.verbose(`\t- ${namedImport}`); } - fluidImport.importDeclaration.addNamedImports(fluidImport.declaration.namedImports); + fluidImport.importDeclaration.addNamedImports( + fluidImport.declaration.namedImports, + ); } // 2. or if not see if there are new imports that would like to take over // which helps preserve comments and vertical spacing. @@ -289,14 +316,21 @@ class FluidImportManager { fluidImport.importDeclaration.setModuleSpecifier( replacement.declaration.moduleSpecifier, ); - fluidImport.importDeclaration.addNamedImports(replacement.declaration.namedImports); - fluidImport.importDeclaration.setIsTypeOnly(replacement.declaration.isTypeOnly); + fluidImport.importDeclaration.addNamedImports( + replacement.declaration.namedImports, + ); + fluidImport.importDeclaration.setIsTypeOnly( + replacement.declaration.isTypeOnly, + ); // Any other prospects should be inserted after this now. for (const otherProspects of takeOverProspects.slice(1)) { otherProspects.insertAfterIndex = true; } // Remove the missing as it is now in place. - this.missingImports.splice(this.missingImports.indexOf(replacement), 1); + this.missingImports.splice( + this.missingImports.indexOf(replacement), + 1, + ); // We could remove the existing entry now, but that would // alter the array being iterated. No further meaningful use is expected. // The later removal check will skip as it now has imports. @@ -339,7 +373,8 @@ class FluidImportManager { // Check for import that has no imports, default or named, that has been // modified. And only after insertions have been taken care of. - for (const { importDeclaration, originallyUnassigned } of this.fluidImports) { + for (const { importDeclaration, originallyUnassigned } of this + .fluidImports) { if (!originallyUnassigned && isImportUnassigned(importDeclaration)) { importDeclaration.remove(); } @@ -408,7 +443,9 @@ class FluidImportManager { packageName: PackageName, order: number, ): { index: number; after: boolean } { - const references = this.fluidImports.filter((v) => v.packageName === packageName); + const references = this.fluidImports.filter( + (v) => v.packageName === packageName, + ); if (references.length === 1) { const ref = references[0]; return { @@ -555,7 +592,8 @@ function parseImport( return undefined; } - const order = exportPathOrder[path] * 2 + (importDeclaration.isTypeOnly() ? 0 : 1); + const order = + exportPathOrder[path] * 2 + (importDeclaration.isTypeOnly() ? 0 : 1); return { importDeclaration, declaration: { @@ -629,7 +667,9 @@ class ApiLevelReader { }, }); - private readonly tempSource = this.project.createSourceFile("flub-fluid-importer-temp.ts"); + private readonly tempSource = this.project.createSourceFile( + "flub-fluid-importer-temp.ts", + ); private readonly map: Map; constructor( @@ -657,7 +697,9 @@ class ApiLevelReader { return loadResult; } - private loadPackageData(packageName: PackageName): NamedExportToPath | undefined { + private loadPackageData( + packageName: PackageName, + ): NamedExportToPath | undefined { const internalImport = this.tempSource.addImportDeclaration({ moduleSpecifier: `${packageName}/internal`, }); @@ -666,26 +708,46 @@ class ApiLevelReader { this.log.warning(`no /internal export from ${packageName}`); return undefined; } - this.log.verbose(`Loading ${packageName} API data from ${internalSource.getFilePath()}`); + this.log.verbose( + `Loading ${packageName} API data from ${internalSource.getFilePath()}`, + ); const exports = getApiExports(internalSource); for (const name of exports.unknown.keys()) { // Suppress any warning for EventEmitter as this export is currently a special case. // See AB#7377 for replacement status upon which this can be removed. if (name !== "EventEmitter") { - this.log.warning(`\t\t${packageName} ${name} API level was not recognized.`); + this.log.warning( + `\t\t${packageName} ${name} API level was not recognized.`, + ); } } const memberData = new Map(); addUniqueNamedExportsToMap(exports.public, memberData, ExportPath.Public); if (this.onlyInternal) { - addUniqueNamedExportsToMap(exports.alpha, memberData, ExportPath.Internal); + addUniqueNamedExportsToMap( + exports.alpha, + memberData, + ExportPath.Internal, + ); addUniqueNamedExportsToMap(exports.beta, memberData, ExportPath.Internal); - addUniqueNamedExportsToMap(exports.legacyAlpha, memberData, ExportPath.Internal); - addUniqueNamedExportsToMap(exports.legacyBeta, memberData, ExportPath.Internal); - addUniqueNamedExportsToMap(exports.legacyPublic, memberData, ExportPath.Internal); + addUniqueNamedExportsToMap( + exports.legacyAlpha, + memberData, + ExportPath.Internal, + ); + addUniqueNamedExportsToMap( + exports.legacyBeta, + memberData, + ExportPath.Internal, + ); + addUniqueNamedExportsToMap( + exports.legacyPublic, + memberData, + ExportPath.Internal, + ); } else { // #region Handle imports for API levels that have had different historical path mappings (with backwards compatibility) @@ -716,7 +778,11 @@ class ApiLevelReader { }, ]; - for (const { apiLevel: level, preferredPath, fallbackPath } of exportSetsWithFallbacks) { + for (const { + apiLevel: level, + preferredPath, + fallbackPath, + } of exportSetsWithFallbacks) { const levelExports = exports[level]; if (levelExports.length > 0) { const usePreferredExportPath = @@ -743,9 +809,17 @@ class ApiLevelReader { // #endregion addUniqueNamedExportsToMap(exports.beta, memberData, ExportPath.Beta); - addUniqueNamedExportsToMap(exports.legacyPublic, memberData, ExportPath.Legacy); + addUniqueNamedExportsToMap( + exports.legacyPublic, + memberData, + ExportPath.Legacy, + ); } - addUniqueNamedExportsToMap(exports.internal, memberData, ExportPath.Internal); + addUniqueNamedExportsToMap( + exports.internal, + memberData, + ExportPath.Internal, + ); return memberData; } } @@ -764,7 +838,10 @@ function addUniqueNamedExportsToMap( } } -async function loadData(dataFile: string, onlyInternal: boolean): Promise { +async function loadData( + dataFile: string, + onlyInternal: boolean, +): Promise { // Load the raw data file // eslint-disable-next-line unicorn/no-await-expression-member const rawData: string = (await readFile(dataFile)).toString(); diff --git a/build-tools/packages/build-cli/src/commands/modify/lockfile.ts b/build-tools/packages/build-cli/src/commands/modify/lockfile.ts index 23a136f961ea..c7d365e2157b 100644 --- a/build-tools/packages/build-cli/src/commands/modify/lockfile.ts +++ b/build-tools/packages/build-cli/src/commands/modify/lockfile.ts @@ -6,7 +6,10 @@ import { updatePackageJsonFile } from "@fluid-tools/build-infrastructure"; import { Flags } from "@oclif/core"; import execa from "execa"; -import { findPackageOrReleaseGroup, packageOrReleaseGroupArg } from "../../args.js"; +import { + findPackageOrReleaseGroup, + packageOrReleaseGroupArg, +} from "../../args.js"; import { BaseCommand } from "../../library/index.js"; /** @@ -72,9 +75,9 @@ export default class UpdateDependencyInLockfileCommand extends BaseCommand< if (json.pnpm.overrides === undefined) { json.pnpm.overrides = {}; } - const currentOverrideVersion = json.pnpm.overrides[this.flags.dependencyName] as - | string - | undefined; + const currentOverrideVersion = json.pnpm.overrides[ + this.flags.dependencyName + ] as string | undefined; if (currentOverrideVersion !== undefined) { this.error( `A pnpm override for the specified dependency already exists (${this.flags.dependencyName}: "${currentOverrideVersion}". Cannot continue.`, diff --git a/build-tools/packages/build-cli/src/commands/promote/package.ts b/build-tools/packages/build-cli/src/commands/promote/package.ts index d4a3d048ed60..51a37f4c793d 100644 --- a/build-tools/packages/build-cli/src/commands/promote/package.ts +++ b/build-tools/packages/build-cli/src/commands/promote/package.ts @@ -21,7 +21,9 @@ interface PackagePromotionErrorResponse { /** * Promotes a package to the Release view in Azure DevOps Artifacts. */ -export default class PromotePackageCommand extends BaseCommand { +export default class PromotePackageCommand extends BaseCommand< + typeof PromotePackageCommand +> { static readonly summary = "Promotes a package to the Release view in Azure DevOps Artifacts."; @@ -52,7 +54,9 @@ export default class PromotePackageCommand extends BaseCommand this.promotePackage(packageName)), + packageOrder.map(async (packageName) => + this.promotePackage(packageName), + ), ); const successfulPackages = results.filter((result) => result.success); @@ -70,15 +74,19 @@ export default class PromotePackageCommand extends BaseCommand 0) { this.log("\nFailed to promote the following packages:"); - for (const pkg of failedPackages) this.log(`- ${pkg.packageName}: ${pkg.error}`); + for (const pkg of failedPackages) + this.log(`- ${pkg.packageName}: ${pkg.error}`); this.error("Some packages failed to promote.", { exit: 1 }); } else { this.log("\nAll packages promoted successfully."); } } catch (error) { - this.error(`An unexpected error occurred during package promotion: ${error}`, { - exit: 2, - }); + this.error( + `An unexpected error occurred during package promotion: ${error}`, + { + exit: 2, + }, + ); } } @@ -89,14 +97,17 @@ export default class PromotePackageCommand extends BaseCommand { - const url = this.getFeedPromotionUrl(packageName, this.flags.version.version); + const url = this.getFeedPromotionUrl( + packageName, + this.flags.version.version, + ); try { const response = await fetch(url, { method: "PATCH", headers: { "Content-Type": "application/json", - "Accept": "application/json", - "Authorization": `Basic ${Buffer.from(`:${this.flags.token}`).toString("base64")}`, + Accept: "application/json", + Authorization: `Basic ${Buffer.from(`:${this.flags.token}`).toString("base64")}`, }, body: JSON.stringify({ views: { @@ -108,7 +119,9 @@ export default class PromotePackageCommand extends BaseCommand { public async run(): Promise { const dangerfile = - this.flags.dangerfile ?? path.join(__dirname, "../../library/dangerfile.cjs"); + this.flags.dangerfile ?? + path.join(__dirname, "../../library/dangerfile.cjs"); // ADO:3710 This needs to change in order to remove the 'danger' dependency in the root package.json execSync(`npx danger ci -d ${dangerfile}`, { stdio: "inherit" }); diff --git a/build-tools/packages/build-cli/src/commands/publish/tarballs.ts b/build-tools/packages/build-cli/src/commands/publish/tarballs.ts index fb14dcbe3e51..28c6fc12d960 100644 --- a/build-tools/packages/build-cli/src/commands/publish/tarballs.ts +++ b/build-tools/packages/build-cli/src/commands/publish/tarballs.ts @@ -24,7 +24,9 @@ interface TarballMetadata { /** * Publishes a tarball to the package registry unless the version is already published. */ -export default class PublishTarballCommand extends BaseCommand { +export default class PublishTarballCommand extends BaseCommand< + typeof PublishTarballCommand +> { static readonly summary = "Publishes tarballs to the package registry unless the version is already published."; @@ -51,7 +53,8 @@ export default class PublishTarballCommand extends BaseCommand f.filename === `${prefix}package.json`)?.fileData; - const packageJson = JSON.parse(new TextDecoder().decode(packageJsonText)) as PackageJson; + const prefix = data[0].filename.substring( + 0, + data[0].filename.indexOf("/") + 1, + ); + const packageJsonText = data.find( + (f) => f.filename === `${prefix}package.json`, + )?.fileData; + const packageJson = JSON.parse( + new TextDecoder().decode(packageJsonText), + ) as PackageJson; return packageJson; } @@ -215,7 +226,9 @@ async function publishTarball( args.push(...publishArgs); } const tarballDirectory = path.dirname(tarball.filePath); - log.verbose(`Executing publish command in ${tarballDirectory}: pnpm ${args.join(" ")}`); + log.verbose( + `Executing publish command in ${tarballDirectory}: pnpm ${args.join(" ")}`, + ); try { const publishOutput = await execa("npm", args, { cwd: tarballDirectory, diff --git a/build-tools/packages/build-cli/src/commands/release.ts b/build-tools/packages/build-cli/src/commands/release.ts index a414c6e94533..5bdba97a724f 100644 --- a/build-tools/packages/build-cli/src/commands/release.ts +++ b/build-tools/packages/build-cli/src/commands/release.ts @@ -39,7 +39,9 @@ import { StateMachineCommand } from "../stateMachineCommand.js"; * {@link FluidReleaseStateHandler} itself. */ -export default class ReleaseCommand extends StateMachineCommand { +export default class ReleaseCommand extends StateMachineCommand< + typeof ReleaseCommand +> { static readonly summary = "Releases a package or release group."; static readonly description = `The release command ensures that a release branch is in good condition, then walks the user through releasing a package or release group. @@ -77,7 +79,10 @@ export default class ReleaseCommand extends StateMachineCommand { await super.init(); - const [context] = await Promise.all([this.getContext(), this.initMachineHooks()]); + const [context] = await Promise.all([ + this.getContext(), + this.initMachineHooks(), + ]); const { argv, flags, logger, machine } = this; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -87,17 +92,27 @@ export default class ReleaseCommand extends StateMachineCommand { - static readonly summary = "Determines release information based on a git tag argument."; +export default class FromTagCommand extends ReleaseReportBaseCommand< + typeof FromTagCommand +> { + static readonly summary = + "Determines release information based on a git tag argument."; static readonly description = "This command is used in CI to determine release information when a new release tag is pushed."; @@ -37,7 +43,8 @@ export default class FromTagCommand extends ReleaseReportBaseCommand <%= command.id %> refs/tags/2.0.0-internal.2.0.2", + command: + "<%= config.bin %> <%= command.id %> refs/tags/2.0.0-internal.2.0.2", }, ]; @@ -80,7 +88,9 @@ export default class FromTagCommand extends ReleaseReportBaseCommand v.version === version.version); + const taggedReleaseIndex = versions.findIndex( + (v) => v.version === version.version, + ); if (taggedReleaseIndex === -1) { this.error(`Release matching version '${version.version}' not found`); } @@ -123,8 +133,12 @@ export default class FromTagCommand extends ReleaseReportBaseCommand { - const tag = input.startsWith(tagRefPrefix) ? input.slice(tagRefPrefix.length) : input; + private async parseTag( + input: string, + ): Promise<[MonoRepo | Package, semver.SemVer, string]> { + const tag = input.startsWith(tagRefPrefix) + ? input.slice(tagRefPrefix.length) + : input; const [rg, ver] = tag.split("_v"); const version = semver.parse(ver); @@ -159,7 +173,8 @@ const getReleaseTitle = ( releaseType: VersionBumpType, ): string => { // eslint-disable-next-line import/no-deprecated - const name = releaseGroup === MonoRepoKind.Client ? "Fluid Framework" : releaseGroup; + const name = + releaseGroup === MonoRepoKind.Client ? "Fluid Framework" : releaseGroup; // e.g. Fluid Framework v2.0.0-internal.4.1.0 (minor) return `${name} v${version.version} (${releaseType})`; }; diff --git a/build-tools/packages/build-cli/src/commands/release/history.ts b/build-tools/packages/build-cli/src/commands/release/history.ts index 44357295777a..318edba09c20 100644 --- a/build-tools/packages/build-cli/src/commands/release/history.ts +++ b/build-tools/packages/build-cli/src/commands/release/history.ts @@ -20,7 +20,10 @@ import { detectBumpType } from "@fluid-tools/version-tools"; import { findPackageOrReleaseGroup } from "../../args.js"; import { packageSelectorFlag, releaseGroupFlag } from "../../flags.js"; import type { ReleaseGroup, ReleasePackage } from "../../releaseGroups.js"; -import { ReleaseReportBaseCommand, type ReleaseSelectionMode } from "./report.js"; +import { + ReleaseReportBaseCommand, + type ReleaseSelectionMode, +} from "./report.js"; const DEFAULT_MIN_VERSION = "0.0.0"; @@ -81,11 +84,17 @@ export default class ReleaseHistoryCommand extends ReleaseReportBaseCommand< // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const releaseGroup = flags.releaseGroup ?? flags.package!; - this.releaseGroupName = findPackageOrReleaseGroup(releaseGroup, context)?.name; + this.releaseGroupName = findPackageOrReleaseGroup( + releaseGroup, + context, + )?.name; if (this.releaseGroupName === undefined) { - this.error(`Can't find release group or package with name: ${releaseGroup}`, { - exit: 1, - }); + this.error( + `Can't find release group or package with name: ${releaseGroup}`, + { + exit: 1, + }, + ); } this.releaseData = await this.collectReleaseData( @@ -102,7 +111,10 @@ export default class ReleaseHistoryCommand extends ReleaseReportBaseCommand< for (const [pkgOrReleaseGroup, data] of Object.entries(this.releaseData)) { const versions = sortVersions([...data.versions], "version"); - const releaseTable = this.generateAllReleasesTable(pkgOrReleaseGroup, versions); + const releaseTable = this.generateAllReleasesTable( + pkgOrReleaseGroup, + versions, + ); this.log( table(releaseTable, { @@ -131,7 +143,9 @@ export default class ReleaseHistoryCommand extends ReleaseReportBaseCommand< index >= 1 ? releases[index - 1].version : DEFAULT_MIN_VERSION; const displayDate = getDisplayDate(ver.date); - const highlight = this.isRecentReleaseByDate(ver.date) ? chalk.green : chalk.white; + const highlight = this.isRecentReleaseByDate(ver.date) + ? chalk.green + : chalk.white; const displayRelDate = highlight(getDisplayDateRelative(ver.date)); const bumpType = detectBumpType(displayPreviousVersion, ver.version); diff --git a/build-tools/packages/build-cli/src/commands/release/prepare.ts b/build-tools/packages/build-cli/src/commands/release/prepare.ts index 689f649de315..b9d624ecb070 100644 --- a/build-tools/packages/build-cli/src/commands/release/prepare.ts +++ b/build-tools/packages/build-cli/src/commands/release/prepare.ts @@ -5,7 +5,10 @@ import chalk from "picocolors"; -import { findPackageOrReleaseGroup, packageOrReleaseGroupArg } from "../../args.js"; +import { + findPackageOrReleaseGroup, + packageOrReleaseGroupArg, +} from "../../args.js"; import { BaseCommand } from "../../library/index.js"; import { CheckDependenciesInstalled, @@ -37,7 +40,9 @@ const allChecks: ReadonlyMap = new Map([ /** * Runs checks on a local branch to verify it is ready to serve as the base for a release branch. */ -export class ReleasePrepareCommand extends BaseCommand { +export class ReleasePrepareCommand extends BaseCommand< + typeof ReleasePrepareCommand +> { public static readonly summary = `Runs checks on a local branch to verify it is ready to serve as the base for a release branch.`; @@ -75,7 +80,9 @@ export class ReleasePrepareCommand extends BaseCommand { +import { + BaseCommand, + type ReleaseReport, + toReportKind, +} from "../../library/index.js"; + +export class UnreleasedReportCommand extends BaseCommand< + typeof UnreleasedReportCommand +> { static readonly summary = `Creates a release report for an unreleased build (one that is not published to npm), using an existing report in the "full" format as input.`; @@ -81,7 +87,12 @@ async function generateReleaseReport( ): Promise { const ignorePackageList = new Set(["@types/jest-environment-puppeteer"]); - await updateReportVersions(fullReleaseReport, ignorePackageList, version, log); + await updateReportVersions( + fullReleaseReport, + ignorePackageList, + version, + log, + ); const caretReportOutput = toReportKind(fullReleaseReport, "caret"); const simpleReportOutput = toReportKind(fullReleaseReport, "simple"); @@ -130,15 +141,25 @@ async function writeReport( log.log(`Build Number: ${buildNumber}`); - const outDirByBuildNumber = path.join(outDir, `${revisedFileName}-${buildNumber}.json`); + const outDirByBuildNumber = path.join( + outDir, + `${revisedFileName}-${buildNumber}.json`, + ); // Generate the build-number manifest unconditionally - const promises = [fs.writeFile(outDirByBuildNumber, JSON.stringify(report, undefined, 2))]; + const promises = [ + fs.writeFile(outDirByBuildNumber, JSON.stringify(report, undefined, 2)), + ]; // Generate the date-based manifest only if the branch is main if (branchName === "refs/heads/main") { - const outDirByCurrentDate = path.join(outDir, `${revisedFileName}-${currentDate}.json`); - promises.push(fs.writeFile(outDirByCurrentDate, JSON.stringify(report, undefined, 2))); + const outDirByCurrentDate = path.join( + outDir, + `${revisedFileName}-${currentDate}.json`, + ); + promises.push( + fs.writeFile(outDirByCurrentDate, JSON.stringify(report, undefined, 2)), + ); } await Promise.all(promises); @@ -161,15 +182,21 @@ async function updateReportVersions( const packageReleaseDetails = report[clientPackageName]; if (packageReleaseDetails === undefined) { - throw new Error(`Client package ${clientPackageName} is not defined in the report.`); + throw new Error( + `Client package ${clientPackageName} is not defined in the report.`, + ); } if (packageReleaseDetails.ranges?.caret === undefined) { - throw new Error(`Caret version for ${clientPackageName} is not defined in the report.`); + throw new Error( + `Caret version for ${clientPackageName} is not defined in the report.`, + ); } if (packageReleaseDetails.version === undefined) { - throw new Error(`Simple version for ${clientPackageName} is not defined in the report.`); + throw new Error( + `Simple version for ${clientPackageName} is not defined in the report.`, + ); } const clientVersionCaret = report[clientPackageName].ranges.caret; @@ -186,7 +213,10 @@ async function updateReportVersions( const packageInfo = report[packageName]; // todo: add better checks - if (packageInfo.ranges.caret && packageInfo.ranges.caret === clientVersionCaret) { + if ( + packageInfo.ranges.caret && + packageInfo.ranges.caret === clientVersionCaret + ) { report[packageName].ranges.caret = version; } diff --git a/build-tools/packages/build-cli/src/commands/release/report.ts b/build-tools/packages/build-cli/src/commands/release/report.ts index fa172cae7716..acaca32a1779 100644 --- a/build-tools/packages/build-cli/src/commands/release/report.ts +++ b/build-tools/packages/build-cli/src/commands/release/report.ts @@ -101,7 +101,10 @@ export abstract class ReleaseReportBaseCommand< /** * The release group or package that is being reported on. */ - protected abstract releaseGroupName: ReleaseGroup | ReleasePackage | undefined; + protected abstract releaseGroupName: + | ReleaseGroup + | ReleasePackage + | undefined; /** * Returns true if the `date` is within `days` days of the current date. @@ -111,7 +114,8 @@ export abstract class ReleaseReportBaseCommand< ? false : this.numberBusinessDaysToConsiderRecent === undefined ? true - : differenceInBusinessDays(Date.now(), date) < this.numberBusinessDaysToConsiderRecent; + : differenceInBusinessDays(Date.now(), date) < + this.numberBusinessDaysToConsiderRecent; } /** @@ -147,7 +151,10 @@ export abstract class ReleaseReportBaseCommand< // Get the release group versions and dependency versions from the repo if (isReleaseGroup(releaseGroupOrPackage)) { if (includeDependencies) { - [rgVerMap, pkgVerMap] = getFluidDependencies(context, releaseGroupOrPackage); + [rgVerMap, pkgVerMap] = getFluidDependencies( + context, + releaseGroupOrPackage, + ); rgs.push(...(Object.keys(rgVerMap) as ReleaseGroup[])); pkgs.push(...Object.keys(pkgVerMap)); } else { @@ -187,12 +194,18 @@ export abstract class ReleaseReportBaseCommand< } for (const pkg of pkgs) { - const repoVersion = pkgVerMap?.[pkg] ?? context.fullPackageMap.get(pkg)?.version; + const repoVersion = + pkgVerMap?.[pkg] ?? context.fullPackageMap.get(pkg)?.version; assert(repoVersion !== undefined, `version of ${pkg} is undefined.`); ux.action.status = `${pkg} (package)`; // eslint-disable-next-line no-await-in-loop - const data = await this.collectRawReleaseData(gitRepo, pkg, repoVersion, mode); + const data = await this.collectRawReleaseData( + gitRepo, + pkg, + repoVersion, + mode, + ); if (data !== undefined) { versionData[pkg] = data; } @@ -239,7 +252,10 @@ export abstract class ReleaseReportBaseCommand< const recentReleases = this.numberBusinessDaysToConsiderRecent === undefined ? sortedByDate - : filterVersionsOlderThan(sortedByDate, this.numberBusinessDaysToConsiderRecent); + : filterVersionsOlderThan( + sortedByDate, + this.numberBusinessDaysToConsiderRecent, + ); // No recent releases, so set the latest to the highest semver if (recentReleases.length === 0) { @@ -264,14 +280,18 @@ export abstract class ReleaseReportBaseCommand< }), }); const selectedVersion = answer ?? recentReleases[0].version; - latestReleasedVersion = recentReleases.find((v) => v.version === selectedVersion); + latestReleasedVersion = recentReleases.find( + (v) => v.version === selectedVersion, + ); } break; } case "inRepo": { - latestReleasedVersion = sortedByVersion.find((v) => v.version === repoVersion); + latestReleasedVersion = sortedByVersion.find( + (v) => v.version === repoVersion, + ); if (latestReleasedVersion === undefined) { const [, previousMinor] = getPreviousVersions(repoVersion); this.info( @@ -301,11 +321,15 @@ export abstract class ReleaseReportBaseCommand< } } - assert(latestReleasedVersion !== undefined, "latestReleasedVersion is undefined"); + assert( + latestReleasedVersion !== undefined, + "latestReleasedVersion is undefined", + ); const vIndex = sortedByVersion.findIndex( (v) => - v.version === latestReleasedVersion?.version && v.date === latestReleasedVersion?.date, + v.version === latestReleasedVersion?.version && + v.date === latestReleasedVersion?.date, ); const previousReleasedVersion = vIndex + 1 <= versionCount @@ -361,7 +385,8 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< }), highest: Flags.boolean({ char: "s", - description: "Always pick the greatest semver version as the latest (ignore dates).", + description: + "Always pick the greatest semver version as the latest (ignore dates).", exclusive: ["mostRecent", "interactive"], }), mostRecent: Flags.boolean({ @@ -549,7 +574,9 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< } } - private async generateReleaseReport(reportData: PackageReleaseData): Promise { + private async generateReleaseReport( + reportData: PackageReleaseData, + ): Promise { const context = await this.getContext(); const report: ReleaseReport = {}; @@ -558,7 +585,8 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< this.warning(`No previous version for ${pkgName}.`); } - const { version: latestVer, date: latestDate } = verDetails.latestReleasedVersion; + const { version: latestVer, date: latestDate } = + verDetails.latestReleasedVersion; const { version: prevVer } = verDetails.previousReleasedVersion ?? { version: DEFAULT_MIN_VERSION, }; @@ -577,7 +605,11 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< throw new Error(`releaseReport not found in config.`); } - const ranges = getRanges(latestVer, context.flubConfig.releaseReport, pkgName); + const ranges = getRanges( + latestVer, + context.flubConfig.releaseReport, + pkgName, + ); // Expand the release group to its constituent packages. if (isReleaseGroup(pkgName)) { @@ -585,7 +617,8 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< report[pkg.name] = { version: latestVer, versionScheme: scheme, - previousVersion: prevVer === DEFAULT_MIN_VERSION ? undefined : prevVer, + previousVersion: + prevVer === DEFAULT_MIN_VERSION ? undefined : prevVer, date: latestDate, releaseType: bumpType, releaseGroup: pkg.monoRepo?.releaseGroup, @@ -597,7 +630,8 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< report[pkgName] = { version: latestVer, versionScheme: scheme, - previousVersion: prevVer === DEFAULT_MIN_VERSION ? undefined : prevVer, + previousVersion: + prevVer === DEFAULT_MIN_VERSION ? undefined : prevVer, date: latestDate, releaseType: bumpType, isNewRelease, @@ -633,12 +667,17 @@ export default class ReleaseReportCommand extends ReleaseReportBaseCommand< } const displayDate = getDisplayDate(latestDate); - const highlight = this.isRecentReleaseByDate(latestDate) ? chalk.green : chalk.white; + const highlight = this.isRecentReleaseByDate(latestDate) + ? chalk.green + : chalk.white; const displayRelDate = highlight(getDisplayDateRelative(latestDate)); const displayPreviousVersion = prevVer ?? DEFAULT_MIN_VERSION; - const bumpType = detectBumpType(prevVer ?? DEFAULT_MIN_VERSION, latestVer); + const bumpType = detectBumpType( + prevVer ?? DEFAULT_MIN_VERSION, + latestVer, + ); const displayBumpType = highlight(`${bumpType}`); const displayVersionSection = chalk.gray( @@ -728,7 +767,12 @@ async function writeReport( report["@fluidframework/container-runtime"].version : context.getVersion(releaseGroup); - const reportName = generateReportFileName(kind, version, releaseGroup, baseFileName); + const reportName = generateReportFileName( + kind, + version, + releaseGroup, + baseFileName, + ); const reportPath = path.join(dir, reportName); log?.info(`${kind} report written to ${reportPath}`); const reportOutput = toReportKind(report, kind); diff --git a/build-tools/packages/build-cli/src/commands/release/setPackageTypesField.ts b/build-tools/packages/build-cli/src/commands/release/setPackageTypesField.ts index c04f9d6f5f21..98a3744d9620 100644 --- a/build-tools/packages/build-cli/src/commands/release/setPackageTypesField.ts +++ b/build-tools/packages/build-cli/src/commands/release/setPackageTypesField.ts @@ -92,7 +92,9 @@ export default class SetReleaseTagPublishingCommand extends PackageCommand< const types: string | undefined = json.types ?? json.typings; if (types === undefined) { - throw new Error("Neither 'types' nor 'typings' field is defined in the package.json."); + throw new Error( + "Neither 'types' nor 'typings' field is defined in the package.json.", + ); } /** @@ -125,7 +127,9 @@ export default class SetReleaseTagPublishingCommand extends PackageCommand< await super.run(); if (this.packageList.packagesUpdated.length === 0) { - this.errorLog(`No updates in package.json for ${this.flags.types} release tag`); + this.errorLog( + `No updates in package.json for ${this.flags.types} release tag`, + ); this.exit(1); } @@ -178,7 +182,9 @@ function updatePackageJsonTypes( } } } catch { - log.verbose(`Unable to update types: ${JSON.stringify(extractorConfig.projectFolder)}`); + log.verbose( + `Unable to update types: ${JSON.stringify(extractorConfig.projectFolder)}`, + ); } return false; } diff --git a/build-tools/packages/build-cli/src/commands/rename-types.ts b/build-tools/packages/build-cli/src/commands/rename-types.ts index 717b4edea7ba..5879bdc6ee98 100644 --- a/build-tools/packages/build-cli/src/commands/rename-types.ts +++ b/build-tools/packages/build-cli/src/commands/rename-types.ts @@ -7,7 +7,11 @@ import * as fs from "node:fs"; import * as path from "node:path"; import { BaseCommand } from "../library/index.js"; -function renameFilesInDir(dir: string, extension: string, newExtension: string): void { +function renameFilesInDir( + dir: string, + extension: string, + newExtension: string, +): void { const files = fs.readdirSync(dir); for (const file of files) { @@ -17,7 +21,8 @@ function renameFilesInDir(dir: string, extension: string, newExtension: string): if (fileStat.isDirectory()) { renameFilesInDir(filePath, extension, newExtension); // recurse into directories } else if (filePath.endsWith(extension)) { - const newFilePath = filePath.slice(0, filePath.length - extension.length) + newExtension; + const newFilePath = + filePath.slice(0, filePath.length - extension.length) + newExtension; fs.renameSync(filePath, newFilePath); } } @@ -29,8 +34,11 @@ function renameFilesInDir(dir: string, extension: string, newExtension: string): * @remarks * This command is primarily used in our build system to rename type declarations in ESM builds. */ -export default class RenameTypesCommand extends BaseCommand { - static readonly description = `Renames type declaration files from .d.ts to .d.mts.`; +export default class RenameTypesCommand extends BaseCommand< + typeof RenameTypesCommand +> { + static readonly description = + `Renames type declaration files from .d.ts to .d.mts.`; public async run(): Promise { renameFilesInDir("./lib", ".d.ts", ".d.mts"); } diff --git a/build-tools/packages/build-cli/src/commands/report/codeCoverage.ts b/build-tools/packages/build-cli/src/commands/report/codeCoverage.ts index 7bd8950c1cb8..621d4f2212c0 100644 --- a/build-tools/packages/build-cli/src/commands/report/codeCoverage.ts +++ b/build-tools/packages/build-cli/src/commands/report/codeCoverage.ts @@ -45,7 +45,8 @@ export default class ReportCodeCoverageCommand extends BaseCommand< required: true, }), adoCIBuildDefinitionIdBaseline: Flags.integer({ - description: "Build definition/pipeline number/id for the baseline build.", + description: + "Build definition/pipeline number/id for the baseline build.", env: "ADO_CI_BUILD_DEFINITION_ID_BASELINE", required: true, }), @@ -77,14 +78,15 @@ export default class ReportCodeCoverageCommand extends BaseCommand< const { flags } = this; const artifactNamePrefix = "Code Coverage Report"; - const codeCoverageConstantsForBaseline: IAzureDevopsBuildCoverageConstants = { - orgUrl: "https://dev.azure.com/fluidframework", - projectName: "public", - ciBuildDefinitionId: flags.adoCIBuildDefinitionIdBaseline, - artifactName: artifactNamePrefix, - branch: flags.targetBranchName, - buildsToSearch: 50, - }; + const codeCoverageConstantsForBaseline: IAzureDevopsBuildCoverageConstants = + { + orgUrl: "https://dev.azure.com/fluidframework", + projectName: "public", + ciBuildDefinitionId: flags.adoCIBuildDefinitionIdBaseline, + artifactName: artifactNamePrefix, + branch: flags.targetBranchName, + buildsToSearch: 50, + }; const codeCoverageConstantsForPR: IAzureDevopsBuildCoverageConstants = { orgUrl: "https://dev.azure.com/fluidframework", @@ -133,7 +135,10 @@ export default class ReportCodeCoverageCommand extends BaseCommand< // Get the paths of the files that have changed in the PR relative to root of the repo. // This is used to determine which packages have been affect so that we can do code coverage // analysis on those packages only. - const changedFiles = await getChangedFilePaths(githubProps, flags.githubPRNumber); + const changedFiles = await getChangedFilePaths( + githubProps, + flags.githubPRNumber, + ); let commentMessage: string = ""; const report = await getCodeCoverageReport( @@ -143,15 +148,17 @@ export default class ReportCodeCoverageCommand extends BaseCommand< changedFiles, this.logger, ).catch((error: Error) => { - commentMessage = "## Code Coverage Summary\n\nError getting code coverage report"; + commentMessage = + "## Code Coverage Summary\n\nError getting code coverage report"; this.logger.errorLog(`Error getting code coverage report: ${error}`); }); if (report !== undefined) { - const packagesListWithCodeCoverageChanges = getPackagesWithCodeCoverageChanges( - report.comparisonData, - this.logger, - ); + const packagesListWithCodeCoverageChanges = + getPackagesWithCodeCoverageChanges( + report.comparisonData, + this.logger, + ); success = isCodeCoverageCriteriaPassed( packagesListWithCodeCoverageChanges, diff --git a/build-tools/packages/build-cli/src/commands/test-only-filter.ts b/build-tools/packages/build-cli/src/commands/test-only-filter.ts index d47788842600..ef281e6f7835 100644 --- a/build-tools/packages/build-cli/src/commands/test-only-filter.ts +++ b/build-tools/packages/build-cli/src/commands/test-only-filter.ts @@ -30,7 +30,9 @@ interface FilterCommandResult { * While the --json flag is technically optional, it should always be passed when using this command for testing. * Otherwise there is no output to be checked for correctness. */ -export default class FilterCommand extends PackageCommand { +export default class FilterCommand extends PackageCommand< + typeof FilterCommand +> { static readonly summary = `FOR INTERNAL TESTING ONLY. This command is used only to test the common package filtering and selection logic that is used across the CLI. FOR INTERNAL TESTING ONLY.`; @@ -47,7 +49,9 @@ export default class FilterCommand extends PackageCommand // do nothing } - protected async processPackages(_packages: PackageWithKind[]): Promise { + protected async processPackages( + _packages: PackageWithKind[], + ): Promise { // do nothing return []; } @@ -55,10 +59,19 @@ export default class FilterCommand extends PackageCommand public async run(): Promise { await super.run(); - assert(this.selectionOptions !== undefined, "selectionOptions is undefined"); + assert( + this.selectionOptions !== undefined, + "selectionOptions is undefined", + ); assert(this.filterOptions !== undefined, "filterOptions is undefined"); - assert(this.selectedPackages !== undefined, "selectedPackages is undefined"); - assert(this.filteredPackages !== undefined, "filteredPackages is undefined"); + assert( + this.selectedPackages !== undefined, + "selectedPackages is undefined", + ); + assert( + this.filteredPackages !== undefined, + "filteredPackages is undefined", + ); const context = await this.getContext(); const pkgs = { diff --git a/build-tools/packages/build-cli/src/commands/typetests.ts b/build-tools/packages/build-cli/src/commands/typetests.ts index 735b776ee14d..bcefb2aecee8 100644 --- a/build-tools/packages/build-cli/src/commands/typetests.ts +++ b/build-tools/packages/build-cli/src/commands/typetests.ts @@ -75,12 +75,14 @@ If targeting prerelease versions, skipping versions, or using skipping some alte { description: "Update type test configuration in package.json for all packages in the client. This is what would be run for client minor releases on both the release branch and the main branch after the version bump and publishing of the first point release of that minor.", - command: "<%= config.bin %> <%= command.id %> -g client --reset --previous", + command: + "<%= config.bin %> <%= command.id %> -g client --reset --previous", }, { description: "Disable type tests and cleanup anything left related to them in the package.json other than the disable flag.", - command: "<%= config.bin %> <%= command.id %> --reset --normalize --disable", + command: + "<%= config.bin %> <%= command.id %> --reset --normalize --disable", }, ]; @@ -177,7 +179,9 @@ export function previousVersion(version: string): string { if (element !== "0") { const numeric = Number(element); if (String(numeric) !== element) { - throw new Error(`Unable to lower non-numeric version "${element}" of "${version}"`); + throw new Error( + `Unable to lower non-numeric version "${element}" of "${version}"`, + ); } parts[index] = String(numeric - 1); return parts.join("."); @@ -221,7 +225,9 @@ export function updateTypeTestDependency( /** * Removes any `typeValidation.broken` entries from package.json. */ -export function resetBrokenTests(pkgJson: { typeValidation?: ITypeValidationConfig }): void { +export function resetBrokenTests(pkgJson: { + typeValidation?: ITypeValidationConfig; +}): void { if (pkgJson.typeValidation !== undefined) { pkgJson.typeValidation.broken = {}; } diff --git a/build-tools/packages/build-cli/src/commands/vnext/check/latestVersions.ts b/build-tools/packages/build-cli/src/commands/vnext/check/latestVersions.ts index 95a594658617..534eb120eaf2 100644 --- a/build-tools/packages/build-cli/src/commands/vnext/check/latestVersions.ts +++ b/build-tools/packages/build-cli/src/commands/vnext/check/latestVersions.ts @@ -8,7 +8,10 @@ import { Flags } from "@oclif/core"; import * as semver from "semver"; import { releaseGroupNameFlag, semverFlag } from "../../../flags.js"; -import { BaseCommandWithBuildProject, getVersionsFromTags } from "../../../library/index.js"; +import { + BaseCommandWithBuildProject, + getVersionsFromTags, +} from "../../../library/index.js"; type MajorVersion = number; @@ -66,7 +69,9 @@ export default class LatestVersionsCommand extends BaseCommandWithBuildProject< }); // Sort the semver versions ordered from highest to lowest - const sortedByVersion = stableVersions.sort((a, b) => semver.rcompare(a, b)); + const sortedByVersion = stableVersions.sort((a, b) => + semver.rcompare(a, b), + ); const inputMajorVersion: MajorVersion = semver.major(versionInput.version); @@ -80,7 +85,9 @@ export default class LatestVersionsCommand extends BaseCommandWithBuildProject< this.log( `Version ${versionInput.version} is the latest version for major version ${majorVersion}`, ); - this.log(`##vso[task.setvariable variable=shouldDeploy;isoutput=true]true`); + this.log( + `##vso[task.setvariable variable=shouldDeploy;isoutput=true]true`, + ); this.log( `##vso[task.setvariable variable=majorVersion;isoutput=true]${majorVersion}`, ); @@ -91,8 +98,12 @@ export default class LatestVersionsCommand extends BaseCommandWithBuildProject< this.log( `##[warning]skipping deployment stage. input version ${versionInput.version} does not match the latest version ${v}`, ); - this.log(`##vso[task.setvariable variable=shouldDeploy;isoutput=true]false`); - this.log(`##vso[task.setvariable variable=majorVersion;isoutput=true]${majorVersion}`); + this.log( + `##vso[task.setvariable variable=shouldDeploy;isoutput=true]false`, + ); + this.log( + `##vso[task.setvariable variable=majorVersion;isoutput=true]${majorVersion}`, + ); return; } } @@ -101,7 +112,9 @@ export default class LatestVersionsCommand extends BaseCommandWithBuildProject< this.log( `##[warning]No major version found corresponding to input version ${versionInput.version}`, ); - this.log(`##vso[task.setvariable variable=shouldDeploy;isoutput=true]false`); + this.log( + `##vso[task.setvariable variable=shouldDeploy;isoutput=true]false`, + ); this.log( `##vso[task.setvariable variable=majorVersion;isoutput=true]${inputMajorVersion}`, ); diff --git a/build-tools/packages/build-cli/src/config.ts b/build-tools/packages/build-cli/src/config.ts index c610d6265e46..8cbd0c8f44c4 100644 --- a/build-tools/packages/build-cli/src/config.ts +++ b/build-tools/packages/build-cli/src/config.ts @@ -373,7 +373,9 @@ export function getFlubConfig(configPath: string, noCache = false): FlubConfig { const config = configResult?.config as FlubConfig | undefined; if (config === undefined) { - throw new Error(`No flub configuration found (configPath='${configPath}').`); + throw new Error( + `No flub configuration found (configPath='${configPath}').`, + ); } // Only version 1 of the config is supported. If any other value is provided, throw an error. @@ -394,7 +396,8 @@ export function getDefaultInterdependencyRange( releaseGroup: ReleaseGroup | MonoRepo, context: Context, ): InterdependencyRange { - const releaseGroupName = releaseGroup instanceof MonoRepo ? releaseGroup.name : releaseGroup; + const releaseGroupName = + releaseGroup instanceof MonoRepo ? releaseGroup.name : releaseGroup; // Prefer to use the configuration in the flub config if available. const flubConfigRanges = context.flubConfig.bump?.defaultInterdependencyRange; @@ -410,11 +413,15 @@ export function getDefaultInterdependencyRange( // This can be removed once we are no longer supporting release branches older than release/client/2.4 const fbConfig = context.fluidBuildConfig.repoPackages?.[releaseGroupName]; const interdependencyRangeFromFluidBuildConfig = - fbConfig !== undefined && typeof fbConfig === "object" && !Array.isArray(fbConfig) + fbConfig !== undefined && + typeof fbConfig === "object" && + !Array.isArray(fbConfig) ? fbConfig.defaultInterdependencyRange : undefined; // Once the back-compat code above is removed, this should change to // return interdependencyRangeFromFlubConfig ?? DEFAULT_INTERDEPENDENCY_RANGE - return interdependencyRangeFromFluidBuildConfig ?? DEFAULT_INTERDEPENDENCY_RANGE; + return ( + interdependencyRangeFromFluidBuildConfig ?? DEFAULT_INTERDEPENDENCY_RANGE + ); } diff --git a/build-tools/packages/build-cli/src/filter.ts b/build-tools/packages/build-cli/src/filter.ts index 717ef06e80d5..50e24df3e537 100644 --- a/build-tools/packages/build-cli/src/filter.ts +++ b/build-tools/packages/build-cli/src/filter.ts @@ -5,7 +5,11 @@ import path from "node:path"; import { type MonoRepo, Package } from "@fluidframework/build-tools"; -import type { PackageSelectionDefault, filterFlags, selectionFlags } from "./flags.js"; +import type { + PackageSelectionDefault, + filterFlags, + selectionFlags, +} from "./flags.js"; import type { Context } from "./library/index.js"; import { type ReleaseGroup, knownReleaseGroups } from "./releaseGroups.js"; @@ -124,7 +128,9 @@ export const parsePackageSelectionFlags = ( * * @param flags - The parsed command flags. */ -export const parsePackageFilterFlags = (flags: filterFlags): PackageFilterOptions => { +export const parsePackageFilterFlags = ( + flags: filterFlags, +): PackageFilterOptions => { const options: PackageFilterOptions = { private: flags.private, scope: flags.scope, @@ -187,7 +193,12 @@ export async function selectPackagesFromContext( kind: PackageKind; }, ): void { - const pkg = Package.load(packageJsonFileName, group, monoRepo, additionalProperties); + const pkg = Package.load( + packageJsonFileName, + group, + monoRepo, + additionalProperties, + ); if (!selected.has(pkg.name)) { selected.set(pkg.name, pkg); } @@ -197,7 +208,9 @@ export async function selectPackagesFromContext( const git = await context.getGitRepository(); const remote = await git.getRemote(git.upstreamRemotePartialUrl); if (remote === undefined) { - throw new Error(`Can't find a remote with ${git.upstreamRemotePartialUrl}`); + throw new Error( + `Can't find a remote with ${git.upstreamRemotePartialUrl}`, + ); } const { packages } = await git.getChangedSinceRef( selection.changedSinceBranch, @@ -248,7 +261,9 @@ export async function selectPackagesFromContext( } if (packages[0].monoRepo === undefined) { - throw new Error(`No release group found for package: ${packages[0].name}`); + throw new Error( + `No release group found for package: ${packages[0].name}`, + ); } const dir = packages[0].monoRepo.directory; @@ -277,7 +292,8 @@ export async function selectAndFilterPackages( const selected = await selectPackagesFromContext(context, selection); // Filter packages if needed - const filtered = filter === undefined ? selected : await filterPackages(selected, filter); + const filtered = + filter === undefined ? selected : await filterPackages(selected, filter); return { selected, filtered }; } diff --git a/build-tools/packages/build-cli/src/flags.ts b/build-tools/packages/build-cli/src/flags.ts index 11a71b1ffa05..650b1d713539 100644 --- a/build-tools/packages/build-cli/src/flags.ts +++ b/build-tools/packages/build-cli/src/flags.ts @@ -153,7 +153,15 @@ export const bumpTypeFlag = Flags.custom({ export const dependencyUpdateTypeFlag = Flags.custom({ char: "t", description: "Version bump type.", - options: ["latest", "newest", "greatest", "minor", "patch", "@next", "@canary"], + options: [ + "latest", + "newest", + "greatest", + "minor", + "patch", + "@next", + "@canary", + ], parse: async (input) => { return input as DependencyUpdateType; }, @@ -178,7 +186,8 @@ export const versionSchemeFlag = Flags.custom({ */ export const testModeFlag = Flags.boolean({ default: false, - description: "Enables test mode. This flag enables other flags used for testing.", + description: + "Enables test mode. This flag enables other flags used for testing.", hidden: true, helpGroup: "TESTING", }); @@ -268,13 +277,15 @@ export const selectionFlags = { helpGroup: "PACKAGE SELECTION", }), dir: Flags.directory({ - description: "Run on the package in this directory. Cannot be used with --all.", + description: + "Run on the package in this directory. Cannot be used with --all.", exclusive: ["all"], helpGroup: "PACKAGE SELECTION", multiple: true, }), packages: Flags.boolean({ - description: "Run on all independent packages in the repo. Cannot be used with --all.", + description: + "Run on all independent packages in the repo. Cannot be used with --all.", default: false, exclusive: ["all"], helpGroup: "PACKAGE SELECTION", @@ -351,7 +362,9 @@ export const defaultSelectionKinds = ["dir", "all"] as const; * A type representing the possible ways a command can set its default selection criteria when no selection flags are * used. */ -export type PackageSelectionDefault = (typeof defaultSelectionKinds)[number] | undefined; +export type PackageSelectionDefault = + | (typeof defaultSelectionKinds)[number] + | undefined; /** * A set of flags that can be used to filter selected packages in the repo. diff --git a/build-tools/packages/build-cli/src/handlers/askFunctions.ts b/build-tools/packages/build-cli/src/handlers/askFunctions.ts index 19d35fa2e6fe..b0d5febc06c9 100644 --- a/build-tools/packages/build-cli/src/handlers/askFunctions.ts +++ b/build-tools/packages/build-cli/src/handlers/askFunctions.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import { type VersionBumpType, bumpVersionScheme } from "@fluid-tools/version-tools"; +import { + type VersionBumpType, + bumpVersionScheme, +} from "@fluid-tools/version-tools"; import { rawlist } from "@inquirer/prompts"; import type { Machine } from "jssm"; @@ -47,9 +50,18 @@ export const askForReleaseType: StateHandlerFunction = async ( if (inputBumpType === undefined) { const selectedBumpType: VersionBumpType = await rawlist({ choices: [ - { value: "major", name: `major (${currentVersion} => ${bumpedMajor.version})` }, - { value: "minor", name: `minor (${currentVersion} => ${bumpedMinor.version})` }, - { value: "patch", name: `patch (${currentVersion} => ${bumpedPatch.version})` }, + { + value: "major", + name: `major (${currentVersion} => ${bumpedMajor.version})`, + }, + { + value: "minor", + name: `minor (${currentVersion} => ${bumpedMinor.version})`, + }, + { + value: "patch", + name: `patch (${currentVersion} => ${bumpedPatch.version})`, + }, ], message: `The current branch is '${currentBranch}'. The default bump type for that branch is '${bumpType}', but you can change it now if needed.`, }); @@ -65,7 +77,9 @@ export const askForReleaseType: StateHandlerFunction = async ( // This state is unique; it uses major/minor/patch as the actions const result = machine.action(bumpType); if (result !== true) { - throw new Error(`Failed when calling the ${bumpType} action from the ${state} state.`); + throw new Error( + `Failed when calling the ${bumpType} action from the ${state} state.`, + ); } return true; diff --git a/build-tools/packages/build-cli/src/handlers/checkFunctions.ts b/build-tools/packages/build-cli/src/handlers/checkFunctions.ts index c069a83d357a..88e8f5d8de14 100644 --- a/build-tools/packages/build-cli/src/handlers/checkFunctions.ts +++ b/build-tools/packages/build-cli/src/handlers/checkFunctions.ts @@ -28,7 +28,10 @@ import type { MachineState } from "../machines/index.js"; import { type ReleaseSource, isReleaseGroup } from "../releaseGroups.js"; import { getRunPolicyCheckDefault } from "../repoConfig.js"; import type { FluidReleaseStateHandlerData } from "./fluidReleaseStateHandler.js"; -import { BaseStateHandler, type StateHandlerFunction } from "./stateHandlers.js"; +import { + BaseStateHandler, + type StateHandlerFunction, +} from "./stateHandlers.js"; /** * Only client and server release groups use changesets and the related release note and per-package changelog @@ -60,7 +63,9 @@ export const checkBranchName: StateHandlerFunction = async ( if (shouldCheckBranch === true) { switch (bumpType) { case "patch": { - log.verbose(`Checking if ${gitRepo.originalBranchName} starts with release/`); + log.verbose( + `Checking if ${gitRepo.originalBranchName} starts with release/`, + ); if (gitRepo.originalBranchName?.startsWith("release/") !== true) { log.warning( `Patch release should only be done on 'release/*' branches, but current branch is '${gitRepo.originalBranchName}'.\nYou can skip this check with --no-branchCheck.'`, @@ -73,8 +78,12 @@ export const checkBranchName: StateHandlerFunction = async ( case "major": case "minor": { - log.verbose(`Checking if ${gitRepo.originalBranchName} is 'main', 'next', or 'lts'.`); - if (!["main", "next", "lts"].includes(gitRepo.originalBranchName ?? "")) { + log.verbose( + `Checking if ${gitRepo.originalBranchName} is 'main', 'next', or 'lts'.`, + ); + if ( + !["main", "next", "lts"].includes(gitRepo.originalBranchName ?? "") + ) { log.warning( `Release prep should only be done on 'main', 'next', or 'lts' branches, but current branch is '${gitRepo.originalBranchName}'.`, ); @@ -163,7 +172,8 @@ export const checkDoesReleaseFromReleaseBranch: StateHandlerFunction = async ( const { releaseGroup } = data; - let releaseSource: ReleaseSource = getReleaseSourceForReleaseGroup(releaseGroup); + let releaseSource: ReleaseSource = + getReleaseSourceForReleaseGroup(releaseGroup); if (releaseSource === "interactive") { releaseSource = await rawlist({ @@ -212,7 +222,9 @@ export const checkHasRemote: StateHandlerFunction = async ( const remote = await gitRepo.getRemote(gitRepo.upstreamRemotePartialUrl); if (remote === undefined) { BaseStateHandler.signalFailure(machine, state); - log.errorLog(`Unable to find remote for '${gitRepo.upstreamRemotePartialUrl}'`); + log.errorLog( + `Unable to find remote for '${gitRepo.upstreamRemotePartialUrl}'`, + ); } BaseStateHandler.signalSuccess(machine, state); @@ -417,7 +429,9 @@ export const checkPolicy: StateHandlerFunction = async ( BaseStateHandler.signalFailure(machine, state); return false; } - } else if (getRunPolicyCheckDefault(releaseGroup, gitRepo.originalBranchName) === false) { + } else if ( + getRunPolicyCheckDefault(releaseGroup, gitRepo.originalBranchName) === false + ) { log.verbose( `Skipping policy check for ${releaseGroup} because it does not run on the ${gitRepo.originalBranchName} branch by default. Pass --policyCheck to force it to run.`, ); @@ -477,7 +491,9 @@ export const checkAssertTagging: StateHandlerFunction = async ( BaseStateHandler.signalFailure(machine, state); return false; } - } else if (getRunPolicyCheckDefault(releaseGroup, gitRepo.originalBranchName) === false) { + } else if ( + getRunPolicyCheckDefault(releaseGroup, gitRepo.originalBranchName) === false + ) { log.verbose( `Skipping assert tagging for ${releaseGroup} because it does not run on the ${gitRepo.originalBranchName} branch by default. Pass --policyCheck to force it to run.`, ); @@ -582,7 +598,8 @@ export const checkChangelogs: StateHandlerFunction = async ( bumpType !== "patch" ) { const confirmed = await confirm({ - message: "Did you generate and commit the CHANGELOG.md files for the release?", + message: + "Did you generate and commit the CHANGELOG.md files for the release?", }); if (confirmed !== true) { @@ -688,7 +705,12 @@ export const checkReleaseIsDone: StateHandlerFunction = async ( const { context, releaseGroup, releaseVersion } = data; - const wasReleased = await isReleased(context, releaseGroup, releaseVersion, log); + const wasReleased = await isReleased( + context, + releaseGroup, + releaseVersion, + log, + ); if (wasReleased) { BaseStateHandler.signalSuccess(machine, state); } else { @@ -717,15 +739,24 @@ export const checkShouldCommit: StateHandlerFunction = async ( ): Promise => { if (testMode) return true; - const { bumpType, context, shouldCommit, releaseGroup, releaseVersion } = data; + const { bumpType, context, shouldCommit, releaseGroup, releaseVersion } = + data; if (shouldCommit !== true) { BaseStateHandler.signalFailure(machine, state); return true; } - const branchName = generateBumpVersionBranchName(releaseGroup, bumpType, releaseVersion); - const commitMsg = generateBumpVersionCommitMessage(releaseGroup, bumpType, releaseVersion); + const branchName = generateBumpVersionBranchName( + releaseGroup, + bumpType, + releaseVersion, + ); + const commitMsg = generateBumpVersionCommitMessage( + releaseGroup, + bumpType, + releaseVersion, + ); const gitRepo = await context.getGitRepository(); await gitRepo.createBranch(branchName); @@ -767,9 +798,15 @@ export const checkShouldCommitReleasedDepsBump: StateHandlerFunction = async ( await gitRepo.createBranch(branchName); log.verbose(`Created bump branch: ${branchName}`); - log.info(`${releaseGroup}: Bumped prerelease dependencies to release versions.`); + log.info( + `${releaseGroup}: Bumped prerelease dependencies to release versions.`, + ); - const commitMsg = generateBumpDepsCommitMessage("prerelease", "latest", releaseGroup); + const commitMsg = generateBumpDepsCommitMessage( + "prerelease", + "latest", + releaseGroup, + ); await gitRepo.gitClient.commit(commitMsg); BaseStateHandler.signalSuccess(machine, state); return true; diff --git a/build-tools/packages/build-cli/src/handlers/doFunctions.ts b/build-tools/packages/build-cli/src/handlers/doFunctions.ts index c9478acb6f34..14da1245e723 100644 --- a/build-tools/packages/build-cli/src/handlers/doFunctions.ts +++ b/build-tools/packages/build-cli/src/handlers/doFunctions.ts @@ -9,7 +9,10 @@ import chalk from "picocolors"; import { FluidRepo, MonoRepo } from "@fluidframework/build-tools"; -import { bumpVersionScheme, detectVersionScheme } from "@fluid-tools/version-tools"; +import { + bumpVersionScheme, + detectVersionScheme, +} from "@fluid-tools/version-tools"; import { getDefaultInterdependencyRange } from "../config.js"; import { @@ -20,9 +23,16 @@ import { } from "../library/index.js"; import type { CommandLogger } from "../logging.js"; import type { MachineState } from "../machines/index.js"; -import { type ReleaseGroup, type ReleasePackage, isReleaseGroup } from "../releaseGroups.js"; +import { + type ReleaseGroup, + type ReleasePackage, + isReleaseGroup, +} from "../releaseGroups.js"; import type { FluidReleaseStateHandlerData } from "./fluidReleaseStateHandler.js"; -import { BaseStateHandler, type StateHandlerFunction } from "./stateHandlers.js"; +import { + BaseStateHandler, + type StateHandlerFunction, +} from "./stateHandlers.js"; /** * Bumps any pre-release dependencies that have been released. @@ -101,10 +111,16 @@ export const doBumpReleasedDependencies: StateHandlerFunction = async ( } } - const remainingReleaseGroupsToBump = difference(preReleaseGroups, updatedDeps); + const remainingReleaseGroupsToBump = difference( + preReleaseGroups, + updatedDeps, + ); const remainingPackagesToBump = difference(preReleasePackages, updatedPkgs); - if (remainingReleaseGroupsToBump.size === 0 && remainingPackagesToBump.size === 0) { + if ( + remainingReleaseGroupsToBump.size === 0 && + remainingPackagesToBump.size === 0 + ) { // This is the same command as run above, but this time we write the changes. There are more // efficient ways to do this but this is simple. ({ updatedPackages, updatedDependencies } = await npmCheckUpdates( @@ -156,7 +172,8 @@ export const doReleaseGroupBump: StateHandlerFunction = async ( ): Promise => { if (testMode) return true; - const { bumpType, context, releaseGroup, releaseVersion, shouldInstall } = data; + const { bumpType, context, releaseGroup, releaseVersion, shouldInstall } = + data; const rgRepo = isReleaseGroup(releaseGroup) ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -178,7 +195,9 @@ export const doReleaseGroupBump: StateHandlerFunction = async ( context, rgRepo, newVersion, - rgRepo instanceof MonoRepo ? getDefaultInterdependencyRange(rgRepo, context) : undefined, + rgRepo instanceof MonoRepo + ? getDefaultInterdependencyRange(rgRepo, context) + : undefined, log, ); diff --git a/build-tools/packages/build-cli/src/handlers/fluidReleaseStateHandler.ts b/build-tools/packages/build-cli/src/handlers/fluidReleaseStateHandler.ts index 7253cc5946a8..6567e8340f11 100644 --- a/build-tools/packages/build-cli/src/handlers/fluidReleaseStateHandler.ts +++ b/build-tools/packages/build-cli/src/handlers/fluidReleaseStateHandler.ts @@ -41,7 +41,10 @@ import { checkTypeTestPrepare, checkValidReleaseGroup, } from "./checkFunctions.js"; -import { doBumpReleasedDependencies, doReleaseGroupBump } from "./doFunctions.js"; +import { + doBumpReleasedDependencies, + doReleaseGroupBump, +} from "./doFunctions.js"; import { InitFailedStateHandler } from "./initFailedStateHandler.js"; import { promptToCommitChanges, @@ -56,7 +59,10 @@ import { promptToRunMinorReleaseCommand, promptToRunTypeTests, } from "./promptFunctions.js"; -import { BaseStateHandler, type StateHandlerFunction } from "./stateHandlers.js"; +import { + BaseStateHandler, + type StateHandlerFunction, +} from "./stateHandlers.js"; /** * Data that is passed to all the handling functions for the {@link FluidReleaseMachine}. This data is intended to be @@ -150,75 +156,77 @@ export class FluidReleaseStateHandler extends InitFailedStateHandler { /** * A map of state machine states to the function that should be called to handle that state. */ - private readonly stateHandlerMap: Map = new Map([ - ["AskForReleaseType", askForReleaseType], - ["CheckAssertTagging", checkAssertTagging], - ["CheckBranchName", checkBranchName], - ["CheckBranchName2", checkBranchName], - ["CheckBranchName3", checkBranchName], - ["CheckBranchUpToDate", checkBranchUpToDate], - ["CheckChangelogs", checkChangelogs], - ["CheckDependenciesInstalled", checkDependenciesInstalled], - ["CheckDoesReleaseFromReleaseBranch", checkDoesReleaseFromReleaseBranch], - ["CheckDoesReleaseFromReleaseBranch2", checkDoesReleaseFromReleaseBranch], - ["CheckDoesReleaseFromReleaseBranch3", checkDoesReleaseFromReleaseBranch], - ["CheckHasRemote", checkHasRemote], - ["CheckMainNextIntegrated", checkMainNextIntegrated], - ["CheckNoPrereleaseDependencies", checkNoPrereleaseDependencies], - ["CheckNoPrereleaseDependencies2", checkNoPrereleaseDependencies], - ["CheckNoPrereleaseDependencies3", checkNoPrereleaseDependencies], - ["CheckOnReleaseBranch", checkOnReleaseBranch], - ["CheckOnReleaseBranch2", checkOnReleaseBranch], - ["CheckOnReleaseBranch3", checkOnReleaseBranch], - ["CheckPolicy", checkPolicy], - ["CheckReleaseBranchExists", checkReleaseBranchExists], - ["CheckReleaseGroupIsBumped", checkReleaseGroupIsBumped], - ["CheckReleaseGroupIsBumpedMinor", checkReleaseGroupIsBumped], - ["CheckReleaseGroupIsBumpedMinor2", checkReleaseGroupIsBumped], - ["CheckReleaseGroupIsBumpedPatch", checkReleaseGroupIsBumped], - ["CheckReleaseGroupIsBumpedPatch2", checkReleaseGroupIsBumped], - ["CheckReleaseIsDone", checkReleaseIsDone], - ["CheckReleaseIsDone2", checkReleaseIsDone], - ["CheckReleaseIsDone3", checkReleaseIsDone], - ["CheckReleaseNotes", checkReleaseNotes], - ["CheckShouldCommitBump", checkShouldCommit], - ["CheckShouldCommitDeps", checkShouldCommit], - ["CheckShouldCommitReleasedDepsBump", checkShouldCommitReleasedDepsBump], - ["CheckShouldRunOptionalChecks", checkShouldRunOptionalChecks], - ["CheckTypeTestGenerate", checkTypeTestGenerate], - ["CheckTypeTestGenerate2", checkTypeTestGenerate], - ["CheckTypeTestPrepare", checkTypeTestPrepare], - ["CheckTypeTestPrepare2", checkTypeTestPrepare], - ["CheckValidReleaseGroup", checkValidReleaseGroup], - ["DoBumpReleasedDependencies", doBumpReleasedDependencies], - ["DoMajorRelease", handleBumpType], - ["DoMinorRelease", handleBumpType], - ["DoPatchRelease", handleBumpType], - ["DoReleaseGroupBump", doReleaseGroupBump], - ["PromptToCommitBump", promptToCommitChanges], - ["PromptToCommitDeps", promptToCommitChanges], - ["PromptToCommitPolicy", promptToCommitChanges], - ["PromptToCommitReleasedDepsBump", promptToCommitChanges], - ["PromptToCreateReleaseBranch", promptToCreateReleaseBranch], - ["PromptToGenerateChangelogs", promptToGenerateChangelogs], - ["PromptToGenerateReleaseNotes", promptToGenerateReleaseNotes], - ["PromptToIntegrateNext", promptToIntegrateNext], - ["PromptToPRBump", promptToPRBump], - ["PromptToPRDeps", promptToPRDeps], - ["PromptToPRReleasedDepsBump", promptToPRDeps], - ["PromptToRelease", promptToRelease], - ["PromptToReleaseDeps", promptToReleaseDeps], - ["PromptToRunMinorReleaseCommand", promptToRunMinorReleaseCommand], - ["PromptToRunTypeTests", promptToRunTypeTests], - + private readonly stateHandlerMap: Map = new Map( [ - "ReleaseComplete", - async (_, __, ___, log): Promise => { - log.info(chalk.green("Release complete!")); - return true; - }, + ["AskForReleaseType", askForReleaseType], + ["CheckAssertTagging", checkAssertTagging], + ["CheckBranchName", checkBranchName], + ["CheckBranchName2", checkBranchName], + ["CheckBranchName3", checkBranchName], + ["CheckBranchUpToDate", checkBranchUpToDate], + ["CheckChangelogs", checkChangelogs], + ["CheckDependenciesInstalled", checkDependenciesInstalled], + ["CheckDoesReleaseFromReleaseBranch", checkDoesReleaseFromReleaseBranch], + ["CheckDoesReleaseFromReleaseBranch2", checkDoesReleaseFromReleaseBranch], + ["CheckDoesReleaseFromReleaseBranch3", checkDoesReleaseFromReleaseBranch], + ["CheckHasRemote", checkHasRemote], + ["CheckMainNextIntegrated", checkMainNextIntegrated], + ["CheckNoPrereleaseDependencies", checkNoPrereleaseDependencies], + ["CheckNoPrereleaseDependencies2", checkNoPrereleaseDependencies], + ["CheckNoPrereleaseDependencies3", checkNoPrereleaseDependencies], + ["CheckOnReleaseBranch", checkOnReleaseBranch], + ["CheckOnReleaseBranch2", checkOnReleaseBranch], + ["CheckOnReleaseBranch3", checkOnReleaseBranch], + ["CheckPolicy", checkPolicy], + ["CheckReleaseBranchExists", checkReleaseBranchExists], + ["CheckReleaseGroupIsBumped", checkReleaseGroupIsBumped], + ["CheckReleaseGroupIsBumpedMinor", checkReleaseGroupIsBumped], + ["CheckReleaseGroupIsBumpedMinor2", checkReleaseGroupIsBumped], + ["CheckReleaseGroupIsBumpedPatch", checkReleaseGroupIsBumped], + ["CheckReleaseGroupIsBumpedPatch2", checkReleaseGroupIsBumped], + ["CheckReleaseIsDone", checkReleaseIsDone], + ["CheckReleaseIsDone2", checkReleaseIsDone], + ["CheckReleaseIsDone3", checkReleaseIsDone], + ["CheckReleaseNotes", checkReleaseNotes], + ["CheckShouldCommitBump", checkShouldCommit], + ["CheckShouldCommitDeps", checkShouldCommit], + ["CheckShouldCommitReleasedDepsBump", checkShouldCommitReleasedDepsBump], + ["CheckShouldRunOptionalChecks", checkShouldRunOptionalChecks], + ["CheckTypeTestGenerate", checkTypeTestGenerate], + ["CheckTypeTestGenerate2", checkTypeTestGenerate], + ["CheckTypeTestPrepare", checkTypeTestPrepare], + ["CheckTypeTestPrepare2", checkTypeTestPrepare], + ["CheckValidReleaseGroup", checkValidReleaseGroup], + ["DoBumpReleasedDependencies", doBumpReleasedDependencies], + ["DoMajorRelease", handleBumpType], + ["DoMinorRelease", handleBumpType], + ["DoPatchRelease", handleBumpType], + ["DoReleaseGroupBump", doReleaseGroupBump], + ["PromptToCommitBump", promptToCommitChanges], + ["PromptToCommitDeps", promptToCommitChanges], + ["PromptToCommitPolicy", promptToCommitChanges], + ["PromptToCommitReleasedDepsBump", promptToCommitChanges], + ["PromptToCreateReleaseBranch", promptToCreateReleaseBranch], + ["PromptToGenerateChangelogs", promptToGenerateChangelogs], + ["PromptToGenerateReleaseNotes", promptToGenerateReleaseNotes], + ["PromptToIntegrateNext", promptToIntegrateNext], + ["PromptToPRBump", promptToPRBump], + ["PromptToPRDeps", promptToPRDeps], + ["PromptToPRReleasedDepsBump", promptToPRDeps], + ["PromptToRelease", promptToRelease], + ["PromptToReleaseDeps", promptToReleaseDeps], + ["PromptToRunMinorReleaseCommand", promptToRunMinorReleaseCommand], + ["PromptToRunTypeTests", promptToRunTypeTests], + + [ + "ReleaseComplete", + async (_, __, ___, log): Promise => { + log.info(chalk.green("Release complete!")); + return true; + }, + ], ], - ]); + ); async handleState( state: MachineState, @@ -230,7 +238,13 @@ export class FluidReleaseStateHandler extends InitFailedStateHandler { const handlerFunction = this.stateHandlerMap.get(state); if (handlerFunction === undefined) { - const superHandled = await super.handleState(state, machine, testMode, log, data); + const superHandled = await super.handleState( + state, + machine, + testMode, + log, + data, + ); return superHandled; } diff --git a/build-tools/packages/build-cli/src/handlers/promptFunctions.ts b/build-tools/packages/build-cli/src/handlers/promptFunctions.ts index e162b360dae3..fc7e2c1bd8e7 100644 --- a/build-tools/packages/build-cli/src/handlers/promptFunctions.ts +++ b/build-tools/packages/build-cli/src/handlers/promptFunctions.ts @@ -6,7 +6,10 @@ import type { Machine } from "jssm"; import chalk from "picocolors"; -import { type InstructionalPrompt, mapADOLinks } from "../instructionalPromptWriter.js"; +import { + type InstructionalPrompt, + mapADOLinks, +} from "../instructionalPromptWriter.js"; import { difference, generateReleaseBranchName, @@ -81,7 +84,10 @@ export const promptToCreateReleaseBranch: StateHandlerFunction = async ( const { command, promptWriter, releaseGroup, releaseVersion } = data; if (isReleaseGroup(releaseGroup)) { - const releaseBranch = generateReleaseBranchName(releaseGroup, releaseVersion); + const releaseBranch = generateReleaseBranchName( + releaseGroup, + releaseVersion, + ); const prompt: InstructionalPrompt = { title: "CREATE A RELEASE BRANCH", @@ -186,8 +192,12 @@ export const promptToPRBump: StateHandlerFunction = async ( }; if (isReleaseGroup(releaseGroup)) { - const releaseBranch = generateReleaseBranchName(releaseGroup, releaseVersion); - const releaseBranchExists = (await gitRepo.getShaForBranch(releaseBranch)) !== undefined; + const releaseBranch = generateReleaseBranchName( + releaseGroup, + releaseVersion, + ); + const releaseBranchExists = + (await gitRepo.getShaForBranch(releaseBranch)) !== undefined; if (!releaseBranchExists) { prompt.sections.push({ @@ -310,7 +320,10 @@ export const promptToReleaseDeps: StateHandlerFunction = async ( const { command, context, promptWriter, releaseGroup } = data; - const prereleaseDepNames = await getPreReleaseDependencies(context, releaseGroup); + const prereleaseDepNames = await getPreReleaseDependencies( + context, + releaseGroup, + ); const prompt: InstructionalPrompt = { title: "NEED TO RELEASE DEPENDENCIES", @@ -324,7 +337,10 @@ export const promptToReleaseDeps: StateHandlerFunction = async ( ], }; - if (prereleaseDepNames.releaseGroups.size > 0 || prereleaseDepNames.packages.size > 0) { + if ( + prereleaseDepNames.releaseGroups.size > 0 || + prereleaseDepNames.packages.size > 0 + ) { if (prereleaseDepNames.packages.size > 0) { let packageSection = ""; for (const [pkg, depVersion] of prereleaseDepNames.packages.entries()) { @@ -339,7 +355,10 @@ export const promptToReleaseDeps: StateHandlerFunction = async ( if (prereleaseDepNames.releaseGroups.size > 0) { let packageSection = ""; - for (const [rg, depVersion] of prereleaseDepNames.releaseGroups.entries()) { + for (const [ + rg, + depVersion, + ] of prereleaseDepNames.releaseGroups.entries()) { packageSection = `${rg} = ${depVersion}`; prompt.sections.push({ title: "RELEASE RELEASE GROUP", diff --git a/build-tools/packages/build-cli/src/index.ts b/build-tools/packages/build-cli/src/index.ts index fd71f09ea0d7..19e133a1605c 100644 --- a/build-tools/packages/build-cli/src/index.ts +++ b/build-tools/packages/build-cli/src/index.ts @@ -18,7 +18,11 @@ export type { ReleaseReportConfig, ScriptRequirement, } from "./config.js"; -export type { knownReleaseGroups, ReleaseGroup, ReleasePackage } from "./releaseGroups.js"; +export type { + knownReleaseGroups, + ReleaseGroup, + ReleasePackage, +} from "./releaseGroups.js"; // Exported for use in config files. export type { AssertTaggingPackageConfig } from "./commands/generate/assertTags.js"; diff --git a/build-tools/packages/build-cli/src/instructionalPromptWriter.ts b/build-tools/packages/build-cli/src/instructionalPromptWriter.ts index c87b16ef5a2c..2b36d4046326 100644 --- a/build-tools/packages/build-cli/src/instructionalPromptWriter.ts +++ b/build-tools/packages/build-cli/src/instructionalPromptWriter.ts @@ -50,7 +50,10 @@ interface Section { /** * Map release groups to ADO pipeline */ -export const ADOPipelineLinks = new Map([ +export const ADOPipelineLinks = new Map< + ReleasePackage | ReleaseGroup | undefined, + string +>([ [ // eslint-disable-next-line import/no-deprecated MonoRepoKind.Client, @@ -62,7 +65,10 @@ export const ADOPipelineLinks = new Map { - assert(azureDevopsBuildCoverageConstants.buildId !== undefined, "buildId is required"); - logger?.verbose(`The buildId id ${azureDevopsBuildCoverageConstants.buildId}`); + assert( + azureDevopsBuildCoverageConstants.buildId !== undefined, + "buildId is required", + ); + logger?.verbose( + `The buildId id ${azureDevopsBuildCoverageConstants.buildId}`, + ); const build: Build = await getBuild( adoConnection, { project: azureDevopsBuildCoverageConstants.projectName, definitions: [azureDevopsBuildCoverageConstants.ciBuildDefinitionId], - maxBuildsPerDefinition: azureDevopsBuildCoverageConstants.buildsToSearch ?? 20, + maxBuildsPerDefinition: + azureDevopsBuildCoverageConstants.buildsToSearch ?? 20, }, azureDevopsBuildCoverageConstants.buildId, ); @@ -154,7 +165,9 @@ export async function getBuildArtifactForSpecificBuild( } logger?.verbose(`Found build with id: ${build.id}`); - logger?.verbose(`projectName: ${azureDevopsBuildCoverageConstants.projectName}`); + logger?.verbose( + `projectName: ${azureDevopsBuildCoverageConstants.projectName}`, + ); logger?.verbose( `codeCoverageAnalysisArtifactName: ${azureDevopsBuildCoverageConstants.artifactName}`, ); diff --git a/build-tools/packages/build-cli/src/library/branches.ts b/build-tools/packages/build-cli/src/library/branches.ts index f478e5b14986..454230e9a615 100644 --- a/build-tools/packages/build-cli/src/library/branches.ts +++ b/build-tools/packages/build-cli/src/library/branches.ts @@ -50,7 +50,11 @@ export async function createBumpBranch( bumpType: VersionBumpType, ): Promise { const version = context.getVersion(releaseGroupOrPackage); - const name = generateBumpVersionBranchName(releaseGroupOrPackage, bumpType, version); + const name = generateBumpVersionBranchName( + releaseGroupOrPackage, + bumpType, + version, + ); const gitRepo = await context.getGitRepository(); await gitRepo.createBranch(name); return name; @@ -108,7 +112,8 @@ export function generateBumpDepsBranchName( bumpType: DependencyUpdateType | VersionBumpType, releaseGroup?: ReleaseGroup, ): string { - const releaseGroupSegment = releaseGroup === undefined ? "" : `_${releaseGroup}`; + const releaseGroupSegment = + releaseGroup === undefined ? "" : `_${releaseGroup}`; const branchName = `bump_deps_${bumpedDep.toLowerCase()}_${bumpType}${releaseGroupSegment}`; return branchName; } @@ -135,7 +140,8 @@ export function generateReleaseBranchName( const branchPath = ["release"]; const scheme = detectVersionScheme(version); - const schemeIsInternal = scheme === "internal" || scheme === "internalPrerelease"; + const schemeIsInternal = + scheme === "internal" || scheme === "internalPrerelease"; let branchVersion: string; if (schemeIsInternal === true) { @@ -156,7 +162,9 @@ export function generateReleaseBranchName( const prereleaseId = fromInternalScheme(version, true)[2]; // Checking the prerelease ID is necessary because we used "v2int" instead of "internal" in branch names. This // was a bad decision in retrospect, but we're stuck with it for now. - branchPath.push(prereleaseId === DEFAULT_PRERELEASE_IDENTIFIER ? "v2int" : releaseGroup); + branchPath.push( + prereleaseId === DEFAULT_PRERELEASE_IDENTIFIER ? "v2int" : releaseGroup, + ); } else { branchPath.push(releaseGroup); } @@ -166,7 +174,10 @@ export function generateReleaseBranchName( let releaseBranchVersion: string; if (schemeIsInternal) { - const [publicVersion, internalVersion, prereleaseId] = fromInternalScheme(version, true); + const [publicVersion, internalVersion, prereleaseId] = fromInternalScheme( + version, + true, + ); releaseBranchVersion = prereleaseId === DEFAULT_PRERELEASE_IDENTIFIER ? `${semver.major(branchVersion)}.${semver.minor(branchVersion)}` diff --git a/build-tools/packages/build-cli/src/library/bump.ts b/build-tools/packages/build-cli/src/library/bump.ts index 2b7322b733ae..4f4517bf8eb0 100644 --- a/build-tools/packages/build-cli/src/library/bump.ts +++ b/build-tools/packages/build-cli/src/library/bump.ts @@ -33,7 +33,9 @@ export type DependencyUpdateType = * * @internal */ -export function isDependencyUpdateType(str: string | undefined): str is DependencyUpdateType { +export function isDependencyUpdateType( + str: string | undefined, +): str is DependencyUpdateType { if (str === undefined) { return false; } diff --git a/build-tools/packages/build-cli/src/library/changesets.ts b/build-tools/packages/build-cli/src/library/changesets.ts index a1e1cf14b483..384f3cb34d0f 100644 --- a/build-tools/packages/build-cli/src/library/changesets.ts +++ b/build-tools/packages/build-cli/src/library/changesets.ts @@ -160,7 +160,10 @@ interface GitCommit { * themselves include a mapping of package to version bump type. This object includes the change type and a single * package, effectively flattening the changesets. */ -export type ChangesetEntry = Omit & { +export type ChangesetEntry = Omit< + Changeset, + "metadata" | "mainPackage" | "changeTypes" +> & { /** * The name of the package this ChangesetEntry applies to. */ @@ -185,15 +188,20 @@ export type ChangesetEntry = Omit>( - a: T, - b: T, -): number { +function compareChangesets< + T extends Pick, +>(a: T, b: T): number { // Sort highlighted items to the top; - if (a.additionalMetadata?.highlight === true && b.additionalMetadata?.highlight !== true) { + if ( + a.additionalMetadata?.highlight === true && + b.additionalMetadata?.highlight !== true + ) { return -1; } - if (a.additionalMetadata?.highlight !== true && b.additionalMetadata?.highlight === true) { + if ( + a.additionalMetadata?.highlight !== true && + b.additionalMetadata?.highlight === true + ) { return 1; } @@ -211,9 +219,15 @@ function compareChangesets { +export async function loadChangesets( + dir: string, + log?: Logger, +): Promise { const repo = simpleGit({ baseDir: dir }); - const changesetFiles = await globby(["*.md", "!README.md"], { cwd: dir, absolute: true }); + const changesetFiles = await globby(["*.md", "!README.md"], { + cwd: dir, + absolute: true, + }); const changesets: Changeset[] = []; for (const file of changesetFiles) { @@ -225,7 +239,9 @@ export async function loadChangesets(dir: string, log?: Logger): Promise oldest, so we want the last item, which is the earliest commit const rawCommit = results.all?.at(-1); const pullRequest = - rawCommit?.message === undefined ? undefined : parseGitHubPRs(rawCommit.message); + rawCommit?.message === undefined + ? undefined + : parseGitHubPRs(rawCommit.message); const commit: GitCommit = { // Newly added files won't have any results from git log, so default to now. @@ -249,7 +265,8 @@ export async function loadChangesets(dir: string, log?: Logger): Promise 0 ? additionalMetadata : undefined, + Object.keys(additionalMetadata).length > 0 + ? additionalMetadata + : undefined, body, summary, sourceFile: file, @@ -298,7 +317,9 @@ export async function loadChangesets(dir: string, log?: Logger): Promise { +export function groupByPackage( + changesets: Changeset[], +): Map { const changesetMap = new Map(); const flattened = flattenChangesets(changesets); for (const changeset of flattened) { diff --git a/build-tools/packages/build-cli/src/library/commands/base.ts b/build-tools/packages/build-cli/src/library/commands/base.ts index ea3c10fb4627..9f2449b78e59 100644 --- a/build-tools/packages/build-cli/src/library/commands/base.ts +++ b/build-tools/packages/build-cli/src/library/commands/base.ts @@ -9,7 +9,10 @@ import { Command, Flags, type Interfaces } from "@oclif/core"; import type { PrettyPrintableError } from "@oclif/core/errors"; import chalk from "picocolors"; -import { type IBuildProject, loadBuildProject } from "@fluid-tools/build-infrastructure"; +import { + type IBuildProject, + loadBuildProject, +} from "@fluid-tools/build-infrastructure"; import type { CommandLogger } from "../../logging.js"; import { Context } from "../context.js"; import { indentString } from "../text.js"; @@ -54,7 +57,8 @@ export abstract class BaseCommand default: false, }), root: Flags.custom({ - description: "Root directory of the Fluid repo (default: env _FLUID_ROOT_).", + description: + "Root directory of the Fluid repo (default: env _FLUID_ROOT_).", env: "_FLUID_ROOT_", hidden: true, })(), @@ -234,7 +238,10 @@ export abstract class BaseCommand public error( input: string | Error, options?: - | ({ code?: string | undefined; exit?: number | undefined } & PrettyPrintableError) + | ({ + code?: string | undefined; + exit?: number | undefined; + } & PrettyPrintableError) | undefined, ): never; @@ -288,7 +295,9 @@ export abstract class BaseCommandWithBuildProject< * @deprecated This method should only be called in BaseCommand instances. */ public getContext(): never { - throw new Error("getContext method should only be called in BaseCommand instances"); + throw new Error( + "getContext method should only be called in BaseCommand instances", + ); } /** diff --git a/build-tools/packages/build-cli/src/library/commands/generateEntrypoints.ts b/build-tools/packages/build-cli/src/library/commands/generateEntrypoints.ts index a792b908559a..e731bae9a8a0 100644 --- a/build-tools/packages/build-cli/src/library/commands/generateEntrypoints.ts +++ b/build-tools/packages/build-cli/src/library/commands/generateEntrypoints.ts @@ -17,7 +17,10 @@ import { BaseCommand } from "./base.js"; import { ApiLevel, isLegacy } from "../apiLevel.js"; import type { ExportData, Node10CompatExportData } from "../packageExports.js"; import { queryTypesResolutionPathsFromPackageExports } from "../packageExports.js"; -import { getApiExports, getPackageDocumentationText } from "../typescriptApi.js"; +import { + getApiExports, + getPackageDocumentationText, +} from "../typescriptApi.js"; import { unscopedPackageNameString } from "./constants.js"; @@ -188,11 +191,16 @@ export class GenerateEntrypointsCommand extends BaseCommand< ); } - promises.push(generateEntrypoints(mainEntrypoint, mapApiTagLevelToOutput, this.logger)); + promises.push( + generateEntrypoints(mainEntrypoint, mapApiTagLevelToOutput, this.logger), + ); if (node10TypeCompat) { promises.push( - generateNode10TypeEntrypoints(mapNode10CompatExportPathToData, this.logger), + generateNode10TypeEntrypoints( + mapNode10CompatExportPathToData, + this.logger, + ), ); } @@ -330,7 +338,8 @@ function getOutputConfiguration( outFileToApiLevelEntries.push([outFileLegacyAlpha, ApiLevel.legacyAlpha]); } - const mapQueryPathToApiTagLevel: Map = new Map(); + const mapQueryPathToApiTagLevel: Map = + new Map(); for (const [outFile, apiLevel] of outFileToApiLevelEntries) { const queryPath = `${pathPrefix}${outFile}${outFileSuffix}`; if (mapQueryPathToApiTagLevel.has(queryPath)) { @@ -349,13 +358,15 @@ function getOutputConfiguration( mapQueryPathToApiTagLevel.set(internalPathRegex, undefined); } - const { mapKeyToOutput: mapApiTagLevelToOutput, mapNode10CompatExportPathToData } = - queryTypesResolutionPathsFromPackageExports( - packageJson, - mapQueryPathToApiTagLevel, - { node10TypeCompat, onlyFirstMatches: true }, - logger, - ); + const { + mapKeyToOutput: mapApiTagLevelToOutput, + mapNode10CompatExportPathToData, + } = queryTypesResolutionPathsFromPackageExports( + packageJson, + mapQueryPathToApiTagLevel, + { node10TypeCompat, onlyFirstMatches: true }, + logger, + ); return { mapQueryPathToApiTagLevel, @@ -465,7 +476,8 @@ async function generateEntrypoints( const mainSourceFile = project.addSourceFileAtPath(mainEntrypoint); const exports = getApiExports(mainSourceFile); - const packageDocumentationHeader = getPackageDocumentationText(mainSourceFile); + const packageDocumentationHeader = + getPackageDocumentationText(mainSourceFile); const newFileHeader = `${generatedHeader}${packageDocumentationHeader}`; const commonNamedExports: Omit[] = []; @@ -478,7 +490,9 @@ async function generateEntrypoints( .map( ([name, { exportedDecl, exportDecl }]) => `${name} from ${sourceContext(exportedDecl)}${ - exportDecl === undefined ? "" : ` via ${sourceContext(exportDecl)}` + exportDecl === undefined + ? "" + : ` via ${sourceContext(exportDecl)}` }`, ) .join(`\n\t`)}`, @@ -489,7 +503,8 @@ async function generateEntrypoints( commonNamedExports.push({ name, leadingTrivia: "\n\t" }); } commonNamedExports[0].leadingTrivia = `\n\t// #region Unrestricted APIs\n\t`; - commonNamedExports[commonNamedExports.length - 1].trailingTrivia = "\n\t// #endregion\n\t"; + commonNamedExports[commonNamedExports.length - 1].trailingTrivia = + "\n\t// #endregion\n\t"; } log.verbose(`Generating entrypoints...`); @@ -509,7 +524,9 @@ async function generateEntrypoints( const isLegacyRelease = isLegacy(apiLevel); // Generate this level's additional (or only) exports sorted by ascending case-sensitive name - const levelExports = [...exports[apiLevel]].sort((a, b) => (a.name > b.name ? 1 : -1)); + const levelExports = [...exports[apiLevel]].sort((a, b) => + a.name > b.name ? 1 : -1, + ); const levelSectionExports: Omit[] = []; for (const levelExport of levelExports) { @@ -586,7 +603,10 @@ export function createNode10EntrypointFileContent({ readonly sourceTypeRelPath: string; readonly isTypeOnly: boolean; }): string { - let entrypointToTypeImportPath = path.posix.relative(dirPath, sourceTypeRelPath); + let entrypointToTypeImportPath = path.posix.relative( + dirPath, + sourceTypeRelPath, + ); // If the path is not explicitly relative, make it so. if (!/^(\.\/|\.\.\/)/.test(entrypointToTypeImportPath)) { @@ -597,7 +617,10 @@ export function createNode10EntrypointFileContent({ return `${generatedHeader}export type * from "${entrypointToTypeImportPath}";\n`; } - const jsImport = entrypointToTypeImportPath.replace(/\.d\.([cm]?)ts/, ".$1js"); + const jsImport = entrypointToTypeImportPath.replace( + /\.d\.([cm]?)ts/, + ".$1js", + ); return `${generatedHeader}export * from "${jsImport}";\n`; } @@ -637,10 +660,17 @@ async function generateNode10TypeEntrypoints( */ const fileSavePromises: Promise[] = []; - for (const [outFile, { relPath, isTypeOnly }] of mapExportPathToData.entries()) { + for (const [ + outFile, + { relPath, isTypeOnly }, + ] of mapExportPathToData.entries()) { log.info(`\tGenerating ${outFile}`); fileSavePromises.push( - createEntrypointFile({ filePath: outFile, sourceTypeRelPath: relPath, isTypeOnly }), + createEntrypointFile({ + filePath: outFile, + sourceTypeRelPath: relPath, + isTypeOnly, + }), ); } diff --git a/build-tools/packages/build-cli/src/library/context.ts b/build-tools/packages/build-cli/src/library/context.ts index d80cc2d79be9..ab2c69312dd5 100644 --- a/build-tools/packages/build-cli/src/library/context.ts +++ b/build-tools/packages/build-cli/src/library/context.ts @@ -83,7 +83,9 @@ export class Context { * @returns An array of packages that belong to the release group */ public packagesInReleaseGroup(releaseGroup: string): Package[] { - const packages = this.packages.filter((pkg) => pkg.monoRepo?.kind === releaseGroup); + const packages = this.packages.filter( + (pkg) => pkg.monoRepo?.kind === releaseGroup, + ); return packages; } @@ -147,7 +149,10 @@ export class Context { public async getGitRepository(): Promise { if (this._gitRepository === undefined && !this.checkedIsGitRepo) { - const repo = new Repository({ baseDir: this.root }, "microsoft/FluidFramework"); + const repo = new Repository( + { baseDir: this.root }, + "microsoft/FluidFramework", + ); const isRepo = await repo.gitClient.checkIsRepo(); this.checkedIsGitRepo = true; this._gitRepository = isRepo ? repo : undefined; diff --git a/build-tools/packages/build-cli/src/library/dangerfile.cts b/build-tools/packages/build-cli/src/library/dangerfile.cts index 4d25a8f78d73..485dc0775ea1 100644 --- a/build-tools/packages/build-cli/src/library/dangerfile.cts +++ b/build-tools/packages/build-cli/src/library/dangerfile.cts @@ -51,7 +51,10 @@ export async function dangerfile(): Promise { throw new Error("no env github api token provided"); } - const adoConnection = getAzureDevopsApi(process.env.ADO_API_TOKEN, adoConstants.orgUrl); + const adoConnection = getAzureDevopsApi( + process.env.ADO_API_TOKEN, + adoConstants.orgUrl, + ); const sizeComparator = new ADOSizeComparator( adoConstants, adoConnection, @@ -65,7 +68,10 @@ export async function dangerfile(): Promise { // Post a message only if there was an error (result.comparison is undefined) or if // there were actual changes to the bundle sizes. In other cases, we don't post a // message and danger will delete its previous message - if (result.comparison === undefined || !bundlesContainNoChanges(result.comparison)) { + if ( + result.comparison === undefined || + !bundlesContainNoChanges(result.comparison) + ) { // Check for bundle size regression const sizeRegressionDetected = result.comparison?.some((bundle: BundleComparison) => { @@ -77,14 +83,19 @@ export async function dangerfile(): Promise { if (metricName === totalSizeMetricName) { return false; } - return compare.parsedSize - baseline.parsedSize > sizeWarningThresholdBytes; + return ( + compare.parsedSize - baseline.parsedSize > + sizeWarningThresholdBytes + ); }, ); }) ?? false; // Add warning message in case of bundle size regression if (sizeRegressionDetected) { - warn("Bundle size regression detected -- please investigate before merging!"); + warn( + "Bundle size regression detected -- please investigate before merging!", + ); try { await danger.github.utils.createOrAddLabel({ diff --git a/build-tools/packages/build-cli/src/library/dates.ts b/build-tools/packages/build-cli/src/library/dates.ts index cb132d5dd46c..f50a757d80ba 100644 --- a/build-tools/packages/build-cli/src/library/dates.ts +++ b/build-tools/packages/build-cli/src/library/dates.ts @@ -9,7 +9,9 @@ import { formatDistanceToNow, formatISO9075 } from "date-fns"; * Formats a date for display in the terminal. */ export function getDisplayDate(date?: Date): string { - return date === undefined ? "--no date--" : formatISO9075(date, { representation: "date" }); + return date === undefined + ? "--no date--" + : formatISO9075(date, { representation: "date" }); } /** diff --git a/build-tools/packages/build-cli/src/library/git.ts b/build-tools/packages/build-cli/src/library/git.ts index 6020c472db96..0587150e470d 100644 --- a/build-tools/packages/build-cli/src/library/git.ts +++ b/build-tools/packages/build-cli/src/library/git.ts @@ -18,7 +18,11 @@ import { parseISO } from "date-fns"; import type { CommandLogger } from "../logging.js"; import type { ReleaseGroup } from "../releaseGroups.js"; // eslint-disable-next-line import/no-deprecated -import { type Context, type VersionDetails, isMonoRepoKind } from "./context.js"; +import { + type Context, + type VersionDetails, + isMonoRepoKind, +} from "./context.js"; const newlineCrossPlatform = /\r?\n/; /** @@ -52,7 +56,10 @@ function getVersionFromTag(tag: string): string | undefined { * @param prefix - Prefix to search for. * @returns List of version tags. */ -async function getVersionTags(git: SimpleGit, prefix: string): Promise { +async function getVersionTags( + git: SimpleGit, + prefix: string, +): Promise { const raw_tags = git.tags(["--list", `${prefix}_v*`]); const tags = await raw_tags; return tags.all; @@ -162,9 +169,14 @@ export class Repository implements GitContext { /** * Returns the SHA hash for a branch. If a remote is provided, the SHA for the remote ref is returned. */ - public async getShaForBranch(branch: string, remote?: string): Promise { + public async getShaForBranch( + branch: string, + remote?: string, + ): Promise { const refspec = - remote === undefined ? `refs/heads/${branch}` : `refs/remotes/${remote}/${branch}`; + remote === undefined + ? `refs/heads/${branch}` + : `refs/remotes/${remote}/${branch}`; // result is a string of the form '64adcdba56deb16e0641c91ca825401a9f7a01f9' const result = await this.git.raw("show-ref", "--hash", refspec); return result; @@ -218,7 +230,10 @@ export class Repository implements GitContext { return base; } - private async getChangedFilesSinceRef(ref: string, remote: string): Promise { + private async getChangedFilesSinceRef( + ref: string, + remote: string, + ): Promise { const divergedAt = await this.getMergeBaseRemote(ref, remote); // Now we can find which files we added const added = await this.gitClient @@ -231,7 +246,10 @@ export class Repository implements GitContext { return files; } - private async getChangedDirectoriesSinceRef(ref: string, remote: string): Promise { + private async getChangedDirectoriesSinceRef( + ref: string, + remote: string, + ): Promise { const files = await this.getChangedFilesSinceRef(ref, remote); const dirs = new Set(files.map((f) => path.dirname(f))); return [...dirs]; @@ -291,8 +309,15 @@ export class Repository implements GitContext { * @param headCommit - The head commit. Defaults to HEAD. * @returns An array of all commits between the base and head commits. */ - public async revList(baseCommit: string, headCommit: string = "HEAD"): Promise { - const result = await this.git.raw("rev-list", `${baseCommit}..${headCommit}`, "--reverse"); + public async revList( + baseCommit: string, + headCommit: string = "HEAD", + ): Promise { + const result = await this.git.raw( + "rev-list", + `${baseCommit}..${headCommit}`, + "--reverse", + ); return result .split(newlineCrossPlatform) .filter((value) => value !== null && value !== undefined && value !== ""); @@ -366,7 +391,9 @@ export class Repository implements GitContext { * @param releaseGroupOrPackage - The release group or independent package to get tags for. * @returns An array of all all the tags for the release group or package. */ - public async getTagsForReleaseGroup(releaseGroupOrPackage: string): Promise { + public async getTagsForReleaseGroup( + releaseGroupOrPackage: string, + ): Promise { // eslint-disable-next-line import/no-deprecated const prefix = isMonoRepoKind(releaseGroupOrPackage) ? releaseGroupOrPackage.toLowerCase() @@ -436,7 +463,9 @@ export class Repository implements GitContext { */ public async createBranch(branchName: string): Promise { if (await this.getShaForBranch(branchName)) { - throw new Error(`Branch '${branchName}' already exists. Failed to create.`); + throw new Error( + `Branch '${branchName}' already exists. Failed to create.`, + ); } await this.gitClient.checkoutLocalBranch(branchName); } @@ -454,7 +483,10 @@ export class Repository implements GitContext { return result; } - public async isBranchUpToDate(branch: string, remote: string): Promise { + public async isBranchUpToDate( + branch: string, + remote: string, + ): Promise { await this.fetchBranch(remote, branch); const currentSha = await this.getShaForBranch(branch); const remoteSha = await this.getShaForBranch(branch, remote); @@ -482,10 +514,14 @@ export class Repository implements GitContext { */ export function getCurrentBranchNameSync(cwd: string = process.cwd()): string { try { - const revParseOut = execFileSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], { - cwd, - encoding: "utf8", - }).trim(); + const revParseOut = execFileSync( + "git", + ["rev-parse", "--abbrev-ref", "HEAD"], + { + cwd, + encoding: "utf8", + }, + ).trim(); return revParseOut.split(/\r?\n/)[0]; } catch (error) { throw new Error( diff --git a/build-tools/packages/build-cli/src/library/github.ts b/build-tools/packages/build-cli/src/library/github.ts index af59a07fa1cd..feee023ad73e 100644 --- a/build-tools/packages/build-cli/src/library/github.ts +++ b/build-tools/packages/build-cli/src/library/github.ts @@ -11,7 +11,8 @@ const COMMIT_INFO = "GET /repos/{owner}/{repo}/commits/{ref}"; const PULL_REQUEST = "POST /repos/{owner}/{repo}/pulls"; const ASSIGNEE = "POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"; const LABEL = "POST /repos/{owner}/{repo}/issues/{issue_number}/labels"; -const REVIEWER = "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"; +const REVIEWER = + "POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"; /** * Check if a pull request exists. @@ -26,7 +27,9 @@ export async function pullRequestExists( repo: string, log: CommandLogger, ): Promise<{ found: boolean; url?: string; number?: number }> { - log.verbose(`Checking if pull request with title="${title}" exists----------------`); + log.verbose( + `Checking if pull request with title="${title}" exists----------------`, + ); const octokit = new Octokit({ auth: token }); const response = await octokit.request(PULL_REQUEST_EXISTS, { owner, repo }); diff --git a/build-tools/packages/build-cli/src/library/index.ts b/build-tools/packages/build-cli/src/library/index.ts index 5e2c4070012a..c592c1c75866 100644 --- a/build-tools/packages/build-cli/src/library/index.ts +++ b/build-tools/packages/build-cli/src/library/index.ts @@ -36,7 +36,12 @@ export { BaseCommandWithBuildProject, GenerateEntrypointsCommand, } from "./commands/index.js"; -export { Context, type VersionDetails, isMonoRepoKind, MonoRepoKind } from "./context.js"; +export { + Context, + type VersionDetails, + isMonoRepoKind, + MonoRepoKind, +} from "./context.js"; export { Repository, getVersionsFromTags } from "./git.js"; export { ensureDevDependencyExists, @@ -55,7 +60,11 @@ export { export { difference } from "./sets.js"; export { getIndent, indentString, readLines } from "./text.js"; export { getApiExports } from "./typescriptApi.js"; -export { createPullRequest, getCommitInfo, pullRequestExists } from "./github.js"; +export { + createPullRequest, + getCommitInfo, + pullRequestExists, +} from "./github.js"; export { getRanges, type ReleaseRanges, diff --git a/build-tools/packages/build-cli/src/library/layerGraph.ts b/build-tools/packages/build-cli/src/library/layerGraph.ts index f7b9a5930a89..d3e12cd66f1f 100644 --- a/build-tools/packages/build-cli/src/library/layerGraph.ts +++ b/build-tools/packages/build-cli/src/library/layerGraph.ts @@ -224,7 +224,9 @@ class PackageNode extends BaseNode { } public get dotName(): string { - return this.name.replace(/@fluidframework\//i, "").replace(/@fluid-internal\//i, ""); + return this.name + .replace(/@fluidframework\//i, "") + .replace(/@fluid-internal\//i, ""); } public get pkg(): Package { @@ -236,12 +238,16 @@ class PackageNode extends BaseNode { public set pkg(pkg: Package) { if (this._pkg) { - throw new Error(`ERROR: Package assigned twice to a PackageNode ${this.name}`); + throw new Error( + `ERROR: Package assigned twice to a PackageNode ${this.name}`, + ); } this._pkg = pkg; } - public initializedDependencies(packageNodeMap: Map): void { + public initializedDependencies( + packageNodeMap: Map, + ): void { for (const dep of this.pkg.dependencies) { const depPackageNode = packageNodeMap.get(dep); if (depPackageNode) { @@ -265,14 +271,13 @@ class PackageNode extends BaseNode { if (this._indirectDependencies === undefined) { // NOTE: recursive isn't great, but the graph should be small enough // eslint-disable-next-line unicorn/no-array-reduce - this._indirectDependencies = this._childDependencies.reduce>( - (accum, childPackage) => { - for (const pkg of childPackage.childDependencies) accum.add(pkg); - for (const pkg of childPackage.indirectDependencies) accum.add(pkg); - return accum; - }, - new Set(), - ); + this._indirectDependencies = this._childDependencies.reduce< + Set + >((accum, childPackage) => { + for (const pkg of childPackage.childDependencies) accum.add(pkg); + for (const pkg of childPackage.indirectDependencies) accum.add(pkg); + return accum; + }, new Set()); } return this._indirectDependencies; } @@ -280,9 +285,12 @@ class PackageNode extends BaseNode { public get level(): number { if (this._level === undefined) { // eslint-disable-next-line unicorn/no-array-reduce - this._level = this._childDependencies.reduce((accum, childPackage) => { - return Math.max(accum, childPackage.level + 1); - }, 0); + this._level = this._childDependencies.reduce( + (accum, childPackage) => { + return Math.max(accum, childPackage.level + 1); + }, + 0, + ); } return this._level; } @@ -308,7 +316,11 @@ export class LayerGraph { return packageNode; } - private constructor(root: string, layerInfo: ILayerInfoFile, packages: Package[]) { + private constructor( + root: string, + layerInfo: ILayerInfoFile, + packages: Package[], + ) { this.initializeLayers(root, layerInfo); this.initializePackages(packages); @@ -333,7 +345,8 @@ export class LayerGraph { this.dirMapping[path.resolve(root, dir)] = layerNode; } if (layerInfo.packages) { - for (const pkg of layerInfo.packages) this.createPackageNode(pkg, layerNode); + for (const pkg of layerInfo.packages) + this.createPackageNode(pkg, layerNode); } if (layerInfo.dev && layerInfo.deps) { @@ -386,7 +399,9 @@ export class LayerGraph { for (const dir of Object.keys(this.dirMapping)) { if (pkg.directory.startsWith(dir)) { const layerNode = this.dirMapping[dir]; - traceLayerCheck(`${pkg.nameColored}: matched with ${layerNode.name} (${dir})`); + traceLayerCheck( + `${pkg.nameColored}: matched with ${layerNode.name} (${dir})`, + ); const newPackageNode = this.createPackageNode(pkg.name, layerNode); newPackageNode.pkg = pkg; matched = true; @@ -452,14 +467,19 @@ export class LayerGraph { public generateDotGraph(): string { const dotEdges: string[] = []; this.forEachDependencies((packageNode, depPackageNode) => { - if (packageNode.doDot && !packageNode.indirectDependencies.has(depPackageNode)) { + if ( + packageNode.doDot && + !packageNode.indirectDependencies.has(depPackageNode) + ) { const suffix = packageNode.indirectDependencies.has(depPackageNode) ? " [constraint=false color=lightgrey]" : packageNode.layerNode !== depPackageNode.layerNode && packageNode.level - depPackageNode.level > 3 ? " [constraint=false]" : ""; - dotEdges.push(`"${packageNode.dotName}"->"${depPackageNode.dotName}"${suffix}`); + dotEdges.push( + `"${packageNode.dotName}"->"${depPackageNode.dotName}"${suffix}`, + ); } return true; }); @@ -487,16 +507,20 @@ export class LayerGraph { */ private traverseLayerDependencyGraph(): void { // Walk all packages, grouping by layers and which layers contain dependencies of that layer - const layers: (LayerDependencyNode & { childrenToVisit: LayerNode[] })[] = []; + const layers: (LayerDependencyNode & { childrenToVisit: LayerNode[] })[] = + []; for (const groupNode of this.groupNodes) { for (const layerNode of groupNode.layerNodes) { const childLayers: Set = new Set(); for (const packageNode of layerNode.packages) { - for (const p of packageNode.childDependencies) childLayers.add(p.layerNode); + for (const p of packageNode.childDependencies) + childLayers.add(p.layerNode); } layers.push({ node: layerNode, - childrenToVisit: [...childLayers].filter((l) => l.name !== layerNode.name), + childrenToVisit: [...childLayers].filter( + (l) => l.name !== layerNode.name, + ), orderedChildren: [], }); } @@ -561,7 +585,9 @@ But some packages in layer A depend on packages in layer B, and likewise some in .relative(repoRoot, packageNode.pkg.directory) .replace(/\\/g, "/")}`; const ifPrivate = packageNode.pkg.isPublished ? "" : " (private)"; - packagesInCell.push(`- [${packageNode.name}](${dirRelativePath})${ifPrivate}`); + packagesInCell.push( + `- [${packageNode.name}](${dirRelativePath})${ifPrivate}`, + ); } const layersInCell: string[] = []; @@ -593,8 +619,13 @@ ${lines.join(newline)} return packagesMdContents; } - public static load(root: string, packages: Package[], info?: string): LayerGraph { - const layerInfoFile = info ?? path.join(__dirname, "..", "..", "data", "layerInfo.json"); + public static load( + root: string, + packages: Package[], + info?: string, + ): LayerGraph { + const layerInfoFile = + info ?? path.join(__dirname, "..", "..", "data", "layerInfo.json"); const layerData = readJsonSync(layerInfoFile) as ILayerInfoFile; return new LayerGraph(root, layerData, packages); } diff --git a/build-tools/packages/build-cli/src/library/markdown.ts b/build-tools/packages/build-cli/src/library/markdown.ts index f32bb25b024b..78ea25714e0c 100644 --- a/build-tools/packages/build-cli/src/library/markdown.ts +++ b/build-tools/packages/build-cli/src/library/markdown.ts @@ -62,7 +62,8 @@ export function addHeadingLinks(): (tree: Node) => void { * WARNING. It ensures that the pattern is not followed by only whitespace characters until the end of the line. * Additionally, it captures any whitespace characters that follow the matched pattern. */ -const ADMONITION_REGEX = /(\[!(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING)])(?!\s*$)\s*/gm; +const ADMONITION_REGEX = + /(\[!(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING)])(?!\s*$)\s*/gm; /** * A regular expression to remove single line breaks from text. This is used to remove extraneous line breaks in text @@ -108,9 +109,9 @@ export function stripSoftBreaks(): (tree: Node) => void { * * @param options - `heading` is a string or regex that a section's heading must match to be removed. */ -export function removeSectionContent(options: { heading: string | RegExp }): ( - tree: Root, -) => void { +export function removeSectionContent(options: { + heading: string | RegExp; +}): (tree: Root) => void { return function (tree: Root) { headingRange(tree, options.heading, (start, _nodes, end, _info) => { return [ @@ -127,14 +128,18 @@ export function removeSectionContent(options: { heading: string | RegExp }): ( * * @param options - The `level` property must be set to the level of heading to remove. */ -export function removeHeadingsAtLevel(options: { level: 1 | 2 | 3 | 4 | 5 | 6 }): ( - tree: Root, -) => void { +export function removeHeadingsAtLevel(options: { + level: 1 | 2 | 3 | 4 | 5 | 6; +}): (tree: Root) => void { return (tree: Root) => { visit( tree, "heading", - (node: Heading, index: number | undefined, parent: Parent | undefined) => { + ( + node: Heading, + index: number | undefined, + parent: Parent | undefined, + ) => { if (node.depth === options.level && index !== undefined) { parent?.children.splice(index, 1); return [SKIP, index]; @@ -150,14 +155,18 @@ export function removeHeadingsAtLevel(options: { level: 1 | 2 | 3 | 4 | 5 | 6 }) * @param options - `checkValue` is a string that will be compared against the link text. Only matching nodes will be * updated. `newUrl` is the new URL to assign to the link. */ -export function updateTocLinks(options: { checkValue: string; newUrl: string }): ( - tree: Root, -) => void { +export function updateTocLinks(options: { + checkValue: string; + newUrl: string; +}): (tree: Root) => void { const { checkValue, newUrl } = options; return (tree: Root) => { visit(tree, "link", (node: Link) => { - if (node.children?.[0].type === "text" && node.children[0].value === checkValue) { + if ( + node.children?.[0].type === "text" && + node.children[0].value === checkValue + ) { node.url = newUrl; } }); diff --git a/build-tools/packages/build-cli/src/library/package.ts b/build-tools/packages/build-cli/src/library/package.ts index 234089c8084a..b85c63ba5bcc 100644 --- a/build-tools/packages/build-cli/src/library/package.ts +++ b/build-tools/packages/build-cli/src/library/package.ts @@ -18,7 +18,12 @@ import { isRangeOperator, isWorkspaceRange, } from "@fluid-tools/version-tools"; -import { type Logger, MonoRepo, Package, type PackageJson } from "@fluidframework/build-tools"; +import { + type Logger, + MonoRepo, + Package, + type PackageJson, +} from "@fluidframework/build-tools"; import { PackageName } from "@rushstack/node-core-library"; import { compareDesc, differenceInBusinessDays } from "date-fns"; import execa from "execa"; @@ -36,7 +41,11 @@ import { type PackageWithKind, selectAndFilterPackages, } from "../filter.js"; -import { type ReleaseGroup, type ReleasePackage, isReleaseGroup } from "../releaseGroups.js"; +import { + type ReleaseGroup, + type ReleasePackage, + isReleaseGroup, +} from "../releaseGroups.js"; import type { DependencyUpdateType } from "./bump.js"; import { zip } from "./collections.js"; import type { Context, VersionDetails } from "./context.js"; @@ -287,7 +296,10 @@ export async function getPreReleaseDependencies( } for (const pkg of packagesToCheck) { - for (const { name: depName, version: depVersion } of pkg.combinedDependencies) { + for (const { + name: depName, + version: depVersion, + } of pkg.combinedDependencies) { // If it's not a dep we're looking to update, skip to the next dep if (!updateDependenciesOnThesePackages.includes(depName)) { continue; @@ -296,7 +308,9 @@ export async function getPreReleaseDependencies( // Convert the range into the minimum version const minVer = semver.minVersion(depVersion); if (minVer === null) { - throw new Error(`semver.minVersion was null: ${depVersion} (${depName})`); + throw new Error( + `semver.minVersion was null: ${depVersion} (${depName})`, + ); } // If the min version has a pre-release section, then it needs to be released. @@ -344,9 +358,14 @@ export async function isReleased( await gitRepo.gitClient.fetch(["--tags"]); const tagName = generateReleaseGitTagName(releaseGroupOrPackage, version); - if (typeof releaseGroupOrPackage === "string" && isReleaseGroup(releaseGroupOrPackage)) { + if ( + typeof releaseGroupOrPackage === "string" && + isReleaseGroup(releaseGroupOrPackage) + ) { // eslint-disable-next-line no-param-reassign, @typescript-eslint/no-non-null-assertion - releaseGroupOrPackage = context.repo.releaseGroups.get(releaseGroupOrPackage)!; + releaseGroupOrPackage = context.repo.releaseGroups.get( + releaseGroupOrPackage, + )!; } log?.verbose(`Checking for tag '${tagName}'`); @@ -403,7 +422,9 @@ export function sortVersions( sortedVersions.sort((a, b) => semver.rcompare(a.version, b.version)); } else { sortedVersions.sort((a, b) => - a.date === undefined || b.date === undefined ? -1 : compareDesc(a.date, b.date), + a.date === undefined || b.date === undefined + ? -1 + : compareDesc(a.date, b.date), ); } @@ -422,7 +443,8 @@ export function filterVersionsOlderThan( numBusinessDays: number, ): VersionDetails[] { return versions.filter((v) => { - const diff = v.date === undefined ? 0 : differenceInBusinessDays(Date.now(), v.date); + const diff = + v.date === undefined ? 0 : differenceInBusinessDays(Date.now(), v.date); return diff <= numBusinessDays; }); } @@ -447,7 +469,9 @@ export function getFluidDependencies( if (isReleaseGroup(releaseGroupOrPackage)) { packagesToCheck = context.packagesInReleaseGroup(releaseGroupOrPackage); } else { - const independentPackage = context.fullPackageMap.get(releaseGroupOrPackage); + const independentPackage = context.fullPackageMap.get( + releaseGroupOrPackage, + ); assert( independentPackage !== undefined, `Package not found in context: ${releaseGroupOrPackage}`, @@ -572,9 +596,12 @@ export async function setVersion( } // Update the release group root package.json - updatePackageJsonFile(path.join(releaseGroupOrPackage.repoPath, "package.json"), (json) => { - json.version = translatedVersion.version; - }); + updatePackageJsonFile( + path.join(releaseGroupOrPackage.repoPath, "package.json"), + (json) => { + json.version = translatedVersion.version; + }, + ); context.repo.reload(); @@ -612,7 +639,10 @@ export async function setVersion( const packagesToCheckAndUpdate = releaseGroupOrPackage.packages; const dependencyVersionMap = new Map(); for (const pkg of packagesToCheckAndUpdate) { - dependencyVersionMap.set(pkg.name, { pkg, range: newRange as InterdependencyRange }); + dependencyVersionMap.set(pkg.name, { + pkg, + range: newRange as InterdependencyRange, + }); } for (const pkg of packagesToCheckAndUpdate) { @@ -644,7 +674,9 @@ export async function setVersion( function getDependenciesRecord( packageJson: PackageJson, depClass: "prod" | "dev" | "peer", -): PackageJson["dependencies" | "devDependencies" | "peerDependencies"] | undefined { +): + | PackageJson["dependencies" | "devDependencies" | "peerDependencies"] + | undefined { switch (depClass) { case "dev": { return packageJson.devDependencies; @@ -688,8 +720,14 @@ async function setPackageDependencies( for (const { name, depClass } of pkg.combinedDependencies) { const dep = dependencyVersionMap.get(name); if (dep !== undefined) { - const isSameReleaseGroup = MonoRepo.isSame(dep.pkg.monoRepo, pkg.monoRepo); - if (!isSameReleaseGroup || (updateWithinSameReleaseGroup && isSameReleaseGroup)) { + const isSameReleaseGroup = MonoRepo.isSame( + dep.pkg.monoRepo, + pkg.monoRepo, + ); + if ( + !isSameReleaseGroup || + (updateWithinSameReleaseGroup && isSameReleaseGroup) + ) { const dependencies = getDependenciesRecord(pkg.packageJson, depClass); if (dependencies === undefined) { continue; @@ -799,7 +837,11 @@ export async function npmCheckUpdatesHomegrown( /** * A map of packages that should be updated, and their latest version. */ - const dependencyVersionMap = await findDepUpdates(depsToUpdate, prerelease, log); + const dependencyVersionMap = await findDepUpdates( + depsToUpdate, + prerelease, + log, + ); log?.verbose( `Dependencies to update:\n${JSON.stringify(dependencyVersionMap, undefined, 2)}`, ); @@ -817,7 +859,8 @@ export async function npmCheckUpdatesHomegrown( // Remove the filtered release group from the list if needed if (releaseGroupFilter !== undefined) { - const indexOfFilteredGroup = selectionCriteria.releaseGroups.indexOf(releaseGroupFilter); + const indexOfFilteredGroup = + selectionCriteria.releaseGroups.indexOf(releaseGroupFilter); if (indexOfFilteredGroup !== -1) { selectionCriteria.releaseGroups.splice(indexOfFilteredGroup, 1); selectionCriteria.releaseGroupRoots.splice(indexOfFilteredGroup, 1); @@ -853,7 +896,9 @@ export async function npmCheckUpdatesHomegrown( throw new Error(`Couldn't parse version ${verString}`); } - const range: InterdependencyRange = prerelease ? newVersion : `^${[...versionSet][0]}`; + const range: InterdependencyRange = prerelease + ? newVersion + : `^${[...versionSet][0]}`; log?.verbose(`Calculated new range: ${range}`); for (const dep of Object.keys(dependencyVersionMap)) { const pkg = context.fullPackageMap.get(dep); @@ -868,7 +913,9 @@ export async function npmCheckUpdatesHomegrown( const promises: Promise[] = []; for (const pkg of packagesToUpdate) { - promises.push(setPackageDependencies(pkg, dependencyUpdateMap, false, writeChanges)); + promises.push( + setPackageDependencies(pkg, dependencyUpdateMap, false, writeChanges), + ); } const results = await Promise.all(promises); const packageStatus = zip(packagesToUpdate, results); @@ -876,7 +923,9 @@ export async function npmCheckUpdatesHomegrown( .filter(([, changed]) => changed === true) .map(([pkg]) => pkg); - log?.info(`Updated ${updatedPackages.length} of ${packagesToUpdate.length} packages.`); + log?.info( + `Updated ${updatedPackages.length} of ${packagesToUpdate.length} packages.`, + ); return { updatedDependencies: dependencyVersionMap, @@ -897,7 +946,9 @@ export function ensureDevDependencyExists( ): string { const dependencyVersion = packageObject?.devDependencies?.[dependencyName]; if (dependencyVersion === undefined) { - throw new Error(`Did not find devDependency '${dependencyName}' in package.json`); + throw new Error( + `Did not find devDependency '${dependencyName}' in package.json`, + ); } return dependencyVersion; } @@ -941,6 +992,8 @@ export async function readPackageJson(): Promise { // Reads and parses the `tsconfig.json` file in the current directory. export async function readTsConfig(): Promise { - const tsConfigContent = await readFile("./tsconfig.json", { encoding: "utf8" }); + const tsConfigContent = await readFile("./tsconfig.json", { + encoding: "utf8", + }); return JSON5.parse(tsConfigContent); } diff --git a/build-tools/packages/build-cli/src/library/packageExports.ts b/build-tools/packages/build-cli/src/library/packageExports.ts index 9fbd158c6b75..3b1308dca507 100644 --- a/build-tools/packages/build-cli/src/library/packageExports.ts +++ b/build-tools/packages/build-cli/src/library/packageExports.ts @@ -47,7 +47,10 @@ export type Node10CompatExportData = Pick; /** * Only the value types of exports that are records. */ -type ExportsRecordValue = Exclude, unknown[]>; +type ExportsRecordValue = Exclude< + Extract, + unknown[] +>; /** * Returns value of first key to match test value, if any. @@ -61,7 +64,11 @@ function valueOfFirstKeyMatching( mapQuery: ReadonlyMap, ): { value: TValue } | undefined { for (const [key, value] of mapQuery.entries()) { - if (typeof key === "string" ? path.resolve(test) === path.resolve(key) : key.test(test)) { + if ( + typeof key === "string" + ? path.resolve(test) === path.resolve(key) + : key.test(test) + ) { // box value to distinguish nothing found from found value that is undefined. return { value }; } @@ -96,15 +103,19 @@ function findTypesPathsMatching( // All exports are type only if there was a previous condition where the only option // was "types" constrained. Otherwise they may still become constrained or not. const isTypeOnlySettled = - (previous.isTypeOnly ?? false) && previous.conditions.includes(typesExportCondition); + (previous.isTypeOnly ?? false) && + previous.conditions.includes(typesExportCondition); const entries = Object.entries(exports); for (const [entry, value] of entries) { // Current conditions // "default" is not an explicit condition, but a catch all; so, never add it to conditions const conditions = - entry === defaultExportCondition ? previous.conditions : [...previous.conditions, entry]; + entry === defaultExportCondition + ? previous.conditions + : [...previous.conditions, entry]; const isTypeOnly = - isTypeOnlySettled || (entries.length === 1 && entry === typesExportCondition); + isTypeOnlySettled || + (entries.length === 1 && entry === typesExportCondition); // First check if this entry is a leaf; where value is only // expected to be a string (a relative file path). if (typeof value === "string") { @@ -113,9 +124,17 @@ function findTypesPathsMatching( // condition (entry) or is an inherited condition, both of which have been // combined into local conditions. if (conditions.includes(typesExportCondition)) { - const queryResult = valueOfFirstKeyMatching(relPath, mapQueryPathToOutKey); + const queryResult = valueOfFirstKeyMatching( + relPath, + mapQueryPathToOutKey, + ); if (queryResult !== undefined) { - results.push({ outKey: queryResult.value, relPath, conditions, isTypeOnly }); + results.push({ + outKey: queryResult.value, + relPath, + conditions, + isTypeOnly, + }); } } } else if (value !== null) { @@ -124,10 +143,15 @@ function findTypesPathsMatching( if (Array.isArray(value)) { continue; } - const deepFind = findTypesPathsMatching(mapQueryPathToOutKey, value, onlyFirstMatch, { - conditions, - isTypeOnly, - }); + const deepFind = findTypesPathsMatching( + mapQueryPathToOutKey, + value, + onlyFirstMatch, + { + conditions, + isTypeOnly, + }, + ); if (deepFind !== undefined) { results.push(...deepFind); } @@ -171,7 +195,10 @@ export function queryTypesResolutionPathsFromPackageExports( >; } { const mapKeyToOutput = new Map(); - const mapNode10CompatExportPathToData = new Map(); + const mapNode10CompatExportPathToData = new Map< + string, + Node10CompatExportData + >(); const mapTypesPathToExportPaths = new Map< string, Readonly<{ exportPath: string; conditions: readonly string[] }>[] @@ -184,13 +211,17 @@ export function queryTypesResolutionPathsFromPackageExports( if (Array.isArray(exports)) { // eslint-disable-next-line unicorn/prefer-type-error - throw new Error(`required entrypoints cannot be generated for "exports" array`); + throw new Error( + `required entrypoints cannot be generated for "exports" array`, + ); } // Iterate through exports looking for properties with values matching keys in map. for (const [exportPath, exportValue] of Object.entries(exports)) { if (typeof exportValue !== "object") { - logger?.verbose(`ignoring non-object export path "${exportPath}": "${exportValue}"`); + logger?.verbose( + `ignoring non-object export path "${exportPath}": "${exportValue}"`, + ); continue; } if (exportValue === null) { @@ -232,7 +263,10 @@ export function queryTypesResolutionPathsFromPackageExports( // Add mapping for Node10 type compatibility generation if requested. // Exclude root "." path as "types" should handle that. if (node10TypeCompat && exportPath !== ".") { - const node10TypeExportPath = exportPath.replace(/(?:\.([cm]?)js)?$/, ".d.$1ts"); + const node10TypeExportPath = exportPath.replace( + /(?:\.([cm]?)js)?$/, + ".d.$1ts", + ); // Nothing needed when export path already matches internal path. if (path.resolve(node10TypeExportPath) !== path.resolve(relPath)) { mapNode10CompatExportPathToData.set(node10TypeExportPath, { @@ -244,7 +278,11 @@ export function queryTypesResolutionPathsFromPackageExports( } } - return { mapKeyToOutput, mapNode10CompatExportPathToData, mapTypesPathToExportPaths }; + return { + mapKeyToOutput, + mapNode10CompatExportPathToData, + mapTypesPathToExportPaths, + }; } /** @@ -294,12 +332,15 @@ export function getTypesPathFromPackage( try { // First try to resolve with the "import" condition, assuming the package is either ESM-only or dual-format. // conditions: ["default", "types", "import", "node"] - const exports = resolve.exports(packageJson, entrypoint, { conditions: ["types"] }); + const exports = resolve.exports(packageJson, entrypoint, { + conditions: ["types"], + }); // resolve.exports returns a `Exports.Output | void` type, though the documentation isn't clear under what // conditions `void` would be the return type vs. just throwing an exception. Since the types say exports could be // undefined or an empty array (Exports.Output is an array type), check for those conditions. - typesPath = exports === undefined || exports.length === 0 ? undefined : exports[0]; + typesPath = + exports === undefined || exports.length === 0 ? undefined : exports[0]; } catch { // Catch and ignore any exceptions here; we'll retry with the require condition. log.verbose( @@ -321,7 +362,8 @@ export function getTypesPathFromPackage( conditions: ["types"], require: true, }); - typesPath = exports === undefined || exports.length === 0 ? undefined : exports[0]; + typesPath = + exports === undefined || exports.length === 0 ? undefined : exports[0]; } catch { // Catch and ignore any exceptions here; we'll retry with the require condition. log.verbose( diff --git a/build-tools/packages/build-cli/src/library/release.ts b/build-tools/packages/build-cli/src/library/release.ts index d2ffd133ada4..0c21b9d6ed78 100644 --- a/build-tools/packages/build-cli/src/library/release.ts +++ b/build-tools/packages/build-cli/src/library/release.ts @@ -134,7 +134,12 @@ interface PackageVersion { * "tilde": tilde-equivalent version ranges. * "legacy-compat": legacy compat equivalent version ranges. */ -export type ReportKind = "full" | "caret" | "tilde" | "simple" | "legacy-compat"; +export type ReportKind = + | "full" + | "caret" + | "tilde" + | "simple" + | "legacy-compat"; /** * Converts a {@link ReleaseReport} into different formats based on the kind. @@ -221,7 +226,10 @@ function getLegacyCompatVersionRange( * * @returns A string representing the next version in the legacy compatibility range. */ -export function getLegacyCompatRange(version: string, interval: number): string { +export function getLegacyCompatRange( + version: string, + interval: number, +): string { const semVersion = semver.parse(version); if (!semVersion) { throw new Error("Invalid version string"); diff --git a/build-tools/packages/build-cli/src/library/releasePrepChecks.ts b/build-tools/packages/build-cli/src/library/releasePrepChecks.ts index af48f19b6e3e..2110ac5376a0 100644 --- a/build-tools/packages/build-cli/src/library/releasePrepChecks.ts +++ b/build-tools/packages/build-cli/src/library/releasePrepChecks.ts @@ -105,7 +105,8 @@ export const CheckDependenciesInstalled: CheckFunction = async ( // If any of the install checks returned false, dependencies need to be installed if (installChecks.includes(false)) { return { - message: "Some dependencies aren't installed. Try installing dependencies manually.", + message: + "Some dependencies aren't installed. Try installing dependencies manually.", fixCommand: "pnpm install", }; } @@ -124,13 +125,17 @@ export const CheckHasRemoteBranchUpToDate: CheckFunction = async ( if (remote === undefined) { return { - message: "No remote found that points to the microsoft/FluidFramework repo.", + message: + "No remote found that points to the microsoft/FluidFramework repo.", }; } let succeeded = false; try { - succeeded = await gitRepo.isBranchUpToDate(gitRepo.originalBranchName, remote); + succeeded = await gitRepo.isBranchUpToDate( + gitRepo.originalBranchName, + remote, + ); } catch (error) { return { message: `Error when checking remote branch. Does the remote branch exist? Full error message:\n${ @@ -141,7 +146,8 @@ export const CheckHasRemoteBranchUpToDate: CheckFunction = async ( if (!succeeded) { return { - message: "Branch is out of date with the remote. Try pulling the latest from upstream.", + message: + "Branch is out of date with the remote. Try pulling the latest from upstream.", fixCommand: "git pull", }; } @@ -198,7 +204,8 @@ export const CheckNoPolicyViolations: CheckFunction = async ( if (result.exitCode !== 0) { return { - message: "Policy check failed. These failures must be fixed before release.", + message: + "Policy check failed. These failures must be fixed before release.", fixCommand: "pnpm run policy-check:fix", }; } @@ -223,7 +230,8 @@ export const CheckNoUntaggedAsserts: CheckFunction = async ( if (!afterPolicyCheckStatus.isClean()) { await gitRepo.gitClient.reset(ResetMode.HARD); return { - message: "Found some untagged asserts. These should be tagged before release.", + message: + "Found some untagged asserts. These should be tagged before release.", fixCommand: "pnpm run policy-check:asserts", }; } diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/copyrightFileHeader.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/copyrightFileHeader.ts index 9bc85be67f08..a2a80bb4a403 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/copyrightFileHeader.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/copyrightFileHeader.ts @@ -38,7 +38,9 @@ interface IFileConfig { * Given an 'IFileConfig' produces a function that detects correct copyright headers * and returns an error string if the header is missing or incorrect. */ -function makeHandler(config: IFileConfig): (file: string) => Promise { +function makeHandler( + config: IFileConfig, +): (file: string) => Promise { const pre = config.headerStart?.source ?? ""; const start = config.lineStart.source; const end = config.lineEnd.source; @@ -49,7 +51,10 @@ function makeHandler(config: IFileConfig): (file: string) => Promise text .split(newline) - .map((line) => `${start}${line.replace(/[$()*+.?[\\\]^{|}]/g, "\\$&")}${end}`) + .map( + (line) => + `${start}${line.replace(/[$()*+.?[\\\]^{|}]/g, "\\$&")}${end}`, + ) .join("") .replace(/\s*\\r\?\\n/, "\\r?\\n"); // Trim trailing spaces at end-of-line. diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/dockerfilePackages.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/dockerfilePackages.ts index 60ecf21d52f4..0a7965cedd94 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/dockerfilePackages.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/dockerfilePackages.ts @@ -27,13 +27,19 @@ function getOrAddLocalMap(key: string, getter: () => Buffer): Buffer { export const handler: Handler = { name: "dockerfile-packages", match: /^(server\/routerlicious\/packages)\/.*\/package\.json/i, - handler: async (file: string, gitRoot: string): Promise => { + handler: async ( + file: string, + gitRoot: string, + ): Promise => { // strip server path since all paths are relative to server directory // Additionally, we normalize slashes here to ensure that the path is consistent across different OSes. // This matters because the Dockerfile is checked in with POSIX-style slashes, and the Node path APIs return // OS-specific file separators. const dockerfileCopyText = getDockerfileCopyText( - TscUtils.normalizeSlashes(path.relative(gitRoot, file)).replace(serverPath, ""), + TscUtils.normalizeSlashes(path.relative(gitRoot, file)).replace( + serverPath, + "", + ), ); const dockerFilePath = path.join( path.relative(process.cwd(), path.join(gitRoot, serverPath)), @@ -67,7 +73,8 @@ export const handler: Handler = { const regexMatch = endOfCopyLinesRegex.exec(dockerfileContents)!; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const localNewline = regexMatch.groups!.newline; - const insertIndex = regexMatch.index + regexMatch[0].length - localNewline.length; + const insertIndex = + regexMatch.index + regexMatch[0].length - localNewline.length; dockerfileContents = dockerfileContents.slice(0, Math.max(0, insertIndex)) + diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildDatabase.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildDatabase.ts index 75b991935d8c..d985a5937d47 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildDatabase.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildDatabase.ts @@ -74,7 +74,9 @@ function flubOutput( if (type === undefined) { type = fileType; } else if (type !== fileType) { - throw new Error(`${pkg.name} "${commandLine}" produces both CommonJS and ESM output`); + throw new Error( + `${pkg.name} "${commandLine}" produces both CommonJS and ESM output`, + ); } } } @@ -106,7 +108,9 @@ function tscModuleType( if (commandLine.startsWith("fluid-tsc module")) { return "ESM"; } - throw new Error(`fluid-tsc package type not recognized in "${commandLine}"`); + throw new Error( + `fluid-tsc package type not recognized in "${commandLine}"`, + ); } return pkg.packageJson.type === "module" ? "ESM" : "CommonJS"; @@ -140,7 +144,9 @@ function tscOutput( const parsedCommand = tscUtils.parseCommandLine(commandLine); if (!parsedCommand) { - throw new Error(`Error parsing ${pkg.name} tsc command line: ${commandLine}`); + throw new Error( + `Error parsing ${pkg.name} tsc command line: ${commandLine}`, + ); } const configFile = tscUtils.findConfigFile(packageDir, parsedCommand); const configJson = tscUtils.readConfigFile(configFile) as TsConfigJson; @@ -168,7 +174,9 @@ function tscOutput( const { module } = options; if (module === undefined) { - throw new Error(`${pkg.name} "${commandLine}" tsc compilerOptions.module not specified`); + throw new Error( + `${pkg.name} "${commandLine}" tsc compilerOptions.module not specified`, + ); } const type = tscModuleType(pkg, commandLine, ts.ModuleKind[module]); @@ -180,7 +188,10 @@ function tscOutput( const outDir = options.outDir ?? "."; const inputRegex = /(?:\.d)?(\.[cm]?ts)$/; const files = fileNames.map((relSrcPath) => { - const relOutPath = path.relative(rootDir, relSrcPath.replace(inputRegex, `.d$1`)); + const relOutPath = path.relative( + rootDir, + relSrcPath.replace(inputRegex, `.d$1`), + ); return path.resolve(packageDir, outDir, relOutPath); }); @@ -201,9 +212,9 @@ const generationCommands: Partial< | undefined > > = { - "flub": flubOutput, + flub: flubOutput, "fluid-tsc": tscOutput, - "tsc": tscOutput, + tsc: tscOutput, }; /** @@ -237,10 +248,7 @@ export class FluidBuildDatabase { packageGroup: ReadonlyMap, packageName: PackageName, script: Script, - ignorePackage?: (packageInfo: { - name: string; - version: string; - }) => boolean, + ignorePackage?: (packageInfo: { name: string; version: string }) => boolean, ): BuildScript[][] { const pkg = packageGroup.get(packageName); if (pkg === undefined) { @@ -249,9 +257,13 @@ export class FluidBuildDatabase { this.loadPackageAndDependencies(packageGroup, packageName); - const localBuildScript = this.packageBuildScripts.get(packageName)?.get(script); + const localBuildScript = this.packageBuildScripts + .get(packageName) + ?.get(script); if (localBuildScript === undefined) { - throw new Error(`${packageName}#${script} is not a recognized build script`); + throw new Error( + `${packageName}#${script} is not a recognized build script`, + ); } const predecessors: BuildScript[][] = []; @@ -265,7 +277,10 @@ export class FluidBuildDatabase { if (depBuildScripts !== undefined) { const possibleScriptPredecessors: BuildScript[] = []; for (const [depScript, { moduleType }] of depBuildScripts.entries()) { - if (moduleType === undefined || moduleType === localBuildScript.moduleType) { + if ( + moduleType === undefined || + moduleType === localBuildScript.moduleType + ) { possibleScriptPredecessors.push({ packageName: depPackageName, script: depScript, @@ -330,11 +345,18 @@ export class FluidBuildDatabase { if (commands === undefined) { continue; } - const source: BuildScript = { packageName, script, moduleType: undefined }; + const source: BuildScript = { + packageName, + script, + moduleType: undefined, + }; const scriptCommandLines = commands.split("&&"); for (const scriptCommandLine of scriptCommandLines) { const scriptCommand = scriptCommandLine.split(" ")[0]; - const outputs = generationCommands[scriptCommand]?.(pkg, scriptCommandLine); + const outputs = generationCommands[scriptCommand]?.( + pkg, + scriptCommandLine, + ); if (outputs === undefined) { // command not known or ignored continue; @@ -344,7 +366,10 @@ export class FluidBuildDatabase { // Update source moduleType if (outputs.type !== undefined) { - if (source.moduleType !== undefined && outputs.type !== source.moduleType) { + if ( + source.moduleType !== undefined && + outputs.type !== source.moduleType + ) { throw new Error( `${packageName} ${script} cumulatively produces both CommonJS and ESM output`, ); diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildTasks.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildTasks.ts index 8a103a3bc59f..cc1dee2126bb 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildTasks.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidBuildTasks.ts @@ -38,7 +38,8 @@ const getFluidBuildTasksTscIgnore = (root: string): Set => { const rootDir = path.resolve(root); let ignore = fluidBuildTasksTscIgnoreTasksCache.get(rootDir); if (ignore === undefined) { - const ignoreArray = getFlubConfig(rootDir)?.policy?.fluidBuildTasks?.tsc?.ignoreTasks; + const ignoreArray = + getFlubConfig(rootDir)?.policy?.fluidBuildTasks?.tsc?.ignoreTasks; ignore = ignoreArray ? new Set(ignoreArray) : new Set(); fluidBuildTasksTscIgnoreTasksCache.set(rootDir, ignore); } @@ -48,7 +49,10 @@ const getFluidBuildTasksTscIgnore = (root: string): Set => { /** * Cache the FluidRepo object, so we don't have to load it repeatedly */ -const repoCache = new Map }>(); +const repoCache = new Map< + string, + { repo: FluidRepo; packageMap: Map } +>(); function getFluidPackageMap(root: string): Map { const rootDir = path.resolve(root); let record = repoCache.get(rootDir); @@ -74,7 +78,10 @@ const fluidBuildDatabaseCache = new FluidBuildDatabase(); * @param command - the command to find the script name for * @returns best script name found to match the command */ -function findScript(json: Readonly, command: string): string | undefined { +function findScript( + json: Readonly, + command: string, +): string | undefined { if (json.scripts === undefined) { return undefined; } @@ -128,7 +135,9 @@ function findFluidTscScript( if ( scriptCommands.startsWith("fluid-tsc") && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - (project ? scriptCommands.includes(project) : !scriptCommands.includes("--project")) + (project + ? scriptCommands.includes(project) + : !scriptCommands.includes("--project")) ) { return script; } @@ -142,7 +151,10 @@ function findFluidTscScript( * @param project - the tsc project to search for * @returns single script name found to use the project or undefined */ -function findTscScript(json: Readonly, project: string): string | undefined { +function findTscScript( + json: Readonly, + project: string, +): string | undefined { const tscScripts: string[] = []; function addIfDefined(script: string | undefined): void { if (script !== undefined) { @@ -198,14 +210,18 @@ async function eslintGetScriptDependencies( const eslintConfig = getEsLintConfigFilePath(packageDir); // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (!eslintConfig) { - throw new Error(`Unable to find eslint config file for package in ${packageDir}`); + throw new Error( + `Unable to find eslint config file for package in ${packageDir}`, + ); } let config: EslintConfig; try { const { ext } = path.parse(eslintConfig); if (ext === ".mjs") { - throw new Error(`Eslint config '${eslintConfig}' is ESM; only CommonJS is supported.`); + throw new Error( + `Eslint config '${eslintConfig}' is ESM; only CommonJS is supported.`, + ); } if (ext !== ".js" && ext !== ".cjs") { @@ -220,7 +236,9 @@ async function eslintGetScriptDependencies( } } } catch (error) { - throw new Error(`Unable to load eslint config file ${eslintConfig}. ${error}`); + throw new Error( + `Unable to load eslint config file ${eslintConfig}. ${error}`, + ); } let projects = config.parserOptions?.project; @@ -279,7 +297,13 @@ async function eslintGetScriptDependencies( const command = commandUntrimmed.trim(); if (shouldProcessScriptForTsc(script, command, emptyIgnoreSet)) { collectiveDependencies.push( - ...getTscCommandDependencies(packageDir, json, script, command, packageMap), + ...getTscCommandDependencies( + packageDir, + json, + script, + command, + packageMap, + ), ); } } @@ -296,7 +320,10 @@ async function eslintGetScriptDependencies( * @param json - package.json content for the package * @returns true if FluidRepo includes the package, false otherwise */ -function isFluidBuildEnabled(root: string, json: Readonly): boolean { +function isFluidBuildEnabled( + root: string, + json: Readonly, +): boolean { return getFluidPackageMap(root).get(json.name) !== undefined; } @@ -324,7 +351,9 @@ function hasTaskDependency( searchDeps: readonly string[], ): boolean { const rootConfig = getFluidBuildConfig(root); - const globalTaskDefinitions = normalizeGlobalTaskDefinitions(rootConfig?.tasks); + const globalTaskDefinitions = normalizeGlobalTaskDefinitions( + rootConfig?.tasks, + ); const taskDefinitions = getTaskDefinitions(json, globalTaskDefinitions, { isReleaseGroupRoot: false, }); @@ -375,10 +404,12 @@ function hasTaskDependency( // ^ means "depends on the task of the same name in all package dependencies". // dep of exactly ^* means "_all_ tasks in all package dependencies". const depPattern = dep.slice(1); - const regexSearchMatches = new RegExp(depPattern === "*" ? "." : `#${depPattern}$`); + const regexSearchMatches = new RegExp( + depPattern === "*" ? "." : `#${depPattern}$`, + ); // Check for task matches - const possibleSearchMatches = packageSpecificSearchDeps.filter((searchDep) => - regexSearchMatches.test(searchDep), + const possibleSearchMatches = packageSpecificSearchDeps.filter( + (searchDep) => regexSearchMatches.test(searchDep), ); // Check if there is matching dependency if ( @@ -393,7 +424,10 @@ function hasTaskDependency( // ^* would already consider all tasks in all dependencies. continue; } - for (const [packageName, secondaryData] of secondaryPackagesTasksToConsider) { + for (const [ + packageName, + secondaryData, + ] of secondaryPackagesTasksToConsider) { // If there is a matching dependency package, add this task to // transitive dependency in secondary package search list. if (packageDependencies.has(packageName)) { @@ -405,7 +439,9 @@ function hasTaskDependency( const packageDepMatch = dep.match(/^([^#]*)#(.*)$/); if (packageDepMatch) { // Consider one level deep of package's tasks to handle multi-task dependencies. - const secondaryPackageSet = secondaryPackagesTasksToConsider.get(packageDepMatch[1]); + const secondaryPackageSet = secondaryPackagesTasksToConsider.get( + packageDepMatch[1], + ); if (secondaryPackageSet) { secondaryPackageSet.tasks.add(packageDepMatch[2]); } @@ -420,14 +456,21 @@ function hasTaskDependency( // Consider secondary package dependencies transitive dependencies const packageMap = getFluidPackageMap(root); - for (const [packageName, secondaryData] of secondaryPackagesTasksToConsider.entries()) { + for (const [ + packageName, + secondaryData, + ] of secondaryPackagesTasksToConsider.entries()) { const pkgJson = packageMap.get(packageName)?.packageJson; if (pkgJson === undefined) { throw new Error(`Dependent package ${packageName} not found in repo`); } - const secondaryTaskDefinitions = getTaskDefinitions(pkgJson, globalTaskDefinitions, { - isReleaseGroupRoot: false, - }); + const secondaryTaskDefinitions = getTaskDefinitions( + pkgJson, + globalTaskDefinitions, + { + isReleaseGroupRoot: false, + }, + ); pending.push(...secondaryData.tasks); let dep; while ((dep = pending.pop()) !== undefined) { @@ -461,7 +504,12 @@ function checkTaskDeps( const missingTaskDependencies = taskDeps .filter( (taskDep) => - !hasTaskDependency(root, json, taskName, Array.isArray(taskDep) ? taskDep : [taskDep]), + !hasTaskDependency( + root, + json, + taskName, + Array.isArray(taskDep) ? taskDep : [taskDep], + ), ) .map((dep) => (Array.isArray(dep) ? dep.join(" or ") : dep)); @@ -501,14 +549,22 @@ function patchTaskDeps( ): void { const missingTaskDependencies = taskDeps.filter( (taskDep) => - !hasTaskDependency(root, json, taskName, Array.isArray(taskDep) ? taskDep : [taskDep]), + !hasTaskDependency( + root, + json, + taskName, + Array.isArray(taskDep) ? taskDep : [taskDep], + ), ); if (missingTaskDependencies.length > 0) { const readonlyFileDep = json.fluidBuild?.tasks?.[taskName]; if (readonlyFileDep === undefined) { let tasks: DeeplyMutable< - Exclude["tasks"], undefined> + Exclude< + Exclude["tasks"], + undefined + > >; if (json.fluidBuild === undefined) { tasks = {}; @@ -568,7 +624,9 @@ function getTscCommandDependencies( // If the project has a referenced project, depend on that instead of the default const parsedCommand = TscUtils.parseCommandLine(command); if (!parsedCommand) { - throw new Error(`Error parsing tsc command for script '${script}': ${command}`); + throw new Error( + `Error parsing tsc command for script '${script}': ${command}`, + ); } const configFile = TscUtils.findConfigFile(packageDir, parsedCommand); const configJson = TscUtils.readConfigFile(configFile) as TsConfigJson; @@ -582,7 +640,8 @@ function getTscCommandDependencies( if ( json.scripts["build:test"] === undefined && json.scripts["typetests:gen"] !== undefined && - (script === "tsc" || (json.scripts.tsc === undefined && script === "build:esnext")) + (script === "tsc" || + (json.scripts.tsc === undefined && script === "build:esnext")) ) { deps.push("typetests:gen"); } @@ -607,7 +666,9 @@ function getTscCommandDependencies( const referencedScript = findTscScript(json, refConfigPath); if (referencedScript === undefined) { - throw new Error(`Unable to find tsc script for referenced project ${refConfigPath}`); + throw new Error( + `Unable to find tsc script for referenced project ${refConfigPath}`, + ); } deps.push(referencedScript); } @@ -649,7 +710,9 @@ function getTscCommandDependencies( // eslint-disable-next-line unicorn/prefer-spread return deps.concat( [...tscPredecessors].map((group) => - group.map((predecessor) => `${predecessor.packageName}#${predecessor.script}`), + group.map( + (predecessor) => `${predecessor.packageName}#${predecessor.script}`, + ), ), ); } @@ -695,7 +758,14 @@ function buildDepsHandler( continue; } try { - const error = check({ packageDir, json, script, command, packageMap, root }); + const error = check({ + packageDir, + json, + script, + command, + packageMap, + root, + }); // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (error) { errors.push(error); @@ -716,7 +786,13 @@ function checkTscDependencies({ packageMap, root, }: BuildDepsCallbackContext): string | undefined { - const checkDeps = getTscCommandDependencies(packageDir, json, script, command, packageMap); + const checkDeps = getTscCommandDependencies( + packageDir, + json, + script, + command, + packageMap, + ); // Check the dependencies return checkTaskDeps(root, json, script, checkDeps); } @@ -726,7 +802,10 @@ export const handlers: Handler[] = [ { name: "fluid-build-tasks-eslint", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { let json: PackageJson; try { json = JSON.parse(readFile(file)) as PackageJson; @@ -738,7 +817,11 @@ export const handlers: Handler[] = [ return; } try { - const scriptDeps = await eslintGetScriptDependencies(path.dirname(file), root, json); + const scriptDeps = await eslintGetScriptDependencies( + path.dirname(file), + root, + json, + ); return checkTaskDeps(root, json, "eslint", scriptDeps); } catch (error: unknown) { return (error as Error).message; @@ -754,7 +837,11 @@ export const handlers: Handler[] = [ return; } try { - const scriptDeps = await eslintGetScriptDependencies(path.dirname(file), root, json); + const scriptDeps = await eslintGetScriptDependencies( + path.dirname(file), + root, + json, + ); patchTaskDeps(root, json, "eslint", scriptDeps); } catch (error: unknown) { result = { resolved: false, message: (error as Error).message }; @@ -771,7 +858,10 @@ export const handlers: Handler[] = [ */ name: "tsc-project-single-use", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { const projectMap = new Map(); return buildDepsHandler( file, @@ -780,7 +870,9 @@ export const handlers: Handler[] = [ // If the project has a referenced project, depend on that instead of the default const parsedCommand = TscUtils.parseCommandLine(command); if (!parsedCommand) { - throw new Error(`Error parsing tsc command for script '${script}': ${command}`); + throw new Error( + `Error parsing tsc command for script '${script}': ${command}`, + ); } const configFile = TscUtils.findConfigFile(packageDir, parsedCommand); const previousUse = projectMap.get(configFile); @@ -797,7 +889,10 @@ export const handlers: Handler[] = [ match, handler: async (file: string, root: string) => buildDepsHandler(file, root, checkTscDependencies), - resolver: (file: string, root: string): { resolved: boolean; message?: string } => { + resolver: ( + file: string, + root: string, + ): { resolved: boolean; message?: string } => { let result: { resolved: boolean; message?: string } = { resolved: true }; updatePackageJsonFile(path.dirname(file), (json) => { if (!isFluidBuildEnabled(root, json)) { @@ -851,7 +946,9 @@ function shouldProcessScriptForTsc( return ( // This clause ensures we don't match commands that are prefixed with "tsc", like "tsc-multi". The exception // is when the whole command is "tsc". - (command.startsWith("tsc ") || command === "tsc" || command.startsWith("fluid-tsc ")) && + (command.startsWith("tsc ") || + command === "tsc" || + command.startsWith("fluid-tsc ")) && // tsc --watch tasks are long-running processes and don't need the standard task deps !command.includes("--watch") && !tasksToIgnore.has(script) diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidCase.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidCase.ts index 78b2bb2ccb6e..371b34bfd4d6 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidCase.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/fluidCase.ts @@ -22,7 +22,10 @@ export const handler: Handler = { resolver: (file: string): { resolved: boolean; message?: string } => { const content = readFile(file); const newContent = content.replace(/([a-z]) fluid ([a-z])/g, "$1 Fluid $2"); - writeFile(file, newContent.replace(/[Ff]luid framework/g, "Fluid Framework")); + writeFile( + file, + newContent.replace(/[Ff]luid framework/g, "Fluid Framework"), + ); return { resolved: true }; }, }; diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/lockfiles.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/lockfiles.ts index e24d1fdabaf9..0adf130f7ebc 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/lockfiles.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/lockfiles.ts @@ -13,7 +13,10 @@ import type { Handler } from "./common.js"; const lockFilePattern = /.*?package-lock\.json$/i; let _knownPaths: string[] | undefined; -const getKnownPaths = (config: FlubConfig, repoConfig: IFluidBuildConfig): string[] => { +const getKnownPaths = ( + config: FlubConfig, + repoConfig: IFluidBuildConfig, +): string[] => { if (_knownPaths === undefined) { // Add the root path (.) because a lockfile is expected there _knownPaths = ["."]; @@ -47,7 +50,10 @@ export const handlers: Handler[] = [ { name: "extraneous-lockfiles", match: lockFilePattern, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { const flubConfig = getFlubConfig(root); const repoConfig = getFluidBuildConfig(root); const knownPaths: string[] = getKnownPaths(flubConfig, repoConfig); @@ -61,7 +67,10 @@ export const handlers: Handler[] = [ return undefined; }, - resolver: (file: string, root: string): { resolved: boolean; message?: string } => { + resolver: ( + file: string, + root: string, + ): { resolved: boolean; message?: string } => { const flubConfig = getFlubConfig(root); const repoConfig = getFluidBuildConfig(root); const knownPaths: string[] = getKnownPaths(flubConfig, repoConfig); diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/npmPackages.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/npmPackages.ts index d1c2c3cec9ea..cc3d2dd67a2b 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/npmPackages.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/npmPackages.ts @@ -14,7 +14,10 @@ import { updatePackageJsonFile, updatePackageJsonFileAsync, } from "@fluid-tools/build-infrastructure"; -import { type PackageJson, getApiExtractorConfigFilePath } from "@fluidframework/build-tools"; +import { + type PackageJson, + getApiExtractorConfigFilePath, +} from "@fluidframework/build-tools"; import { writeJson } from "fs-extra/esm"; import JSON5 from "json5"; import replace from "replace-in-file"; @@ -183,7 +186,8 @@ export function packageMustNotBePrivate(name: string, root: string): boolean { } return ( - packageMustPublishToNPM(name, config) || packageMustPublishToInternalFeedOnly(name, config) + packageMustPublishToNPM(name, config) || + packageMustPublishToInternalFeedOnly(name, config) ); } @@ -198,13 +202,18 @@ function packageIsFluidPackage(name: string, root: string): boolean { return true; } - return packageScopeIsAllowed(name, config) || packageIsKnownUnscoped(name, config); + return ( + packageScopeIsAllowed(name, config) || packageIsKnownUnscoped(name, config) + ); } /** * Returns true if the package scope matches the . */ -function packageScopeIsAllowed(name: string, config: PackageNamePolicyConfig): boolean { +function packageScopeIsAllowed( + name: string, + config: PackageNamePolicyConfig, +): boolean { const allowedScopes = config?.allowedScopes; if (allowedScopes === undefined) { @@ -224,7 +233,10 @@ function packageScopeIsAllowed(name: string, config: PackageNamePolicyConfig): b /** * Returns true if the name matches one of the configured known unscoped package names. */ -function packageIsKnownUnscoped(name: string, config: PackageNamePolicyConfig): boolean { +function packageIsKnownUnscoped( + name: string, + config: PackageNamePolicyConfig, +): boolean { const unscopedPackages = config?.unscopedPackages; if (unscopedPackages === undefined) { @@ -293,7 +305,8 @@ export function packagePublishesToFeed( feed: Feed, ): boolean { const publishPublic = - packageMustPublishToNPM(name, config) || packageMayChooseToPublishToNPM(name, config); + packageMustPublishToNPM(name, config) || + packageMayChooseToPublishToNPM(name, config); const publishInternalBuild = publishPublic || packageMustPublishToInternalFeedOnly(name, config); @@ -310,7 +323,8 @@ export function packagePublishesToFeed( case "internal-dev": { return ( - !publishInternalBuild && packageMayChooseToPublishToInternalFeedOnly(name, config) + !publishInternalBuild && + packageMayChooseToPublishToInternalFeedOnly(name, config) ); } @@ -366,7 +380,9 @@ async function ensurePrivatePackagesComputed(): Promise> { const packageJsons = await repo.getFiles("**/package.json"); for (const filePath of packageJsons) { - const packageJson = JSON.parse(readFile(path.resolve(baseDir, filePath))) as PackageJson; + const packageJson = JSON.parse( + readFile(path.resolve(baseDir, filePath)), + ) as PackageJson; if (packageJson.private ?? false) { computedPrivatePackages.add(packageJson.name); } @@ -401,9 +417,13 @@ function parseArgs( const regexQuotedSegment = onlyDoubleQuotes ? /(?:^|(?<=(?:[^\\]|^)(?:\\\\)*))(")(.*?)(?:(?<=[^\\](?:\\\\)*)\1|$)/g : /(?:^|(?<=(?:[^\\]|^)(?:\\\\)*))(["'])(.*?)(?:(?<=[^\\](?:\\\\)*)\1|$)/g; - const regexEscapedCharacters = onlyDoubleQuotes ? /\\(["\\])/g : /\\(["'\\])/g; + const regexEscapedCharacters = onlyDoubleQuotes + ? /\\(["\\])/g + : /\\(["'\\])/g; return [...commandLine.matchAll(regexArg)].map((matches) => ({ - arg: matches[0].replace(regexQuotedSegment, "$2").replace(regexEscapedCharacters, "$1"), + arg: matches[0] + .replace(regexQuotedSegment, "$2") + .replace(regexEscapedCharacters, "$1"), original: matches[0], })); } @@ -441,7 +461,10 @@ function quoteAndEscapeArgsForUniversalCommandLine( * @param parsedArg - one result from parseArgs * @returns preferred string to use within a command script string */ -function quoteAndEscapeArgsForUniversalScriptLine({ arg, original }: ParsedArg): string { +function quoteAndEscapeArgsForUniversalScriptLine({ + arg, + original, +}: ParsedArg): string { // Check for exactly `&&` or `|`. if (arg === "&&" || arg === "|") { // Use quoting if original had any quoting. @@ -519,11 +542,11 @@ async function readConfigMainEntryPointFilePath( // mainEntryPointFilePath is relative to the config file // directory unless it is prefixed with // which is replaced with the project root directory. - const mainEntryPointFilePathWithoutProjectFolder = mainEntryPointFilePath.replace( - /^\//, - "./", - ); - if (mainEntryPointFilePathWithoutProjectFolder !== mainEntryPointFilePath) { + const mainEntryPointFilePathWithoutProjectFolder = + mainEntryPointFilePath.replace(/^\//, "./"); + if ( + mainEntryPointFilePathWithoutProjectFolder !== mainEntryPointFilePath + ) { return mainEntryPointFilePathWithoutProjectFolder; } const mainEntryPointFileAbsPath = path.join( @@ -604,18 +627,24 @@ async function getApiLintElementsMissing( const configFiles = new Map(); const devDependencies: string[] = []; const targetsImpacted = new Set(); - const missing = { scriptEntries, configFiles, devDependencies, targetsImpacted }; + const missing = { + scriptEntries, + configFiles, + devDependencies, + targetsImpacted, + }; const exportsField = packageJson.exports; if (exportsField === undefined) { return missing; } - const { mapTypesPathToExportPaths } = queryTypesResolutionPathsFromPackageExports( - packageJson, - new Map([[/\.d\.ts$/, undefined]]), - { node10TypeCompat: false, onlyFirstMatches: false }, - ); + const { mapTypesPathToExportPaths } = + queryTypesResolutionPathsFromPackageExports( + packageJson, + new Map([[/\.d\.ts$/, undefined]]), + { node10TypeCompat: false, onlyFirstMatches: false }, + ); const needsLinted = new Map(); let internalLintTarget: string | undefined; @@ -692,7 +721,8 @@ async function getApiLintElementsMissing( { const bundleLintTarget = internalLintTarget ?? rootLintTarget; if (bundleLintTarget !== undefined) { - const lintBundleTags = packageJson.scripts?.["check:exports:bundle-release-tags"]; + const lintBundleTags = + packageJson.scripts?.["check:exports:bundle-release-tags"]; const apiExtractorFile = "api-extractor/api-extractor-lint-bundle.json"; const commandLine = `api-extractor run --config ${apiExtractorFile}`; if (lintBundleTags !== commandLine) { @@ -707,7 +737,10 @@ async function getApiLintElementsMissing( // or any target appropriate for cross group consistency checks. "*|" is used // as a sentinel to allow any target, but also encodes a default file when // fixing is invoked. - configFiles.set(configFileAbsPath, internalLintTarget ?? `*|${rootLintTarget}`); + configFiles.set( + configFileAbsPath, + internalLintTarget ?? `*|${rootLintTarget}`, + ); } } @@ -715,7 +748,8 @@ async function getApiLintElementsMissing( await removeLintedExportsPathsAsync(packageJson, dir, needsLinted); // Form script entries and unique config file names for files without recognized coverage. - const regexPath = /^(?:\.\/)?(?:lib\/|dist\/)?(?[^/]+(?:\/[^/]+)*)\.d\.ts$/; + const regexPath = + /^(?:\.\/)?(?:lib\/|dist\/)?(?[^/]+(?:\/[^/]+)*)\.d\.ts$/; for (const [relPath, skew] of needsLinted) { const pathMatch = regexPath.exec(relPath); const scriptEntry = pathMatch?.groups?.path.replace(/\//g, ":") ?? ""; @@ -772,7 +806,10 @@ export const handlers: Handler[] = [ { name: "npm-package-metadata-and-sorting", match, - handler: async (file: string, gitRoot: string): Promise => { + handler: async ( + file: string, + gitRoot: string, + ): Promise => { let json: PackageJson; try { json = JSON.parse(readFile(file)) as PackageJson; @@ -801,17 +838,24 @@ export const handlers: Handler[] = [ ret.push(`repository should be an object, not a string`); } else { if (json.repository?.url !== repository) { - ret.push(`repository.url: "${json.repository.url}" !== "${repository}"`); + ret.push( + `repository.url: "${json.repository.url}" !== "${repository}"`, + ); } - const relativePkgDir = path.dirname(path.relative(gitRoot, file)).replace(/\\/g, "/"); + const relativePkgDir = path + .dirname(path.relative(gitRoot, file)) + .replace(/\\/g, "/"); // The directory field should be omitted from the root package, so consider this a policy failure. if (relativePkgDir === "." && json.repository.directory !== undefined) { ret.push( `repository.directory: "${json.repository.directory}" field is present but should be omitted from root package`, ); - } else if (relativePkgDir !== "." && json.repository?.directory !== relativePkgDir) { + } else if ( + relativePkgDir !== "." && + json.repository?.directory !== relativePkgDir + ) { ret.push( `repository.directory: "${json.repository.directory}" !== "${relativePkgDir}"`, ); @@ -842,7 +886,9 @@ export const handlers: Handler[] = [ json.license = licenseId; // file is absolute path, so make relative to the repo root - const relativePkgDir = path.dirname(path.relative(gitRoot, file)).replace(/\\/g, "/"); + const relativePkgDir = path + .dirname(path.relative(gitRoot, file)) + .replace(/\\/g, "/"); json.repository = // The directory field should be omitted from the root package. relativePkgDir === "." @@ -867,7 +913,10 @@ export const handlers: Handler[] = [ // If you'd like to introduce a new package scope or a new unscoped package, please discuss it first. name: "npm-strange-package-name", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { let json: PackageJson; try { json = JSON.parse(readFile(file)) as PackageJson; @@ -890,7 +939,10 @@ export const handlers: Handler[] = [ // Also verify that non-private packages don't take dependencies on private packages. name: "npm-private-packages", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { let json: PackageJson; try { json = JSON.parse(readFile(file)) as PackageJson; @@ -912,7 +964,10 @@ export const handlers: Handler[] = [ } const deps = Object.keys(json.dependencies ?? {}); - if (json.private !== true && deps.some((name) => privatePackages.has(name))) { + if ( + json.private !== true && + deps.some((name) => privatePackages.has(name)) + ) { errors.push( `Non-private package must not depend on the private package(s): ${deps .filter((name) => privatePackages.has(name)) @@ -951,7 +1006,10 @@ export const handlers: Handler[] = [ } } - if (fs.existsSync(path.join(packageDir, "Dockerfile")) && !readmeInfo.trademark) { + if ( + fs.existsSync(path.join(packageDir, "Dockerfile")) && + !readmeInfo.trademark + ) { return `Readme in package directory ${packageDir} with Dockerfile should contain with trademark verbiage`; } }, @@ -967,10 +1025,15 @@ export const handlers: Handler[] = [ const packageDir = path.dirname(file); const readmeInfo: IReadmeInfo = getReadmeInfo(packageDir); const expectedTitle = `# ${json.name}`; - const expectTrademark = fs.existsSync(path.join(packageDir, "Dockerfile")); + const expectTrademark = fs.existsSync( + path.join(packageDir, "Dockerfile"), + ); if (!readmeInfo.exists) { if (expectTrademark) { - writeFile(readmeInfo.filePath, `${expectedTitle}${newline}${newline}${trademark}`); + writeFile( + readmeInfo.filePath, + `${expectedTitle}${newline}${newline}${trademark}`, + ); } else { writeFile(readmeInfo.filePath, `${expectedTitle}${newline}`); } @@ -1028,7 +1091,10 @@ export const handlers: Handler[] = [ { name: "npm-package-license", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { let json: PackageJson; try { json = JSON.parse(readFile(file)) as PackageJson; @@ -1056,7 +1122,10 @@ export const handlers: Handler[] = [ return `LICENSE file in ${packageDir} doesn't match ${rootLicensePath}`; } }, - resolver: (file: string, root: string): { resolved: boolean; message?: string } => { + resolver: ( + file: string, + root: string, + ): { resolved: boolean; message?: string } => { const packageDir = path.dirname(file); const licensePath = path.join(packageDir, "LICENSE"); const rootLicensePath = path.join(root, "LICENSE"); @@ -1083,7 +1152,10 @@ export const handlers: Handler[] = [ return `Error parsing JSON file: ${file}`; } - const hasScriptsField = Object.prototype.hasOwnProperty.call(json, "scripts"); + const hasScriptsField = Object.prototype.hasOwnProperty.call( + json, + "scripts", + ); const missingScripts: string[] = []; if (hasScriptsField) { @@ -1095,11 +1167,17 @@ export const handlers: Handler[] = [ json.scripts, "prettier:fix", ); - const hasFormatScript = Object.prototype.hasOwnProperty.call(json.scripts, "format"); + const hasFormatScript = Object.prototype.hasOwnProperty.call( + json.scripts, + "format", + ); const isLernaFormat = json.scripts.format?.includes("lerna"); // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - if (!isLernaFormat && (hasPrettierScript || hasPrettierFixScript || hasFormatScript)) { + if ( + !isLernaFormat && + (hasPrettierScript || hasPrettierFixScript || hasFormatScript) + ) { if (!hasPrettierScript) { missingScripts.push(`prettier`); } @@ -1120,7 +1198,10 @@ export const handlers: Handler[] = [ }, resolver: (file: string): { resolved: boolean; message?: string } => { updatePackageJsonFile(path.dirname(file), (json) => { - const hasScriptsField = Object.prototype.hasOwnProperty.call(json, "scripts"); + const hasScriptsField = Object.prototype.hasOwnProperty.call( + json, + "scripts", + ); if (hasScriptsField) { const hasFormatScriptResolver = Object.prototype.hasOwnProperty.call( @@ -1128,15 +1209,11 @@ export const handlers: Handler[] = [ "format", ); - const hasPrettierScriptResolver = Object.prototype.hasOwnProperty.call( - json.scripts, - "prettier", - ); + const hasPrettierScriptResolver = + Object.prototype.hasOwnProperty.call(json.scripts, "prettier"); - const hasPrettierFixScriptResolver = Object.prototype.hasOwnProperty.call( - json.scripts, - "prettier:fix", - ); + const hasPrettierFixScriptResolver = + Object.prototype.hasOwnProperty.call(json.scripts, "prettier:fix"); if ( hasFormatScriptResolver || @@ -1144,7 +1221,8 @@ export const handlers: Handler[] = [ hasPrettierFixScriptResolver ) { const formatScript = json.scripts?.format?.includes("lerna"); - const prettierScript = json.scripts?.prettier?.includes("--ignore-path"); + const prettierScript = + json.scripts?.prettier?.includes("--ignore-path"); const prettierFixScript = json.scripts?.["prettier:fix"]?.includes("--ignore-path"); // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions @@ -1178,12 +1256,21 @@ export const handlers: Handler[] = [ return `Error parsing JSON file: ${file}`; } - const hasScriptsField = Object.prototype.hasOwnProperty.call(json, "scripts"); + const hasScriptsField = Object.prototype.hasOwnProperty.call( + json, + "scripts", + ); const missingScripts: string[] = []; if (hasScriptsField) { - const hasBuildScript = Object.prototype.hasOwnProperty.call(json.scripts, "build"); - const hasCleanScript = Object.prototype.hasOwnProperty.call(json.scripts, "clean"); + const hasBuildScript = Object.prototype.hasOwnProperty.call( + json.scripts, + "build", + ); + const hasCleanScript = Object.prototype.hasOwnProperty.call( + json.scripts, + "clean", + ); if (hasBuildScript && !hasCleanScript) { missingScripts.push(`clean`); @@ -1198,7 +1285,10 @@ export const handlers: Handler[] = [ { name: "npm-package-json-script-dep", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { const manifest = getFlubConfig(root); const commandPackages = manifest.policy?.dependencies?.commandPackages; if (commandPackages === undefined) { @@ -1213,7 +1303,10 @@ export const handlers: Handler[] = [ return `Error parsing JSON file: ${file}`; } - const hasScriptsField = Object.prototype.hasOwnProperty.call(json, "scripts"); + const hasScriptsField = Object.prototype.hasOwnProperty.call( + json, + "scripts", + ); const missingDeps: string[] = []; if (hasScriptsField) { @@ -1245,7 +1338,9 @@ export const handlers: Handler[] = [ dep && !deps.has(dep) ) { - missingDeps.push(`Package '${dep}' missing needed by command '${command}'`); + missingDeps.push( + `Package '${dep}' missing needed by command '${command}'`, + ); } } } @@ -1269,7 +1364,10 @@ export const handlers: Handler[] = [ return `Error parsing JSON file: ${file}`; } - const hasScriptsField = Object.prototype.hasOwnProperty.call(json, "scripts"); + const hasScriptsField = Object.prototype.hasOwnProperty.call( + json, + "scripts", + ); if (!hasScriptsField) { return undefined; } @@ -1289,9 +1387,13 @@ export const handlers: Handler[] = [ : undefined; }, resolver: (file: string): { resolved: boolean; message?: string } => { - const result: { resolved: boolean; message?: string } = { resolved: true }; + const result: { resolved: boolean; message?: string } = { + resolved: true, + }; updatePackageJsonFile(path.dirname(file), (json) => { - for (const [scriptName, scriptContent] of Object.entries(json.scripts)) { + for (const [scriptName, scriptContent] of Object.entries( + json.scripts, + )) { // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (scriptContent) { json.scripts[scriptName] = getPreferredScriptLine(scriptContent); @@ -1332,7 +1434,9 @@ export const handlers: Handler[] = [ const info = fs.readdirSync(testDir, { withFileTypes: true }); if ( info.some( - (e) => path.extname(e.name) === ".ts" || (e.isDirectory() && e.name !== "types"), + (e) => + path.extname(e.name) === ".ts" || + (e.isDirectory() && e.name !== "types"), ) ) { return "Test files exists but no test scripts"; @@ -1415,7 +1519,8 @@ export const handlers: Handler[] = [ if (scripts === undefined) { return undefined; } - const mochaScriptName = scripts["test:mocha"] === undefined ? "test" : "test:mocha"; + const mochaScriptName = + scripts["test:mocha"] === undefined ? "test" : "test:mocha"; const mochaScript = scripts[mochaScriptName]; // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Existing logic is easier to read @@ -1425,7 +1530,12 @@ export const handlers: Handler[] = [ } const packageDir = path.dirname(file); - const mochaRcNames = [".mocharc", ".mocharc.js", ".mocharc.json", ".mocharc.cjs"]; + const mochaRcNames = [ + ".mocharc", + ".mocharc.js", + ".mocharc.json", + ".mocharc.cjs", + ]; const mochaRcName = mochaRcNames.find((name) => fs.existsSync(path.join(packageDir, name)), ); @@ -1453,7 +1563,8 @@ export const handlers: Handler[] = [ if (scripts === undefined) { return undefined; } - const jestScriptName = scripts["test:jest"] === undefined ? "test" : "test:jest"; + const jestScriptName = + scripts["test:jest"] === undefined ? "test" : "test:jest"; const jestScript = scripts[jestScriptName]; // eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- Existing logic is easier to read @@ -1472,7 +1583,9 @@ export const handlers: Handler[] = [ const jestConfigFile = path.join(packageDir, jestFileName); // This assumes that the jest config will be in CommonJS, because if it's ESM the require call will fail. - const config = require(path.resolve(jestConfigFile)) as { reporters?: unknown }; + const config = require(path.resolve(jestConfigFile)) as { + reporters?: unknown; + }; if (config.reporters === undefined) { return `Missing reporters in '${jestConfigFile}'`; } @@ -1488,7 +1601,9 @@ export const handlers: Handler[] = [ ], ]; - if (JSON.stringify(config.reporters) !== JSON.stringify(expectedReporter)) { + if ( + JSON.stringify(config.reporters) !== JSON.stringify(expectedReporter) + ) { return `Unexpected reporters in '${jestConfigFile}'`; } @@ -1523,7 +1638,9 @@ export const handlers: Handler[] = [ // that it has a ESM build. // Newer packages may be ESM only and just use tsc to build ESM, which isn't detected. const esnextScriptsNames = ["build:esnext", "tsc:esnext"]; - const hasBuildEsNext = esnextScriptsNames.some((name) => scripts[name] !== undefined); + const hasBuildEsNext = esnextScriptsNames.some( + (name) => scripts[name] !== undefined, + ); const hasModuleOutput = json.module !== undefined; if (hasBuildEsNext) { @@ -1559,7 +1676,10 @@ export const handlers: Handler[] = [ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (cleanScript) { // Ignore clean scripts that are root of the release group - if (cleanScript.startsWith("pnpm") || cleanScript.startsWith("fluid-build")) { + if ( + cleanScript.startsWith("pnpm") || + cleanScript.startsWith("fluid-build") + ) { return undefined; } @@ -1583,7 +1703,9 @@ export const handlers: Handler[] = [ } }, resolver: (file: string): { resolved: boolean; message?: string } => { - const result: { resolved: boolean; message?: string } = { resolved: true }; + const result: { resolved: boolean; message?: string } = { + resolved: true, + }; updatePackageJsonFile(path.dirname(file), (json) => { const missing = missingCleanDirectories(json.scripts); let clean: string = json.scripts.clean ?? "rimraf --glob"; @@ -1720,7 +1842,9 @@ export const handlers: Handler[] = [ } }, resolver: (file: string): { resolved: boolean; message?: string } => { - const result: { resolved: boolean; message?: string } = { resolved: true }; + const result: { resolved: boolean; message?: string } = { + resolved: true, + }; updatePackageJsonFile(path.dirname(file), (json) => { if (shouldCheckExportsField(json)) { try { @@ -1769,17 +1893,25 @@ export const handlers: Handler[] = [ file: string, root: string, ): Promise<{ resolved: boolean; message?: string }> => { - const result: { resolved: boolean; message?: string } = { resolved: true }; + const result: { resolved: boolean; message?: string } = { + resolved: true, + }; const dir = path.dirname(file); const pathToRoot = path.relative(dir, root); // is used in path to allow config file to be located anywhere // within project (projectFolder = package.json directory). const commonApiLintConfig = `/${path - .join(pathToRoot, "common/build/build-common/api-extractor-lint.entrypoint.json") + .join( + pathToRoot, + "common/build/build-common/api-extractor-lint.entrypoint.json", + ) .replaceAll("\\", "/")}`; await updatePackageJsonFileAsync(dir, async (packageJson) => { try { - const missingElements = await getApiLintElementsMissing(packageJson, dir); + const missingElements = await getApiLintElementsMissing( + packageJson, + dir, + ); // 1. Fix config files. // Config files are written first before any scripts are updated that // would reference them. In case of failure, the package.json is not @@ -1867,7 +1999,8 @@ export const handlers: Handler[] = [ return; } - const requirements = getFlubConfig(rootDirectoryPath).policy?.publicPackageRequirements; + const requirements = + getFlubConfig(rootDirectoryPath).policy?.publicPackageRequirements; if (requirements === undefined) { // If no requirements have been specified, we have nothing to validate. return; @@ -1907,75 +2040,85 @@ export const handlers: Handler[] = [ } if (errors.length > 0) { - return [`Policy violations for public package "${packageJson.name}":`, ...errors].join( - `${newline}* `, - ); + return [ + `Policy violations for public package "${packageJson.name}":`, + ...errors, + ].join(`${newline}* `); } }, resolver: ( packageJsonFilePath: string, rootDirectoryPath: string, ): { resolved: boolean; message?: string } => { - const result: { resolved: boolean; message?: string } = { resolved: true }; - updatePackageJsonFile(path.dirname(packageJsonFilePath), (packageJson) => { - // If the package is private, there is nothing to fix. - if (packageJson.private === true) { - return result; - } - - const requirements = - getFlubConfig(rootDirectoryPath).policy?.publicPackageRequirements; - if (requirements === undefined) { - // If no requirements have been specified, we have nothing to validate. - return; - } + const result: { resolved: boolean; message?: string } = { + resolved: true, + }; + updatePackageJsonFile( + path.dirname(packageJsonFilePath), + (packageJson) => { + // If the package is private, there is nothing to fix. + if (packageJson.private === true) { + return result; + } - /** - * Updates the package.json contents to ensure the requirements of the specified script are met. - */ - function applyScriptCorrection(script: ScriptRequirement): void { - // If the script is missing, or if it exists but its body doesn't satisfy the requirement, - // apply the correct script configuration. - if ( - packageJson.scripts[script.name] === undefined || - script.bodyMustMatch === true - ) { - packageJson.scripts[script.name] = script.body; + const requirements = + getFlubConfig(rootDirectoryPath).policy?.publicPackageRequirements; + if (requirements === undefined) { + // If no requirements have been specified, we have nothing to validate. + return; } - } - if (requirements.requiredScripts !== undefined) { - // Ensure scripts body exists - if (packageJson.scripts === undefined) { - packageJson.scripts = {}; + /** + * Updates the package.json contents to ensure the requirements of the specified script are met. + */ + function applyScriptCorrection(script: ScriptRequirement): void { + // If the script is missing, or if it exists but its body doesn't satisfy the requirement, + // apply the correct script configuration. + if ( + packageJson.scripts[script.name] === undefined || + script.bodyMustMatch === true + ) { + packageJson.scripts[script.name] = script.body; + } } - // Applies script corrections as needed for all script requirements - // eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference - requirements.requiredScripts.forEach(applyScriptCorrection); - } + if (requirements.requiredScripts !== undefined) { + // Ensure scripts body exists + if (packageJson.scripts === undefined) { + packageJson.scripts = {}; + } - // If there are any missing required dev dependencies, report that the issues were not resolved (and - // the dependencies need to be added manually). - // TODO: In the future, we could consider having this code actually run the pnpm commands to install - // the missing deps. - if (requirements.requiredDevDependencies !== undefined) { - const devDependencies = Object.keys(packageJson.devDependencies ?? {}); - for (const requiredDevDependency of requirements.requiredDevDependencies) { - if (!devDependencies.includes(requiredDevDependency)) { - result.resolved = false; - break; + // Applies script corrections as needed for all script requirements + // eslint-disable-next-line unicorn/no-array-for-each, unicorn/no-array-callback-reference + requirements.requiredScripts.forEach(applyScriptCorrection); + } + + // If there are any missing required dev dependencies, report that the issues were not resolved (and + // the dependencies need to be added manually). + // TODO: In the future, we could consider having this code actually run the pnpm commands to install + // the missing deps. + if (requirements.requiredDevDependencies !== undefined) { + const devDependencies = Object.keys( + packageJson.devDependencies ?? {}, + ); + for (const requiredDevDependency of requirements.requiredDevDependencies) { + if (!devDependencies.includes(requiredDevDependency)) { + result.resolved = false; + break; + } } } - } - }); + }, + ); return result; }, }, ]; -function missingCleanDirectories(scripts: { [key: string]: string | undefined }): string[] { +function missingCleanDirectories(scripts: { + [key: string]: string | undefined; +}): string[] { const expectedClean: string[] = []; if (scripts.tsc !== undefined) { @@ -1985,7 +2128,9 @@ function missingCleanDirectories(scripts: { [key: string]: string | undefined }) // Using the heuristic that our package use "build:esnext" or "tsc:esnext" to indicate // that it has a ESM build. const esnextScriptsNames = ["build:esnext", "tsc:esnext"]; - const hasBuildEsNext = esnextScriptsNames.some((name) => scripts[name] !== undefined); + const hasBuildEsNext = esnextScriptsNames.some( + (name) => scripts[name] !== undefined, + ); if (hasBuildEsNext) { expectedClean.push("lib"); } diff --git a/build-tools/packages/build-cli/src/library/repoPolicyCheck/pnpm.ts b/build-tools/packages/build-cli/src/library/repoPolicyCheck/pnpm.ts index be673b610ece..f35ab6dedbd2 100644 --- a/build-tools/packages/build-cli/src/library/repoPolicyCheck/pnpm.ts +++ b/build-tools/packages/build-cli/src/library/repoPolicyCheck/pnpm.ts @@ -15,7 +15,10 @@ export const handlers: Handler[] = [ // A workspace that uses pnpm must also have a preinstall script that tells the user to use pnpm. name: "pnpm-npm-package-json-preinstall", match, - handler: async (file: string, root: string): Promise => { + handler: async ( + file: string, + root: string, + ): Promise => { const dirname = path.dirname(file); const packageJsonFile = path.join(dirname, "package.json"); const manifest = getFlubConfig(root); @@ -36,7 +39,9 @@ export const handlers: Handler[] = [ const script: string | undefined = json.scripts?.preinstall; // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions if (script) { - const matchResult = script.match(/^node ((?:\.\.\/)*)scripts\/only-pnpm.cjs/); + const matchResult = script.match( + /^node ((?:\.\.\/)*)scripts\/only-pnpm.cjs/, + ); if (matchResult) { const onlyPnpmPath = path.join( dirname, diff --git a/build-tools/packages/build-cli/src/library/typescriptApi.ts b/build-tools/packages/build-cli/src/library/typescriptApi.ts index 81a747f1237d..8dc0b4d49824 100644 --- a/build-tools/packages/build-cli/src/library/typescriptApi.ts +++ b/build-tools/packages/build-cli/src/library/typescriptApi.ts @@ -3,7 +3,12 @@ * Licensed under the MIT License. */ -import type { ExportDeclaration, ExportedDeclarations, JSDoc, SourceFile } from "ts-morph"; +import type { + ExportDeclaration, + ExportedDeclarations, + JSDoc, + SourceFile, +} from "ts-morph"; import { Node, SyntaxKind } from "ts-morph"; import type { ApiLevel } from "./apiLevel.js"; @@ -28,7 +33,10 @@ interface ExportRecords { * ExportedDeclarations provides context for the origin of * such cases. */ - unknown: Map; + unknown: Map< + string, + { exportedDecl: ExportedDeclarations; exportDecl?: ExportDeclaration } + >; } /** @@ -64,7 +72,9 @@ interface ApiSupportLevelInfo { /** * Searches the given JSDocs for known release tags and returns the appropriate {@link ApiSupportLevelInfo | support details} (if any). */ -function getSupportInfoFromDocs(jsdocs: JSDoc[]): ApiSupportLevelInfo | undefined { +function getSupportInfoFromDocs( + jsdocs: JSDoc[], +): ApiSupportLevelInfo | undefined { let releaseLevel: ReleaseLevel | undefined; let isLegacy = false; for (const jsdoc of jsdocs) { @@ -83,7 +93,9 @@ function getSupportInfoFromDocs(jsdocs: JSDoc[]): ApiSupportLevelInfo | undefine } } } - return releaseLevel === undefined ? undefined : { releaseLevel: releaseLevel, isLegacy }; + return releaseLevel === undefined + ? undefined + : { releaseLevel: releaseLevel, isLegacy }; } /** @@ -125,7 +137,9 @@ function getApiLevelFromTags(tags: ApiSupportLevelInfo): ApiLevel { } case "internal": { if (isLegacy) { - throw new Error("@legacy + @internal is not supported. Use @internal only."); + throw new Error( + "@legacy + @internal is not supported. Use @internal only.", + ); } return "internal"; } @@ -231,7 +245,10 @@ export function getApiExports(sourceFile: SourceFile): ExportRecords { if (namespaceLevel === undefined) { unknownExported.exportDecl = exportDeclaration; } else { - records[namespaceLevel].push({ name, isTypeOnly: exportDeclaration.isTypeOnly() }); + records[namespaceLevel].push({ + name, + isTypeOnly: exportDeclaration.isTypeOnly(), + }); records.unknown.delete(name); if (records.unknown.size === 0) { return records; @@ -261,7 +278,8 @@ export function getApiExports(sourceFile: SourceFile): ExportRecords { } else { records[exportLevel].push({ name, - isTypeOnly: exportDeclaration.isTypeOnly() || exportSpecifier.isTypeOnly(), + isTypeOnly: + exportDeclaration.isTypeOnly() || exportSpecifier.isTypeOnly(), }); records.unknown.delete(name); if (records.unknown.size === 0) { diff --git a/build-tools/packages/build-cli/src/test/commands/generate/buildVersion.test.ts b/build-tools/packages/build-cli/src/test/commands/generate/buildVersion.test.ts index 816c393d12f2..e3756312c977 100644 --- a/build-tools/packages/build-cli/src/test/commands/generate/buildVersion.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/generate/buildVersion.test.ts @@ -42,7 +42,11 @@ const test_tags = [ * @param testValue - the value to test against * @returns An assertion that will fail if the line doesn't match the value and pass if it does. */ -function stdoutLineEquals(stdout: string, lineIndex: number, testValue: string): void { +function stdoutLineEquals( + stdout: string, + lineIndex: number, + testValue: string, +): void { const lines = stdout.split(EOL); if (lineIndex > lines.length) { console.error(lines); @@ -541,7 +545,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "2.0.0-rc.7.0.0", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "2.0.0-rc.7.0.0", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -563,7 +573,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "3.0.0", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "3.0.0", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -585,7 +601,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "3.0.0", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "3.0.0", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -607,7 +629,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "3.0.0", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "3.0.0", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -629,7 +657,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "2.1.2", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "2.1.2", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -651,7 +685,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "2.0.2", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "2.0.2", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -673,7 +713,13 @@ describe("generate:buildVersion", () => { ); const { stdout } = await runCommand( - ["generate:buildVersion", "--fileVersion", "2.2.0", "--tags", ...test_tags], + [ + "generate:buildVersion", + "--fileVersion", + "2.2.0", + "--tags", + ...test_tags, + ], { root: import.meta.url, }, @@ -706,9 +752,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0-88879-alpha-types"); stdoutLineEquals(stdout, 2, "isLatest=false"); }); @@ -722,9 +771,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0-88879-beta-types"); stdoutLineEquals(stdout, 2, "isLatest=false"); }); @@ -738,9 +790,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0-88879"); stdoutLineEquals(stdout, 2, "isLatest=false"); }); @@ -754,9 +809,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0-88879"); stdoutLineEquals(stdout, 2, "isLatest=false"); }); @@ -770,9 +828,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0-88879"); stdoutLineEquals(stdout, 2, "isLatest=false"); }); @@ -787,9 +848,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0"); }); @@ -803,9 +867,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 0, "version=0.4.0"); }); @@ -819,9 +886,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 2, "version=0.0.0-88879-test-alpha-types"); stdoutLineEquals(stdout, 4, "isLatest=false"); }); @@ -836,9 +906,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 2, "version=0.0.0-88879-test-beta-types"); stdoutLineEquals(stdout, 4, "isLatest=false"); }); @@ -853,9 +926,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 2, "version=0.0.0-88879-test"); stdoutLineEquals(stdout, 4, "isLatest=false"); }); @@ -870,9 +946,12 @@ describe("generate:buildVersion for alpha/beta", () => { { clear: true }, ); - const { stdout } = await runCommand(["generate:buildVersion", "--fileVersion", "0.4.0"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["generate:buildVersion", "--fileVersion", "0.4.0"], + { + root: import.meta.url, + }, + ); stdoutLineEquals(stdout, 2, "version=0.0.0-88879-test"); stdoutLineEquals(stdout, 4, "isLatest=false"); }); diff --git a/build-tools/packages/build-cli/src/test/commands/generate/typetests.test.ts b/build-tools/packages/build-cli/src/test/commands/generate/typetests.test.ts index 0c04c40c3b33..c82b85d83690 100644 --- a/build-tools/packages/build-cli/src/test/commands/generate/typetests.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/generate/typetests.test.ts @@ -25,7 +25,10 @@ describe("generate:typetests", () => { }; /* eslint-enable @typescript-eslint/explicit-function-return-type */ - function forCompare(data: Map, includeTypeOf?: true): unknown[] { + function forCompare( + data: Map, + includeTypeOf?: true, + ): unknown[] { return [...data.entries()].map(([k, v]) => ({ name: k, import: v.name, @@ -36,7 +39,9 @@ describe("generate:typetests", () => { // Test a file which looks like a rollup: a file that reexports content from other files. it("rollup", () => { - const currentFile = loadTypesSourceFile("./src/test/data/exports/exports-rollup.d.ts"); + const currentFile = loadTypesSourceFile( + "./src/test/data/exports/exports-rollup.d.ts", + ); const types = forCompare(typeDataFromFile(currentFile, logger)); assert.deepEqual(types, [ @@ -60,7 +65,9 @@ describe("generate:typetests", () => { // Test a file which directly includes several kinds of exports to ensure that various export types work correctly. it("direct", () => { - const currentFile = loadTypesSourceFile("./src/test/data/exports/exports.d.ts"); + const currentFile = loadTypesSourceFile( + "./src/test/data/exports/exports.d.ts", + ); const types = forCompare(typeDataFromFile(currentFile, logger)); assert.deepEqual(types, [ @@ -93,7 +100,9 @@ describe("generate:typetests", () => { describe("generateCompatibilityTestCase", () => { it("sealed", () => { - const currentFile = loadTypesSourceFile("./src/test/data/exports/exports.d.ts"); + const currentFile = loadTypesSourceFile( + "./src/test/data/exports/exports.d.ts", + ); const typeData = typeDataFromFile(currentFile, logger); const testType = typeData.get("TypeAlias_Sealed"); assert(testType !== undefined); @@ -101,14 +110,21 @@ describe("generate:typetests", () => { const test = generateCompatibilityTestCase(testType, {}); // strip comments to simplify comparison const code = test.filter( - (line) => !(line.startsWith("/*") || line.startsWith(" *") || line.length === 0), + (line) => + !( + line.startsWith("/*") || + line.startsWith(" *") || + line.length === 0 + ), ); assert.deepEqual(code, [ "declare type current_as_old_for_TypeAlias_Sealed = requireAssignableTo, TypeOnly>", ]); }); it("input", () => { - const currentFile = loadTypesSourceFile("./src/test/data/exports/exports.d.ts"); + const currentFile = loadTypesSourceFile( + "./src/test/data/exports/exports.d.ts", + ); const typeData = typeDataFromFile(currentFile, logger); const testType = typeData.get("TypeAlias_Input"); assert(testType !== undefined); @@ -116,7 +132,12 @@ describe("generate:typetests", () => { const test = generateCompatibilityTestCase(testType, {}); // strip comments to simplify comparison const code = test.filter( - (line) => !(line.startsWith("/*") || line.startsWith(" *") || line.length === 0), + (line) => + !( + line.startsWith("/*") || + line.startsWith(" *") || + line.length === 0 + ), ); assert.deepEqual(code, [ "declare type old_as_current_for_TypeAlias_Input = requireAssignableTo, TypeOnly>", @@ -126,12 +147,19 @@ describe("generate:typetests", () => { // Test classes generate both cases correctly it("class", () => { - const currentFile = loadTypesSourceFile("./src/test/data/exports/class.d.ts"); + const currentFile = loadTypesSourceFile( + "./src/test/data/exports/class.d.ts", + ); const types = forCompare(typeDataFromFile(currentFile, logger), true); assert.deepEqual(types, [ { name: "Class_Foo", import: "Foo", tags: ["public"], typeof: false }, - { name: "ClassStatics_Foo", import: "Foo", tags: ["public"], typeof: true }, + { + name: "ClassStatics_Foo", + import: "Foo", + tags: ["public"], + typeof: true, + }, ]); }); }); diff --git a/build-tools/packages/build-cli/src/test/commands/list.test.ts b/build-tools/packages/build-cli/src/test/commands/list.test.ts index 51244770966c..3015dba206f4 100644 --- a/build-tools/packages/build-cli/src/test/commands/list.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/list.test.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import { type Package, getResolvedFluidRoot } from "@fluidframework/build-tools"; +import { + type Package, + getResolvedFluidRoot, +} from "@fluidframework/build-tools"; import { expect } from "chai"; import { describe, it } from "mocha"; diff --git a/build-tools/packages/build-cli/src/test/commands/release/fromTag.test.ts b/build-tools/packages/build-cli/src/test/commands/release/fromTag.test.ts index f629a88977d4..6e783703b1db 100644 --- a/build-tools/packages/build-cli/src/test/commands/release/fromTag.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/release/fromTag.test.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import type { ReleaseVersion, VersionBumpType } from "@fluid-tools/version-tools"; +import type { + ReleaseVersion, + VersionBumpType, +} from "@fluid-tools/version-tools"; import { runCommand } from "@oclif/test"; import { expect } from "chai"; import * as chai from "chai"; @@ -38,9 +41,12 @@ describe("flub release fromTag", () => { }; it("--json", async () => { - const { stdout } = await runCommand(["release:fromTag", "build-tools_v0.26.1", "--json"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["release:fromTag", "build-tools_v0.26.1", "--json"], + { + root: import.meta.url, + }, + ); const output: jsonOutput = JSON.parse(stdout) as jsonOutput; expect(output).to.deep.equal(expected); }); diff --git a/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts b/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts index 1ea3aea70324..303b98b7984e 100644 --- a/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/test-only-filter.test.ts @@ -19,9 +19,12 @@ interface jsonOutput { describe("flub test-only-filter", () => { it(`--all selector`, async () => { - const { stdout } = await runCommand(["test-only-filter", "--quiet", "--json", "--all"], { - root: import.meta.url, - }); + const { stdout } = await runCommand( + ["test-only-filter", "--quiet", "--json", "--all"], + { + root: import.meta.url, + }, + ); const output: jsonOutput = JSON.parse(stdout) as jsonOutput; const { selected, filtered } = output; expect(selected).to.be.ofSize(filtered.length); @@ -46,7 +49,13 @@ describe("flub test-only-filter", () => { it(`--releaseGroup selector`, async () => { const { stdout } = await runCommand( - ["test-only-filter", "--quiet", "--json", "--releaseGroup", "build-tools"], + [ + "test-only-filter", + "--quiet", + "--json", + "--releaseGroup", + "build-tools", + ], { root: import.meta.url }, ); const output: jsonOutput = JSON.parse(stdout) as jsonOutput; @@ -64,7 +73,9 @@ describe("flub test-only-filter", () => { const { filtered } = output; const names = filtered.map((p) => p.name); - expect(names).to.be.containing("@fluid-private/changelog-generator-wrapper"); + expect(names).to.be.containing( + "@fluid-private/changelog-generator-wrapper", + ); expect(names).to.be.containing("@fluid-example/example-utils"); }); @@ -77,12 +88,21 @@ describe("flub test-only-filter", () => { const { filtered } = output; const names = filtered.map((p) => p.name); - expect(names).not.to.be.containing("@fluid-private/changelog-generator-wrapper"); + expect(names).not.to.be.containing( + "@fluid-private/changelog-generator-wrapper", + ); }); it(`--scope filter`, async () => { const { stdout } = await runCommand( - ["test-only-filter", "--quiet", "--json", "--all", "--skipScope", "@fluidframework"], + [ + "test-only-filter", + "--quiet", + "--json", + "--all", + "--skipScope", + "@fluidframework", + ], { root: import.meta.url }, ); const output: jsonOutput = JSON.parse(stdout) as jsonOutput; diff --git a/build-tools/packages/build-cli/src/test/commands/typetests.test.ts b/build-tools/packages/build-cli/src/test/commands/typetests.test.ts index 94df94d9c99a..f378be24c6a2 100644 --- a/build-tools/packages/build-cli/src/test/commands/typetests.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/typetests.test.ts @@ -35,7 +35,9 @@ function packageMinimal(): PackageWithTypeTestSettings { * * @param enabled - Set this to false to return a package with disabled type tests. */ -function packageWithTypeValidation(enabled = true): PackageWithTypeTestSettings { +function packageWithTypeValidation( + enabled = true, +): PackageWithTypeTestSettings { return { ...packageMinimal(), devDependencies: { @@ -160,7 +162,9 @@ describe("typetests tests", () => { }, }; resetBrokenTests(pkgJson); - assert.deepEqual(pkgJson, { typeValidation: { broken: {}, entrypoint: "legacyAlpha" } }); + assert.deepEqual(pkgJson, { + typeValidation: { broken: {}, entrypoint: "legacyAlpha" }, + }); }); it("ignores packages with no typeValidation node", () => { diff --git a/build-tools/packages/build-cli/src/test/commands/vnext/check/latestVersions.test.ts b/build-tools/packages/build-cli/src/test/commands/vnext/check/latestVersions.test.ts index f5efd9d2123c..b9275a4a4d2c 100644 --- a/build-tools/packages/build-cli/src/test/commands/vnext/check/latestVersions.test.ts +++ b/build-tools/packages/build-cli/src/test/commands/vnext/check/latestVersions.test.ts @@ -22,7 +22,11 @@ const test_tags = ["group2_v1.0.0", "group3_v1.2.3"]; * @param testValue - the value to test against * @returns An assertion that will fail if the line doesn't match the value and pass if it does. */ -function stdoutLineEquals(stdout: string, lineIndex: number, testValue: string): void { +function stdoutLineEquals( + stdout: string, + lineIndex: number, + testValue: string, +): void { const lines = stdout.split(EOL); if (lineIndex > lines.length) { console.error(lines); diff --git a/build-tools/packages/build-cli/src/test/filter.test.ts b/build-tools/packages/build-cli/src/test/filter.test.ts index 906b97e8ce65..394b3d5b92df 100644 --- a/build-tools/packages/build-cli/src/test/filter.test.ts +++ b/build-tools/packages/build-cli/src/test/filter.test.ts @@ -5,7 +5,10 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; -import { type Package, getResolvedFluidRoot } from "@fluidframework/build-tools"; +import { + type Package, + getResolvedFluidRoot, +} from "@fluidframework/build-tools"; import { expect } from "chai"; import * as chai from "chai"; import assertArrays from "chai-arrays"; @@ -152,7 +155,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { selected } = await selectAndFilterPackages(context, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = selected.map((p) => p.name); expect(names).to.be.containingAllOf([ @@ -179,7 +186,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { selected } = await selectAndFilterPackages(context, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = selected.map((p) => p.name); expect(names).to.be.containingAllOf([ "@fluidframework/build-common", @@ -208,7 +219,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { selected } = await selectAndFilterPackages(context, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = selected.map((p) => p.name); expect(names).to.be.equalTo([ @@ -235,7 +250,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { selected } = await selectAndFilterPackages(context, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const dirs = selected.map((p) => context.repo.relativeToRepo(p.directory)); expect(selected.length).to.equal(1); @@ -288,10 +307,16 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); - expect(names).to.be.containingAllOf(["@fluid-private/changelog-generator-wrapper"]); + expect(names).to.be.containingAllOf([ + "@fluid-private/changelog-generator-wrapper", + ]); }); it("select release group, filter non-private", async () => { @@ -309,7 +334,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo([ @@ -336,7 +365,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo([ @@ -361,7 +394,11 @@ describe("selectAndFilterPackages", () => { skipScope: ["@fluid-tools", "@fluid-private"], }; - const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + context, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo([ diff --git a/build-tools/packages/build-cli/src/test/init.ts b/build-tools/packages/build-cli/src/test/init.ts index e46f0c17523f..48678e73714f 100644 --- a/build-tools/packages/build-cli/src/test/init.ts +++ b/build-tools/packages/build-cli/src/test/init.ts @@ -10,7 +10,10 @@ import { _dirname } from "./dirname.cjs"; /** * Absolute path to the test data. */ -const testDataPath = path.resolve(_dirname, "../../../build-infrastructure/src/test/data"); +const testDataPath = path.resolve( + _dirname, + "../../../build-infrastructure/src/test/data", +); /** * Absolute path to the test repo. */ diff --git a/build-tools/packages/build-cli/src/test/library/branches.test.ts b/build-tools/packages/build-cli/src/test/library/branches.test.ts index 21edfc7b0d0c..d3c7aa57c08b 100644 --- a/build-tools/packages/build-cli/src/test/library/branches.test.ts +++ b/build-tools/packages/build-cli/src/test/library/branches.test.ts @@ -36,19 +36,31 @@ describe("generateBumpVersionBranchName", () => { describe("Fluid internal versions", () => { it("patch", () => { - const actual = generateBumpVersionBranchName("client", "patch", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "patch", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_patch_2.0.0-internal.1.0.1"; assert.equal(actual, expected); }); it("minor", () => { - const actual = generateBumpVersionBranchName("client", "minor", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "minor", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_minor_2.0.0-internal.1.1.0"; assert.equal(actual, expected); }); it("major", () => { - const actual = generateBumpVersionBranchName("client", "major", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "major", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_major_2.0.0-internal.2.0.0"; assert.equal(actual, expected); }); @@ -78,19 +90,31 @@ describe("generateBumpDepsBranchName", () => { describe("Fluid internal versions", () => { it("patch", () => { - const actual = generateBumpVersionBranchName("client", "patch", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "patch", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_patch_2.0.0-internal.1.0.1"; assert.equal(actual, expected); }); it("minor", () => { - const actual = generateBumpVersionBranchName("client", "minor", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "minor", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_minor_2.0.0-internal.1.1.0"; assert.equal(actual, expected); }); it("major", () => { - const actual = generateBumpVersionBranchName("client", "major", "2.0.0-internal.1.0.0"); + const actual = generateBumpVersionBranchName( + "client", + "major", + "2.0.0-internal.1.0.0", + ); const expected = "bump_client_major_2.0.0-internal.2.0.0"; assert.equal(actual, expected); }); @@ -141,7 +165,10 @@ describe("generateReleaseBranchName", () => { }); it("Independent package with standard semver", () => { - const actual = generateReleaseBranchName("@fluidframework/build-common", "1.2.1"); + const actual = generateReleaseBranchName( + "@fluidframework/build-common", + "1.2.1", + ); const expected = "release/build-common/1.2"; assert.equal(actual, expected); }); diff --git a/build-tools/packages/build-cli/src/test/library/commands/generateEntrypoints.test.ts b/build-tools/packages/build-cli/src/test/library/commands/generateEntrypoints.test.ts index 9ddf2cf27e3c..f1b7b2005c6e 100644 --- a/build-tools/packages/build-cli/src/test/library/commands/generateEntrypoints.test.ts +++ b/build-tools/packages/build-cli/src/test/library/commands/generateEntrypoints.test.ts @@ -19,7 +19,10 @@ describe("generateEntrypoints", () => { expect(readArgValues("", optionDefaults)).to.deep.equal(optionDefaults); expect( - readArgValues("--outFileLegacyBeta legacy --outDir ./dist", optionDefaults), + readArgValues( + "--outFileLegacyBeta legacy --outDir ./dist", + optionDefaults, + ), ).to.deep.equal({ ...optionDefaults, outDir: "./dist", diff --git a/build-tools/packages/build-cli/src/test/library/package.test.ts b/build-tools/packages/build-cli/src/test/library/package.test.ts index 90f7e971cdaf..dd24af26ef44 100644 --- a/build-tools/packages/build-cli/src/test/library/package.test.ts +++ b/build-tools/packages/build-cli/src/test/library/package.test.ts @@ -101,8 +101,8 @@ const mockPackageObject: PackageJson = { version: "1.0.0", scripts: {}, devDependencies: { - "dependency1": "1.0.0", - "dependency2": "2.0.0", + dependency1: "1.0.0", + dependency2: "2.0.0", "mockPackage-previous": "1.2.3", }, }; diff --git a/build-tools/packages/build-cli/src/test/library/packageExports.test.ts b/build-tools/packages/build-cli/src/test/library/packageExports.test.ts index c9d26bcb0072..36ea268bcf77 100644 --- a/build-tools/packages/build-cli/src/test/library/packageExports.test.ts +++ b/build-tools/packages/build-cli/src/test/library/packageExports.test.ts @@ -10,7 +10,10 @@ import type { Logger, PackageJson } from "@fluidframework/build-tools"; import { assert } from "chai"; import { describe, it } from "mocha"; -import type { ExportData, Node10CompatExportData } from "../../library/packageExports.js"; +import type { + ExportData, + Node10CompatExportData, +} from "../../library/packageExports.js"; import { queryTypesResolutionPathsFromPackageExports } from "../../library/packageExports.js"; const typeOnlyExportPackage: PackageJson = { @@ -128,7 +131,10 @@ function genTestData( ): { query: Map; commonExportResults: Map; - commonNode10CompatExportResults: Map>; + commonNode10CompatExportResults: Map< + string, + Pick + >; typeOnlyExportResults: Map; doubleReferenceExportResults: Map; } { @@ -282,12 +288,13 @@ describe("library/packageExports", () => { } = genTestData(path, condition); it("finds path in common package export pattern", () => { - const { mapKeyToOutput } = queryTypesResolutionPathsFromPackageExports( - commonExportsPackage, - query, - { node10TypeCompat: false, onlyFirstMatches: true }, - logger, - ); + const { mapKeyToOutput } = + queryTypesResolutionPathsFromPackageExports( + commonExportsPackage, + query, + { node10TypeCompat: false, onlyFirstMatches: true }, + logger, + ); // Verify assert(logger.calls.length === 0, "logs nothing of interest"); @@ -295,12 +302,13 @@ describe("library/packageExports", () => { }); it("finds type only export paths", () => { - const { mapKeyToOutput } = queryTypesResolutionPathsFromPackageExports( - typeOnlyExportPackage, - query, - { node10TypeCompat: false, onlyFirstMatches: true }, - logger, - ); + const { mapKeyToOutput } = + queryTypesResolutionPathsFromPackageExports( + typeOnlyExportPackage, + query, + { node10TypeCompat: false, onlyFirstMatches: true }, + logger, + ); // Verify assert(logger.calls.length === 0, "logs nothing of interest"); @@ -308,12 +316,13 @@ describe("library/packageExports", () => { }); it("warns on double referenced export paths", () => { - const { mapKeyToOutput } = queryTypesResolutionPathsFromPackageExports( - doubleReferencingExportsPackage, - query, - { node10TypeCompat: false, onlyFirstMatches: true }, - logger, - ); + const { mapKeyToOutput } = + queryTypesResolutionPathsFromPackageExports( + doubleReferencingExportsPackage, + query, + { node10TypeCompat: false, onlyFirstMatches: true }, + logger, + ); // Verify assert(logger.calls.length === 1, "logs one warning"); diff --git a/build-tools/packages/build-cli/src/test/library/release.test.ts b/build-tools/packages/build-cli/src/test/library/release.test.ts index 69cd3e18ecca..045b4d9d1e66 100644 --- a/build-tools/packages/build-cli/src/test/library/release.test.ts +++ b/build-tools/packages/build-cli/src/test/library/release.test.ts @@ -131,13 +131,17 @@ describe("Legacy compatibility ranges", () => { if (upperBound instanceof Error) { it(`should throw error for input version '${inputVersion}' and interval '${interval}'`, () => { assert.throws( - () => getLegacyCompatRange(inputVersion, Number.parseInt(interval, 10)), + () => + getLegacyCompatRange(inputVersion, Number.parseInt(interval, 10)), Error, ); }); } else { it(`legacy compat: ${inputVersion} and compat version interval ${interval} yields ${expected}`, () => { - const range = getLegacyCompatRange(inputVersion, Number.parseInt(interval, 10)); + const range = getLegacyCompatRange( + inputVersion, + Number.parseInt(interval, 10), + ); assert.strictEqual(range, expected); }); } diff --git a/build-tools/packages/build-cli/src/test/tsconfig.json b/build-tools/packages/build-cli/src/test/tsconfig.json index d766733c0c5a..3f7e5b0b6942 100644 --- a/build-tools/packages/build-cli/src/test/tsconfig.json +++ b/build-tools/packages/build-cli/src/test/tsconfig.json @@ -6,11 +6,11 @@ "rootDir": "./", "outDir": "../../lib/test", "types": ["node", "mocha", "chai"], - "exactOptionalPropertyTypes": false, + "exactOptionalPropertyTypes": false }, "references": [ { - "path": "../..", - }, - ], + "path": "../.." + } + ] } diff --git a/build-tools/packages/build-cli/src/typeValidator/changeToNamedExports.ts b/build-tools/packages/build-cli/src/typeValidator/changeToNamedExports.ts index 497318801878..1555840edd00 100644 --- a/build-tools/packages/build-cli/src/typeValidator/changeToNamedExports.ts +++ b/build-tools/packages/build-cli/src/typeValidator/changeToNamedExports.ts @@ -43,7 +43,9 @@ async function convert_package_dir(packageDir: string): Promise { const moduleSpecifierSourceFile = exportDeclaration.getModuleSpecifierSourceFileOrThrow(); const namedExports = new Array(); - for (const [name] of moduleSpecifierSourceFile.getExportedDeclarations()) { + for (const [ + name, + ] of moduleSpecifierSourceFile.getExportedDeclarations()) { namedExports.push(name); } for (const name of namedExports.sort(case_insensitive_comp)) { diff --git a/build-tools/packages/build-cli/src/typeValidator/testGeneration.ts b/build-tools/packages/build-cli/src/typeValidator/testGeneration.ts index 3b36e098614c..24a38d0de8d2 100644 --- a/build-tools/packages/build-cli/src/typeValidator/testGeneration.ts +++ b/build-tools/packages/build-cli/src/typeValidator/testGeneration.ts @@ -20,7 +20,8 @@ export function buildTestCase( return []; } - const expectErrorString = "// @ts-expect-error compatibility expected to be broken"; + const expectErrorString = + "// @ts-expect-error compatibility expected to be broken"; const testString: string[] = []; if (!isCompatible) { diff --git a/build-tools/packages/build-cli/src/typeValidator/typeDecomposition.ts b/build-tools/packages/build-cli/src/typeValidator/typeDecomposition.ts index 51324938693a..7e891502cd94 100644 --- a/build-tools/packages/build-cli/src/typeValidator/typeDecomposition.ts +++ b/build-tools/packages/build-cli/src/typeValidator/typeDecomposition.ts @@ -101,7 +101,10 @@ export function typeToString(typeChecker: TypeChecker, type: Type): string { * @param node - The type node to decompose * @returns DecompositionResult for the type */ -export function decomposeType(checker: TypeChecker, node: Type): DecompositionResult { +export function decomposeType( + checker: TypeChecker, + node: Type, +): DecompositionResult { const result = { typeAsString: typeToString(checker, node), replacedTypes: new Set(), diff --git a/build-tools/packages/build-cli/tsconfig.json b/build-tools/packages/build-cli/tsconfig.json index f4f8685382ab..ab5057d7b15c 100644 --- a/build-tools/packages/build-cli/tsconfig.json +++ b/build-tools/packages/build-cli/tsconfig.json @@ -10,6 +10,6 @@ "noUnusedLocals": false, // Checked in lint instead so unused variables do not block compilation "target": "ES2022", "noUncheckedIndexedAccess": false, - "exactOptionalPropertyTypes": false, - }, + "exactOptionalPropertyTypes": false + } } diff --git a/build-tools/packages/build-infrastructure/api-markdown.mjs b/build-tools/packages/build-infrastructure/api-markdown.mjs index 5b7601e12826..c407ac5bf275 100644 --- a/build-tools/packages/build-infrastructure/api-markdown.mjs +++ b/build-tools/packages/build-infrastructure/api-markdown.mjs @@ -6,7 +6,10 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; -import { MarkdownRenderer, loadModel } from "@fluid-tools/api-markdown-documenter"; +import { + MarkdownRenderer, + loadModel, +} from "@fluid-tools/api-markdown-documenter"; const dirname = path.dirname(fileURLToPath(import.meta.url)); const inputDir = path.resolve(dirname, "_api-extractor-temp", "doc-models"); diff --git a/build-tools/packages/build-infrastructure/biome.jsonc b/build-tools/packages/build-infrastructure/biome.jsonc index 504f9419b45f..eb2f7cbf1d03 100644 --- a/build-tools/packages/build-infrastructure/biome.jsonc +++ b/build-tools/packages/build-infrastructure/biome.jsonc @@ -1,7 +1,7 @@ { + "root": false, "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"], "files": { - "ignore": ["src/test/data/biome/empty.jsonc"] + "includes": ["**", "!**/src/test/data/biome/empty.jsonc"] } } diff --git a/build-tools/packages/build-infrastructure/src/buildProject.ts b/build-tools/packages/build-infrastructure/src/buildProject.ts index 6690c1dedd6d..4d8f66533166 100644 --- a/build-tools/packages/build-infrastructure/src/buildProject.ts +++ b/build-tools/packages/build-infrastructure/src/buildProject.ts @@ -70,7 +70,10 @@ export class BuildProject

implements IBuildProject

{ console.warn( `The repoPackages setting is deprecated and will no longer be read in a future version. Use buildProject instead.`, ); - this._workspaces = loadWorkspacesFromLegacyConfig(config.repoPackages, this); + this._workspaces = loadWorkspacesFromLegacyConfig( + config.repoPackages, + this, + ); } } else { this._workspaces = new Map( @@ -208,7 +211,11 @@ export function loadBuildProject

( export function getAllDependencies( repo: IBuildProject, packages: IPackage[], -): { packages: IPackage[]; releaseGroups: IReleaseGroup[]; workspaces: IWorkspace[] } { +): { + packages: IPackage[]; + releaseGroups: IReleaseGroup[]; + workspaces: IWorkspace[]; +} { const dependencyPackages: Set = new Set(); const releaseGroups: Set = new Set(); const workspaces: Set = new Set(); @@ -274,9 +281,15 @@ export async function setDependencyRange

( // Update the version in packageJson if (depKind === "prod" && pkg.packageJson.dependencies !== undefined) { pkg.packageJson.dependencies[depName] = depRange; - } else if (depKind === "dev" && pkg.packageJson.devDependencies !== undefined) { + } else if ( + depKind === "dev" && + pkg.packageJson.devDependencies !== undefined + ) { pkg.packageJson.devDependencies[depName] = depRange; - } else if (depKind === "peer" && pkg.packageJson.peerDependencies !== undefined) { + } else if ( + depKind === "peer" && + pkg.packageJson.peerDependencies !== undefined + ) { pkg.packageJson.peerDependencies[depName] = depRange; } } diff --git a/build-tools/packages/build-infrastructure/src/commands/list.ts b/build-tools/packages/build-infrastructure/src/commands/list.ts index 5ed102025b8c..b811362c741e 100644 --- a/build-tools/packages/build-infrastructure/src/commands/list.ts +++ b/build-tools/packages/build-infrastructure/src/commands/list.ts @@ -18,7 +18,8 @@ export class ListCommand extends Command { static override flags = { path: Flags.directory({ - description: "Path to start searching for the Build project configuration.", + description: + "Path to start searching for the Build project configuration.", default: ".", }), full: Flags.boolean({ @@ -56,7 +57,10 @@ export class ListCommand extends Command { this.logIndent(pkgMessage, 4); } - const { releaseGroups, workspaces } = getAllDependencies(repo, releaseGroup.packages); + const { releaseGroups, workspaces } = getAllDependencies( + repo, + releaseGroup.packages, + ); if (releaseGroups.length > 0 || workspaces.length > 0) { this.log(); this.logIndent(colors.bold("Depends on:"), 3); diff --git a/build-tools/packages/build-infrastructure/src/config.ts b/build-tools/packages/build-infrastructure/src/config.ts index 4bc4ba2e36a2..2ee61899d4f9 100644 --- a/build-tools/packages/build-infrastructure/src/config.ts +++ b/build-tools/packages/build-infrastructure/src/config.ts @@ -114,7 +114,10 @@ export interface IFluidBuildDirs { /** * @deprecated Use buildProject and associated types instead. */ -export type IFluidBuildDirEntry = string | IFluidBuildDir | (string | IFluidBuildDir)[]; +export type IFluidBuildDirEntry = + | string + | IFluidBuildDir + | (string | IFluidBuildDir)[]; /** * Configures a package or release group diff --git a/build-tools/packages/build-infrastructure/src/filter.ts b/build-tools/packages/build-infrastructure/src/filter.ts index c06ef57698a9..eaeab43c8b6d 100644 --- a/build-tools/packages/build-infrastructure/src/filter.ts +++ b/build-tools/packages/build-infrastructure/src/filter.ts @@ -134,7 +134,9 @@ const selectPackagesFromRepo = async

( const git = await buildProject.getGitRepository(); const remote = await getRemote(git, buildProject.upstreamRemotePartialUrl); if (remote === undefined) { - throw new Error(`Can't find a remote with ${buildProject.upstreamRemotePartialUrl}`); + throw new Error( + `Can't find a remote with ${buildProject.upstreamRemotePartialUrl}`, + ); } const { packages } = await getChangedSinceRef( buildProject, @@ -155,7 +157,9 @@ const selectPackagesFromRepo = async

( (p) => p.directory === selectedAbsolutePath, ); if (dirPackage === undefined) { - throw new Error(`Cannot find package with directory: ${selectedAbsolutePath}`); + throw new Error( + `Cannot find package with directory: ${selectedAbsolutePath}`, + ); } selected.add(dirPackage); return selected; @@ -163,7 +167,10 @@ const selectPackagesFromRepo = async

( // Select workspace and workspace root packages for (const workspace of buildProject.workspaces.values()) { - if (selection.workspaces.length > 0 && mm.isMatch(workspace.name, selection.workspaces)) { + if ( + selection.workspaces.length > 0 && + mm.isMatch(workspace.name, selection.workspaces) + ) { addAllToSet( selected, workspace.packages.filter((p) => !p.isWorkspaceRoot), @@ -222,10 +229,13 @@ export async function selectAndFilterPackages

( filter?: PackageFilterOptions, ): Promise<{ selected: P[]; filtered: P[] }> { // Select the packages from the repo - const selected = [...(await selectPackagesFromRepo

(buildProject, selection))]; + const selected = [ + ...(await selectPackagesFromRepo

(buildProject, selection)), + ]; // Filter resulting list if needed - const filtered = filter === undefined ? selected : await filterPackages(selected, filter); + const filtered = + filter === undefined ? selected : await filterPackages(selected, filter); return { selected, filtered }; } diff --git a/build-tools/packages/build-infrastructure/src/git.ts b/build-tools/packages/build-infrastructure/src/git.ts index 4cc8faa33dcb..9ef614d66701 100644 --- a/build-tools/packages/build-infrastructure/src/git.ts +++ b/build-tools/packages/build-infrastructure/src/git.ts @@ -75,7 +75,8 @@ export async function getMergeBaseRemote( await git.fetch([remote]); } - const compareRef = remote === undefined ? branch : `refs/remotes/${remote}/${branch}`; + const compareRef = + remote === undefined ? branch : `refs/remotes/${remote}/${branch}`; const base = await git.raw("merge-base", compareRef, localRef); return base; } @@ -97,7 +98,8 @@ export async function getChangedFilesSinceRef( } // Find the merge base commit - const divergedAt = remote === undefined ? ref : await getMergeBaseRemote(git, ref, remote); + const divergedAt = + remote === undefined ? ref : await getMergeBaseRemote(git, ref, remote); // Now we can find which files have changed const changed = await git.diff([ divergedAt, @@ -173,11 +175,15 @@ export async function getChangedSinceRef

( .map((name) => buildProject.packages.get(name as PackageName)) .filter((pkg): pkg is P => pkg !== undefined); - const changedReleaseGroups = [...new Set(changedPackages.map((pkg) => pkg.releaseGroup))] + const changedReleaseGroups = [ + ...new Set(changedPackages.map((pkg) => pkg.releaseGroup)), + ] .map((rg) => buildProject.releaseGroups.get(rg)) .filter((rg): rg is IReleaseGroup => rg !== undefined); - const changedWorkspaces = [...new Set(changedReleaseGroups.map((ws) => ws.workspace))]; + const changedWorkspaces = [ + ...new Set(changedReleaseGroups.map((ws) => ws.workspace)), + ]; return { files, @@ -220,7 +226,10 @@ export async function getRemote( * @param directory - A directory to filter the results by. Only files under this directory will be returned. To * return all files in the repo use the value `"."`. */ -export async function getFiles(git: SimpleGit, directory: string): Promise { +export async function getFiles( + git: SimpleGit, + directory: string, +): Promise { // Note that `--deduplicate` is not used here because it is not available until git version 2.31.0. const results = await git.raw( "ls-files", diff --git a/build-tools/packages/build-infrastructure/src/index.ts b/build-tools/packages/build-infrastructure/src/index.ts index 590b45613b9d..b4e74e87c800 100644 --- a/build-tools/packages/build-infrastructure/src/index.ts +++ b/build-tools/packages/build-infrastructure/src/index.ts @@ -37,7 +37,10 @@ export { getChangedSinceRef, } from "./git.js"; export { PackageBase } from "./package.js"; -export { updatePackageJsonFile, updatePackageJsonFileAsync } from "./packageJsonUtils.js"; +export { + updatePackageJsonFile, + updatePackageJsonFileAsync, +} from "./packageJsonUtils.js"; export { createPackageManager } from "./packageManagers.js"; export type { AdditionalPackageProps, diff --git a/build-tools/packages/build-infrastructure/src/package.ts b/build-tools/packages/build-infrastructure/src/package.ts index b996f49d3a34..7669c8a60fd1 100644 --- a/build-tools/packages/build-infrastructure/src/package.ts +++ b/build-tools/packages/build-infrastructure/src/package.ts @@ -11,8 +11,14 @@ import fsePkg from "fs-extra"; const { readJsonSync } = fsePkg; import colors from "picocolors"; -import { type WorkspaceDefinition, findReleaseGroupForPackage } from "./config.js"; -import { readPackageJsonAndIndent, writePackageJson } from "./packageJsonUtils.js"; +import { + type WorkspaceDefinition, + findReleaseGroupForPackage, +} from "./config.js"; +import { + readPackageJsonAndIndent, + writePackageJson, +} from "./packageJsonUtils.js"; import type { AdditionalPackageProps, IPackage, @@ -65,7 +71,9 @@ export abstract class PackageBase< // eslint-disable-next-line @typescript-eslint/explicit-function-return-type private get color() { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return Package.colorFunction[this.packageId % Package.colorFunction.length]!; + return Package.colorFunction[ + this.packageId % Package.colorFunction.length + ]!; } /** @@ -109,7 +117,8 @@ export abstract class PackageBase< public isReleaseGroupRoot: boolean, additionalProperties?: TAddProps, ) { - [this._packageJson, this._indent] = readPackageJsonAndIndent(packageJsonFilePath); + [this._packageJson, this._indent] = + readPackageJsonAndIndent(packageJsonFilePath); if (additionalProperties !== undefined) { Object.assign(this, additionalProperties); } @@ -186,7 +195,9 @@ export abstract class PackageBase< * {@inheritDoc IPackage.getScript} */ public getScript(name: string): string | undefined { - return this.packageJson.scripts === undefined ? undefined : this.packageJson.scripts[name]; + return this.packageJson.scripts === undefined + ? undefined + : this.packageJson.scripts[name]; } /** @@ -199,7 +210,9 @@ export abstract class PackageBase< } if (!existsSync(path.join(this.directory, "node_modules"))) { - return [`${this.nameColored}: node_modules not installed in ${this.directory}`]; + return [ + `${this.nameColored}: node_modules not installed in ${this.directory}`, + ]; } const errors: string[] = []; @@ -274,7 +287,9 @@ class Package< workspaceDefinition.releaseGroups[releaseGroupName as string]; if (releaseGroupDefinition === undefined) { - throw new Error(`Cannot find release group definition for ${releaseGroupName}`); + throw new Error( + `Cannot find release group definition for ${releaseGroupName}`, + ); } const { rootPackageName } = releaseGroupDefinition; @@ -329,7 +344,9 @@ export function loadPackageFromWorkspaceDefinition( function* iterateDependencies( packageJson: T, ): Generator { - for (const [pkgName, version] of Object.entries(packageJson.dependencies ?? {})) { + for (const [pkgName, version] of Object.entries( + packageJson.dependencies ?? {}, + )) { const name = pkgName as PackageName; if (version === undefined) { throw new Error(`Dependency found without a version specifier: ${name}`); @@ -341,7 +358,9 @@ function* iterateDependencies( } as const; } - for (const [pkgName, version] of Object.entries(packageJson.devDependencies ?? {})) { + for (const [pkgName, version] of Object.entries( + packageJson.devDependencies ?? {}, + )) { const name = pkgName as PackageName; if (version === undefined) { throw new Error(`Dependency found without a version specifier: ${name}`); @@ -353,7 +372,9 @@ function* iterateDependencies( } as const; } - for (const [pkgName, version] of Object.entries(packageJson.devDependencies ?? {})) { + for (const [pkgName, version] of Object.entries( + packageJson.devDependencies ?? {}, + )) { const name = pkgName as PackageName; if (version === undefined) { throw new Error(`Dependency found without a version specifier: ${name}`); diff --git a/build-tools/packages/build-infrastructure/src/packageJsonUtils.ts b/build-tools/packages/build-infrastructure/src/packageJsonUtils.ts index a3e6794b22b2..0d7b57d96a59 100644 --- a/build-tools/packages/build-infrastructure/src/packageJsonUtils.ts +++ b/build-tools/packages/build-infrastructure/src/packageJsonUtils.ts @@ -64,7 +64,9 @@ export function writePackageJson( pkgJson: J, indent: string, ): void { - return writeJsonSync(packagePath, sortPackageJson(pkgJson), { spaces: indent }); + return writeJsonSync(packagePath, sortPackageJson(pkgJson), { + spaces: indent, + }); } /** @@ -79,14 +81,17 @@ export function writePackageJson( * @remarks * The package.json is always sorted using sort-package-json. */ -export async function updatePackageJsonFileAsync( +export async function updatePackageJsonFileAsync< + J extends PackageJson = PackageJson, +>( packagePath: string, packageTransformer: (json: J) => Promise, ): Promise { const resolvedPath = packagePath.endsWith("package.json") ? packagePath : path.join(packagePath, "package.json"); - const [pkgJson, indent] = await readPackageJsonAndIndentAsync(resolvedPath); + const [pkgJson, indent] = + await readPackageJsonAndIndentAsync(resolvedPath); // Transform the package.json await packageTransformer(pkgJson); @@ -98,9 +103,9 @@ export async function updatePackageJsonFileAsync( - pathToJson: string, -): Promise<[json: J, indent: string]> { +async function readPackageJsonAndIndentAsync< + J extends PackageJson = PackageJson, +>(pathToJson: string): Promise<[json: J, indent: string]> { return readFile(pathToJson, { encoding: "utf8" }).then((contents) => { const indentation = detectIndent(contents).indent || "\t"; const pkgJson: J = JSON.parse(contents) as J; diff --git a/build-tools/packages/build-infrastructure/src/packageManagers.ts b/build-tools/packages/build-infrastructure/src/packageManagers.ts index d417a611dadf..bcd84bcdc61d 100644 --- a/build-tools/packages/build-infrastructure/src/packageManagers.ts +++ b/build-tools/packages/build-infrastructure/src/packageManagers.ts @@ -42,12 +42,16 @@ export class PackageManager implements IPackageManager { const args: string[] = ["install"]; switch (this.name) { case "npm": { - args.push(updateLockfile ? "--package-lock=true" : "--package-lock=false"); + args.push( + updateLockfile ? "--package-lock=true" : "--package-lock=false", + ); return args; } case "pnpm": { - args.push(updateLockfile ? "--no-frozen-lockfile" : "--frozen-lockfile"); + args.push( + updateLockfile ? "--no-frozen-lockfile" : "--frozen-lockfile", + ); return args; } @@ -65,6 +69,8 @@ export class PackageManager implements IPackageManager { /** * Create a new package manager instance. */ -export function createPackageManager(name: PackageManagerName): IPackageManager { +export function createPackageManager( + name: PackageManagerName, +): IPackageManager { return new PackageManager(name); } diff --git a/build-tools/packages/build-infrastructure/src/releaseGroup.ts b/build-tools/packages/build-infrastructure/src/releaseGroup.ts index 4d71ea830f62..2f6603c8016f 100644 --- a/build-tools/packages/build-infrastructure/src/releaseGroup.ts +++ b/build-tools/packages/build-infrastructure/src/releaseGroup.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import { type ReleaseGroupDefinition, matchesReleaseGroupDefinition } from "./config.js"; +import { + type ReleaseGroupDefinition, + matchesReleaseGroupDefinition, +} from "./config.js"; import type { IPackage, IReleaseGroup, @@ -43,7 +46,9 @@ export class ReleaseGroup implements IReleaseGroup { this.name = name as ReleaseGroupName; this.adoPipelineUrl = releaseGroupDefinition.adoPipelineUrl; this.packages = workspace.packages - .filter((pkg) => matchesReleaseGroupDefinition(pkg, releaseGroupDefinition)) + .filter((pkg) => + matchesReleaseGroupDefinition(pkg, releaseGroupDefinition), + ) .map((pkg) => { // update the release group in the package object so we have an easy way to get from packages to release groups pkg.releaseGroup = this.name; @@ -95,7 +100,9 @@ export class ReleaseGroup implements IReleaseGroup { continue; } - const releaseGroup = buildProject.releaseGroups.get(depPackage.releaseGroup); + const releaseGroup = buildProject.releaseGroups.get( + depPackage.releaseGroup, + ); if (releaseGroup === undefined) { throw new Error( `Cannot find release group "${depPackage.releaseGroup}" in workspace "${this.workspace}"`, diff --git a/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts b/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts index 8cd2bf4851da..afebe2f58ea1 100644 --- a/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/buildProject.test.ts @@ -43,7 +43,9 @@ describe("loadBuildProject", () => { "main workspace has the wrong number of release groups", ); - const mainReleaseGroup = repo.releaseGroups.get("main" as ReleaseGroupName); + const mainReleaseGroup = repo.releaseGroups.get( + "main" as ReleaseGroupName, + ); expect(mainReleaseGroup).to.not.be.undefined; expect(mainReleaseGroup?.packages.length).to.equal( 5, @@ -64,7 +66,9 @@ describe("loadBuildProject", () => { it("releaseGroupDependencies", async () => { const repo = loadBuildProject(testRepoRoot); - const mainReleaseGroup = repo.releaseGroups.get("main" as ReleaseGroupName); + const mainReleaseGroup = repo.releaseGroups.get( + "main" as ReleaseGroupName, + ); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- test data (validated by another test) guarantees this has a value const actualDependencies = mainReleaseGroup!.releaseGroupDependencies; const names = actualDependencies.map((r) => r.name as string); @@ -99,7 +103,9 @@ describe("loadBuildProject", () => { it("releaseGroupDependencies", async () => { const repo = loadBuildProject(findGitRootSync()); - const clientReleaseGroup = repo.releaseGroups.get("client" as ReleaseGroupName); + const clientReleaseGroup = repo.releaseGroups.get( + "client" as ReleaseGroupName, + ); assert(clientReleaseGroup !== undefined); const actualDependencies = clientReleaseGroup.releaseGroupDependencies; @@ -137,7 +143,8 @@ describe("setDependencyRange", () => { const allCorrect = main.packages.every((pkg) => { const dependencies = pkg.packageJson.dependencies ?? {}; - const group2PkgDUpdated = (dependencies["@group2/pkg-d"] ?? "2.0.0") === "2.0.0"; + const group2PkgDUpdated = + (dependencies["@group2/pkg-d"] ?? "2.0.0") === "2.0.0"; return group2PkgDUpdated; }); @@ -154,11 +161,14 @@ describe("setDependencyRange", () => { const pkgbUpdated = (dependencies["pkg-b"] ?? "2.0.0") === "2.0.0"; - const pkgcUpdated = (dependencies["@private/pkg-c"] ?? "2.0.0") === "2.0.0"; + const pkgcUpdated = + (dependencies["@private/pkg-c"] ?? "2.0.0") === "2.0.0"; - const sharedUpdated = (dependencies["@shared/shared"] ?? "2.0.0") === "2.0.0"; + const sharedUpdated = + (dependencies["@shared/shared"] ?? "2.0.0") === "2.0.0"; - const pkgdUpdated = (dependencies["@group2/pkg-d"] ?? "2.0.0") === "2.0.0"; + const pkgdUpdated = + (dependencies["@group2/pkg-d"] ?? "2.0.0") === "2.0.0"; return pkgbUpdated && pkgcUpdated && sharedUpdated && pkgdUpdated; }); @@ -175,7 +185,8 @@ describe("setDependencyRange", () => { const pkgbUpdated = (dependencies["pkg-b"] ?? "2.0.0") === "2.0.0"; - const sharedUpdated = (dependencies["@shared/shared"] ?? "2.0.0") === "2.0.0"; + const sharedUpdated = + (dependencies["@shared/shared"] ?? "2.0.0") === "2.0.0"; return pkgbUpdated && sharedUpdated; }); diff --git a/build-tools/packages/build-infrastructure/src/test/data/spaces/_package.json b/build-tools/packages/build-infrastructure/src/test/data/spaces/_package.json index 330848bba227..5f46712b5d58 100644 --- a/build-tools/packages/build-infrastructure/src/test/data/spaces/_package.json +++ b/build-tools/packages/build-infrastructure/src/test/data/spaces/_package.json @@ -1,5 +1,5 @@ { - "name": "spaces-package", - "version": "1.0.0", - "private": true + "name": "spaces-package", + "version": "1.0.0", + "private": true } diff --git a/build-tools/packages/build-infrastructure/src/test/data/testRepo/.changeset/config.json b/build-tools/packages/build-infrastructure/src/test/data/testRepo/.changeset/config.json index 9012ad8fd105..a0affa5706be 100644 --- a/build-tools/packages/build-infrastructure/src/test/data/testRepo/.changeset/config.json +++ b/build-tools/packages/build-infrastructure/src/test/data/testRepo/.changeset/config.json @@ -12,20 +12,9 @@ ], "commit": false, "fixed": [ - [ - "pkg-a", - "pkg-b", - "@private/pkg-c", - "@shared/shared" - ], - [ - "@group2/pkg-d", - "@group2/pkg-e" - ], - [ - "@group3/pkg-f", - "@group3/pkg-g" - ] + ["pkg-a", "pkg-b", "@private/pkg-c", "@shared/shared"], + ["@group2/pkg-d", "@group2/pkg-e"], + ["@group3/pkg-f", "@group3/pkg-g"] ], "ignore": [], "linked": [], diff --git a/build-tools/packages/build-infrastructure/src/test/filter.test.ts b/build-tools/packages/build-infrastructure/src/test/filter.test.ts index 81fede33fce6..942ce4ac9178 100644 --- a/build-tools/packages/build-infrastructure/src/test/filter.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/filter.test.ts @@ -138,7 +138,11 @@ describe("selectAndFilterPackages", () => { const selectionOptions = AllPackagesSelectionCriteria; const filter = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filter); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filter, + ); const names = selected.map((p) => p.name).sort(); expect(names).to.be.equalTo([ @@ -185,7 +189,9 @@ describe("selectAndFilterPackages", () => { const pkg = filtered[0]!; expect(pkg.name).to.equal("other-pkg-a"); - expect(fluidRepo.relativeToRepo(pkg.directory)).to.equal("second/packages/other-pkg-a"); + expect(fluidRepo.relativeToRepo(pkg.directory)).to.equal( + "second/packages/other-pkg-a", + ); }); describe("select release group", () => { @@ -197,10 +203,19 @@ describe("selectAndFilterPackages", () => { }; const filters: PackageFilterOptions = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = selected.map((p) => p.name); - expect(names).to.be.equalTo(["pkg-a", "pkg-b", "@private/pkg-c", "@shared/shared"]); + expect(names).to.be.equalTo([ + "pkg-a", + "pkg-b", + "@private/pkg-c", + "@shared/shared", + ]); }); it("select release group root", async () => { @@ -211,7 +226,11 @@ describe("selectAndFilterPackages", () => { }; const filters: PackageFilterOptions = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const dirs = selected.map((p) => fluidRepo.relativeToRepo(p.directory)); expect(selected.length).to.equal(1); @@ -229,7 +248,11 @@ describe("selectAndFilterPackages", () => { private: true, }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.containingAllOf(["@private/pkg-c"]); @@ -246,7 +269,11 @@ describe("selectAndFilterPackages", () => { private: false, }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo(["pkg-a", "pkg-b", "@shared/shared"]); @@ -263,7 +290,11 @@ describe("selectAndFilterPackages", () => { scope: ["@shared"], }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo(["@shared/shared"]); @@ -280,7 +311,11 @@ describe("selectAndFilterPackages", () => { skipScope: ["@shared", "@private"], }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo(["pkg-a", "pkg-b"]); @@ -296,7 +331,11 @@ describe("selectAndFilterPackages", () => { }; const filters: PackageFilterOptions = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = selected.map((p) => p.name); expect(names).to.be.equalTo([ @@ -319,7 +358,11 @@ describe("selectAndFilterPackages", () => { }; const filters: PackageFilterOptions = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const dirs = selected.map((p) => fluidRepo.relativeToRepo(p.directory)); expect(selected.length).to.equal(1); @@ -334,7 +377,11 @@ describe("selectAndFilterPackages", () => { }; const filters: PackageFilterOptions = EmptyFilter; - const { selected } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { selected } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const dirs = selected.map((p) => fluidRepo.relativeToRepo(p.directory)); expect(selected.length).to.equal(1); @@ -353,7 +400,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.containingAllOf(["@private/pkg-c"]); @@ -371,7 +422,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo([ @@ -397,7 +452,11 @@ describe("selectAndFilterPackages", () => { skipScope: undefined, }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo(["@shared/shared"]); @@ -415,10 +474,19 @@ describe("selectAndFilterPackages", () => { skipScope: ["@shared", "@private", "@group3"], }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); - expect(names).to.be.equalTo(["@group2/pkg-d", "@group2/pkg-e", "pkg-a", "pkg-b"]); + expect(names).to.be.equalTo([ + "@group2/pkg-d", + "@group2/pkg-e", + "pkg-a", + "pkg-b", + ]); }); }); @@ -433,7 +501,11 @@ describe("selectAndFilterPackages", () => { releaseGroups: ["group2"], }; - const { filtered } = await selectAndFilterPackages(fluidRepo, selectionOptions, filters); + const { filtered } = await selectAndFilterPackages( + fluidRepo, + selectionOptions, + filters, + ); const names = filtered.map((p) => p.name); expect(names).to.be.equalTo([ diff --git a/build-tools/packages/build-infrastructure/src/test/git.test.ts b/build-tools/packages/build-infrastructure/src/test/git.test.ts index 4c17259265d2..7f46adb09dfc 100644 --- a/build-tools/packages/build-infrastructure/src/test/git.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/git.test.ts @@ -15,7 +15,12 @@ import { CleanOptions, simpleGit } from "simple-git"; import { loadBuildProject } from "../buildProject.js"; import { NotInGitRepository } from "../errors.js"; -import { findGitRootSync, getChangedSinceRef, getFiles, getRemote } from "../git.js"; +import { + findGitRootSync, + getChangedSinceRef, + getFiles, + getRemote, +} from "../git.js"; import type { PackageJson } from "../types.js"; import { packageRootPath, testRepoRoot } from "./init.js"; @@ -61,10 +66,15 @@ describe("getChangedSinceRef: local", () => { await git.add(newFile); // delete a file - await unlink(path.join(testRepoRoot, "packages/group3/pkg-f/src/index.mjs")); + await unlink( + path.join(testRepoRoot, "packages/group3/pkg-f/src/index.mjs"), + ); // edit a file - const pkgJson = path.join(testRepoRoot, "packages/group3/pkg-f/package.json"); + const pkgJson = path.join( + testRepoRoot, + "packages/group3/pkg-f/package.json", + ); const json = (await readJson(pkgJson)) as PackageJson; json.author = "edited field"; await writeJson(pkgJson, json); @@ -121,7 +131,10 @@ describe("getChangedSinceRef: local", () => { it("returns correct workspaces", async () => { const { workspaces } = await getChangedSinceRef(repo, "HEAD"); - expect(workspaces.map((p) => p.name)).to.be.containingAllOf(["main", "second"]); + expect(workspaces.map((p) => p.name)).to.be.containingAllOf([ + "main", + "second", + ]); expect(workspaces).to.be.ofSize(2); }); }); diff --git a/build-tools/packages/build-infrastructure/src/test/init.ts b/build-tools/packages/build-infrastructure/src/test/init.ts index c178af3d82bd..a7fc60e4c504 100644 --- a/build-tools/packages/build-infrastructure/src/test/init.ts +++ b/build-tools/packages/build-infrastructure/src/test/init.ts @@ -12,7 +12,11 @@ export const packageRootPath = path.resolve(_dirname, "../.."); /** * Absolute path to the test data. It's rooted two directories up because the tests get executed from lib/. */ -export const testDataPath = path.resolve(_dirname, packageRootPath, "src/test/data"); +export const testDataPath = path.resolve( + _dirname, + packageRootPath, + "src/test/data", +); /** * Absolute path to the test repo. diff --git a/build-tools/packages/build-infrastructure/src/test/tsconfig.json b/build-tools/packages/build-infrastructure/src/test/tsconfig.json index 9661822c0030..50e0a63f59aa 100644 --- a/build-tools/packages/build-infrastructure/src/test/tsconfig.json +++ b/build-tools/packages/build-infrastructure/src/test/tsconfig.json @@ -4,11 +4,11 @@ "compilerOptions": { "rootDir": "./", "outDir": "../../lib/test", - "types": ["node", "mocha", "chai"], + "types": ["node", "mocha", "chai"] }, "references": [ { - "path": "../..", - }, - ], + "path": "../.." + } + ] } diff --git a/build-tools/packages/build-infrastructure/src/test/versions.test.ts b/build-tools/packages/build-infrastructure/src/test/versions.test.ts index 44487d3160be..1147aa1c9dc2 100644 --- a/build-tools/packages/build-infrastructure/src/test/versions.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/versions.test.ts @@ -54,7 +54,9 @@ describe("setVersion", () => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion await setVersion(secondWorkspace.packages, semver.parse("2.2.1")!); - const allCorrect = secondWorkspace.packages.every((pkg) => pkg.version === "2.2.1"); + const allCorrect = secondWorkspace.packages.every( + (pkg) => pkg.version === "2.2.1", + ); expect(allCorrect).to.be.true; }); diff --git a/build-tools/packages/build-infrastructure/src/test/workspace.test.ts b/build-tools/packages/build-infrastructure/src/test/workspace.test.ts index bcab05229ff5..ef52101304ee 100644 --- a/build-tools/packages/build-infrastructure/src/test/workspace.test.ts +++ b/build-tools/packages/build-infrastructure/src/test/workspace.test.ts @@ -60,7 +60,10 @@ describe("workspaces", () => { describe("not installed", () => { beforeEach(async () => { try { - await rm(path.join(repo.root, "node_modules"), { recursive: true, force: true }); + await rm(path.join(repo.root, "node_modules"), { + recursive: true, + force: true, + }); } catch { // nothing } diff --git a/build-tools/packages/build-infrastructure/src/types.ts b/build-tools/packages/build-infrastructure/src/types.ts index 4d781afaf73a..b2453681b09f 100644 --- a/build-tools/packages/build-infrastructure/src/types.ts +++ b/build-tools/packages/build-infrastructure/src/types.ts @@ -4,7 +4,11 @@ */ import type { SimpleGit } from "simple-git"; -import type { Opaque, SetRequired, PackageJson as StandardPackageJson } from "type-fest"; +import type { + Opaque, + SetRequired, + PackageJson as StandardPackageJson, +} from "type-fest"; import type { BuildProjectConfig } from "./config.js"; @@ -49,7 +53,8 @@ export type AdditionalPackageProps = Record | undefined; * * @typeParam P - The type of {@link IPackage} the repo uses. This can be any type that implements {@link IPackage}. */ -export interface IBuildProject

extends Reloadable { +export interface IBuildProject

+ extends Reloadable { /** * The absolute path to the root of the IBuildProject. This is the path where the config file is located. */ diff --git a/build-tools/packages/build-infrastructure/src/workspace.ts b/build-tools/packages/build-infrastructure/src/workspace.ts index a1353ace0b04..31f7e802bda0 100644 --- a/build-tools/packages/build-infrastructure/src/workspace.ts +++ b/build-tools/packages/build-infrastructure/src/workspace.ts @@ -185,7 +185,8 @@ export class Workspace implements IWorkspace { * {@inheritDoc Installable.install} */ public async install(updateLockfile: boolean): Promise { - const commandArgs = this.packageManager.getInstallCommandWithArgs(updateLockfile); + const commandArgs = + this.packageManager.getInstallCommandWithArgs(updateLockfile); const output = await execa(this.packageManager.name, commandArgs, { cwd: this.directory, diff --git a/build-tools/packages/build-infrastructure/src/workspaceCompat.ts b/build-tools/packages/build-infrastructure/src/workspaceCompat.ts index b8271732eb44..dde178ebed7e 100644 --- a/build-tools/packages/build-infrastructure/src/workspaceCompat.ts +++ b/build-tools/packages/build-infrastructure/src/workspaceCompat.ts @@ -39,12 +39,18 @@ export function loadWorkspacesFromLegacyConfig( const loadedWorkspaces: IWorkspace[] = []; if (Array.isArray(entry)) { for (const item of entry) { - loadedWorkspaces.push(...loadWorkspacesFromLegacyConfigEntry(item, buildProject)); + loadedWorkspaces.push( + ...loadWorkspacesFromLegacyConfigEntry(item, buildProject), + ); } } else if (typeof entry === "object") { - loadedWorkspaces.push(...loadWorkspacesFromLegacyConfigEntry(entry, buildProject, name)); + loadedWorkspaces.push( + ...loadWorkspacesFromLegacyConfigEntry(entry, buildProject, name), + ); } else { - loadedWorkspaces.push(...loadWorkspacesFromLegacyConfigEntry(entry, buildProject)); + loadedWorkspaces.push( + ...loadWorkspacesFromLegacyConfigEntry(entry, buildProject), + ); } for (const ws of loadedWorkspaces) { workspaces.set(ws.name, ws); @@ -95,7 +101,12 @@ function loadWorkspacesFromLegacyConfigEntry( }; return [ - Workspace.load(workspaceName, workspaceDefinition, buildProject.root, buildProject), + Workspace.load( + workspaceName, + workspaceDefinition, + buildProject.root, + buildProject, + ), ]; } diff --git a/build-tools/packages/build-infrastructure/tsconfig.json b/build-tools/packages/build-infrastructure/tsconfig.json index 078e317ad2ad..e4f4e0939b20 100644 --- a/build-tools/packages/build-infrastructure/tsconfig.json +++ b/build-tools/packages/build-infrastructure/tsconfig.json @@ -7,6 +7,6 @@ "outDir": "./lib", "types": ["node"], "exactOptionalPropertyTypes": false, - "noUnusedLocals": false, // Checked in lint instead so unused variables do not block compilation - }, + "noUnusedLocals": false // Checked in lint instead so unused variables do not block compilation + } } diff --git a/build-tools/packages/build-tools/.eslintrc.cjs b/build-tools/packages/build-tools/.eslintrc.cjs index 295a637a45fe..a9ebe9a579b2 100644 --- a/build-tools/packages/build-tools/.eslintrc.cjs +++ b/build-tools/packages/build-tools/.eslintrc.cjs @@ -4,7 +4,11 @@ */ module.exports = { - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier", + ], plugins: ["@typescript-eslint"], parser: "@typescript-eslint/parser", parserOptions: { diff --git a/build-tools/packages/build-tools/biome.jsonc b/build-tools/packages/build-tools/biome.jsonc index 504f9419b45f..eb2f7cbf1d03 100644 --- a/build-tools/packages/build-tools/biome.jsonc +++ b/build-tools/packages/build-tools/biome.jsonc @@ -1,7 +1,7 @@ { + "root": false, "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"], "files": { - "ignore": ["src/test/data/biome/empty.jsonc"] + "includes": ["**", "!**/src/test/data/biome/empty.jsonc"] } } diff --git a/build-tools/packages/build-tools/src/common/biomeConfig.ts b/build-tools/packages/build-tools/src/common/biomeConfig.ts index 85cfbdbc4372..c799dbd381c9 100644 --- a/build-tools/packages/build-tools/src/common/biomeConfig.ts +++ b/build-tools/packages/build-tools/src/common/biomeConfig.ts @@ -40,14 +40,18 @@ async function loadRawBiomeConfig(configPath: string): Promise { * Returns an array of absolute paths to Biome config files. The paths are in the order in which they are merged by * Biome. That is, the last item in the array will be the absolute path to `configPath`. */ -export async function getAllBiomeConfigPaths(configPath: string): Promise { +export async function getAllBiomeConfigPaths( + configPath: string, +): Promise { const config = await loadRawBiomeConfig(configPath); let extendedConfigPaths: string[] = []; if (config.extends) { const pathsNested = await Promise.all( config.extends.map((configToExtend) => - getAllBiomeConfigPaths(path.join(path.dirname(configPath), configToExtend)), + getAllBiomeConfigPaths( + path.join(path.dirname(configPath), configToExtend), + ), ), ); extendedConfigPaths = pathsNested.flat(); @@ -70,7 +74,9 @@ export async function getAllBiomeConfigPaths(configPath: string): Promise { +export async function loadBiomeConfig( + configPath: string, +): Promise { const allConfigPaths = await getAllBiomeConfigPaths(configPath); return loadBiomeConfigs(allConfigPaths); } @@ -80,7 +86,9 @@ export async function loadBiomeConfig(configPath: string): Promise { +async function loadBiomeConfigs( + allConfigPaths: string[], +): Promise { const allConfigs = await Promise.all( allConfigPaths.map((pathToConfig) => loadRawBiomeConfig(pathToConfig)), ); @@ -154,7 +162,10 @@ export async function getBiomeFormattedFilesFromDirectory( let configFile: string; if ((await stat(directoryOrConfigFile)).isFile()) { configFile = directoryOrConfigFile; - directory = path.relative(gitRepo.resolvedRoot, path.dirname(directoryOrConfigFile)); + directory = path.relative( + gitRepo.resolvedRoot, + path.dirname(directoryOrConfigFile), + ); } else { configFile = await getClosestBiomeConfigPath(directoryOrConfigFile); directory = path.relative(gitRepo.resolvedRoot, directoryOrConfigFile); @@ -256,7 +267,10 @@ export class BiomeConfigReader { let configFile: string; if ((await stat(directoryOrConfigFile)).isFile()) { configFile = directoryOrConfigFile; - directory = path.relative(gitRepo.resolvedRoot, path.dirname(directoryOrConfigFile)); + directory = path.relative( + gitRepo.resolvedRoot, + path.dirname(directoryOrConfigFile), + ); } else { configFile = await getClosestBiomeConfigPath(directoryOrConfigFile); directory = path.relative(gitRepo.resolvedRoot, directoryOrConfigFile); @@ -264,7 +278,11 @@ export class BiomeConfigReader { const allConfigs = await getAllBiomeConfigPaths(configFile); const mergedConfig = await loadBiomeConfigs(allConfigs); - const files = await getBiomeFormattedFiles(mergedConfig, directory, gitRepo); + const files = await getBiomeFormattedFiles( + mergedConfig, + directory, + gitRepo, + ); return new BiomeConfigReader(configFile, allConfigs, mergedConfig, files); } } diff --git a/build-tools/packages/build-tools/src/common/biomeConfigTypes.d.ts b/build-tools/packages/build-tools/src/common/biomeConfigTypes.d.ts index 0061f19ec401..14a74deb03b6 100644 --- a/build-tools/packages/build-tools/src/common/biomeConfigTypes.d.ts +++ b/build-tools/packages/build-tools/src/common/biomeConfigTypes.d.ts @@ -34,15 +34,21 @@ export type TrailingCommas = "all" | "es5" | "none"; */ export type JsxRuntime = "transparent" | "reactClassic"; export type TrailingCommas2 = "none" | "all"; -export type RuleFixConfiguration = RulePlainConfiguration | RuleWithFixNoOptions; +export type RuleFixConfiguration = + | RulePlainConfiguration + | RuleWithFixNoOptions; export type RulePlainConfiguration = "warn" | "error" | "info" | "off"; /** * Used to identify the kind of code action emitted by a rule */ export type FixKind = "none" | "safe" | "unsafe"; export type RuleConfiguration = RulePlainConfiguration | RuleWithNoOptions; -export type ValidAriaRoleConfiguration = RulePlainConfiguration | RuleWithValidAriaRoleOptions; -export type ComplexityConfiguration = RulePlainConfiguration | RuleWithComplexityOptions; +export type ValidAriaRoleConfiguration = + | RulePlainConfiguration + | RuleWithValidAriaRoleOptions; +export type ComplexityConfiguration = + | RulePlainConfiguration + | RuleWithComplexityOptions; export type HooksConfiguration = RulePlainConfiguration | RuleWithHooksOptions; export type StableHookResult = boolean | [number, ...number[]]; export type DeprecatedHooksConfiguration = @@ -73,7 +79,12 @@ export type FilenamingConventionConfiguration = /** * Supported cases for file names. */ -export type FilenameCase = "camelCase" | "export" | "kebab-case" | "PascalCase" | "snake_case"; +export type FilenameCase = + | "camelCase" + | "export" + | "kebab-case" + | "PascalCase" + | "snake_case"; export type FilenameCases = FilenameCase[]; export type NamingConventionConfiguration = | RulePlainConfiguration @@ -81,7 +92,11 @@ export type NamingConventionConfiguration = /** * Supported cases. */ -export type Format = "camelCase" | "CONSTANT_CASE" | "PascalCase" | "snake_case"; +export type Format = + | "camelCase" + | "CONSTANT_CASE" + | "PascalCase" + | "snake_case"; export type Formats = Format[]; export type Regex = string; export type Kind = @@ -125,7 +140,12 @@ export type Kind = | "typeProperty" | "typeSetter" | "typeMethod"; -export type RestrictedModifier = "abstract" | "private" | "protected" | "readonly" | "static"; +export type RestrictedModifier = + | "abstract" + | "private" + | "protected" + | "readonly" + | "static"; export type Modifiers = RestrictedModifier[]; export type Scope = "any" | "global"; export type Overrides = OverridePattern[]; diff --git a/build-tools/packages/build-tools/src/common/gitRepo.ts b/build-tools/packages/build-tools/src/common/gitRepo.ts index 2d7345f472e5..ef9f32b8bb6e 100644 --- a/build-tools/packages/build-tools/src/common/gitRepo.ts +++ b/build-tools/packages/build-tools/src/common/gitRepo.ts @@ -43,7 +43,9 @@ export class GitRepo { } public async getShaForBranch(branch: string, remote?: string) { - const refspec = remote ? `refs/remotes/${remote}/${branch}` : `refs/heads/${branch}`; + const refspec = remote + ? `refs/remotes/${remote}/${branch}` + : `refs/heads/${branch}`; const result = await this.execNoError(`show-ref ${refspec}`); if (result) { const line = result.split(/\r?\n/)[0]; @@ -107,7 +109,10 @@ export class GitRepo { * Get the current git branch name */ public async getCurrentBranchName() { - const revParseOut = await this.exec("rev-parse --abbrev-ref HEAD", "get current branch"); + const revParseOut = await this.exec( + "rev-parse --abbrev-ref HEAD", + "get current branch", + ); return revParseOut.split(/\r?\n/)[0]; } @@ -124,7 +129,11 @@ export class GitRepo { * Push branch * @param branchName */ - public async pushBranch(remote: string, fromBranchName: string, toBranchName: string) { + public async pushBranch( + remote: string, + fromBranchName: string, + toBranchName: string, + ) { await this.exec( `push ${remote} ${fromBranchName}:${toBranchName}`, `push branch ${fromBranchName}->${toBranchName} to ${remote}`, @@ -199,8 +208,13 @@ export class GitRepo { const results = pattern === undefined || pattern.length === 0 ? await this.exec(`tag -l --sort=-committerdate`, `get all tags`) - : await this.exec(`tag -l "${pattern}" --sort=-committerdate`, `get tags ${pattern}`); - const tags = results.split("\n").filter((t) => t !== undefined && t !== "" && t !== null); + : await this.exec( + `tag -l "${pattern}" --sort=-committerdate`, + `get tags ${pattern}`, + ); + const tags = results + .split("\n") + .filter((t) => t !== undefined && t !== "" && t !== null); traceGitRepo(`Found ${tags.length} tags.`); return tags; @@ -280,14 +294,20 @@ export class GitRepo { */ public async getCommitDate(gitRef: string) { const result = ( - await this.exec(`show -s --format=%cI "${gitRef}"`, `get commit date ${gitRef}`) + await this.exec( + `show -s --format=%cI "${gitRef}"`, + `get commit date ${gitRef}`, + ) ).trim(); const date = parseISO(result); return date; } public async setUpstream(branchName: string, remote: string = "origin") { - return await this.exec(`push --set-upstream ${remote} ${branchName}`, `publish branch`); + return await this.exec( + `push --set-upstream ${remote} ${branchName}`, + `publish branch`, + ); } public async addRemote(repoPath: string) { diff --git a/build-tools/packages/build-tools/src/common/logging.ts b/build-tools/packages/build-tools/src/common/logging.ts index c60deae99155..79982a9204cd 100644 --- a/build-tools/packages/build-tools/src/common/logging.ts +++ b/build-tools/packages/build-tools/src/common/logging.ts @@ -18,7 +18,10 @@ export type ErrorLoggingFunction = ( /** * A function that logs an error message. */ -export type LoggingFunction = (message: string, ...args: any[]) => string | void; +export type LoggingFunction = ( + message: string, + ...args: any[] +) => string | void; /** * A general-purpose logger object. diff --git a/build-tools/packages/build-tools/src/common/monoRepo.ts b/build-tools/packages/build-tools/src/common/monoRepo.ts index dbf7e0045443..0d83d09c9f77 100644 --- a/build-tools/packages/build-tools/src/common/monoRepo.ts +++ b/build-tools/packages/build-tools/src/common/monoRepo.ts @@ -58,8 +58,18 @@ export class MonoRepo { return this.repoPath; } - public get releaseGroup(): "build-tools" | "client" | "server" | "gitrest" | "historian" { - return this.kind as "build-tools" | "client" | "server" | "gitrest" | "historian"; + public get releaseGroup(): + | "build-tools" + | "client" + | "server" + | "gitrest" + | "historian" { + return this.kind as + | "build-tools" + | "client" + | "server" + | "gitrest" + | "historian"; } static load(group: string, repoPackage: IFluidBuildDir) { @@ -72,7 +82,9 @@ export class MonoRepo { if (path.resolve(rootDir) !== directory) { // This is a sanity check. directory is the path passed in when creating the MonoRepo object, while rootDir is // the dir that manypkg found. They should be the same. - throw new Error(`rootDir ${rootDir} does not match repoPath ${directory}`); + throw new Error( + `rootDir ${rootDir} does not match repoPath ${directory}`, + ); } switch (tool.type) { case "lerna": @@ -91,12 +103,20 @@ export class MonoRepo { // this is a independent package return undefined; } - packageDirs = packages.filter((pkg) => pkg.relativeDir !== ".").map((pkg) => pkg.dir); + packageDirs = packages + .filter((pkg) => pkg.relativeDir !== ".") + .map((pkg) => pkg.dir); } catch { return undefined; } - return new MonoRepo(group, directory, packageManager, packageDirs, ignoredDirs); + return new MonoRepo( + group, + directory, + packageManager, + packageDirs, + ignoredDirs, + ); } /** @@ -135,7 +155,9 @@ export class MonoRepo { for (const pkgDir of packageDirs) { traceInit(`${kind}: Loading packages from ${pkgDir}`); - this.packages.push(Package.load(path.join(pkgDir, "package.json"), kind, this)); + this.packages.push( + Package.load(path.join(pkgDir, "package.json"), kind, this), + ); } if (packageManager === "pnpm") { @@ -153,7 +175,9 @@ export class MonoRepo { } if (lerna.version !== undefined) { - traceInit(`${kind}: Loading version (${lerna.version}) from ${lernaPath}`); + traceInit( + `${kind}: Loading version (${lerna.version}) from ${lernaPath}`, + ); this.version = lerna.version; versionFromLerna = true; } @@ -191,8 +215,14 @@ export class MonoRepo { } public async install() { - this.logger.log(`Release group ${this.kind}: Installing - ${this.installCommand}`); - return execWithErrorAsync(this.installCommand, { cwd: this.repoPath }, this.repoPath); + this.logger.log( + `Release group ${this.kind}: Installing - ${this.installCommand}`, + ); + return execWithErrorAsync( + this.installCommand, + { cwd: this.repoPath }, + this.repoPath, + ); } public async uninstall() { return rimrafWithErrorAsync(this.getNodeModulePath(), this.repoPath); diff --git a/build-tools/packages/build-tools/src/common/npmPackage.ts b/build-tools/packages/build-tools/src/common/npmPackage.ts index c904015966e4..d706805af859 100644 --- a/build-tools/packages/build-tools/src/common/npmPackage.ts +++ b/build-tools/packages/build-tools/src/common/npmPackage.ts @@ -11,7 +11,10 @@ import { readJsonSync, writeJsonSync } from "fs-extra"; import chalk from "picocolors"; import sortPackageJson from "sort-package-json"; -import type { SetRequired, PackageJson as StandardPackageJson } from "type-fest"; +import type { + SetRequired, + PackageJson as StandardPackageJson, +} from "type-fest"; import type { IFluidBuildConfig } from "../fluidBuild/fluidBuildConfig"; import { options } from "../fluidBuild/options"; @@ -119,7 +122,8 @@ export class Package { public readonly monoRepo?: MonoRepo, additionalProperties: any = {}, ) { - [this._packageJson, this._indent] = readPackageJsonAndIndent(packageJsonFileName); + [this._packageJson, this._indent] = + readPackageJsonAndIndent(packageJsonFileName); const pnpmWorkspacePath = path.join(this.directory, "pnpm-workspace.yaml"); const yarnLockPath = path.join(this.directory, "yarn.lock"); this.packageManager = monoRepo @@ -167,7 +171,9 @@ export class Package { * Returns true if the package is a release group root package based on its directory path. */ public get isReleaseGroupRoot(): boolean { - return this.monoRepo !== undefined && this.directory === this.monoRepo.repoPath; + return ( + this.monoRepo !== undefined && this.directory === this.monoRepo.repoPath + ); } public get matched() { @@ -245,11 +251,16 @@ export class Package { } public getScript(name: string): string | undefined { - return this.packageJson.scripts ? this.packageJson.scripts[name] : undefined; + return this.packageJson.scripts + ? this.packageJson.scripts[name] + : undefined; } public async cleanNodeModules() { - return rimrafWithErrorAsync(path.join(this.directory, "node_modules"), this.nameColored); + return rimrafWithErrorAsync( + path.join(this.directory, "node_modules"), + this.nameColored, + ); } public async savePackageJson() { @@ -268,7 +279,9 @@ export class Package { if (!existsSync(path.join(this.directory, "node_modules"))) { if (print) { - error(`${this.nameColored}: node_modules not installed in ${this.directory}`); + error( + `${this.nameColored}: node_modules not installed in ${this.directory}`, + ); } return false; } @@ -295,7 +308,11 @@ export class Package { } log(`${this.nameColored}: Installing - ${this.installCommand}`); - return execWithErrorAsync(this.installCommand, { cwd: this.directory }, this.directory); + return execWithErrorAsync( + this.installCommand, + { cwd: this.directory }, + this.directory, + ); } /** @@ -381,7 +398,11 @@ async function queueExec( }, options.concurrency); const p: Promise[] = []; for (const item of items) { - p.push(new Promise((resolve, reject) => q.push({ item, resolve, reject }))); + p.push( + new Promise((resolve, reject) => + q.push({ item, resolve, reject }), + ), + ); } return Promise.all(p); } @@ -409,7 +430,9 @@ export class Packages { ignoredDirFullPaths === undefined || !ignoredDirFullPaths.some((name) => isSameFileOrDir(name, fullPath)) ) { - packages.push(...Packages.loadDir(fullPath, group, ignoredDirFullPaths, monoRepo)); + packages.push( + ...Packages.loadDir(fullPath, group, ignoredDirFullPaths, monoRepo), + ); } } }); @@ -417,7 +440,10 @@ export class Packages { } public async cleanNodeModules() { - return this.queueExecOnAllPackage((pkg) => pkg.cleanNodeModules(), "rimraf node_modules"); + return this.queueExecOnAllPackage( + (pkg) => pkg.cleanNodeModules(), + "rimraf node_modules", + ); } public async forEachAsync( @@ -515,6 +541,12 @@ export function readPackageJsonAndIndent( /** * Writes a PackageJson object to a file using the provided indentation. */ -function writePackageJson(packagePath: string, pkgJson: PackageJson, indent: string) { - return writeJsonSync(packagePath, sortPackageJson(pkgJson), { spaces: indent }); +function writePackageJson( + packagePath: string, + pkgJson: PackageJson, + indent: string, +) { + return writeJsonSync(packagePath, sortPackageJson(pkgJson), { + spaces: indent, + }); } diff --git a/build-tools/packages/build-tools/src/common/typeCompatibility.ts b/build-tools/packages/build-tools/src/common/typeCompatibility.ts index 3838fa20188a..e325f2b5de78 100644 --- a/build-tools/packages/build-tools/src/common/typeCompatibility.ts +++ b/build-tools/packages/build-tools/src/common/typeCompatibility.ts @@ -135,7 +135,10 @@ namespace Test2 { // @ts-expect-error This means that renaming an Enum (even if you also export an alias to it under the old name) would be incorrectly detected as a breaking change. type _check2 = requireAssignableTo; // TypeOnly prevents this mistake from being flagged as breaking: - type _check3 = requireAssignableTo, TypeOnly>; + type _check3 = requireAssignableTo< + TypeOnly, + TypeOnly + >; } // Const enums @@ -176,7 +179,10 @@ namespace Test5 { // @ts-expect-error Renaming works the same as with non-const enums. type _check2 = requireAssignableTo; // TypeOnly prevents this mistake from being flagged as breaking: - type _check3 = requireAssignableTo, TypeOnly>; + type _check3 = requireAssignableTo< + TypeOnly, + TypeOnly + >; } // Classes with protected members @@ -233,13 +239,19 @@ namespace Test_TypeOnly_Preserves_Primitives { // but the number type is preserved: type brandedNumber = number & { brand: "Number" }; type _check_number1 = requireAssignableTo, number>; - type _check_number2 = requireAssignableTo>; + type _check_number2 = requireAssignableTo< + brandedNumber, + TypeOnly + >; // Due to limitations of the current version of TypeOnly, brands on string are lost, // but the string type is preserved: type brandedString = string & { brand: "String" }; type _check_string1 = requireAssignableTo, string>; - type _check_string2 = requireAssignableTo>; + type _check_string2 = requireAssignableTo< + brandedString, + TypeOnly + >; // Due to limitations of the current version of TypeOnly, brands on unions involving // 'string' or 'number' are lost, but the 'string | number' type is preserved: @@ -255,8 +267,14 @@ namespace Test_TypeOnly_Preserves_Primitives { // Other branded primitive types are preserved. type brandedBoolean = boolean & { brand: "Boolean" }; - type _check_bool1 = requireAssignableTo, brandedBoolean>; - type _check_bool2 = requireAssignableTo>; + type _check_bool1 = requireAssignableTo< + TypeOnly, + brandedBoolean + >; + type _check_bool2 = requireAssignableTo< + brandedBoolean, + TypeOnly + >; type brandedBigInt = bigint & { brand: "BigInt" }; type _check_bigint1 = requireAssignableTo, bigint>; @@ -277,8 +295,14 @@ namespace Test_TypeOnly_Preserves_Primitives { type brandedUnion = (undefined | null | boolean | bigint) & { brand: "Union"; }; - type _check_union3 = requireAssignableTo, brandedUnion>; - type _check_union4 = requireAssignableTo>; + type _check_union3 = requireAssignableTo< + TypeOnly, + brandedUnion + >; + type _check_union4 = requireAssignableTo< + brandedUnion, + TypeOnly + >; } namespace Test_TypeOnly_Symbols { diff --git a/build-tools/packages/build-tools/src/common/typeTests.ts b/build-tools/packages/build-tools/src/common/typeTests.ts index 65121129c4cc..c69b294e53de 100644 --- a/build-tools/packages/build-tools/src/common/typeTests.ts +++ b/build-tools/packages/build-tools/src/common/typeTests.ts @@ -20,7 +20,11 @@ export function getTypeTestPreviousPackageDetails(pkg: Package): { packageJsonPath: string; } { const previousPackageName = `${pkg.name}-previous`; - const previousBasePath = path.join(pkg.directory, "node_modules", previousPackageName); + const previousBasePath = path.join( + pkg.directory, + "node_modules", + previousPackageName, + ); const previousPackageJsonPath = path.join(previousBasePath, "package.json"); return { name: previousPackageName, diff --git a/build-tools/packages/build-tools/src/common/utils.ts b/build-tools/packages/build-tools/src/common/utils.ts index 90b5a28b4261..8e52cee4bf78 100644 --- a/build-tools/packages/build-tools/src/common/utils.ts +++ b/build-tools/packages/build-tools/src/common/utils.ts @@ -14,7 +14,10 @@ import isEqual from "lodash.isequal"; */ const defaultMultiCommandExecutables = ["flub", "biome"] as const; -export function getExecutableFromCommand(command: string, multiCommandExecutables: string[]) { +export function getExecutableFromCommand( + command: string, + multiCommandExecutables: string[], +) { let toReturn: string; const commands = command.split(" "); const multiExecutables: Set = new Set([ @@ -27,8 +30,13 @@ export function getExecutableFromCommand(command: string, multiCommandExecutable // // This assumes that subcommand names always precede flags and that non-command arguments // match one of the patterns we look for below. - const nonCommandIndex = commands.findIndex((c) => c.startsWith("-") || c === "."); - toReturn = nonCommandIndex !== -1 ? commands.slice(0, nonCommandIndex).join(" ") : command; + const nonCommandIndex = commands.findIndex( + (c) => c.startsWith("-") || c === ".", + ); + toReturn = + nonCommandIndex !== -1 + ? commands.slice(0, nonCommandIndex).join(" ") + : command; } else { toReturn = commands[0]; } @@ -84,7 +92,10 @@ async function rimrafAsync(deletePath: string) { }); } -export async function rimrafWithErrorAsync(deletePath: string, errorPrefix: string) { +export async function rimrafWithErrorAsync( + deletePath: string, + errorPrefix: string, +) { const ret = await rimrafAsync(deletePath); printExecError(ret, `rimraf ${deletePath}`, errorPrefix, true); return ret; @@ -132,7 +143,10 @@ export async function lookUpDirAsync( return undefined; } -export function lookUpDirSync(dir: string, callback: (currentDir: string) => boolean) { +export function lookUpDirSync( + dir: string, + callback: (currentDir: string) => boolean, +) { let curr = path.resolve(dir); // eslint-disable-next-line no-constant-condition while (true) { diff --git a/build-tools/packages/build-tools/src/docStats/docStats.ts b/build-tools/packages/build-tools/src/docStats/docStats.ts index c205bba90ac1..a84f7ce4b586 100644 --- a/build-tools/packages/build-tools/src/docStats/docStats.ts +++ b/build-tools/packages/build-tools/src/docStats/docStats.ts @@ -67,7 +67,9 @@ async function main() { }; try { - const content = JSON.parse(fs.readFileSync(path.join(dir, file.name), "utf-8")); + const content = JSON.parse( + fs.readFileSync(path.join(dir, file.name), "utf-8"), + ); processMembers(content); record.push({ name: file.name, diff --git a/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts b/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts index e59de77c5594..bb24edd31a18 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/buildGraph.ts @@ -85,9 +85,13 @@ export class BuildPackage { public readonly pkg: Package, globalTaskDefinitions: TaskDefinitions, ) { - this._taskDefinitions = getTaskDefinitions(this.pkg.packageJson, globalTaskDefinitions, { - isReleaseGroupRoot: this.pkg.isReleaseGroupRoot, - }); + this._taskDefinitions = getTaskDefinitions( + this.pkg.packageJson, + globalTaskDefinitions, + { + isReleaseGroupRoot: this.pkg.isReleaseGroupRoot, + }, + ); traceTaskDef( `${pkg.nameColored}: Task def: ${JSON.stringify(this._taskDefinitions, undefined, 2)}`, ); @@ -212,7 +216,9 @@ export class BuildPackage { } const config = this.getTaskDefinition(taskName); if (config?.script === false) { - throw new Error(`${this.pkg.nameColored}: '${taskName}' must be a script task`); + throw new Error( + `${this.pkg.nameColored}: '${taskName}' must be a script task`, + ); } const task = TaskFactory.Create( @@ -230,7 +236,10 @@ export class BuildPackage { } // Create or return and existing task with a name. If it is a script, it will also create and return the pre/post script task if it exists - private getTask(taskName: string, pendingInitDep: Task[] | undefined): Task | undefined { + private getTask( + taskName: string, + pendingInitDep: Task[] | undefined, + ): Task | undefined { const existing = this.targetTasks.get(taskName); if (existing) { return existing; @@ -244,7 +253,10 @@ export class BuildPackage { return this.createTask(taskName, pendingInitDep); } - public getScriptTask(taskName: string, pendingInitDep: Task[]): Task | undefined { + public getScriptTask( + taskName: string, + pendingInitDep: Task[], + ): Task | undefined { const config = this.getTaskDefinition(taskName); if (config?.script === false) { // it is not a script task @@ -258,7 +270,11 @@ export class BuildPackage { return this.createScriptTask(taskName, pendingInitDep, config?.files); } - public getDependsOnTasks(task: Task, taskName: string, pendingInitDep: Task[]) { + public getDependsOnTasks( + task: Task, + taskName: string, + pendingInitDep: Task[], + ) { const taskConfig = this.getTaskDefinition(taskName); if (taskConfig === undefined) { return []; @@ -315,7 +331,9 @@ export class BuildPackage { } } if (!found) { - throw new Error(`${this.pkg.nameColored}: Unable to find dependent '${dep}'`); + throw new Error( + `${this.pkg.nameColored}: Unable to find dependent '${dep}'`, + ); } } return matchedTasks; @@ -332,7 +350,8 @@ export class BuildPackage { } // avoid circular dependency. ignore mutual before "*" */ beforeStarTaskNames = Array.from(this.targetTasks.keys()).filter( - (depTaskName) => !this.getTaskDefinition(depTaskName)?.before.includes("*"), + (depTaskName) => + !this.getTaskDefinition(depTaskName)?.before.includes("*"), ); return beforeStarTaskNames; }; @@ -344,13 +363,17 @@ export class BuildPackage { } // avoid circular dependency. ignore mutual after "*" */ afterStarTaskNames = Array.from(this.targetTasks.keys()).filter( - (depTaskName) => !this.getTaskDefinition(depTaskName)?.after.includes("*"), + (depTaskName) => + !this.getTaskDefinition(depTaskName)?.after.includes("*"), ); return afterStarTaskNames; }; // Expand the star entry to all scheduled tasks - const expandStar = (deps: readonly string[], getTaskNames: () => string[]) => { + const expandStar = ( + deps: readonly string[], + getTaskNames: () => string[], + ) => { const newDeps = deps.filter((dep) => dep !== "*"); if (newDeps.length === deps.length) { return newDeps; @@ -421,7 +444,9 @@ export class BuildPackage { return isUpToDateArr.every((isUpToDate) => isUpToDate); } - private async buildAllTasks(q: AsyncPriorityQueue): Promise { + private async buildAllTasks( + q: AsyncPriorityQueue, + ): Promise { const runP: Promise[] = []; for (const task of this.tasks) { runP.push(task.run(q)); @@ -598,7 +623,9 @@ export class BuildGraph { this.context.taskStats.leafUpToDateCount - this.context.taskStats.leafBuiltCount; summaryLines.unshift(chalk.redBright("Failed Tasks:")); - summaryLines.push(chalk.yellow(`Did not run ${notRunCount} tasks due to prior failures.`)); + summaryLines.push( + chalk.yellow(`Did not run ${notRunCount} tasks due to prior failures.`), + ); return summaryLines.join("\n"); } @@ -610,7 +637,11 @@ export class BuildGraph { let buildPackage = this.buildPackages.get(pkg); if (buildPackage === undefined) { try { - buildPackage = new BuildPackage(this.context, pkg, globalTaskDefinitions); + buildPackage = new BuildPackage( + this.context, + pkg, + globalTaskDefinitions, + ); } catch (e: unknown) { throw new Error( `${pkg.nameColored}: Failed to load build package in ${pkg.directory}\n\t${ @@ -630,7 +661,9 @@ export class BuildGraph { globalTaskDefinitionsOnDisk: TaskDefinitionsOnDisk | undefined, getDepFilter: (pkg: Package) => (dep: Package) => boolean, ) { - const globalTaskDefinitions = normalizeGlobalTaskDefinitions(globalTaskDefinitionsOnDisk); + const globalTaskDefinitions = normalizeGlobalTaskDefinitions( + globalTaskDefinitionsOnDisk, + ); const pendingInitDep: BuildPackage[] = []; for (const pkg of packages.values()) { // Start with only matched packages @@ -658,7 +691,9 @@ export class BuildGraph { if (node.pkg.isReleaseGroupRoot) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion for (const dep of node.pkg.monoRepo!.packages) { - traceGraph(`Package dependency: ${node.pkg.nameColored} => ${dep.nameColored}`); + traceGraph( + `Package dependency: ${node.pkg.nameColored} => ${dep.nameColored}`, + ); node.dependentPackages.push( this.getBuildPackage(dep, globalTaskDefinitions, pendingInitDep), ); @@ -670,12 +705,19 @@ export class BuildGraph { const dep = packages.get(name); if (dep) { const satisfied = - version.startsWith("workspace:") || semver.satisfies(dep.version, version); + version.startsWith("workspace:") || + semver.satisfies(dep.version, version); if (satisfied) { if (depFilter(dep)) { - traceGraph(`Package dependency: ${node.pkg.nameColored} => ${dep.nameColored}`); + traceGraph( + `Package dependency: ${node.pkg.nameColored} => ${dep.nameColored}`, + ); node.dependentPackages.push( - this.getBuildPackage(dep, globalTaskDefinitions, pendingInitDep), + this.getBuildPackage( + dep, + globalTaskDefinitions, + pendingInitDep, + ), ); } else { traceGraph( diff --git a/build-tools/packages/build-tools/src/fluidBuild/buildResult.ts b/build-tools/packages/build-tools/src/fluidBuild/buildResult.ts index ca882b0e8556..71006d4e4b3d 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/buildResult.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/buildResult.ts @@ -16,7 +16,9 @@ export enum BuildResult { * If there is at least one success and no failures, success is returned. * Otherwise (when there are no results or all are up-to-date) up-to-date is returned. */ -export function summarizeBuildResult(results: readonly BuildResult[]): BuildResult { +export function summarizeBuildResult( + results: readonly BuildResult[], +): BuildResult { let retResult = BuildResult.UpToDate; for (const result of results) { if (result === BuildResult.Failed) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/fluidBuildConfig.ts b/build-tools/packages/build-tools/src/fluidBuild/fluidBuildConfig.ts index a11384fde014..8b81c0b7b4ac 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/fluidBuildConfig.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/fluidBuildConfig.ts @@ -4,7 +4,10 @@ */ import type { InterdependencyRange } from "@fluid-tools/version-tools"; -import type { TaskDefinitionsOnDisk, TaskFileDependencies } from "./fluidTaskDefinitions"; +import type { + TaskDefinitionsOnDisk, + TaskFileDependencies, +} from "./fluidTaskDefinitions"; /** * The version of the fluidBuild configuration currently used. @@ -85,7 +88,10 @@ export interface IFluidBuildDir { defaultInterdependencyRange?: InterdependencyRange; } -export type IFluidBuildDirEntry = string | IFluidBuildDir | (string | IFluidBuildDir)[]; +export type IFluidBuildDirEntry = + | string + | IFluidBuildDir + | (string | IFluidBuildDir)[]; export interface IFluidBuildDirs { [name: string]: IFluidBuildDirEntry; diff --git a/build-tools/packages/build-tools/src/fluidBuild/fluidRepo.ts b/build-tools/packages/build-tools/src/fluidBuild/fluidRepo.ts index 179a5e3ec64c..00276f91474a 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/fluidRepo.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/fluidRepo.ts @@ -8,7 +8,11 @@ import * as path from "path"; import { MonoRepo } from "../common/monoRepo"; import { type Package, Packages } from "../common/npmPackage"; import type { ExecAsyncResult } from "../common/utils"; -import type { IFluidBuildDir, IFluidBuildDirEntry, IFluidBuildDirs } from "./fluidBuildConfig"; +import type { + IFluidBuildDir, + IFluidBuildDirEntry, + IFluidBuildDirs, +} from "./fluidBuildConfig"; /** * @deprecated Should not be used outside the build-tools package. @@ -27,7 +31,9 @@ export class FluidRepo { fluidBuildDirs?: IFluidBuildDirs, ) { // Expand to full IFluidRepoPackage and full path - const normalizeEntry = (item: IFluidBuildDirEntry): IFluidBuildDir | IFluidBuildDir[] => { + const normalizeEntry = ( + item: IFluidBuildDirEntry, + ): IFluidBuildDir | IFluidBuildDir[] => { if (Array.isArray(item)) { return item.map((entry) => normalizeEntry(entry) as IFluidBuildDir); } @@ -68,7 +74,9 @@ export class FluidRepo { } public createPackageMap() { - return new Map(this.packages.packages.map((pkg) => [pkg.name, pkg])); + return new Map( + this.packages.packages.map((pkg) => [pkg.name, pkg]), + ); } public reload() { diff --git a/build-tools/packages/build-tools/src/fluidBuild/fluidRepoBuild.ts b/build-tools/packages/build-tools/src/fluidBuild/fluidRepoBuild.ts index c0618abb34d6..bd3db9a8eaf2 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/fluidRepoBuild.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/fluidRepoBuild.ts @@ -11,7 +11,11 @@ import chalk from "picocolors"; import { defaultLogger } from "../common/logging"; import { MonoRepo } from "../common/monoRepo"; import { type Package, Packages } from "../common/npmPackage"; -import { type ExecAsyncResult, isSameFileOrDir, lookUpDirSync } from "../common/utils"; +import { + type ExecAsyncResult, + isSameFileOrDir, + lookUpDirSync, +} from "../common/utils"; import type { BuildContext } from "./buildContext"; import { BuildGraph } from "./buildGraph"; import { FluidRepo } from "./fluidRepo"; @@ -46,13 +50,18 @@ export class FluidRepoBuild extends FluidRepo { removePromise.push(g.uninstall()); } - const r = await Promise.all([cleanPackageNodeModules, Promise.all(removePromise)]); + const r = await Promise.all([ + cleanPackageNodeModules, + Promise.all(removePromise), + ]); return r[0] && !r[1].some((ret) => ret?.error); } public setMatched(options: IPackageMatchedOptions) { const hasMatchArgs = - options.match.length || options.dirs.length || options.releaseGroups.length; + options.match.length || + options.dirs.length || + options.releaseGroups.length; if (hasMatchArgs) { let matched = false; diff --git a/build-tools/packages/build-tools/src/fluidBuild/fluidTaskDefinitions.ts b/build-tools/packages/build-tools/src/fluidBuild/fluidTaskDefinitions.ts index 0e02ea785e40..8ca31f73f235 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/fluidTaskDefinitions.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/fluidTaskDefinitions.ts @@ -4,7 +4,10 @@ */ import type { PackageJson } from "../common/npmPackage"; -import { isConcurrentlyCommand, parseConcurrentlyCommand } from "./parseCommands"; +import { + isConcurrentlyCommand, + parseConcurrentlyCommand, +} from "./parseCommands"; /** * Task definitions (type `TaskDefinitions`) is an object describing build tasks for fluid-build. @@ -158,12 +161,16 @@ interface MutableTaskDefinitions { } // On file versions that allow fields to be omitted -export type TaskConfigOnDisk = TaskDependencies | Omit, "children">; +export type TaskConfigOnDisk = + | TaskDependencies + | Omit, "children">; export interface TaskDefinitionsOnDisk { readonly [name: TaskName]: TaskConfigOnDisk; } -const isTaskDependencies = (value: TaskConfigOnDisk): value is TaskDependencies => { +const isTaskDependencies = ( + value: TaskConfigOnDisk, +): value is TaskDependencies => { return Array.isArray(value); }; @@ -276,12 +283,18 @@ export function normalizeGlobalTaskDefinitions( ); } if (full.files !== undefined) { - throw new Error(`Non-script global task definition '${name}' cannot have 'files'`); + throw new Error( + `Non-script global task definition '${name}' cannot have 'files'`, + ); } } detectInvalid( full.dependsOn, - (value) => value === "..." || value.includes("#") || value === "*" || value === "^*", + (value) => + value === "..." || + value.includes("#") || + value === "*" || + value === "^*", name, "dependsOn", true, @@ -323,7 +336,10 @@ export function normalizeGlobalTaskDefinitions( return taskDefinitions; } -function expandDotDotDot(config: readonly string[], inherited?: readonly string[]) { +function expandDotDotDot( + config: readonly string[], + inherited?: readonly string[], +) { const expanded = config.filter((value) => value !== "..."); if (inherited !== undefined && expanded.length !== config.length) { return expanded.concat(inherited); @@ -337,7 +353,10 @@ function expandDotDotDot(config: readonly string[], inherited?: readonly string[ * @param allScriptNames - all the script names in the package.json * @returns elements of script that are other scripts */ -function getDirectlyCalledScripts(script: string, allScriptNames: string[]): string[] { +function getDirectlyCalledScripts( + script: string, + allScriptNames: string[], +): string[] { const directlyCalledScripts: string[] = []; const commands = script.split("&&"); for (const step of commands) { @@ -389,9 +408,11 @@ export function getTaskDefinitions( const globalAllow = (value) => value.startsWith("^") || - (globalTaskDefinitions[value] !== undefined && !globalTaskDefinitions[value].script) || + (globalTaskDefinitions[value] !== undefined && + !globalTaskDefinitions[value].script) || packageScripts[value] !== undefined; - const globalAllowExpansionsStar = (value) => value === "*" || globalAllow(value); + const globalAllowExpansionsStar = (value) => + value === "*" || globalAllow(value); // Initialize from global TaskDefinition, and filter out script tasks if the package doesn't have the script for (const name in globalTaskDefinitions) { @@ -433,12 +454,17 @@ export function getTaskDefinitions( `Non-script task definition '${name}' cannot have 'before' or 'after'`, ); } else if (full.files !== undefined) { - throw new Error(`Non-script task definition '${name}' cannot have 'files'`); + throw new Error( + `Non-script task definition '${name}' cannot have 'files'`, + ); } } const currentTaskConfig = taskDefinitions[name]; - full.dependsOn = expandDotDotDot(full.dependsOn, currentTaskConfig?.dependsOn); + full.dependsOn = expandDotDotDot( + full.dependsOn, + currentTaskConfig?.dependsOn, + ); full.before = expandDotDotDot(full.before, currentTaskConfig?.before); full.after = expandDotDotDot(full.after, currentTaskConfig?.after); const currentFiles = currentTaskConfig?.files; @@ -472,8 +498,20 @@ export function getTaskDefinitions( for (const name in taskDefinitions) { const taskDefinition = taskDefinitions[name]; // Find any non-existent tasks or scripts in the dependencies - detectInvalid(taskDefinition.dependsOn, invalidDependOn, name, "dependsOn", false); - detectInvalid(taskDefinition.before, invalidBefore, name, "before", false); + detectInvalid( + taskDefinition.dependsOn, + invalidDependOn, + name, + "dependsOn", + false, + ); + detectInvalid( + taskDefinition.before, + invalidBefore, + name, + "before", + false, + ); detectInvalid(taskDefinition.after, invalidAfter, name, "after", false); } } diff --git a/build-tools/packages/build-tools/src/fluidBuild/fluidUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/fluidUtils.ts index bb6021031dae..855fbbff0251 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/fluidUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/fluidUtils.ts @@ -140,7 +140,11 @@ const configName = "fluidBuild"; * for performance. The cache is per-explorer, so re-using the same explorer is a minor perf improvement. */ const configExplorer = cosmiconfigSync(configName, { - searchPlaces: [`${configName}.config.cjs`, `${configName}.config.js`, "package.json"], + searchPlaces: [ + `${configName}.config.cjs`, + `${configName}.config.js`, + "package.json", + ], packageProp: [configName], }); diff --git a/build-tools/packages/build-tools/src/fluidBuild/npmDepChecker.ts b/build-tools/packages/build-tools/src/fluidBuild/npmDepChecker.ts index 0ca649dfcd76..1cc3c469a75f 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/npmDepChecker.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/npmDepChecker.ts @@ -44,7 +44,9 @@ export class NpmDepChecker { "style-loader", ]; private readonly records: DepCheckRecord[] = []; - private readonly altTyping = new Map([["ws", "isomorphic-ws"]]); + private readonly altTyping = new Map([ + ["ws", "isomorphic-ws"], + ]); private readonly peerDependencies = new Map([ ["ws", "socket.io-client"], ["@angular/compiler", "@angular/platform-browser-dynamic"], @@ -65,7 +67,9 @@ export class NpmDepChecker { packageName = name.substring("@types/".length); } const peerPackage = this.peerDependencies.get(name); - const packageMatch = peerPackage ? `(${packageName}|${peerPackage})` : packageName; + const packageMatch = peerPackage + ? `(${packageName}|${peerPackage})` + : packageName; // These regexp doesn't aim to be totally accurate, but try to avoid false positives. // These can definitely be improved this.records.push({ @@ -74,7 +78,10 @@ export class NpmDepChecker { `(import|require)[^;]+[\`'"](blob-url-loader.*)?${packageMatch}.*[\`'"]`, "m", ), - declare: new RegExp(`declare[\\s]+module[\\s]+['"]${packageMatch}['"]`, "m"), + declare: new RegExp( + `declare[\\s]+module[\\s]+['"]${packageMatch}['"]`, + "m", + ), found: false, }); } @@ -95,7 +102,9 @@ export class NpmDepChecker { continue; } if (!record.import.test(content) && !record.declare.test(content)) { - traceDepCheck(`${this.pkg.nameColored}: ${record.name} found in ${tsFile}`); + traceDepCheck( + `${this.pkg.nameColored}: ${record.name} found in ${tsFile}`, + ); continue; } record.found = true; @@ -116,7 +125,9 @@ export class NpmDepChecker { } } else if (!depCheckRecord.found) { if (this.dev.indexOf(name) != -1) { - console.warn(`${this.pkg.nameColored}: warning: misplaced dependency ${name}`); + console.warn( + `${this.pkg.nameColored}: warning: misplaced dependency ${name}`, + ); if (apply) { if (!this.pkg.packageJson.devDependencies) { this.pkg.packageJson.devDependencies = {}; @@ -125,7 +136,9 @@ export class NpmDepChecker { this.pkg.packageJson.dependencies?.[name]; } } else { - console.warn(`${this.pkg.nameColored}: warning: unused dependency ${name}`); + console.warn( + `${this.pkg.nameColored}: warning: unused dependency ${name}`, + ); } if (apply) { changed = true; @@ -153,9 +166,14 @@ export class NpmDepChecker { const typePkgName = dep.substring("@types/".length); const altName = this.altTyping.get(typePkgName); if ( - !(this.isInDependencies(typePkgName) || (altName && this.isInDependencies(altName))) + !( + this.isInDependencies(typePkgName) || + (altName && this.isInDependencies(altName)) + ) ) { - console.warn(`${this.pkg.nameColored}: warning: unused type dependency ${dep}`); + console.warn( + `${this.pkg.nameColored}: warning: unused type dependency ${dep}`, + ); if (apply) { if (this.pkg.packageJson.devDependencies) { delete this.pkg.packageJson.devDependencies[dep]; @@ -172,7 +190,10 @@ export class NpmDepChecker { } private dupCheck(apply: boolean) { - if (!this.pkg.packageJson.devDependencies || !this.pkg.packageJson.dependencies) { + if ( + !this.pkg.packageJson.devDependencies || + !this.pkg.packageJson.dependencies + ) { return false; } let changed = false; diff --git a/build-tools/packages/build-tools/src/fluidBuild/options.ts b/build-tools/packages/build-tools/src/fluidBuild/options.ts index 73802a048723..3989b612fb71 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/options.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/options.ts @@ -10,7 +10,10 @@ import * as path from "node:path"; import { defaultLogger } from "../common/logging"; import { commonOptionString, parseOption } from "./commonOptions"; import type { IPackageMatchedOptions } from "./fluidRepoBuild"; -import { defaultBuildTaskName, defaultCleanTaskName } from "./fluidTaskDefinitions"; +import { + defaultBuildTaskName, + defaultCleanTaskName, +} from "./fluidTaskDefinitions"; const { log, errorLog } = defaultLogger; diff --git a/build-tools/packages/build-tools/src/fluidBuild/parseCommands.ts b/build-tools/packages/build-tools/src/fluidBuild/parseCommands.ts index 92305032adb3..e1711ac9aa68 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/parseCommands.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/parseCommands.ts @@ -5,7 +5,9 @@ type ConcurrentlyCommand = `concurrently ${string}`; -export function isConcurrentlyCommand(command: string): command is ConcurrentlyCommand { +export function isConcurrentlyCommand( + command: string, +): command is ConcurrentlyCommand { return command.startsWith("concurrently "); } @@ -39,7 +41,9 @@ export function parseConcurrentlyCommand( // Note: result of no matches is allowed, so long as another concurrently step has a match. // This avoids general tool being overly prescriptive about script patterns. If always // having a match is desired, then such a policy should be enforced. - for (const scriptName of scriptNames.filter((s) => s.startsWith(scriptSpec))) { + for (const scriptName of scriptNames.filter((s) => + s.startsWith(scriptSpec), + )) { onNpmCommand(scriptName); } } else { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/groupTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/groupTask.ts index 02bc2d9e8b30..a749f629cdc1 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/groupTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/groupTask.ts @@ -86,7 +86,9 @@ export class GroupTask extends Task { return true; } - protected async runTask(q: AsyncPriorityQueue): Promise { + protected async runTask( + q: AsyncPriorityQueue, + ): Promise { this.traceExec(`Begin Group Task`); const taskP = new Array>(); for (const task of this.subTasks) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/apiExtractorTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/apiExtractorTask.ts index 1520ef676291..7f80b774266a 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/apiExtractorTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/apiExtractorTask.ts @@ -3,17 +3,25 @@ * Licensed under the MIT License. */ -import { getApiExtractorConfigFilePath, getInstalledPackageVersion } from "../taskUtils.js"; +import { + getApiExtractorConfigFilePath, + getInstalledPackageVersion, +} from "../taskUtils.js"; import { TscDependentTask } from "./tscTask.js"; export class ApiExtractorTask extends TscDependentTask { protected get configFileFullPaths() { // TODO: read all configs used by command via api-extractor simple extension pattern - return [this.getPackageFileFullPath(getApiExtractorConfigFilePath(this.command))]; + return [ + this.getPackageFileFullPath(getApiExtractorConfigFilePath(this.command)), + ]; } protected async getToolVersion() { - return getInstalledPackageVersion("@microsoft/api-extractor", this.node.pkg.directory); + return getInstalledPackageVersion( + "@microsoft/api-extractor", + this.node.pkg.directory, + ); } protected get useWorker() { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/flubTasks.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/flubTasks.ts index 534bcecee1b5..3c1aec843b06 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/flubTasks.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/flubTasks.ts @@ -29,9 +29,9 @@ export class FlubListTask extends LeafWithDoneFileTask { if (resourceGroup === undefined) { return undefined; } - const packages = Array.from(this.node.context.repoPackageMap.values()).filter( - (pkg) => pkg.monoRepo?.kind === resourceGroup, - ); + const packages = Array.from( + this.node.context.repoPackageMap.values(), + ).filter((pkg) => pkg.monoRepo?.kind === resourceGroup); if (packages.length === 0) { return undefined; } @@ -59,9 +59,9 @@ export class FlubCheckLayerTask extends LeafWithDoneFileTask { return layerInfoFile ? JSON.stringify({ layerInfo: layerInfoFile, - packageJson: Array.from(this.node.context.repoPackageMap.values()).map( - (pkg) => pkg.packageJson, - ), + packageJson: Array.from( + this.node.context.repoPackageMap.values(), + ).map((pkg) => pkg.packageJson), }) : undefined; } diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/generateEntrypointsTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/generateEntrypointsTask.ts index b5d5e3727332..1fc9339f7381 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/generateEntrypointsTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/generateEntrypointsTask.ts @@ -13,6 +13,9 @@ export class GenerateEntrypointsTask extends TscDependentTask { } protected async getToolVersion() { - return getInstalledPackageVersion("@fluid-tools/build-cli", this.node.pkg.directory); + return getInstalledPackageVersion( + "@fluid-tools/build-cli", + this.node.pkg.directory, + ); } } diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts index 72e8d3bddbad..0619773d044a 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/leafTask.ts @@ -160,7 +160,8 @@ export abstract class LeafTask extends Task { if (this.isTemp) { return true; } - const isLintTask = this.executable === "eslint" || this.executable === "prettier"; + const isLintTask = + this.executable === "eslint" || this.executable === "prettier"; return (options.nolint && isLintTask) || (options.lintonly && !isLintTask); } @@ -186,16 +187,23 @@ export abstract class LeafTask extends Task { const taskNum = this.node.context.taskStats.leafBuiltCount .toString() .padStart(totalTask.toString().length, " "); - log(`[${taskNum}/${totalTask}] ${this.node.pkg.nameColored}: ${this.command}`); + log( + `[${taskNum}/${totalTask}] ${this.node.pkg.nameColored}: ${this.command}`, + ); } const startTime = Date.now(); - if (this.recheckLeafIsUpToDate && !this.forced && (await this.checkLeafIsUpToDate())) { + if ( + this.recheckLeafIsUpToDate && + !this.forced && + (await this.checkLeafIsUpToDate()) + ) { return this.execDone(startTime, BuildResult.UpToDate); } const ret = await this.execCore(); if (ret.error) { - const codeStr = ret.error.code !== undefined ? ` (exit code ${ret.error.code})` : ""; + const codeStr = + ret.error.code !== undefined ? ` (exit code ${ret.error.code})` : ""; console.error( `${this.node.pkg.nameColored}: error during command '${this.command}'${codeStr}`, ); @@ -204,7 +212,9 @@ export abstract class LeafTask extends Task { } if (ret.stderr) { // no error code but still error messages, treat them is non fatal warnings - console.warn(`${this.node.pkg.nameColored}: warning during command '${this.command}'`); + console.warn( + `${this.node.pkg.nameColored}: warning during command '${this.command}'`, + ); console.warn(this.getExecErrors(ret)); } @@ -246,7 +256,9 @@ export abstract class LeafTask extends Task { if (workerResult.error.stack) { console.warn(workerResult.error.stack); } else { - console.warn(`${workerResult.error.name}: ${workerResult.error.message}`); + console.warn( + `${workerResult.error.name}: ${workerResult.error.message}`, + ); } } } @@ -279,7 +291,10 @@ export abstract class LeafTask extends Task { if (options.vscode) { errorMessages = this.getVsCodeErrorMessages(errorMessages); } else { - errorMessages = errorMessages.replace(/\n/g, `\n${this.node.pkg.nameColored}: `); + errorMessages = errorMessages.replace( + /\n/g, + `\n${this.node.pkg.nameColored}: `, + ); errorMessages = `${this.node.pkg.nameColored}: ${errorMessages}`; } return errorMessages; @@ -322,7 +337,9 @@ export abstract class LeafTask extends Task { return status; } - protected async runTask(q: AsyncPriorityQueue): Promise { + protected async runTask( + q: AsyncPriorityQueue, + ): Promise { this.traceExec("Begin Leaf Task"); // Build all the dependent tasks first @@ -354,7 +371,9 @@ export abstract class LeafTask extends Task { const start = Date.now(); const leafIsUpToDate = await this.checkLeafIsUpToDate(); - traceTaskCheck(`${this.nameColored}: checkLeafIsUpToDate: ${Date.now() - start}ms`); + traceTaskCheck( + `${this.nameColored}: checkLeafIsUpToDate: ${Date.now() - start}ms`, + ); if (leafIsUpToDate) { this.node.context.taskStats.leafUpToDateCount++; this.traceExec(`Skipping Leaf Task`); @@ -367,7 +386,9 @@ export abstract class LeafTask extends Task { const dependentLeafTasks = this.getDependentLeafTasks(); for (const dependentLeafTask of dependentLeafTasks) { if (!(await dependentLeafTask.isUpToDate())) { - this.traceTrigger(`dependent task ${dependentLeafTask.toString()} not up to date`); + this.traceTrigger( + `dependent task ${dependentLeafTask.toString()} not up to date`, + ); return false; } } @@ -380,7 +401,9 @@ export abstract class LeafTask extends Task { return this.dependentLeafTasks!.values(); } - private async buildDependentTask(q: AsyncPriorityQueue): Promise { + private async buildDependentTask( + q: AsyncPriorityQueue, + ): Promise { const p = new Array>(); for (const dependentLeafTask of this.getDependentLeafTasks()) { p.push(dependentLeafTask.run(q)); @@ -656,7 +679,10 @@ export abstract class LeafWithFileStatDoneFileTask extends LeafWithDoneFileTask const srcHashesP = Promise.all(srcFiles.map(mapHash)); const dstHashesP = Promise.all(dstFiles.map(mapHash)); - const [srcHashes, dstHashes] = await Promise.all([srcHashesP, dstHashesP]); + const [srcHashes, dstHashes] = await Promise.all([ + srcHashesP, + dstHashesP, + ]); // sort by name for determinism srcHashes.sort(sortByName); @@ -735,7 +761,10 @@ export abstract class LeafWithGlobInputOutputDoneFileTask extends LeafWithFileSt * @returns An array of absolute paths to all files that match the globs. */ private async getFiles(mode: GitIgnoreSettingValue): Promise { - const globs = mode === "input" ? await this.getInputGlobs() : await this.getOutputGlobs(); + const globs = + mode === "input" + ? await this.getInputGlobs() + : await this.getOutputGlobs(); const excludeGitIgnoredFiles: boolean = this.gitIgnore.includes(mode); const files = await globby(globs, { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/lintTasks.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/lintTasks.ts index bc2e36a9e9e5..2b6b4135329d 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/lintTasks.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/lintTasks.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import { getEsLintConfigFilePath, getInstalledPackageVersion } from "../taskUtils"; +import { + getEsLintConfigFilePath, + getInstalledPackageVersion, +} from "../taskUtils"; import { TscDependentTask } from "./tscTask"; export class TsLintTask extends TscDependentTask { @@ -20,9 +23,13 @@ export class EsLintTask extends TscDependentTask { private _configFileFullPath: string | undefined; protected get configFileFullPaths() { if (!this._configFileFullPath) { - this._configFileFullPath = getEsLintConfigFilePath(this.package.directory); + this._configFileFullPath = getEsLintConfigFilePath( + this.package.directory, + ); if (!this._configFileFullPath) { - throw new Error(`Unable to find config file for eslint ${this.command}`); + throw new Error( + `Unable to find config file for eslint ${this.command}`, + ); } } return [this._configFileFullPath]; diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/miscTasks.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/miscTasks.ts index e323ebdf85a2..6322ef76df2b 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/miscTasks.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/miscTasks.ts @@ -229,7 +229,9 @@ export class GenVerTask extends LeafTask { return false; } if (this.node.pkg.version !== match[2]) { - this.traceTrigger("package version in src/packageVersion.ts not matched"); + this.traceTrigger( + "package version in src/packageVersion.ts not matched", + ); return false; } return true; @@ -252,7 +254,9 @@ export class TypeValidationTask extends LeafWithFileStatDoneFileTask { this.inputFiles = [path.join(this.node.pkg.directory, "package.json")]; // Casting as any is a workaround because the typeValidation-related types are in build-cli. // Eventually the common stuff will be split into a shared package; tracked by AB#13197. - if (!((this.node.pkg.packageJson as any).typeValidation?.disabled === true)) { + if ( + !((this.node.pkg.packageJson as any).typeValidation?.disabled === true) + ) { // TODO: depend on all of input to product tsc, which impacts the API. // This task is effectively a TscDependentTask with additional input, // but some packages build tests including type tests as part of @@ -262,7 +266,9 @@ export class TypeValidationTask extends LeafWithFileStatDoneFileTask { // The package.json file of prior package is a pretty good representative // for exposed types of prior package. If this is missing, task won't be // incremental. That is okay because task will also fail. - this.inputFiles.push(getTypeTestPreviousPackageDetails(this.node.pkg).packageJsonPath); + this.inputFiles.push( + getTypeTestPreviousPackageDetails(this.node.pkg).packageJsonPath, + ); } } return this.inputFiles; @@ -275,7 +281,10 @@ export class TypeValidationTask extends LeafWithFileStatDoneFileTask { protected async getOutputFiles(): Promise { if (this.outputFiles === undefined) { // Assumes all typetest output is in src/test/types - const typetestGlob = path.join(this.node.pkg.directory, "src/test/types/**"); + const typetestGlob = path.join( + this.node.pkg.directory, + "src/test/types/**", + ); this.outputFiles = await globFn(typetestGlob, { nodir: true }); } return this.outputFiles; @@ -335,7 +344,9 @@ export class DepCruiseTask extends LeafWithFileStatDoneFileTask { const fullPath = path.join(this.node.pkg.directory, scan.base); const files = await readdir(fullPath, { recursive: true }); inputFiles.push( - ...files.filter((file) => match(file)).map((file) => path.join(fullPath, file)), + ...files + .filter((file) => match(file)) + .map((file) => path.join(fullPath, file)), ); } else { const fullPath = path.resolve(this.node.pkg.directory, file); diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/prettierTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/prettierTask.ts index 9953c2b3fe03..d8cee154a20b 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/prettierTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/prettierTask.ts @@ -10,7 +10,11 @@ import ignore from "ignore"; import type { BuildContext } from "../../buildContext"; import type { BuildPackage } from "../../buildGraph"; -import { getInstalledPackageVersion, getRecursiveFiles, globFn } from "../taskUtils"; +import { + getInstalledPackageVersion, + getRecursiveFiles, + globFn, +} from "../taskUtils"; import { LeafWithDoneFileTask } from "./leafTask"; export class PrettierTask extends LeafWithDoneFileTask { @@ -57,7 +61,9 @@ export class PrettierTask extends LeafWithDoneFileTask { protected async getDoneFileContent() { if (!this.parsed) { - this.traceError(`error generating done file content, unable to understand command line`); + this.traceError( + `error generating done file content, unable to understand command line`, + ); return undefined; } @@ -68,13 +74,19 @@ export class PrettierTask extends LeafWithDoneFileTask { if (existsSync(ignoreFile)) { const ignoreFileContent = await readFile(ignoreFile, "utf8"); ignoreEntries = ignoreFileContent.split(/\r?\n/); - ignoreEntries = ignoreEntries.filter((value) => value && !value.startsWith("#")); + ignoreEntries = ignoreEntries.filter( + (value) => value && !value.startsWith("#"), + ); } else if (this.ignorePath) { - this.traceError(`error generating done file content, unable to find ${ignoreFile}`); + this.traceError( + `error generating done file content, unable to find ${ignoreFile}`, + ); return undefined; } } catch (e) { - this.traceError(`error generating done file content, unable to read ${ignoreFile} file`); + this.traceError( + `error generating done file content, unable to read ${ignoreFile} file`, + ); return undefined; } @@ -92,13 +104,17 @@ export class PrettierTask extends LeafWithDoneFileTask { // TODO: This includes files that prettier might not check const recursiveFiles = await getRecursiveFiles(fullPath); files.push( - ...recursiveFiles.map((file) => path.relative(this.node.pkg.directory, file)), + ...recursiveFiles.map((file) => + path.relative(this.node.pkg.directory, file), + ), ); } else { files.push(entry); } } else { - const globFiles = await globFn(entry, { cwd: this.node.pkg.directory }); + const globFiles = await globFn(entry, { + cwd: this.node.pkg.directory, + }); files.push(...globFiles); } } @@ -111,7 +127,10 @@ export class PrettierTask extends LeafWithDoneFileTask { }); const hashes = await Promise.all(hashesP); return JSON.stringify({ - version: await getInstalledPackageVersion("prettier", this.node.pkg.directory), + version: await getInstalledPackageVersion( + "prettier", + this.node.pkg.directory, + ), hashes, }); } catch (e) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/ts2EsmTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/ts2EsmTask.ts index ba09ce3b7330..f620d3421cf8 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/ts2EsmTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/ts2EsmTask.ts @@ -25,16 +25,22 @@ export class Ts2EsmTask extends LeafWithFileStatDoneFileTask { const split = this.command.split(" "); // Assume arguments are package-relative paths to tsconfigs - const configs = split.slice(1).map((filePath) => this.getPackageFileFullPath(filePath)); + const configs = split + .slice(1) + .map((filePath) => this.getPackageFileFullPath(filePath)); for (const configPath of configs) { const configDir = path.dirname(configPath); - const tsConfig = JSON5.parse(readFileSync(configPath, "utf8")) as TsConfigJson; + const tsConfig = JSON5.parse( + readFileSync(configPath, "utf8"), + ) as TsConfigJson; if (tsConfig.files !== undefined) { // Config might not be relative to package; get an absolute path. // Note: repo has no tsconfig's with files; so this is untested in real use. inputFiles.push( - ...tsConfig.files.map((filePath) => path.resolve(filePath, configDir)), + ...tsConfig.files.map((filePath) => + path.resolve(filePath, configDir), + ), ); } if (tsConfig.include !== undefined) { @@ -55,7 +61,9 @@ export class Ts2EsmTask extends LeafWithFileStatDoneFileTask { } // To keep absolute paths out of the cache file, make the path relative to the package. - return inputFiles.map((filePath) => path.relative(this.package.directory, filePath)); + return inputFiles.map((filePath) => + path.relative(this.package.directory, filePath), + ); } protected async getOutputFiles(): Promise { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts index 2d8cea07afff..17f61ed8d4bc 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/tscTask.ts @@ -65,7 +65,9 @@ export class TscTask extends LeafTask { const parsedCommandLine = this.parsedCommandLine; if (parsedCommandLine?.options.build) { return this.checkReferencesIsUpToDate( - parsedCommandLine.fileNames.length === 0 ? ["."] : parsedCommandLine.fileNames, + parsedCommandLine.fileNames.length === 0 + ? ["."] + : parsedCommandLine.fileNames, new Set(), ); } @@ -73,7 +75,10 @@ export class TscTask extends LeafTask { return this.checkTscIsUpToDate(); } - private async checkReferencesIsUpToDate(checkDir: string[], checkedProjects: Set) { + private async checkReferencesIsUpToDate( + checkDir: string[], + checkedProjects: Set, + ) { for (const dir of checkDir) { if (checkedProjects.has(dir)) { continue; @@ -104,7 +109,9 @@ export class TscTask extends LeafTask { // Only check project reference if we are in build mode if (checkedProjects && config.projectReferences) { const referencePaths = config.projectReferences.map((p) => p.path); - if (!(await this.checkReferencesIsUpToDate(referencePaths, checkedProjects))) { + if ( + !(await this.checkReferencesIsUpToDate(referencePaths, checkedProjects)) + ) { return false; } } @@ -136,7 +143,8 @@ export class TscTask extends LeafTask { (program.affectedFilesPendingEmit?.length ?? 0) > 0 || (program.emitDiagnosticsPerFile?.length ?? 0) > 0; const hasSemanticErrors = - program.semanticDiagnosticsPerFile?.some((item) => Array.isArray(item)) ?? false; + program.semanticDiagnosticsPerFile?.some((item) => Array.isArray(item)) ?? + false; const previousBuildError = noEmit ? hasChangedFiles || hasSemanticErrors @@ -154,7 +162,9 @@ export class TscTask extends LeafTask { // remove the files that we sees from the tsBuildInfo. The remaining files are // new files that need to be rebuilt. const configFileNames = new Set( - config.fileNames.map((p) => tscUtils.getCanonicalFileName(path.normalize(p))), + config.fileNames.map((p) => + tscUtils.getCanonicalFileName(path.normalize(p)), + ), ); // Check dependencies file hashes @@ -179,23 +189,32 @@ export class TscTask extends LeafTask { fullPath, tscUtils.getSourceFileVersion, ); - const version = typeof fileInfo === "string" ? fileInfo : fileInfo.version; + const version = + typeof fileInfo === "string" ? fileInfo : fileInfo.version; if (hash !== version) { - this.traceTrigger(`version mismatch for ${fileName}, ${hash}, ${version}`); + this.traceTrigger( + `version mismatch for ${fileName}, ${hash}, ${version}`, + ); return false; } // Remove files that we have built before - configFileNames.delete(tscUtils.getCanonicalFileName(path.normalize(fullPath))); + configFileNames.delete( + tscUtils.getCanonicalFileName(path.normalize(fullPath)), + ); } catch (e: any) { - this.traceTrigger(`exception generating hash for ${fileName}\n\t${e.stack}`); + this.traceTrigger( + `exception generating hash for ${fileName}\n\t${e.stack}`, + ); return false; } } if (configFileNames.size !== 0) { // New files that are not in the previous build, we are not up to date. - this.traceTrigger(`new file detected ${[...configFileNames.values()].join(",")}`); + this.traceTrigger( + `new file detected ${[...configFileNames.values()].join(",")}`, + ); return false; } try { @@ -219,9 +238,14 @@ export class TscTask extends LeafTask { return this.checkTsConfig(tsBuildInfoFileDirectory, tsBuildInfo, config); } - private remapSrcDeclFile(fullPath: string, config: tsTypes.ParsedCommandLine) { + private remapSrcDeclFile( + fullPath: string, + config: tsTypes.ParsedCommandLine, + ) { if (!this._sourceStats) { - this._sourceStats = config ? config.fileNames.map((v) => lstatSync(v)) : []; + this._sourceStats = config + ? config.fileNames.map((v) => lstatSync(v)) + : []; } const stat = lstatSync(fullPath); @@ -365,7 +389,9 @@ export class TscTask extends LeafTask { return options.options.tsBuildInfoFile; } - const outFile = options.options.out ? options.options.out : options.options.outFile; + const outFile = options.options.out + ? options.options.out + : options.options.outFile; if (outFile) { return `${outFile}.tsbuildinfo`; } @@ -380,7 +406,11 @@ export class TscTask extends LeafTask { return undefined; } - return this.remapOutFile(options, path.parse(configFileFullPath).dir, tsBuildInfoFileName); + return this.remapOutFile( + options, + path.parse(configFileFullPath).dir, + tsBuildInfoFileName, + ); } private remapOutFile( @@ -428,7 +458,9 @@ export class TscTask extends LeafTask { const tsBuildInfoFileFullPath = this.tsBuildInfoFileFullPath; if (tsBuildInfoFileFullPath && existsSync(tsBuildInfoFileFullPath)) { try { - const tsBuildInfo = JSON.parse(await readFile(tsBuildInfoFileFullPath, "utf8")); + const tsBuildInfo = JSON.parse( + await readFile(tsBuildInfoFileFullPath, "utf8"), + ); if ( tsBuildInfo.program && tsBuildInfo.program.fileNames && @@ -477,12 +509,14 @@ export abstract class TscDependentTask extends LeafWithDoneFileTask { const tscTasks = [...this.getDependentLeafTasks()].filter( (task) => task instanceof TscTask, ) as TscTask[]; - const ownTscTasks = tscTasks.filter((task) => task.package == this.package); + const ownTscTasks = tscTasks.filter( + (task) => task.package == this.package, + ); // Take only the tsc task in the same package if possible. // Sort by task name to provide some stability - const tasks = (ownTscTasks.length === 0 ? tscTasks : ownTscTasks).sort((a, b) => - a.name.localeCompare(b.name), + const tasks = (ownTscTasks.length === 0 ? tscTasks : ownTscTasks).sort( + (a, b) => a.name.localeCompare(b.name), ); for (const dep of tasks) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/webpackTask.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/webpackTask.ts index cdc716a5204e..b60ff97a9545 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/webpackTask.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/leaf/webpackTask.ts @@ -25,10 +25,16 @@ export class WebpackTask extends LeafWithDoneFileTask { // where their output might change the webpack's input. assert.strictEqual(this.recheckLeafIsUpToDate, false); try { - const config = await loadModule(this.configFileFullPath, this.package.packageJson.type); + const config = await loadModule( + this.configFileFullPath, + this.package.packageJson.type, + ); const content: DoneFileContent = { version: await this.getVersion(), - config: typeof config === "function" ? config(this.getEnvArguments()) : config, + config: + typeof config === "function" + ? config(this.getEnvArguments()) + : config, sources: {}, }; @@ -36,7 +42,8 @@ export class WebpackTask extends LeafWithDoneFileTask { const srcGlob = toPosixPath(this.node.pkg.directory) + "/src/**/*.*"; const srcFiles = await globFn(srcGlob); for (const srcFile of srcFiles) { - content.sources[srcFile] = await this.node.context.fileHashCache.getFileHash(srcFile); + content.sources[srcFile] = + await this.node.context.fileHashCache.getFileHash(srcFile); } return JSON.stringify(content); diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/task.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/task.ts index d3a6a97ecd1a..81cbdb2a83f8 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/task.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/task.ts @@ -75,7 +75,11 @@ export abstract class Task { // This function should only be called by task with task names assert.notStrictEqual(this.taskName, undefined); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - this.dependentTasks = this.node.getDependsOnTasks(this, this.taskName!, pendingInitDep); + this.dependentTasks = this.node.getDependsOnTasks( + this, + this.taskName!, + pendingInitDep, + ); } // Add dependent task. For group tasks, propagate to unnamed subtask only if it's a default dependency @@ -157,14 +161,20 @@ export abstract class Task { public abstract initializeDependentLeafTasks(): void; public abstract collectLeafTasks(leafTasks: Set); - public abstract addDependentLeafTasks(dependentTasks: Iterable): void; + public abstract addDependentLeafTasks( + dependentTasks: Iterable, + ): void; public abstract initializeWeight(): void; protected abstract checkIsUpToDate(): Promise; - protected abstract runTask(q: AsyncPriorityQueue): Promise; + protected abstract runTask( + q: AsyncPriorityQueue, + ): Promise; public get forced() { - return options.force && (options.matchedOnly !== true || this.package.matched); + return ( + options.force && (options.matchedOnly !== true || this.package.matched) + ); } protected traceExec(msg: string) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskFactory.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskFactory.ts index 595b83bd34f8..67e1d4bd6178 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskFactory.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskFactory.ts @@ -7,12 +7,19 @@ import { getExecutableFromCommand } from "../../common/utils"; import type { BuildContext } from "../buildContext"; import type { BuildPackage } from "../buildGraph"; import type { TaskFileDependencies } from "../fluidTaskDefinitions"; -import { isConcurrentlyCommand, parseConcurrentlyCommand } from "../parseCommands"; +import { + isConcurrentlyCommand, + parseConcurrentlyCommand, +} from "../parseCommands"; import { GroupTask } from "./groupTask"; import { ApiExtractorTask } from "./leaf/apiExtractorTask"; import { BiomeTask } from "./leaf/biomeTasks"; import { DeclarativeLeafTask } from "./leaf/declarativeTask"; -import { FlubCheckLayerTask, FlubCheckPolicyTask, FlubListTask } from "./leaf/flubTasks"; +import { + FlubCheckLayerTask, + FlubCheckPolicyTask, + FlubListTask, +} from "./leaf/flubTasks"; import { GenerateEntrypointsTask } from "./leaf/generateEntrypointsTask.js"; import { type LeafTask, UnknownLeafTask } from "./leaf/leafTask"; import { EsLintTask, TsLintTask } from "./leaf/lintTasks"; @@ -36,26 +43,26 @@ import type { TaskHandler } from "./taskHandlers"; const executableToLeafTask: { [key: string]: TaskHandler; } = { - "ts2esm": Ts2EsmTask, - "tsc": TscTask, + ts2esm: Ts2EsmTask, + tsc: TscTask, "fluid-tsc": TscTask, - "tslint": TsLintTask, - "eslint": EsLintTask, - "webpack": WebpackTask, + tslint: TsLintTask, + eslint: EsLintTask, + webpack: WebpackTask, "parallel-webpack": WebpackTask, - "lessc": LesscTask, - "copyfiles": CopyfilesTask, - "echo": EchoTask, - "prettier": PrettierTask, + lessc: LesscTask, + copyfiles: CopyfilesTask, + echo: EchoTask, + prettier: PrettierTask, "gen-version": GenVerTask, - "gf": GoodFence, + gf: GoodFence, "api-extractor": ApiExtractorTask, "flub check layers": FlubCheckLayerTask, "flub check policy": FlubCheckPolicyTask, "flub generate entrypoints": GenerateEntrypointsTask, "flub generate typetests": TypeValidationTask, "fluid-type-test-generator": TypeValidationTask, - "depcruise": DepCruiseTask, + depcruise: DepCruiseTask, "biome check": BiomeTask, "biome format": BiomeTask, @@ -113,7 +120,10 @@ function getLeafTaskForCommand( return new handler(node, command, context, taskName); } -function getRunScriptName(command: string, packageManager: string): string | undefined { +function getRunScriptName( + command: string, + packageManager: string, +): string | undefined { // Remove the package manager name from the command if (command.startsWith("npm run ")) { return command.substring("npm run ".length); @@ -143,7 +153,9 @@ export class TaskFactory { const steps = command.split("&&"); if (steps.length > 1) { for (const step of steps) { - subTasks.push(TaskFactory.Create(node, step.trim(), context, pendingInitDep)); + subTasks.push( + TaskFactory.Create(node, step.trim(), context, pendingInitDep), + ); } if (files !== undefined) { @@ -184,7 +196,9 @@ export class TaskFactory { subTasks.push(task); }, (step) => { - subTasks.push(TaskFactory.Create(node, step, context, pendingInitDep)); + subTasks.push( + TaskFactory.Create(node, step, context, pendingInitDep), + ); }, ); if (subTasks.length === 0) { @@ -229,7 +243,13 @@ export class TaskFactory { context: BuildContext, taskName: string | undefined, ) { - return new GroupTask(node, `fluid-build -t ${taskName}`, context, [], taskName); + return new GroupTask( + node, + `fluid-build -t ${taskName}`, + context, + [], + taskName, + ); } public static CreateTaskWithLifeCycle( diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts index bb12876ed8e0..baabe1b5db03 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts @@ -14,7 +14,12 @@ import { lookUpDirSync } from "../../common/utils"; export function getEsLintConfigFilePath(dir: string) { // TODO: we currently don't support .yaml and .yml, or config in package.json - const possibleConfig = [".eslintrc.js", ".eslintrc.cjs", ".eslintrc.json", ".eslintrc"]; + const possibleConfig = [ + ".eslintrc.js", + ".eslintrc.cjs", + ".eslintrc.json", + ".eslintrc", + ]; for (const configFile of possibleConfig) { const configFileFullPath = path.join(dir, configFile); if (existsSync(configFileFullPath)) { @@ -24,7 +29,10 @@ export function getEsLintConfigFilePath(dir: string) { return undefined; } -export async function getInstalledPackageVersion(packageName: string, cwd: string) { +export async function getInstalledPackageVersion( + packageName: string, + cwd: string, +) { const resolvedPath = require.resolve(packageName, { paths: [cwd] }); const packageJsonPath = lookUpDirSync(resolvedPath, (currentDir) => { return existsSync(path.join(currentDir, "package.json")); @@ -65,7 +73,8 @@ export async function getRecursiveFiles(pathName: string) { */ export function getApiExtractorConfigFilePath(commandLine: string): string { const commandArgs = commandLine.split(/\s+/); - const configFileArg = commandArgs.findIndex((arg) => arg === "--config" || arg === "-c") + 1; + const configFileArg = + commandArgs.findIndex((arg) => arg === "--config" || arg === "-c") + 1; if (configFileArg > 0 && commandArgs.length > configFileArg) { return commandArgs[configFileArg]; } @@ -78,7 +87,10 @@ export function toPosixPath(s: string) { return path.sep === "\\" ? s.replace(/\\/g, "/") : s; } -export async function globFn(pattern: string, options: glob.IOptions = {}): Promise { +export async function globFn( + pattern: string, + options: glob.IOptions = {}, +): Promise { return new Promise((resolve, reject) => { glob.default(pattern, options, (err, matches) => { if (err) { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/apiExtractorWorker.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/apiExtractorWorker.ts index 82e0470e70be..2307f5df709b 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/apiExtractorWorker.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/apiExtractorWorker.ts @@ -12,14 +12,18 @@ import type { WorkerExecResult, WorkerMessage } from "./worker.js"; * Worker for running API Extractor. * See "worker.ts" and "apiExtractorTask.ts" for more details. */ -export async function apiExtractorWorker(message: WorkerMessage): Promise { +export async function apiExtractorWorker( + message: WorkerMessage, +): Promise { // Load the api-extractor version that is in the cwd scope const apiExtractorPath = require.resolve("@microsoft/api-extractor", { paths: [message.cwd], }); // eslint-disable-next-line @typescript-eslint/no-var-requires - const apiExtractorModule = require(apiExtractorPath) as typeof ApiExtractorModule; + const apiExtractorModule = require( + apiExtractorPath, + ) as typeof ApiExtractorModule; const config = getApiExtractorConfigFilePath(message.command); const configPath = path.join(message.cwd, config); diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/tscWorker.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/tscWorker.ts index 4b63cb25f302..5515c0f03de2 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/tscWorker.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/tscWorker.ts @@ -11,12 +11,16 @@ export async function compile(msg: WorkerMessage): Promise { return { code: tsCompile(msg) }; } -export async function fluidCompile(msg: WorkerMessage): Promise { +export async function fluidCompile( + msg: WorkerMessage, +): Promise { const commandMatch = msg.command.match(fluidTscRegEx); if (!commandMatch) { throw new Error(`worker command not recognized: ${msg.command}`); } const command = msg.command.replace(commandMatch[0], "tsc"); const packageJsonTypeOverride = commandMatch[1] as "commonjs" | "module"; - return { code: tsCompile({ command, cwd: msg.cwd, packageJsonTypeOverride }) }; + return { + code: tsCompile({ command, cwd: msg.cwd, packageJsonTypeOverride }), + }; } diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/worker.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/worker.ts index a64ec842adb3..ea0262dc205f 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/worker.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/worker.ts @@ -21,10 +21,12 @@ export interface WorkerExecResult { memoryUsage?: NodeJS.MemoryUsage; } -const workers: { [key: string]: (message: WorkerMessage) => Promise } = { - "tsc": compile, +const workers: { + [key: string]: (message: WorkerMessage) => Promise; +} = { + tsc: compile, "fluid-tsc": fluidCompile, - "eslint": lint, + eslint: lint, "api-extractor": apiExtractorWorker, }; @@ -51,7 +53,9 @@ async function messageHandler(msg: WorkerMessage): Promise { code: -1, }; } - return collectMemoryUsage ? { ...res, memoryUsage: process.memoryUsage() } : res; + return collectMemoryUsage + ? { ...res, memoryUsage: process.memoryUsage() } + : res; } if (parentPort) { @@ -66,7 +70,9 @@ if (parentPort) { messageHandler(message).then(process.send!.bind(process)); }); process.on("uncaughtException", (error) => { - console.error(`ERROR: Uncaught exception. ${error.message}\n${error.stack}`); + console.error( + `ERROR: Uncaught exception. ${error.message}\n${error.stack}`, + ); process.exit(-1); }); process.on("unhandledRejection", (reason) => { diff --git a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/workerPool.ts b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/workerPool.ts index ffbee9de9a6c..7c9a2e006e48 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/workerPool.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tasks/workers/workerPool.ts @@ -27,7 +27,10 @@ export class WorkerPool { private getThreadWorker() { let worker: Worker | undefined = this.threadWorkerPool.pop(); if (!worker) { - worker = new Worker(`${__dirname}/worker.js`, { stdout: true, stderr: true }); + worker = new Worker(`${__dirname}/worker.js`, { + stdout: true, + stderr: true, + }); } return worker; } @@ -37,7 +40,9 @@ export class WorkerPool { if (!worker) { worker = fork( `${__dirname}/worker.js`, - this.memoryUsageLimit !== Number.POSITIVE_INFINITY ? ["--memoryUsage"] : undefined, + this.memoryUsageLimit !== Number.POSITIVE_INFINITY + ? ["--memoryUsage"] + : undefined, { silent: true }, ); } @@ -92,21 +97,23 @@ export class WorkerPool { return res; } else { const worker = this.getProcessWorker(); - const res = await new Promise((res, rej) => { - const setupErrorListener = (event: string) => { - installTemporaryListener(worker, event, () => { - rej(new Error(`Worker ${event}`)); - }); - }; - - setupWorker(worker, res); - - setupErrorListener("close"); - setupErrorListener("disconnect"); - setupErrorListener("error"); - setupErrorListener("exit"); - worker.send(workerMessage); - }); + const res = await new Promise( + (res, rej) => { + const setupErrorListener = (event: string) => { + installTemporaryListener(worker, event, () => { + rej(new Error(`Worker ${event}`)); + }); + }; + + setupWorker(worker, res); + + setupErrorListener("close"); + setupErrorListener("disconnect"); + setupErrorListener("error"); + setupErrorListener("exit"); + worker.send(workerMessage); + }, + ); // Workers accumulate memory use over time. // Since recreating workers fixes this, but takes time, @@ -114,7 +121,10 @@ export class WorkerPool { const freeMemory = freemem(); // As a heuristic to avoid memory pressure, lower threshold if running out of memory. - const currentMemoryLimit = Math.min(this.memoryUsageLimit, freeMemory / 2); + const currentMemoryLimit = Math.min( + this.memoryUsageLimit, + freeMemory / 2, + ); const bytesPerGiB = 1024 * 1024 * 1024; if ( diff --git a/build-tools/packages/build-tools/src/fluidBuild/tsCompile.ts b/build-tools/packages/build-tools/src/fluidBuild/tsCompile.ts index 76ad427d5618..3caafb283630 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tsCompile.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tsCompile.ts @@ -57,12 +57,18 @@ export function tsCompile( if (commandLine) { configFileName = tscUtils.findConfigFile(cwd, commandLine); if (configFileName) { - commandLine = ts.getParsedCommandLineOfConfigFile(configFileName, commandLine.options, { - ...currentDirectorySystem, - onUnRecoverableConfigFileDiagnostic: (diagnostic: tsTypes.Diagnostic) => { - diagnostics.push(diagnostic); + commandLine = ts.getParsedCommandLineOfConfigFile( + configFileName, + commandLine.options, + { + ...currentDirectorySystem, + onUnRecoverableConfigFileDiagnostic: ( + diagnostic: tsTypes.Diagnostic, + ) => { + diagnostics.push(diagnostic); + }, }, - }); + ); } else { throw new Error("Unknown config file in command line"); } @@ -72,7 +78,10 @@ export function tsCompile( if (commandLine && diagnostics.length === 0) { // When specified, overrides current directory's package.json type field so tsc may cleanly // transpile .ts files to CommonJS or ESM using compilerOptions.module Node16 or NodeNext. - let packageJsonTypeOverrideUsage = "not read" as "not read" | "already present" | "used"; + let packageJsonTypeOverrideUsage = "not read" as + | "not read" + | "already present" + | "used"; const applyPackageJsonTypeOverride = !packageJsonTypeOverride ? undefined : ( @@ -81,7 +90,9 @@ export function tsCompile( | tsTypes.WatchCompilerHostOfConfigFile, ): void => { const originalReadFile = host.readFile; - const packageJsonPath = normalizeSlashes(path.join(cwd, "package.json")); + const packageJsonPath = normalizeSlashes( + path.join(cwd, "package.json"), + ); host.readFile = (fileName: string) => { const rawFile = originalReadFile(fileName); if (fileName === packageJsonPath && rawFile !== undefined) { @@ -91,7 +102,10 @@ export function tsCompile( (packageJson.type ?? "commonjs") !== packageJsonTypeOverride ? "used" : "already present"; - return JSON.stringify({ ...packageJson, type: packageJsonTypeOverride }); + return JSON.stringify({ + ...packageJson, + type: packageJsonTypeOverride, + }); } return rawFile; }; @@ -104,7 +118,9 @@ export function tsCompile( ); } if (!configFileName) { - throw new Error("A config file is required when --watch option is specified."); + throw new Error( + "A config file is required when --watch option is specified.", + ); } const host = ts.createWatchCompilerHost( @@ -118,7 +134,9 @@ export function tsCompile( return undefined; } - const incremental = !!(commandLine.options.incremental || commandLine.options.composite); + const incremental = !!( + commandLine.options.incremental || commandLine.options.composite + ); const host = incremental ? ts.createIncrementalCompilerHost(commandLine.options) @@ -127,11 +145,17 @@ export function tsCompile( const param = { rootNames: commandLine.fileNames, - options: tscUtils.convertOptionPaths(commandLine.options, cwd, path.resolve), + options: tscUtils.convertOptionPaths( + commandLine.options, + cwd, + path.resolve, + ), host, projectReferences: commandLine.projectReferences, }; - const program = incremental ? ts.createIncrementalProgram(param) : ts.createProgram(param); + const program = incremental + ? ts.createIncrementalProgram(param) + : ts.createProgram(param); diagnostics.push(...program.getConfigFileParsingDiagnostics()); diagnostics.push(...program.getSyntacticDiagnostics()); @@ -170,7 +194,10 @@ export function tsCompile( // TODO: tsc has more complicated summary than this if (commandLine?.options?.pretty !== false) { console.log( - ts.formatDiagnosticsWithColorAndContext(sortedDiagnostics, formatDiagnosticsHost), + ts.formatDiagnosticsWithColorAndContext( + sortedDiagnostics, + formatDiagnosticsHost, + ), ); console.log( `${ts.sys.newLine}Found ${sortedDiagnostics.length} error${ @@ -178,7 +205,9 @@ export function tsCompile( }.`, ); } else { - console.log(ts.formatDiagnostics(sortedDiagnostics, formatDiagnosticsHost)); + console.log( + ts.formatDiagnostics(sortedDiagnostics, formatDiagnosticsHost), + ); } } return code; diff --git a/build-tools/packages/build-tools/src/fluidBuild/tscUtils.ts b/build-tools/packages/build-tools/src/fluidBuild/tscUtils.ts index 1449d87b9bfb..61f43a937c2e 100644 --- a/build-tools/packages/build-tools/src/fluidBuild/tscUtils.ts +++ b/build-tools/packages/build-tools/src/fluidBuild/tscUtils.ts @@ -149,7 +149,9 @@ function createGetCanonicalFileName(tsLib: typeof ts) { return tsLib.sys.useCaseSensitiveFileNames ? (x: string) => x : (x: string) => - fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x; + fileNameLowerCaseRegExp.test(x) + ? x.replace(fileNameLowerCaseRegExp, toLowerCase) + : x; } function createGetSourceFileVersion(tsLib: typeof ts) { @@ -218,12 +220,18 @@ function createTscUtil(tsLib: typeof ts) { return parsedCommand; }, - findConfigFile: (directory: string, parsedCommand: ts.ParsedCommandLine | undefined) => { + findConfigFile: ( + directory: string, + parsedCommand: ts.ParsedCommandLine | undefined, + ) => { let tsConfigFullPath: string | undefined; const project = parsedCommand?.options.project; if (project !== undefined) { tsConfigFullPath = path.resolve(directory, project); - if (fs.existsSync(tsConfigFullPath) && fs.statSync(tsConfigFullPath).isDirectory()) { + if ( + fs.existsSync(tsConfigFullPath) && + fs.statSync(tsConfigFullPath).isDirectory() + ) { tsConfigFullPath = path.join(tsConfigFullPath, "tsconfig.json"); } } else { @@ -238,7 +246,9 @@ function createTscUtil(tsLib: typeof ts) { } else { // Assume there will be a local tsconfig.json and it is just currently missing. tsConfigFullPath = path.join(directory, "tsconfig.json"); - console.warn(`Warning: no config file found; assuming ${tsConfigFullPath}`); + console.warn( + `Warning: no config file found; assuming ${tsConfigFullPath}`, + ); } } return tsConfigFullPath; diff --git a/build-tools/packages/build-tools/src/index.ts b/build-tools/packages/build-tools/src/index.ts index 738cb9d7e207..c1138e099e25 100644 --- a/build-tools/packages/build-tools/src/index.ts +++ b/build-tools/packages/build-tools/src/index.ts @@ -6,7 +6,10 @@ export { GitRepo } from "./common/gitRepo"; export { FluidRepo } from "./fluidBuild/fluidRepo"; export { type IFluidBuildConfig } from "./fluidBuild/fluidBuildConfig"; -export { getResolvedFluidRoot, getFluidBuildConfig } from "./fluidBuild/fluidUtils"; +export { + getResolvedFluidRoot, + getFluidBuildConfig, +} from "./fluidBuild/fluidUtils"; export type { Logger } from "./common/logging"; export { MonoRepo } from "./common/monoRepo"; export { diff --git a/build-tools/packages/build-tools/src/test/biomeConfig.test.ts b/build-tools/packages/build-tools/src/test/biomeConfig.test.ts index 51e22b610bb6..8dc419a8d4e7 100644 --- a/build-tools/packages/build-tools/src/test/biomeConfig.test.ts +++ b/build-tools/packages/build-tools/src/test/biomeConfig.test.ts @@ -48,8 +48,14 @@ describe("Biome config loading", () => { testDataPath, "biome/pkg-b/include-formatter-added-1/subdirectory/markdownFile2.md", ), - path.resolve(testDataPath, "biome/pkg-b/include-formatter-added-1/sourceFile.ts"), - path.resolve(testDataPath, "biome/pkg-b/include-formatter-added-1/markdownFile1.md"), + path.resolve( + testDataPath, + "biome/pkg-b/include-formatter-added-1/sourceFile.ts", + ), + path.resolve( + testDataPath, + "biome/pkg-b/include-formatter-added-1/markdownFile1.md", + ), ]; const { formattedFiles } = config; assert( @@ -71,7 +77,10 @@ describe("Biome config loading", () => { testDataPath, "biome/pkg-b/include-formatter-added-1/subdirectory/markdownFile2.md", ), - path.resolve(testDataPath, "biome/pkg-b/include-formatter-added-1/markdownFile1.md"), + path.resolve( + testDataPath, + "biome/pkg-b/include-formatter-added-1/markdownFile1.md", + ), ]; const { formattedFiles } = config; assert( @@ -111,7 +120,9 @@ describe("Biome config loading", () => { assert(actual.files!.ignoreUnknown === false); assert(actual.files!.include!.includes("pkg-a-include/**")); assert(actual.files!.ignore!.includes("pkg-a-ignore/**")); - assert(actual.formatter!.include!.includes("include-formatter-added-1/**")); + assert( + actual.formatter!.include!.includes("include-formatter-added-1/**"), + ); assert(actual.formatter!.ignore!.includes("ignore-formatter-added-1/**")); assert(actual.linter!.include!.includes("include-linter-added-1/**")); assert(actual.linter!.ignore!.includes("ignore-linter-added-1/**")); @@ -211,11 +222,18 @@ describe("Biome config loading", () => { ); assert(ignores.has("pkg-a-ignore/**")); assert(ignores.has("ignore-formatter/**")); - assert(ignores.size === 2, `expected 2 items in the set, got ${ignores.size}`); + assert( + ignores.size === 2, + `expected 2 items in the set, got ${ignores.size}`, + ); }); it("linter ignore settings are merged with root", async () => { - const ignores = await getSettingValuesFromBiomeConfig(testConfig, "linter", "ignore"); + const ignores = await getSettingValuesFromBiomeConfig( + testConfig, + "linter", + "ignore", + ); assert(ignores.has("pkg-a-ignore/**")); assert(ignores.has("ignore-linter/**")); assert(ignores.size === 2); @@ -263,10 +281,19 @@ describe("Biome config loading", () => { testDataPath, "biome/pkg-a/pkg-a-include/include-formatter/formatter.ts", ), - path.resolve(testDataPath, "biome/pkg-a/pkg-a-include/include-linter/linter.ts"), - path.resolve(testDataPath, "biome/pkg-a/include-formatter/formatter.ts"), + path.resolve( + testDataPath, + "biome/pkg-a/pkg-a-include/include-linter/linter.ts", + ), + path.resolve( + testDataPath, + "biome/pkg-a/include-formatter/formatter.ts", + ), ]; - const formattedFiles = await getBiomeFormattedFilesFromDirectory(testPath, gitRepo); + const formattedFiles = await getBiomeFormattedFilesFromDirectory( + testPath, + gitRepo, + ); for (const actual of formattedFiles) { assert(expected.includes(actual)); } @@ -290,15 +317,27 @@ describe("Biome config loading", () => { it("returns correct file set", async () => { const expected = [ path.resolve(testDataPath, "biome/pkg-a/pkg-a-include/sourceFile.ts"), - path.resolve(testDataPath, "biome/pkg-a/pkg-a-include/include-linter/linter.ts"), + path.resolve( + testDataPath, + "biome/pkg-a/pkg-a-include/include-linter/linter.ts", + ), path.resolve( testDataPath, "biome/pkg-a/pkg-a-include/include-formatter/formatter.ts", ), - path.resolve(testDataPath, "biome/pkg-a/pkg-a-include/pkg-a-ignore/ignoredFile.ts"), - path.resolve(testDataPath, "biome/pkg-a/include-formatter/formatter.ts"), + path.resolve( + testDataPath, + "biome/pkg-a/pkg-a-include/pkg-a-ignore/ignoredFile.ts", + ), + path.resolve( + testDataPath, + "biome/pkg-a/include-formatter/formatter.ts", + ), ]; - const formattedFiles = await getBiomeFormattedFilesFromDirectory(testPath, gitRepo); + const formattedFiles = await getBiomeFormattedFilesFromDirectory( + testPath, + gitRepo, + ); for (const actual of formattedFiles) { assert(expected.includes(actual)); } diff --git a/build-tools/packages/build-tools/src/test/data/biome/add-includes-ignores.jsonc b/build-tools/packages/build-tools/src/test/data/biome/add-includes-ignores.jsonc index aa0eede3c307..084327ebec2e 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/add-includes-ignores.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/add-includes-ignores.jsonc @@ -1,11 +1,9 @@ { "$schema": "../../../../node_modules/@biomejs/biome/configuration_schema.json", "formatter": { - "include": ["include-formatter-added-1/**"], - "ignore": ["ignore-formatter-added-1/**"] + "includes": ["include-formatter-added-1/**"] }, "linter": { - "include": ["include-linter-added-1/**"], - "ignore": ["ignore-linter-added-1/**"] + "includes": ["include-linter-added-1/**"] } } diff --git a/build-tools/packages/build-tools/src/test/data/biome/base.jsonc b/build-tools/packages/build-tools/src/test/data/biome/base.jsonc index ffe1ff6a342c..9d90532f7f64 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/base.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/base.jsonc @@ -9,19 +9,8 @@ }, "files": { "ignoreUnknown": true, - - "ignore": [ - // Build output - "**/base-1/*", - "**/base-2/*", - "**/base/*.done.build.log" - ], - "maxSize": 2097152 }, - "organizeImports": { - "enabled": false - }, "linter": { "enabled": false, "rules": { @@ -59,7 +48,7 @@ // of the repo. // // This configuration should be kept up-to-date with the settings in `experimental/dds/tree/biome.jsonc`. - "include": ["experimental/dds/tree/**"], + "includes": ["experimental/dds/tree/**"], "formatter": { "lineWidth": 120 }, @@ -77,7 +66,7 @@ // format them conservatively without trailing commas. // // See also: https://github.com/microsoft/vscode/issues/102061 - "include": [ + "includes": [ "**/*.jsonc", // Tools reading api-extractor config files do not consistently support trailing commas. @@ -99,7 +88,7 @@ { // JSONC WITH TRAILING COMMAS // These JSONC files are known to support trailing commas. - "include": [ + "includes": [ // vscode config files all support trailing commas. "**/.vscode/*.json", @@ -120,7 +109,7 @@ // PACKAGE.JSON // These settings are used to format package.json files in the way npm itself does, with the exception of using // tabs instead of spaces. - "include": ["**/package.json"], + "includes": ["**/package.json"], "json": { "formatter": { "lineWidth": 1 diff --git a/build-tools/packages/build-tools/src/test/data/biome/pkg-a/biome.jsonc b/build-tools/packages/build-tools/src/test/data/biome/pkg-a/biome.jsonc index 4e8707c74300..2a8c1a2d0b54 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/pkg-a/biome.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/pkg-a/biome.jsonc @@ -1,16 +1,13 @@ { + "root": false, "$schema": "../../../../../node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../base.jsonc"], "files": { - "include": ["pkg-a-include/**"], - "ignore": ["pkg-a-ignore/**"] + "includes": ["pkg-a-include/**"] }, "formatter": { - "include": ["include-formatter/**"], - "ignore": ["ignore-formatter/**"] + "includes": ["include-formatter/**"] }, "linter": { - "include": ["include-linter/**"], - "ignore": ["ignore-linter/**"] + "includes": ["include-linter/**"] } } diff --git a/build-tools/packages/build-tools/src/test/data/biome/pkg-a/extended.jsonc b/build-tools/packages/build-tools/src/test/data/biome/pkg-a/extended.jsonc index c17f4599ea53..f2dd6528c03f 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/pkg-a/extended.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/pkg-a/extended.jsonc @@ -1,5 +1,4 @@ { - "extends": ["biome.jsonc"], "files": { "ignore": [] }, diff --git a/build-tools/packages/build-tools/src/test/data/biome/pkg-b/biome.jsonc b/build-tools/packages/build-tools/src/test/data/biome/pkg-b/biome.jsonc index f19a5a908350..cdd15cc93dc7 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/pkg-b/biome.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/pkg-b/biome.jsonc @@ -1,6 +1,6 @@ { + "root": false, "$schema": "../../../../../node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../pkg-a/biome.jsonc", "../add-includes-ignores.jsonc"], "files": { "ignoreUnknown": false } diff --git a/build-tools/packages/build-tools/src/test/data/biome/pkg-b/include-md-only.jsonc b/build-tools/packages/build-tools/src/test/data/biome/pkg-b/include-md-only.jsonc index da01ad4e5c6d..956b9b087621 100644 --- a/build-tools/packages/build-tools/src/test/data/biome/pkg-b/include-md-only.jsonc +++ b/build-tools/packages/build-tools/src/test/data/biome/pkg-b/include-md-only.jsonc @@ -1,6 +1,5 @@ { "$schema": "../../../../node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../pkg-a/biome.jsonc"], "files": { "include": ["*.md"] } diff --git a/build-tools/packages/build-tools/src/test/data/spaces/_package.json b/build-tools/packages/build-tools/src/test/data/spaces/_package.json index 330848bba227..5f46712b5d58 100644 --- a/build-tools/packages/build-tools/src/test/data/spaces/_package.json +++ b/build-tools/packages/build-tools/src/test/data/spaces/_package.json @@ -1,5 +1,5 @@ { - "name": "spaces-package", - "version": "1.0.0", - "private": true + "name": "spaces-package", + "version": "1.0.0", + "private": true } diff --git a/build-tools/packages/build-tools/src/test/npmPackage.test.ts b/build-tools/packages/build-tools/src/test/npmPackage.test.ts index aa44cbc0fd4d..80bbc5837033 100644 --- a/build-tools/packages/build-tools/src/test/npmPackage.test.ts +++ b/build-tools/packages/build-tools/src/test/npmPackage.test.ts @@ -6,7 +6,10 @@ import { strict as assert } from "assert"; import * as path from "node:path"; -import { type PackageJson, readPackageJsonAndIndent } from "../common/npmPackage"; +import { + type PackageJson, + readPackageJsonAndIndent, +} from "../common/npmPackage"; import { testDataPath } from "./init"; /** diff --git a/build-tools/packages/build-tools/src/test/tasks/leaf/apiExtractorTask.tests.ts b/build-tools/packages/build-tools/src/test/tasks/leaf/apiExtractorTask.tests.ts index d744fe7bb3ab..b731f2b0e58b 100644 --- a/build-tools/packages/build-tools/src/test/tasks/leaf/apiExtractorTask.tests.ts +++ b/build-tools/packages/build-tools/src/test/tasks/leaf/apiExtractorTask.tests.ts @@ -12,7 +12,11 @@ describe("API Extractor Task", () => { assert(useWorker("api-extractor run --local")); assert(useWorker("api-extractor run --config the/File.extension")); assert(useWorker("api-extractor run --local --config the/File.extension")); - assert(!useWorker("api-extractor run --local --config the/File.extension --unsupported")); + assert( + !useWorker( + "api-extractor run --local --config the/File.extension --unsupported", + ), + ); assert(!useWorker("api-extractor run unsupported")); assert(!useWorker("api-extractor run --local --config")); }); diff --git a/build-tools/packages/build-tools/src/test/tsconfig.json b/build-tools/packages/build-tools/src/test/tsconfig.json index c5a3d54565ea..5fc617d19774 100644 --- a/build-tools/packages/build-tools/src/test/tsconfig.json +++ b/build-tools/packages/build-tools/src/test/tsconfig.json @@ -39,7 +39,10 @@ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ - "types": ["node", "mocha"] /* Type declaration files to be included in compilation. */, + "types": [ + "node", + "mocha" + ] /* Type declaration files to be included in compilation. */, // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ @@ -51,13 +54,13 @@ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ - "incremental": true, + "incremental": true }, "include": ["./**/*"], "exclude": [], "references": [ { - "path": "../..", - }, - ], + "path": "../.." + } + ] } diff --git a/build-tools/packages/build-tools/tsconfig.json b/build-tools/packages/build-tools/tsconfig.json index 1847eac34662..767f68817225 100644 --- a/build-tools/packages/build-tools/tsconfig.json +++ b/build-tools/packages/build-tools/tsconfig.json @@ -14,8 +14,8 @@ "target": "es2022", "module": "node16", "moduleResolution": "node16", - "types": ["node"], + "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["src/test/**/*", "dist", "node_modules"], + "exclude": ["src/test/**/*", "dist", "node_modules"] } diff --git a/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts b/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts index e05b53bf1396..1da777c2294b 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/AdoArtifactFileProvider.ts @@ -58,7 +58,9 @@ export async function getZipObjectFromArtifact( buildApi.createAcceptHeader = originalCreateAcceptHeader; // We want our relative paths to be clean, so navigating JsZip into the top level folder - const result = (await unzipStream(artifactStream)).folder(bundleAnalysisArtifactName); + const result = (await unzipStream(artifactStream)).folder( + bundleAnalysisArtifactName, + ); assert( result, `getZipObjectFromArtifact could not find the folder ${bundleAnalysisArtifactName}`, @@ -77,7 +79,10 @@ export async function getStatsFileFromZip( relativePath: string, ): Promise { const jsZipObject = jsZip.file(relativePath); - assert(jsZipObject, `getStatsFileFromZip could not find file ${relativePath}`); + assert( + jsZipObject, + `getStatsFileFromZip could not find file ${relativePath}`, + ); const buffer = await jsZipObject.async("nodebuffer"); return decompressStatsFile(buffer); @@ -93,7 +98,10 @@ export async function getBundleBuddyConfigFileFromZip( relativePath: string, ): Promise { const jsZipObject = jsZip.file(relativePath); - assert(jsZipObject, `getBundleBuddyConfigFileFromZip could not find file ${relativePath}`); + assert( + jsZipObject, + `getBundleBuddyConfigFileFromZip could not find file ${relativePath}`, + ); const buffer = await jsZipObject.async("nodebuffer"); return JSON.parse(buffer.toString()); diff --git a/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts b/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts index 18227f1d6e82..285d203c73a5 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/AdoSizeComparator.ts @@ -5,10 +5,16 @@ import { join } from "path"; import type { WebApi } from "azure-devops-node-api"; -import { BuildResult, BuildStatus } from "azure-devops-node-api/interfaces/BuildInterfaces"; +import { + BuildResult, + BuildStatus, +} from "azure-devops-node-api/interfaces/BuildInterfaces"; import type JSZip from "jszip"; -import type { BundleComparison, BundleComparisonResult } from "../BundleBuddyTypes"; +import type { + BundleComparison, + BundleComparisonResult, +} from "../BundleBuddyTypes"; import { compareBundles } from "../compareBundles"; import { getBaselineCommit, getBuilds, getPriorCommit } from "../utilities"; import { @@ -26,7 +32,10 @@ import { import { getBuildTagForCommit } from "./getBuildTagForCommit"; import { getBundleBuddyConfigMap } from "./getBundleBuddyConfigMap"; import { getBundleSummaries } from "./getBundleSummaries"; -import { getCommentForBundleDiff, getSimpleComment } from "./getCommentForBundleDiff"; +import { + getCommentForBundleDiff, + getSimpleComment, +} from "./getCommentForBundleDiff"; export class ADOSizeComparator { /** @@ -71,7 +80,9 @@ export class ADOSizeComparator { * Naive fallback generator provided for convenience. It yields the commit directly * prior to the previous commit. */ - public static *naiveFallbackCommitGenerator(startingCommit: string): Generator { + public static *naiveFallbackCommitGenerator( + startingCommit: string, + ): Generator { let currentCommit = startingCommit; for (let i = 0; i < ADOSizeComparator.defaultBuildsToSearch; i++) { currentCommit = getPriorCommit(currentCommit); @@ -100,7 +111,8 @@ export class ADOSizeComparator { project: this.adoConstants.projectName, definitions: [this.adoConstants.ciBuildDefinitionId], maxBuildsPerDefinition: - this.adoConstants.buildsToSearch ?? ADOSizeComparator.defaultBuildsToSearch, + this.adoConstants.buildsToSearch ?? + ADOSizeComparator.defaultBuildsToSearch, }); while (baselineCommit !== undefined) { const baselineBuild = recentBuilds.find( @@ -191,7 +203,8 @@ export class ADOSizeComparator { return { message, comparison: undefined }; } - const comparison: BundleComparison[] = await this.createComparisonFromZip(baselineZip); + const comparison: BundleComparison[] = + await this.createComparisonFromZip(baselineZip); console.log(JSON.stringify(comparison)); const message = getCommentForBundleDiff(comparison, baselineCommit); @@ -216,20 +229,27 @@ export class ADOSizeComparator { } } - private async createComparisonFromZip(baselineZip: JSZip): Promise { + private async createComparisonFromZip( + baselineZip: JSZip, + ): Promise { const baselineZipBundlePaths = getBundlePathsFromZipObject(baselineZip); - const prBundleFileSystemPaths = await getBundlePathsFromFileSystem(this.localReportPath); + const prBundleFileSystemPaths = await getBundlePathsFromFileSystem( + this.localReportPath, + ); const configFileMap = await getBundleBuddyConfigMap({ bundleFileData: prBundleFileSystemPaths, getBundleBuddyConfig: (relativePath) => - getBundleBuddyConfigFromFileSystem(join(this.localReportPath, relativePath)), + getBundleBuddyConfigFromFileSystem( + join(this.localReportPath, relativePath), + ), }); const baselineSummaries = await getBundleSummaries({ bundlePaths: baselineZipBundlePaths, - getStatsFile: (relativePath) => getStatsFileFromZip(baselineZip, relativePath), + getStatsFile: (relativePath) => + getStatsFileFromZip(baselineZip, relativePath), getBundleBuddyConfigFile: (bundleName) => configFileMap.get(bundleName), statsProcessors: DefaultStatsProcessors, }); diff --git a/build-tools/packages/bundle-size-tools/src/ADO/DefaultStatsProcessors.ts b/build-tools/packages/bundle-size-tools/src/ADO/DefaultStatsProcessors.ts index 3a847440ab47..3eb104d2c622 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/DefaultStatsProcessors.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/DefaultStatsProcessors.ts @@ -15,8 +15,11 @@ import { totalSizeMetricName } from "./Constants"; */ export const DefaultStatsProcessors = [ getBundleBuddyConfigProcessor({ - metricNameProvider: (chunk) => `${chunk.name}.js `, + metricNameProvider: (chunk) => + `${chunk.name}.js `, + }), + getEntryStatsProcessor({ + metricNameProvider: (chunkName) => `${chunkName}.js`, }), - getEntryStatsProcessor({ metricNameProvider: (chunkName) => `${chunkName}.js` }), getTotalSizeStatsProcessor({ metricName: totalSizeMetricName }), ]; diff --git a/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts b/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts index fdc8d457f771..596571698d78 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/FileSystemBundleFileProvider.ts @@ -41,7 +41,9 @@ export async function getBundleBuddyConfigFromFileSystem( * Gets a decompressed webpack stats file from the filesystem * @param path - the full path to the file in the filesystem */ -export async function getStatsFileFromFileSystem(path: string): Promise { +export async function getStatsFileFromFileSystem( + path: string, +): Promise { const file = await fsPromises.readFile(path); return decompressStatsFile(file); diff --git a/build-tools/packages/bundle-size-tools/src/ADO/PrCommentsUtils.ts b/build-tools/packages/bundle-size-tools/src/ADO/PrCommentsUtils.ts index 103111ee9ab4..107aac3ea901 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/PrCommentsUtils.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/PrCommentsUtils.ts @@ -35,7 +35,10 @@ export class prCommentsUtils { * @param message - the message to write on the thread. You can pass HTML * @param threadType - the identifier of your thread */ - public async createOrUpdateThread(message: string, threadType: string | undefined) { + public async createOrUpdateThread( + message: string, + threadType: string | undefined, + ) { const gitApi = await this.gitApi; const existingThread = (threadType && (await this.getThreadByType(threadType))) || undefined; @@ -77,13 +80,21 @@ export class prCommentsUtils { * @param message - the message to write on the thread. You can pass HTML * @param threadType - the identifier of your thread */ - public async createOrReplaceThread(message: string, threadType: string | undefined) { + public async createOrReplaceThread( + message: string, + threadType: string | undefined, + ) { const gitApi = await this.gitApi; const existingThread = (threadType && (await this.getThreadByType(threadType))) || undefined; if (existingThread && existingThread.id) { - await gitApi.deleteComment(this.repoId, this.pullRequestId, existingThread.id, 1); + await gitApi.deleteComment( + this.repoId, + this.pullRequestId, + existingThread.id, + 1, + ); } await this.createOrUpdateThread(message, threadType); @@ -107,7 +118,12 @@ export class prCommentsUtils { content: message, }; - await gitApi.createComment(comment, this.repoId, this.pullRequestId, existingThread.id); + await gitApi.createComment( + comment, + this.repoId, + this.pullRequestId, + existingThread.id, + ); } /** @@ -131,7 +147,12 @@ export class prCommentsUtils { status: commentThreadStatus, }; - await gitApi.updateThread(thread, this.repoId, this.pullRequestId, existingThread.id); + await gitApi.updateThread( + thread, + this.repoId, + this.pullRequestId, + existingThread.id, + ); } private async getThreadByType(threadType: string) { @@ -139,7 +160,9 @@ export class prCommentsUtils { const threads = await gitApi.getThreads(this.repoId, this.pullRequestId); return threads.find((thread) => { - return thread.properties?.type?.$value === threadType && !thread.isDeleted; + return ( + thread.properties?.type?.$value === threadType && !thread.isDeleted + ); }); } } diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getBundleBuddyConfigMap.ts b/build-tools/packages/bundle-size-tools/src/ADO/getBundleBuddyConfigMap.ts index 2210f09c0d31..c9acff197e5e 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/getBundleBuddyConfigMap.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/getBundleBuddyConfigMap.ts @@ -21,9 +21,11 @@ export async function getBundleBuddyConfigMap( args.bundleFileData.forEach((bundle) => { if (bundle.relativePathToConfigFile) { asyncWork.push( - args.getBundleBuddyConfig(bundle.relativePathToConfigFile).then((configFile) => { - result.set(bundle.bundleName, configFile); - }), + args + .getBundleBuddyConfig(bundle.relativePathToConfigFile) + .then((configFile) => { + result.set(bundle.bundleName, configFile); + }), ); } }); diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts b/build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts index ed79193f2ad3..709e65598573 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/getBundleFilePathsFromFolder.ts @@ -18,7 +18,9 @@ function getBundleNameFromPath(relativePath: string): string { const pathParts = relativePath.replace(/\\/g, "/").split("/"); if (pathParts.length < 3) { - throw Error(`Could not derive a bundle name from this path: ${relativePath}`); + throw Error( + `Could not derive a bundle name from this path: ${relativePath}`, + ); } pathParts.pop(); // Remove the filename diff --git a/build-tools/packages/bundle-size-tools/src/ADO/getCommentForBundleDiff.ts b/build-tools/packages/bundle-size-tools/src/ADO/getCommentForBundleDiff.ts index 62fa7467ed8a..546cf989ec16 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/getCommentForBundleDiff.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/getCommentForBundleDiff.ts @@ -20,9 +20,11 @@ export function getCommentForBundleDiff( bundleComparison: BundleComparison[], baselineCommit: string, ) { - const diffDetails = bundleComparison.map(getBundleDetails).reduce((prev, current) => { - return prev + current; - }); + const diffDetails = bundleComparison + .map(getBundleDetails) + .reduce((prev, current) => { + return prev + current; + }); const baselineFooter = getCommentFooter(baselineCommit); @@ -73,7 +75,8 @@ function getBundleDetails(bundleDiff: BundleComparison) { `Could not compute the total size for a bundle, missing metric with name ${totalSizeMetricName}`, ); - const totalParsedSizeDiff = totalMetric.compare.parsedSize - totalMetric.baseline.parsedSize; + const totalParsedSizeDiff = + totalMetric.compare.parsedSize - totalMetric.baseline.parsedSize; const formattedTotalDiff = formatDiff(totalParsedSizeDiff); const glyph = getColorGlyph(totalParsedSizeDiff); @@ -115,7 +118,9 @@ function formatBytes(bytes: number) { const exponent = Math.floor(Math.log(Math.abs(bytes)) / Math.log(base)); return ( - parseFloat((bytes / Math.pow(base, exponent)).toFixed(decimals)) + " " + sizes[exponent] + parseFloat((bytes / Math.pow(base, exponent)).toFixed(decimals)) + + " " + + sizes[exponent] ); } diff --git a/build-tools/packages/bundle-size-tools/src/ADO/index.ts b/build-tools/packages/bundle-size-tools/src/ADO/index.ts index c9902a50da2d..3e2664c71835 100644 --- a/build-tools/packages/bundle-size-tools/src/ADO/index.ts +++ b/build-tools/packages/bundle-size-tools/src/ADO/index.ts @@ -23,7 +23,16 @@ export { getBundleBuddyConfigMap, GetBundleBuddyConfigMapArgs, } from "./getBundleBuddyConfigMap"; -export { BundleFileData, getBundleFilePathsFromFolder } from "./getBundleFilePathsFromFolder"; -export { getBundleSummaries, GetBundleSummariesArgs } from "./getBundleSummaries"; -export { getCommentForBundleDiff, getSimpleComment } from "./getCommentForBundleDiff"; +export { + BundleFileData, + getBundleFilePathsFromFolder, +} from "./getBundleFilePathsFromFolder"; +export { + getBundleSummaries, + GetBundleSummariesArgs, +} from "./getBundleSummaries"; +export { + getCommentForBundleDiff, + getSimpleComment, +} from "./getCommentForBundleDiff"; export { prCommentsUtils } from "./PrCommentsUtils"; diff --git a/build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts b/build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts index 9fc423abec5d..5ae908a170a6 100644 --- a/build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts +++ b/build-tools/packages/bundle-size-tools/src/BundleBuddyTypes.ts @@ -29,7 +29,9 @@ export interface BundleMetric { export interface BundleComparison { bundleName: string; - commonBundleMetrics: { [key: string]: { baseline: BundleMetric; compare: BundleMetric } }; + commonBundleMetrics: { + [key: string]: { baseline: BundleMetric; compare: BundleMetric }; + }; } /** diff --git a/build-tools/packages/bundle-size-tools/src/bannedModulesPlugin/bannedModulesPlugin.ts b/build-tools/packages/bundle-size-tools/src/bannedModulesPlugin/bannedModulesPlugin.ts index 9920511b6890..19724afb3222 100644 --- a/build-tools/packages/bundle-size-tools/src/bannedModulesPlugin/bannedModulesPlugin.ts +++ b/build-tools/packages/bundle-size-tools/src/bannedModulesPlugin/bannedModulesPlugin.ts @@ -46,7 +46,8 @@ export class BannedModulesPlugin { for (const bannedModule of this.options.bannedModules) { if (modulePath?.startsWith(bannedModule.moduleName)) { // We store the issuers as a set to remove duplicates - const bannedModuleIssuers = foundBannedModules.get(bannedModule) || new Set(); + const bannedModuleIssuers = + foundBannedModules.get(bannedModule) || new Set(); bannedModuleIssuers.add(JSON.stringify(mod.issuerPath)); foundBannedModules.set(bannedModule, bannedModuleIssuers); break; @@ -62,7 +63,9 @@ export class BannedModulesPlugin { issuerPaths.forEach((issuerPathJson) => { errorMessage += `\t\tIssuer: \n`; const pathSegments: { name: string }[] = JSON.parse(issuerPathJson); - pathSegments.forEach((segment) => (errorMessage += `\t\t\t${segment.name}\n`)); + pathSegments.forEach( + (segment) => (errorMessage += `\t\t\t${segment.name}\n`), + ); }); }); throw new Error(errorMessage); diff --git a/build-tools/packages/bundle-size-tools/src/compareBundles.ts b/build-tools/packages/bundle-size-tools/src/compareBundles.ts index 42a30fcbe575..9b4c5630ff80 100644 --- a/build-tools/packages/bundle-size-tools/src/compareBundles.ts +++ b/build-tools/packages/bundle-size-tools/src/compareBundles.ts @@ -22,7 +22,10 @@ export function compareBundles( `Baseline has bundle '${bundleName}' that does not appear in the comparison bundle `, ); } else { - const bundleComparison: BundleComparison = { bundleName, commonBundleMetrics: {} }; + const bundleComparison: BundleComparison = { + bundleName, + commonBundleMetrics: {}, + }; baselineBundle.forEach((baselineMetric, metricName) => { const compareMetric = compareBundle.get(metricName); @@ -50,7 +53,9 @@ export function compareBundles( * Checks if a bundle comparison contains no size changes * @param comparisons - bundle comparison */ -export function bundlesContainNoChanges(comparisons: BundleComparison[]): boolean { +export function bundlesContainNoChanges( + comparisons: BundleComparison[], +): boolean { for (const { commonBundleMetrics } of comparisons) { const metrics = Object.values(commonBundleMetrics); for (const { baseline, compare } of metrics) { diff --git a/build-tools/packages/bundle-size-tools/src/statsProcessors/bundleBuddyConfigProcessor.ts b/build-tools/packages/bundle-size-tools/src/statsProcessors/bundleBuddyConfigProcessor.ts index 1eb85258d8a1..313b6dadc1a0 100644 --- a/build-tools/packages/bundle-size-tools/src/statsProcessors/bundleBuddyConfigProcessor.ts +++ b/build-tools/packages/bundle-size-tools/src/statsProcessors/bundleBuddyConfigProcessor.ts @@ -3,7 +3,11 @@ * Licensed under the MIT License. */ -import type { BundleMetric, ChunkToAnalyze, WebpackStatsProcessor } from "../BundleBuddyTypes"; +import type { + BundleMetric, + ChunkToAnalyze, + WebpackStatsProcessor, +} from "../BundleBuddyTypes"; import { getChunkAndDependencySizes } from "../utilities"; export interface BundleBuddyConfigProcessorOptions { diff --git a/build-tools/packages/bundle-size-tools/src/statsProcessors/index.ts b/build-tools/packages/bundle-size-tools/src/statsProcessors/index.ts index 037d3215d920..0ead6dd55727 100644 --- a/build-tools/packages/bundle-size-tools/src/statsProcessors/index.ts +++ b/build-tools/packages/bundle-size-tools/src/statsProcessors/index.ts @@ -7,7 +7,10 @@ export { BundleBuddyConfigProcessorOptions, getBundleBuddyConfigProcessor, } from "./bundleBuddyConfigProcessor"; -export { EntryStatsProcessorOptions, getEntryStatsProcessor } from "./entryStatsProcessor"; +export { + EntryStatsProcessorOptions, + getEntryStatsProcessor, +} from "./entryStatsProcessor"; export { getTotalSizeStatsProcessor, TotalSizeStatsProcessorOptions, diff --git a/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts b/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts index b8f3447ce3dc..1b318e351ccd 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts +++ b/build-tools/packages/bundle-size-tools/src/utilities/getBuilds.ts @@ -22,7 +22,10 @@ export interface GetBuildOptions { /** * A wrapper around the terrible API signature for ADO getBuilds */ -export async function getBuilds(adoConnection: WebApi, options: GetBuildOptions) { +export async function getBuilds( + adoConnection: WebApi, + options: GetBuildOptions, +) { const buildApi = await adoConnection.getBuildApi(); return buildApi.getBuilds( diff --git a/build-tools/packages/bundle-size-tools/src/utilities/getChunkAndDependenciesSizes.ts b/build-tools/packages/bundle-size-tools/src/utilities/getChunkAndDependenciesSizes.ts index 27bee92eb5ee..910218e0971a 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/getChunkAndDependenciesSizes.ts +++ b/build-tools/packages/bundle-size-tools/src/utilities/getChunkAndDependenciesSizes.ts @@ -46,11 +46,14 @@ export function getChunkAndDependencySizes( // Find a chunk that has the desired name const rootChunk = stats.chunks.find( - (c) => (c.names?.length ?? 0) > 0 && c.names!.find((name) => name === chunkName), + (c) => + (c.names?.length ?? 0) > 0 && c.names!.find((name) => name === chunkName), ); if (rootChunk === undefined) { - throw new Error(`Could not find chunk with name: ${chunkName} in the stats file`); + throw new Error( + `Could not find chunk with name: ${chunkName} in the stats file`, + ); } const dependencySizeInfo: ChunkSizeInfo[] = []; @@ -59,7 +62,10 @@ export function getChunkAndDependencySizes( const processedDependencies = new Set(); // Get the initial set of dependencies - const dependenciesToProcess = [...(rootChunk.parents ?? []), ...(rootChunk.siblings ?? [])]; + const dependenciesToProcess = [ + ...(rootChunk.parents ?? []), + ...(rootChunk.siblings ?? []), + ]; while (dependenciesToProcess.length > 0) { const chunkToProcess = dependenciesToProcess.pop()!; @@ -76,6 +82,9 @@ export function getChunkAndDependencySizes( return { name: chunkName, dependencies: dependencySizeInfo, - size: getChunkParsedSize(stats, rootChunk.id ?? fail("root chunk does not have id")), + size: getChunkParsedSize( + stats, + rootChunk.id ?? fail("root chunk does not have id"), + ), }; } diff --git a/build-tools/packages/bundle-size-tools/src/utilities/getChunkParsedSize.ts b/build-tools/packages/bundle-size-tools/src/utilities/getChunkParsedSize.ts index f54b24e973af..041fe9388887 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/getChunkParsedSize.ts +++ b/build-tools/packages/bundle-size-tools/src/utilities/getChunkParsedSize.ts @@ -8,7 +8,10 @@ import type { StatsCompilation } from "webpack"; /** * This gets the size of a chunk after minification, which is what the browser will parse. */ -export function getChunkParsedSize(stats: StatsCompilation, chunkId: string | number): number { +export function getChunkParsedSize( + stats: StatsCompilation, + chunkId: string | number, +): number { if (stats.assets === undefined) { throw new Error( `No assets property in the stats file, can't compute parsed sizes of chunks`, diff --git a/build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts b/build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts index 6ead78470aea..dc983163c0f1 100644 --- a/build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts +++ b/build-tools/packages/bundle-size-tools/src/utilities/gitCommands.ts @@ -9,11 +9,15 @@ import { execSync } from "child_process"; * Gets the commit in the target branch that the current branch is based on. */ export function getBaselineCommit(): string { - return execSync(`git merge-base origin/${process.env.TARGET_BRANCH_NAME} HEAD`) + return execSync( + `git merge-base origin/${process.env.TARGET_BRANCH_NAME} HEAD`, + ) .toString() .trim(); } export function getPriorCommit(baseCommit: string): string { - return execSync(`git log --pretty=format:"%H" -1 ${baseCommit}~1`).toString().trim(); + return execSync(`git log --pretty=format:"%H" -1 ${baseCommit}~1`) + .toString() + .trim(); } diff --git a/build-tools/packages/bundle-size-tools/tsconfig.json b/build-tools/packages/bundle-size-tools/tsconfig.json index ade3da577f6b..584da6d63824 100644 --- a/build-tools/packages/bundle-size-tools/tsconfig.json +++ b/build-tools/packages/bundle-size-tools/tsconfig.json @@ -7,8 +7,8 @@ "noImplicitThis": true, "noImplicitAny": true, "target": "es2018", - "types": ["node"], + "types": ["node"] }, "include": ["src/**/*.ts"], - "exclude": ["src/test/**/*", "dist", "node_modules"], + "exclude": ["src/test/**/*", "dist", "node_modules"] } diff --git a/build-tools/packages/version-tools/src/bumpTypes.ts b/build-tools/packages/version-tools/src/bumpTypes.ts index 4a4a3a071636..4b465f6d8a9d 100644 --- a/build-tools/packages/version-tools/src/bumpTypes.ts +++ b/build-tools/packages/version-tools/src/bumpTypes.ts @@ -50,7 +50,11 @@ export type RangeOperatorWithVersion = `${Exclude}${string}`; * We intentionally only include the ranges we use, not everything considered valid by workspace-protocol-aware tools * like yarn and pnpm. */ -export const WorkspaceRanges = ["workspace:*", "workspace:^", "workspace:~"] as const; +export const WorkspaceRanges = [ + "workspace:*", + "workspace:^", + "workspace:~", +] as const; /** * A type representing the workspace range strings we use. @@ -87,7 +91,10 @@ export type InterdependencyRange = * which is good because I don't know how to fix it. */ export function isInterdependencyRange(r: unknown): r is InterdependencyRange { - if ((typeof r === "string" || r instanceof semver.SemVer) && semver.valid(r) !== null) { + if ( + (typeof r === "string" || r instanceof semver.SemVer) && + semver.valid(r) !== null + ) { return true; } @@ -95,7 +102,10 @@ export function isInterdependencyRange(r: unknown): r is InterdependencyRange { return true; } - if ((typeof r === "string" || r instanceof semver.Range) && semver.validRange(r) === null) { + if ( + (typeof r === "string" || r instanceof semver.Range) && + semver.validRange(r) === null + ) { return false; } @@ -139,7 +149,9 @@ export type VersionChangeTypeExtended = VersionBumpTypeExtended | semver.SemVer; export function isVersionBumpType( type: VersionChangeType | string | undefined, ): type is VersionBumpType { - return type === undefined ? false : type === "major" || type === "minor" || type === "patch"; + return type === undefined + ? false + : type === "major" || type === "minor" || type === "patch"; } /** @@ -148,5 +160,10 @@ export function isVersionBumpType( export function isVersionBumpTypeExtended( type: VersionChangeType | string, ): type is VersionBumpTypeExtended { - return type === "major" || type === "minor" || type === "patch" || type === "current"; + return ( + type === "major" || + type === "minor" || + type === "patch" || + type === "current" + ); } diff --git a/build-tools/packages/version-tools/src/commands/version.ts b/build-tools/packages/version-tools/src/commands/version.ts index acdf06899689..9e931554bbfc 100644 --- a/build-tools/packages/version-tools/src/commands/version.ts +++ b/build-tools/packages/version-tools/src/commands/version.ts @@ -68,15 +68,18 @@ export default class VersionCommand extends Command { static readonly examples = [ { description: "The version can be a Fluid internal version.", - command: "<%= config.bin %> <%= command.id %> 2.0.0-internal.1.0.0 --type minor", + command: + "<%= config.bin %> <%= command.id %> 2.0.0-internal.1.0.0 --type minor", }, { description: "The version can also be a semver with a bump type.", command: "<%= config.bin %> <%= command.id %> 1.0.0 --type minor", }, { - description: "If needed, you can provide a public version to override the default.", - command: "<%= config.bin %> <%= command.id %> 1.0.0 --type patch --publicVersion 3.1.0", + description: + "If needed, you can provide a public version to override the default.", + command: + "<%= config.bin %> <%= command.id %> 1.0.0 --type patch --publicVersion 3.1.0", }, { description: "You can use ^ and ~ as a shorthand.", @@ -85,7 +88,8 @@ export default class VersionCommand extends Command { { description: "You can use the 'current' bump type to calculate ranges without bumping the version.", - command: "<%= config.bin %> <%= command.id %> 2.0.0-internal.1.0.0 --type current", + command: + "<%= config.bin %> <%= command.id %> 2.0.0-internal.1.0.0 --type current", }, ]; @@ -158,7 +162,9 @@ export default class VersionCommand extends Command { this.log(tablify(data.original)); if (bumpType !== "current") { - this.log(`\nBUMPED to ${data.bumped.internalSchemeVersion} (${data.bumpType})`); + this.log( + `\nBUMPED to ${data.bumped.internalSchemeVersion} (${data.bumpType})`, + ); this.log(tablify(data.bumped)); } @@ -199,7 +205,11 @@ export default class VersionCommand extends Command { function tablify(scheme: VersionScheme): string { return table(Object.entries(scheme), { - columns: [{ alignment: "left" }, { alignment: "left" }, { alignment: "left" }], + columns: [ + { alignment: "left" }, + { alignment: "left" }, + { alignment: "left" }, + ], singleLine: true, }); } diff --git a/build-tools/packages/version-tools/src/index.ts b/build-tools/packages/version-tools/src/index.ts index 98d918bfb0f3..00edc3b73f7d 100644 --- a/build-tools/packages/version-tools/src/index.ts +++ b/build-tools/packages/version-tools/src/index.ts @@ -40,6 +40,18 @@ export { sortVersions, type VersionScheme, } from "./schemes"; -export { bumpRange, detectBumpType, isPrereleaseVersion, getPreviousVersions } from "./semver"; -export { getIsLatest, getSimpleVersion, getVersionsFromStrings } from "./versions"; -export { fromVirtualPatchScheme, toVirtualPatchScheme } from "./virtualPatchScheme"; +export { + bumpRange, + detectBumpType, + isPrereleaseVersion, + getPreviousVersions, +} from "./semver"; +export { + getIsLatest, + getSimpleVersion, + getVersionsFromStrings, +} from "./versions"; +export { + fromVirtualPatchScheme, + toVirtualPatchScheme, +} from "./virtualPatchScheme"; diff --git a/build-tools/packages/version-tools/src/internalVersionScheme.ts b/build-tools/packages/version-tools/src/internalVersionScheme.ts index 8f03c0140b4b..e49b4335c6a1 100644 --- a/build-tools/packages/version-tools/src/internalVersionScheme.ts +++ b/build-tools/packages/version-tools/src/internalVersionScheme.ts @@ -104,13 +104,17 @@ export function fromInternalScheme( : prereleaseSections.slice(1).join("."); const newSemVer = semver.parse(newSemVerString); if (newSemVer === null) { - throw new Error(`Couldn't convert ${internalVersion} to a standard semver.`); + throw new Error( + `Couldn't convert ${internalVersion} to a standard semver.`, + ); } const publicVersionString = parsedVersion.format().split("-")[0]; const publicVersion = semver.parse(publicVersionString); if (publicVersion === null) { - throw new Error(`Couldn't convert ${publicVersionString} to a standard semver.`); + throw new Error( + `Couldn't convert ${publicVersionString} to a standard semver.`, + ); } return [publicVersion, newSemVer, prereleaseIdentifier]; @@ -173,7 +177,9 @@ export function toInternalScheme( } if (!isInternalVersionScheme(newSemVer, allowPrereleases, true)) { - throw new Error(`Converted version is not a valid Fluid internal version: ${newSemVer}`); + throw new Error( + `Converted version is not a valid Fluid internal version: ${newSemVer}`, + ); } return newSemVer; @@ -238,7 +244,8 @@ export function validateVersionScheme( parsedVersion.prerelease.length < EXPECTED_PRERELEASE_SECTIONS || // If the version has more than the minimum prerelease sections, then it's not considered an internal version unless // allowPrereleases === true - (parsedVersion.prerelease.length > EXPECTED_PRERELEASE_SECTIONS && !allowPrereleases) + (parsedVersion.prerelease.length > EXPECTED_PRERELEASE_SECTIONS && + !allowPrereleases) ) { throw new Error( `Prerelease value contains ${parsedVersion.prerelease.length} components; expected ${EXPECTED_PRERELEASE_SECTIONS}.`, @@ -264,7 +271,9 @@ export function isInternalVersionScheme( allowAnyPrereleaseId = false, ): boolean { const parsedVersion = semver.parse(version); - const prereleaseIds = allowAnyPrereleaseId ? undefined : ALLOWED_PRERELEASE_IDENTIFIERS; + const prereleaseIds = allowAnyPrereleaseId + ? undefined + : ALLOWED_PRERELEASE_IDENTIFIERS; try { validateVersionScheme(parsedVersion, allowPrereleases, prereleaseIds); @@ -283,7 +292,10 @@ export function isInternalVersionScheme( * `ALLOWED_PRERELEASE_IDENTIFIERS`. * @returns True if the range string matches the Fluid internal version scheme. */ -export function isInternalVersionRange(range: string, allowAnyPrereleaseId = false): boolean { +export function isInternalVersionRange( + range: string, + allowAnyPrereleaseId = false, +): boolean { if (semver.validRange(range) === null) { return false; } @@ -328,7 +340,8 @@ export function isInternalVersionRange(range: string, allowAnyPrereleaseId = fal const prereleasePrefix = `${minVer.major}.${minVer.minor}.${minVer.patch}-${minVer.prerelease[0]}.`; return singleRangeSet.some( (comparator) => - comparator.operator === "<" && comparator.semver.version.startsWith(prereleasePrefix), + comparator.operator === "<" && + comparator.semver.version.startsWith(prereleasePrefix), ); } @@ -345,7 +358,11 @@ export function bumpInternalVersion( bumpType: VersionBumpTypeExtended, ): semver.SemVer { validateVersionScheme(version, true, undefined); - const [pubVer, intVer, prereleaseId] = fromInternalScheme(version, true, true); + const [pubVer, intVer, prereleaseId] = fromInternalScheme( + version, + true, + true, + ); const newIntVer = bumpType === "current" @@ -431,7 +448,9 @@ export function changePreReleaseIdentifier( if (typeof identifier === "number") { // eslint-disable-next-line unicorn/prefer-type-error - throw new Error(`Prerelease identifier is numeric; it should be a string: ${version}`); + throw new Error( + `Prerelease identifier is numeric; it should be a string: ${version}`, + ); } const newPrereleaseSection = [newIdentifier, ...pr.slice(1)].join("."); @@ -495,7 +514,11 @@ export function detectInternalVersionConstraintType( const minor = bumpInternalVersion(minVer, "minor"); const maxSatisfying = semver.maxSatisfying([patch, minor], range); - return maxSatisfying === patch ? "patch" : maxSatisfying === minor ? "minor" : "exact"; + return maxSatisfying === patch + ? "patch" + : maxSatisfying === minor + ? "minor" + : "exact"; } /** @@ -516,7 +539,9 @@ export function detectInternalVersionConstraintType( * * @throws error - If the version string cannot be parsed as a valid semantic version. */ -export function isInternalTestVersion(version: semver.SemVer | string): boolean { +export function isInternalTestVersion( + version: semver.SemVer | string, +): boolean { const parsedVersion = semver.parse(version); if (parsedVersion === null) { diff --git a/build-tools/packages/version-tools/src/schemes.ts b/build-tools/packages/version-tools/src/schemes.ts index 892be4de3aaa..dfe859a5695d 100644 --- a/build-tools/packages/version-tools/src/schemes.ts +++ b/build-tools/packages/version-tools/src/schemes.ts @@ -26,7 +26,11 @@ import { bumpVirtualPatchVersion, isVirtualPatch } from "./virtualPatchScheme"; * * - "virtualPatch" is the 0.36.1002 scheme. */ -export type VersionScheme = "semver" | "internal" | "internalPrerelease" | "virtualPatch"; +export type VersionScheme = + | "semver" + | "internal" + | "internalPrerelease" + | "virtualPatch"; /** * A typeguard to check if a string is a {@link VersionScheme}. @@ -45,7 +49,9 @@ export function isVersionScheme(scheme: string): scheme is VersionScheme { * @param rangeOrVersion - a version or range string. * @returns The version scheme that the string is in. */ -export function detectVersionScheme(rangeOrVersion: string | semver.SemVer): VersionScheme { +export function detectVersionScheme( + rangeOrVersion: string | semver.SemVer, +): VersionScheme { // First check if the string is a valid internal version if (isInternalVersionScheme(rangeOrVersion)) { return "internal"; @@ -73,7 +79,9 @@ export function detectVersionScheme(rangeOrVersion: string | semver.SemVer): Ver const coercedVersion = semver.coerce(rangeOrVersion); if (coercedVersion === null) { - throw new Error(`Couldn't parse a usable version from '${rangeOrVersion}'.`); + throw new Error( + `Couldn't parse a usable version from '${rangeOrVersion}'.`, + ); } const operator = rangeOrVersion.slice(0, 1); @@ -104,7 +112,10 @@ export function bumpVersionScheme( scheme?: VersionScheme, ): semver.SemVer { const sv = semver.parse(version); - assert(sv !== null && version !== undefined, `Not a valid semver: ${version}`); + assert( + sv !== null && version !== undefined, + `Not a valid semver: ${version}`, + ); if (scheme === undefined) { // eslint-disable-next-line no-param-reassign scheme = detectVersionScheme(version); @@ -129,7 +140,9 @@ export function bumpVersionScheme( } case "internal": { if (version === undefined || !isInternalVersionScheme(version)) { - throw new Error(`Version is not in the ${scheme} version scheme: ${version}`); + throw new Error( + `Version is not in the ${scheme} version scheme: ${version}`, + ); } return bumpInternalVersion(version, bumpType); } @@ -170,7 +183,10 @@ export function getLatestReleaseFromList( return latest; } -export function sortVersions(versionList: string[], allowPrereleases = false): string[] { +export function sortVersions( + versionList: string[], + allowPrereleases = false, +): string[] { let list: string[] = []; // Check if the versionList is version strings or tag names @@ -188,7 +204,8 @@ export function sortVersions(versionList: string[], allowPrereleases = false): s if (v === undefined) { return false; } - const hasSemverPrereleaseSection = semver.prerelease(v)?.length ?? 0 !== 0; + const hasSemverPrereleaseSection = + semver.prerelease(v)?.length ?? 0 !== 0; const scheme = detectVersionScheme(v); const isPrerelease = scheme === "internalPrerelease" || diff --git a/build-tools/packages/version-tools/src/semver.ts b/build-tools/packages/version-tools/src/semver.ts index 191f90527fd1..d3307e3a4637 100644 --- a/build-tools/packages/version-tools/src/semver.ts +++ b/build-tools/packages/version-tools/src/semver.ts @@ -5,7 +5,11 @@ import * as semver from "semver"; -import type { ReleaseVersion, VersionBumpType, VersionBumpTypeExtended } from "./bumpTypes"; +import type { + ReleaseVersion, + VersionBumpType, + VersionBumpTypeExtended, +} from "./bumpTypes"; import { DEFAULT_PRERELEASE_IDENTIFIER, RC_PRERELEASE_IDENTIFER, @@ -17,7 +21,10 @@ import { toInternalScheme, } from "./internalVersionScheme"; import { bumpVersionScheme, detectVersionScheme } from "./schemes"; -import { fromVirtualPatchScheme, toVirtualPatchScheme } from "./virtualPatchScheme"; +import { + fromVirtualPatchScheme, + toVirtualPatchScheme, +} from "./virtualPatchScheme"; /** * Return the version RANGE incremented by the bump type (major, minor, or patch). @@ -75,7 +82,9 @@ export function bumpRange( } default: { - throw new Error(`${scheme} wasn't handled. Was a new version scheme added?`); + throw new Error( + `${scheme} wasn't handled. Was a new version scheme added?`, + ); } } } @@ -175,7 +184,9 @@ export function detectBumpType( * @param version - The version to check. * @returns True if the version is a prerelease version, false otherwise. */ -export function isPrereleaseVersion(version: string | semver.SemVer | undefined): boolean { +export function isPrereleaseVersion( + version: string | semver.SemVer | undefined, +): boolean { if (version === undefined) { return false; } @@ -224,7 +235,11 @@ export function isPrereleaseVersion(version: string | semver.SemVer | undefined) */ export function getPreviousVersions( version: ReleaseVersion, -): [ReleaseVersion | undefined, ReleaseVersion | undefined, ReleaseVersion | undefined] { +): [ + ReleaseVersion | undefined, + ReleaseVersion | undefined, + ReleaseVersion | undefined, +] { const scheme = detectVersionScheme(version); let previousMajorVersion: ReleaseVersion | undefined; let previousMinorVersion: ReleaseVersion | undefined; diff --git a/build-tools/packages/version-tools/src/test/internalVersionScheme.test.ts b/build-tools/packages/version-tools/src/test/internalVersionScheme.test.ts index ed8ff122ffa6..e33534d1d710 100644 --- a/build-tools/packages/version-tools/src/test/internalVersionScheme.test.ts +++ b/build-tools/packages/version-tools/src/test/internalVersionScheme.test.ts @@ -140,7 +140,11 @@ describe("internalScheme", () => { ">=2.0.0-internal.1.0.0 <2.0.0-internal.1.1.0 || >=2.0.0-rc.1.0.0 <2.0.0-rc.1.1.0", undefined, ], - [false, ">=2.0.0-internal.1.0.0 <2.0.0-internal.1.1.0 || >=1.0.0 <2.0.0", undefined], + [ + false, + ">=2.0.0-internal.1.0.0 <2.0.0-internal.1.1.0 || >=1.0.0 <2.0.0", + undefined, + ], [true, ">=2.0.0-internal.2.2.1 <2.0.0-internal.3.0.0", undefined], [false, ">=2.0.0-alpha.2.2.1 <2.0.0-alpha.3.0.0", undefined], [true, ">=2.0.0-alpha.2.2.1 <2.0.0-alpha.3.0.0", true], @@ -312,7 +316,10 @@ describe("internalScheme", () => { ), ); assert.isFalse( - semver.satisfies(`2.0.0-dev.1.5.0`, `>=2.0.0-internal.1.4.0 <2.0.0-internal.2.0.0`), + semver.satisfies( + `2.0.0-dev.1.5.0`, + `>=2.0.0-internal.1.4.0 <2.0.0-internal.2.0.0`, + ), ); }); }); diff --git a/build-tools/packages/version-tools/src/test/semver.test.ts b/build-tools/packages/version-tools/src/test/semver.test.ts index 80716152437a..2e46fce3298e 100644 --- a/build-tools/packages/version-tools/src/test/semver.test.ts +++ b/build-tools/packages/version-tools/src/test/semver.test.ts @@ -31,15 +31,23 @@ describe("semver", () => { }); it("internal version scheme patch", () => { - assert.equal(detectBumpType("2.0.0-internal.4.0.7", "2.0.0-internal.4.0.8"), "patch"); + assert.equal( + detectBumpType("2.0.0-internal.4.0.7", "2.0.0-internal.4.0.8"), + "patch", + ); }); it("internal -> RC is major", () => { - assert.equal(detectBumpType("2.0.0-internal.1.0.7", "2.0.0-rc.2.0.8"), "major"); + assert.equal( + detectBumpType("2.0.0-internal.1.0.7", "2.0.0-rc.2.0.8"), + "major", + ); }); it("RC -> internal throws", () => { - assert.throws(() => detectBumpType("2.0.0-rc.4.0.7", "2.0.0-internal.5.0.0")); + assert.throws(() => + detectBumpType("2.0.0-rc.4.0.7", "2.0.0-internal.5.0.0"), + ); }); it("premajor", () => { @@ -71,15 +79,24 @@ describe("semver", () => { describe("detectBumpType internal version scheme", () => { it("major", () => { - assert.equal(detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.2.0.0"), "major"); + assert.equal( + detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.2.0.0"), + "major", + ); }); it("minor", () => { - assert.equal(detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.1.1.0"), "minor"); + assert.equal( + detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.1.1.0"), + "minor", + ); }); it("patch", () => { - assert.equal(detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.1.0.1"), "patch"); + assert.equal( + detectBumpType("2.0.0-internal.1.0.0", "2.0.0-internal.1.0.1"), + "patch", + ); }); it("premajor bump type returns major", () => { @@ -139,7 +156,10 @@ describe("semver", () => { }); it("v1 is internal, v2 is rc", () => { - assert.equal(detectBumpType("2.0.0-internal.8.0.1", "2.0.0-rc.1.0.0"), "major"); + assert.equal( + detectBumpType("2.0.0-internal.8.0.1", "2.0.0-rc.1.0.0"), + "major", + ); }); it("v1 is rc, v2 is rc", () => { @@ -759,7 +779,10 @@ describe("semver", () => { it("2.0.0-internal.2.0.0", () => { const input = `2.0.0-internal.2.0.0`; - const [expected1, expected2] = [`2.0.0-internal.1.0.0`, `2.0.0-internal.2.0.0`]; + const [expected1, expected2] = [ + `2.0.0-internal.1.0.0`, + `2.0.0-internal.2.0.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); @@ -767,7 +790,10 @@ describe("semver", () => { it("2.0.0-internal.2.2.0", () => { const input = `2.0.0-internal.2.2.0`; - const [expected1, expected2] = [`2.0.0-internal.1.0.0`, `2.0.0-internal.2.1.0`]; + const [expected1, expected2] = [ + `2.0.0-internal.1.0.0`, + `2.0.0-internal.2.1.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); @@ -775,7 +801,10 @@ describe("semver", () => { it("2.0.0-internal.3.0.0", () => { const input = `2.0.0-internal.3.0.0`; - const [expected1, expected2] = [`2.0.0-internal.2.0.0`, `2.0.0-internal.3.0.0`]; + const [expected1, expected2] = [ + `2.0.0-internal.2.0.0`, + `2.0.0-internal.3.0.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); @@ -783,7 +812,10 @@ describe("semver", () => { it("2.0.0-internal.3.2.0", () => { const input = `2.0.0-internal.3.2.0`; - const [expected1, expected2] = [`2.0.0-internal.2.0.0`, `2.0.0-internal.3.1.0`]; + const [expected1, expected2] = [ + `2.0.0-internal.2.0.0`, + `2.0.0-internal.3.1.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); @@ -791,7 +823,10 @@ describe("semver", () => { it("2.0.0-internal.3.2.2", () => { const input = `2.0.0-internal.3.2.2`; - const [expected1, expected2] = [`2.0.0-internal.2.0.0`, `2.0.0-internal.3.1.0`]; + const [expected1, expected2] = [ + `2.0.0-internal.2.0.0`, + `2.0.0-internal.3.1.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); @@ -799,7 +834,10 @@ describe("semver", () => { it("3.0.0-internal.3.2.2", () => { const input = `3.0.0-internal.3.2.2`; - const [expected1, expected2] = [`3.0.0-internal.2.0.0`, `3.0.0-internal.3.1.0`]; + const [expected1, expected2] = [ + `3.0.0-internal.2.0.0`, + `3.0.0-internal.3.1.0`, + ]; const [result1, result2] = getPreviousVersions(input); assert.equal(result1, expected1, "previous major version mismatch"); assert.equal(result2, expected2, "previous minor version mismatch"); diff --git a/build-tools/packages/version-tools/src/test/tsconfig.json b/build-tools/packages/version-tools/src/test/tsconfig.json index cafb913ae554..06194b934315 100644 --- a/build-tools/packages/version-tools/src/test/tsconfig.json +++ b/build-tools/packages/version-tools/src/test/tsconfig.json @@ -7,12 +7,12 @@ "rootDir": "./", "outDir": "../../lib/test", "types": ["node", "mocha", "chai"], - "skipLibCheck": true, + "skipLibCheck": true }, "include": ["./**/*"], "references": [ { - "path": "../..", - }, - ], + "path": "../.." + } + ] } diff --git a/build-tools/packages/version-tools/src/test/versions.test.ts b/build-tools/packages/version-tools/src/test/versions.test.ts index fad1feac8281..aca13548f45d 100644 --- a/build-tools/packages/version-tools/src/test/versions.test.ts +++ b/build-tools/packages/version-tools/src/test/versions.test.ts @@ -7,7 +7,11 @@ import { assert, expect } from "chai"; import * as semver from "semver"; import { getVersionRange } from "../internalVersionScheme"; -import { getIsLatest, getSimpleVersion, getVersionsFromStrings } from "../versions"; +import { + getIsLatest, + getSimpleVersion, + getVersionsFromStrings, +} from "../versions"; // Deliberately not sorted here; highest version is 0.59.3000 const test_tags = [ @@ -25,12 +29,21 @@ const test_tags = [ describe("getSimpleVersion", () => { it("version with id, no prerelease", () => { - assert.equal(getSimpleVersion("0.15.0", "12345.0", false, true), "0.15.12345"); - assert.equal(getSimpleVersion("0.15.0", "12345.0", true, true), "0.15.12345"); + assert.equal( + getSimpleVersion("0.15.0", "12345.0", false, true), + "0.15.12345", + ); + assert.equal( + getSimpleVersion("0.15.0", "12345.0", true, true), + "0.15.12345", + ); }); it("version with id, with prerelease", () => { - assert.equal(getSimpleVersion("0.15.0-rc", "12345.0", false, true), "0.15.12345-rc"); + assert.equal( + getSimpleVersion("0.15.0-rc", "12345.0", false, true), + "0.15.12345-rc", + ); assert.equal( getSimpleVersion("0.15.0-alpha.1", "12345.0", false, true), "0.15.12345-alpha.1", @@ -39,16 +52,25 @@ describe("getSimpleVersion", () => { getSimpleVersion("0.15.0-beta.2.1", "12345.0", false, true), "0.15.12345-beta.2.1", ); - assert.equal(getSimpleVersion("0.15.0-beta", "12345.0", true, true), "0.15.12345-beta"); + assert.equal( + getSimpleVersion("0.15.0-beta", "12345.0", true, true), + "0.15.12345-beta", + ); }); it("version no id, no prerelease", () => { - assert.equal(getSimpleVersion("0.16.0", "12345.0", false, false), "0.16.0-12345.0"); + assert.equal( + getSimpleVersion("0.16.0", "12345.0", false, false), + "0.16.0-12345.0", + ); assert.equal(getSimpleVersion("0.16.0", "12345.0", true, false), "0.16.0"); }); it("version no id, with prerelease", () => { - assert.equal(getSimpleVersion("0.16.0-rc", "12345.0", false, false), "0.16.0-rc.12345.0"); + assert.equal( + getSimpleVersion("0.16.0-rc", "12345.0", false, false), + "0.16.0-rc.12345.0", + ); assert.equal( getSimpleVersion("0.16.0-alpha.1", "12345.0", false, false), "0.16.0-alpha.1.12345.0", @@ -57,7 +79,10 @@ describe("getSimpleVersion", () => { getSimpleVersion("0.16.0-beta.2.1", "12345.0", false, false), "0.16.0-beta.2.1.12345.0", ); - assert.equal(getSimpleVersion("0.16.0-beta", "12345.0", true, false), "0.16.0-beta"); + assert.equal( + getSimpleVersion("0.16.0-beta", "12345.0", true, false), + "0.16.0-beta", + ); }); describe("Fluid internal versions", () => { @@ -140,7 +165,9 @@ describe("getIsLatest", () => { // By default, getIsLatest filters out Fluid internal versions. This can be changed with an argument, so these // tests check that isLatest returns it("2.0.0-internal.1.0.0 is latest", () => { - assert.isTrue(getIsLatest("client", "2.0.0-internal.1.0.0", post1_tags, true)); + assert.isTrue( + getIsLatest("client", "2.0.0-internal.1.0.0", post1_tags, true), + ); }); it("1.2.3 is not latest", () => { @@ -148,7 +175,9 @@ describe("getIsLatest", () => { }); it("2.0.0-internal.1.0.1.12345 is not latest", () => { - assert.isTrue(getIsLatest("client", "2.0.0-internal.1.0.1.12345", post1_tags, true)); + assert.isTrue( + getIsLatest("client", "2.0.0-internal.1.0.1.12345", post1_tags, true), + ); }); it("pre 1.0 builds are not latest", () => { @@ -204,7 +233,11 @@ describe("getVersionsFromStrings", () => { }); it("should return an empty array if no tags match the prefix", () => { - const tags = ["server_v0.59.1001", "server_v0.59.2000", "server_v0.59.3000"]; + const tags = [ + "server_v0.59.1001", + "server_v0.59.2000", + "server_v0.59.3000", + ]; const result = getVersionsFromStrings("client", tags); expect(result).to.deep.equal([]); }); diff --git a/build-tools/packages/version-tools/src/versions.ts b/build-tools/packages/version-tools/src/versions.ts index e95179ac2afd..5d91f80d5fa8 100644 --- a/build-tools/packages/version-tools/src/versions.ts +++ b/build-tools/packages/version-tools/src/versions.ts @@ -50,9 +50,16 @@ export function getSimpleVersion( } } - const { releaseVersion, prereleaseVersion } = parseFileVersion(version, buildId); + const { releaseVersion, prereleaseVersion } = parseFileVersion( + version, + buildId, + ); const build_suffix = buildId ? "" : argRelease ? "" : argBuildNum; - const fullVersion = generateSimpleVersion(releaseVersion, prereleaseVersion, build_suffix); + const fullVersion = generateSimpleVersion( + releaseVersion, + prereleaseVersion, + build_suffix, + ); return fullVersion; } @@ -101,7 +108,9 @@ export function getIsLatest( } if (log) { - console.log(`Latest tagged: ${latestTaggedRelease}, current: ${current_version}`); + console.log( + `Latest tagged: ${latestTaggedRelease}, current: ${current_version}`, + ); } const currentIsGreater = semver.gte(current_version, latestTaggedRelease); const currentIsPrerelease = includeInternalVersions @@ -151,7 +160,9 @@ function parseFileVersion( // split the prerelease out const r = releaseVersion.split("."); if (r.length !== 3) { - console.error(`ERROR: Invalid format for release version ${releaseVersion}`); + console.error( + `ERROR: Invalid format for release version ${releaseVersion}`, + ); // eslint-disable-next-line unicorn/no-process-exit process.exit(9); } @@ -182,7 +193,10 @@ function getVersions(prefix: TagPrefix): string[] { * @param tags - An array of tags as strings. * @returns An array of versions extracted from the provided tags. */ -export function getVersionsFromStrings(prefix: TagPrefix, tags: string[]): string[] { +export function getVersionsFromStrings( + prefix: TagPrefix, + tags: string[], +): string[] { const versions = tags .filter((v) => v.startsWith(`${prefix}_v`)) .map((tag) => tag.slice(`${prefix}_v`.length)); diff --git a/build-tools/packages/version-tools/src/virtualPatchScheme.ts b/build-tools/packages/version-tools/src/virtualPatchScheme.ts index b71e6ba77730..a7feecb70ed1 100644 --- a/build-tools/packages/version-tools/src/virtualPatchScheme.ts +++ b/build-tools/packages/version-tools/src/virtualPatchScheme.ts @@ -58,7 +58,8 @@ export function bumpVirtualPatchVersion( virtualVersion.patch += VIRTUAL_PATCH_FORMAT_MULTIPLIER; // adjust down to the nearest thousand virtualVersion.patch = - virtualVersion.patch - (virtualVersion.patch % VIRTUAL_PATCH_FORMAT_MULTIPLIER); + virtualVersion.patch - + (virtualVersion.patch % VIRTUAL_PATCH_FORMAT_MULTIPLIER); break; } case "patch": { @@ -87,19 +88,24 @@ export function fromVirtualPatchScheme( assert(parsedVersion !== null, `Parsed as null: ${virtualPatchVersion}`); if (!isVirtualPatch(parsedVersion)) { - throw new Error(`Version is not using the virtualPatch scheme: ${virtualPatchVersion}`); + throw new Error( + `Version is not using the virtualPatch scheme: ${virtualPatchVersion}`, + ); } const major = parsedVersion.minor; const minor = - (parsedVersion.patch - (parsedVersion.patch % VIRTUAL_PATCH_FORMAT_MULTIPLIER)) / + (parsedVersion.patch - + (parsedVersion.patch % VIRTUAL_PATCH_FORMAT_MULTIPLIER)) / VIRTUAL_PATCH_FORMAT_MULTIPLIER; const patch = parsedVersion.patch % VIRTUAL_PATCH_FORMAT_MULTIPLIER; const convertedVersionString = `${major}.${minor}.${patch}`; const newSemVer = semver.parse(convertedVersionString); if (newSemVer === null) { - throw new Error(`Couldn't convert ${convertedVersionString} to a standard semver.`); + throw new Error( + `Couldn't convert ${convertedVersionString} to a standard semver.`, + ); } return newSemVer; @@ -111,7 +117,9 @@ export function fromVirtualPatchScheme( * @param virtualPatchVersion - A version. * @returns The translated virtualPatch version. */ -export function toVirtualPatchScheme(version: semver.SemVer | string): semver.SemVer { +export function toVirtualPatchScheme( + version: semver.SemVer | string, +): semver.SemVer { const parsedVersion = semver.parse(version); assert(parsedVersion !== null, `Parsed as null: ${version}`); @@ -133,7 +141,9 @@ export function toVirtualPatchScheme(version: semver.SemVer | string): semver.Se const convertedVersionString = `${major}.${minor}.${patch}`; const newSemVer = semver.parse(convertedVersionString); if (newSemVer === null) { - throw new Error(`Couldn't convert ${convertedVersionString} to a standard semver.`); + throw new Error( + `Couldn't convert ${convertedVersionString} to a standard semver.`, + ); } return newSemVer; diff --git a/build-tools/packages/version-tools/tsconfig.json b/build-tools/packages/version-tools/tsconfig.json index 5be1b96ce6d0..aa851cd517e2 100644 --- a/build-tools/packages/version-tools/tsconfig.json +++ b/build-tools/packages/version-tools/tsconfig.json @@ -5,8 +5,8 @@ "rootDir": "./src", "outDir": "./lib", "types": ["node"], - "noImplicitAny": true, + "noImplicitAny": true }, "include": ["src/**/*"], - "exclude": ["src/test/**/*"], + "exclude": ["src/test/**/*"] } diff --git a/build-tools/syncpack.config.cjs b/build-tools/syncpack.config.cjs index 47123bf022b1..d38f73de553f 100644 --- a/build-tools/syncpack.config.cjs +++ b/build-tools/syncpack.config.cjs @@ -65,7 +65,11 @@ module.exports = { { label: "Ignore unsupported pnpm override entries", dependencyTypes: ["pnpmOverrides"], - dependencies: ["json5@<1.0.2", "json5@>=2.0.0 <2.2.2", "oclif>@aws-sdk/client*"], + dependencies: [ + "json5@<1.0.2", + "json5@>=2.0.0 <2.2.2", + "oclif>@aws-sdk/client*", + ], packages: ["build-tools-release-group-root"], isIgnored: true, }, @@ -137,7 +141,8 @@ module.exports = { */ versionGroups: [ { - label: "chalk >2 is ESM only but build-tools and version-tools are still CJS only.", + label: + "chalk >2 is ESM only but build-tools and version-tools are still CJS only.", dependencies: ["chalk"], packages: ["@fluidframework/build-tools", "@fluid-tools/version-tools"], }, diff --git a/common/build/eslint-config-fluid/minimal-deprecated.js b/common/build/eslint-config-fluid/minimal-deprecated.js index 14859f9da05d..0de3cc1ad415 100644 --- a/common/build/eslint-config-fluid/minimal-deprecated.js +++ b/common/build/eslint-config-fluid/minimal-deprecated.js @@ -485,9 +485,7 @@ module.exports = { "import/no-internal-modules": [ "error", { - allow: ["@fluid*/*/test*", "@fluid*/*/internal/test*"].concat( - permittedImports, - ), + allow: ["@fluid*/*/test*", "@fluid*/*/internal/test*"].concat(permittedImports), }, ], diff --git a/common/build/eslint-config-fluid/printed-configs/default.json b/common/build/eslint-config-fluid/printed-configs/default.json index e8c40438c22c..10cd7d03e619 100644 --- a/common/build/eslint-config-fluid/printed-configs/default.json +++ b/common/build/eslint-config-fluid/printed-configs/default.json @@ -1,2390 +1,979 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "off" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "off" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "off" - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "error", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "off" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "off" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "error" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "error" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "error" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "error" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "error" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "error" - ], - "unicorn/no-thenable": [ - "error" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "error" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "error" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "error" - ], - "unicorn/prefer-array-index-of": [ - "error" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "error" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "error" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "error" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - "off" - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["off"], + "@typescript-eslint/consistent-indexed-object-style": ["off"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "error", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "error", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["off"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["error"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["error"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["error"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["error"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["error"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["error"], + "unicorn/no-thenable": ["error"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["error"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["error"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["error"], + "unicorn/prefer-array-index-of": ["error"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["error"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["error"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["error"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": ["off"], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/minimal.json b/common/build/eslint-config-fluid/printed-configs/minimal.json index 337ab0ce38a4..d89c1264a79a 100644 --- a/common/build/eslint-config-fluid/printed-configs/minimal.json +++ b/common/build/eslint-config-fluid/printed-configs/minimal.json @@ -1,2060 +1,837 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": 2018, - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unicorn", - "unused-imports", - "tsdoc", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "warn" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "off" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "off" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "off" - ], - "@typescript-eslint/consistent-type-imports": [ - "off" - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "off" - ], - "@typescript-eslint/explicit-member-accessibility": [ - "off" - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "off" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "off" - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "off" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "off" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "off" - ], - "@typescript-eslint/no-unsafe-call": [ - "off" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "off" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "off" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "off" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "off" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "require-atomic-updates": [ - "off" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/template-indent": [ - 0 - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 2018, + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unicorn", + "unused-imports", + "tsdoc", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["warn"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["off"], + "@typescript-eslint/consistent-indexed-object-style": ["off"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": ["off"], + "@typescript-eslint/consistent-type-imports": ["off"], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": ["off"], + "@typescript-eslint/explicit-member-accessibility": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["off"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": ["off"], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["off"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["off"], + "@typescript-eslint/no-unsafe-assignment": ["off"], + "@typescript-eslint/no-unsafe-call": ["off"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["off"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["off"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["off"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "require-atomic-updates": ["off"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/no-for-loop": ["off"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-buffer": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/template-indent": [0], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/react.json b/common/build/eslint-config-fluid/printed-configs/react.json index c9a0ea222368..a06c87643e31 100644 --- a/common/build/eslint-config-fluid/printed-configs/react.json +++ b/common/build/eslint-config-fluid/printed-configs/react.json @@ -1,2467 +1,1008 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "react-hooks", - "react", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "off" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "off" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "off" - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "error", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "off" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "off" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "error" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react-hooks/exhaustive-deps": [ - "warn" - ], - "react-hooks/rules-of-hooks": [ - "error" - ], - "react/display-name": [ - 2 - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-key": [ - 2 - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-no-comment-textnodes": [ - 2 - ], - "react/jsx-no-duplicate-props": [ - 2 - ], - "react/jsx-no-target-blank": [ - 2 - ], - "react/jsx-no-undef": [ - 2 - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-uses-react": [ - 2 - ], - "react/jsx-uses-vars": [ - 2 - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "react/no-children-prop": [ - 2 - ], - "react/no-danger-with-children": [ - 2 - ], - "react/no-deprecated": [ - 2 - ], - "react/no-direct-mutation-state": [ - 2 - ], - "react/no-find-dom-node": [ - 2 - ], - "react/no-is-mounted": [ - 2 - ], - "react/no-render-return-value": [ - 2 - ], - "react/no-string-refs": [ - 2 - ], - "react/no-unescaped-entities": [ - 2 - ], - "react/no-unknown-property": [ - 2 - ], - "react/no-unsafe": [ - 0 - ], - "react/prop-types": [ - 2 - ], - "react/react-in-jsx-scope": [ - 2 - ], - "react/require-render-return": [ - 2 - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "off" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "error" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "error" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "error" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "error" - ], - "unicorn/no-thenable": [ - "error" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "error" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "error" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "error" - ], - "unicorn/prefer-array-index-of": [ - "error" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "error" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "error" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "error" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - "off" - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - }, - "react": { - "version": "detect" - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "react-hooks", + "react", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["off"], + "@typescript-eslint/consistent-indexed-object-style": ["off"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "error", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "error", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["off"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["error"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react-hooks/exhaustive-deps": ["warn"], + "react-hooks/rules-of-hooks": ["error"], + "react/display-name": [2], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-key": [2], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-no-comment-textnodes": [2], + "react/jsx-no-duplicate-props": [2], + "react/jsx-no-target-blank": [2], + "react/jsx-no-undef": [2], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-uses-react": [2], + "react/jsx-uses-vars": [2], + "react/jsx-wrap-multilines": ["off"], + "react/no-children-prop": [2], + "react/no-danger-with-children": [2], + "react/no-deprecated": [2], + "react/no-direct-mutation-state": [2], + "react/no-find-dom-node": [2], + "react/no-is-mounted": [2], + "react/no-render-return-value": [2], + "react/no-string-refs": [2], + "react/no-unescaped-entities": [2], + "react/no-unknown-property": [2], + "react/no-unsafe": [0], + "react/prop-types": [2], + "react/react-in-jsx-scope": [2], + "react/require-render-return": [2], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["off"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["error"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["error"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["error"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["error"], + "unicorn/no-thenable": ["error"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["error"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["error"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["error"], + "unicorn/prefer-array-index-of": ["error"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["error"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["error"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["error"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": ["off"], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + }, + "react": { + "version": "detect" + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/recommended.json b/common/build/eslint-config-fluid/printed-configs/recommended.json index e8c40438c22c..10cd7d03e619 100644 --- a/common/build/eslint-config-fluid/printed-configs/recommended.json +++ b/common/build/eslint-config-fluid/printed-configs/recommended.json @@ -1,2390 +1,979 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "off" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "off" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "off" - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "error", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "off" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "off" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "error" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "error" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "error" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "error" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "error" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "error" - ], - "unicorn/no-thenable": [ - "error" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "error" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "error" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "error" - ], - "unicorn/prefer-array-index-of": [ - "error" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "error" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "error" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "error" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - "off" - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["off"], + "@typescript-eslint/consistent-indexed-object-style": ["off"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "error", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "error", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["off"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["error"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["error"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["error"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["error"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["error"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["error"], + "unicorn/no-thenable": ["error"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["error"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["error"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["error"], + "unicorn/prefer-array-index-of": ["error"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["error"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["error"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["error"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": ["off"], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/strict-biome.json b/common/build/eslint-config-fluid/printed-configs/strict-biome.json index 837673b1bd67..25c702d3fd1c 100644 --- a/common/build/eslint-config-fluid/printed-configs/strict-biome.json +++ b/common/build/eslint-config-fluid/printed-configs/strict-biome.json @@ -1,2705 +1,1112 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@eslint-community/eslint-plugin-mysticatea/no-this-in-static": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@next/eslint-plugin-next/google-font-display": [ - "off" - ], - "@next/eslint-plugin-next/google-font-preconnect": [ - "off" - ], - "@next/eslint-plugin-next/no-document-import-in-page": [ - "off" - ], - "@next/eslint-plugin-next/no-head-element": [ - "off" - ], - "@next/eslint-plugin-next/no-head-import-in-document": [ - "off" - ], - "@next/eslint-plugin-next/no-img-element": [ - "off" - ], - "@next/eslint-plugin-next/no-unwanted-polyfillio": [ - "off" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "off" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "off" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "error" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "error" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "off", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "off", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "off" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "error", - { - "accessibility": "explicit", - "overrides": { - "accessors": "explicit", - "constructors": "explicit", - "methods": "explicit", - "properties": "explicit", - "parameterProperties": "explicit" - } - } - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "off" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-dupe-class-members": [ - "off" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "off", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "off" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "off" - ], - "@typescript-eslint/no-floating-promises": [ - "off" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "off" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-invalid-void-type": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "off" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "off" - ], - "@typescript-eslint/no-misused-promises": [ - "off" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "off" - ], - "@typescript-eslint/no-redeclare": [ - "off" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "error" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "off" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "off" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "off" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "off" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "error" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-useless-constructor": [ - "off" - ], - "@typescript-eslint/no-useless-empty-export": [ - "off" - ], - "@typescript-eslint/no-useless-template-literals": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "off" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-literal-enum-member": [ - "off" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "off" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "off" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/switch-exhaustiveness-check": [ - "off" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-callback-return": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "off" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "default-case-last": [ - "off" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "off", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "eslint-plugin-mysticatea/no-this-in-static": [ - "off" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "off" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "graphql/no-anonymous-operations": [ - "off" - ], - "graphql/no-duplicate-fields": [ - "off" - ], - "graphql/require-deprecation-reason": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import-access/eslint-plugin-import-access": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jest/no-duplicate-hooks": [ - "off" - ], - "jest/no-export": [ - "off" - ], - "jest/no-focused-tests": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-jsdoc": [ - "error", - { - "publicOnly": true, - "enableFixer": false, - "require": { - "ArrowFunctionExpression": true, - "ClassDeclaration": true, - "ClassExpression": true, - "FunctionDeclaration": true, - "FunctionExpression": true, - "MethodDefinition": false - }, - "contexts": [ - "TSEnumDeclaration", - "TSInterfaceDeclaration", - "TSTypeAliasDeclaration", - "ExportNamedDeclaration > VariableDeclaration" - ], - "skipInterveningOverloadedDeclarations": false, - "exemptOverloadedImplementations": true, - "checkConstructors": true, - "checkGetters": true, - "checkSetters": true, - "exemptEmptyConstructors": false, - "exemptEmptyFunctions": false, - "fixerMessage": "" - } - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-a11y/alt-text": [ - "off" - ], - "jsx-a11y/anchor-has-content": [ - "off" - ], - "jsx-a11y/anchor-is-valid": [ - "off" - ], - "jsx-a11y/aria-activedescendant-has-tabindex": [ - "off" - ], - "jsx-a11y/aria-props": [ - "off" - ], - "jsx-a11y/aria-proptypes": [ - "off" - ], - "jsx-a11y/aria-role": [ - "off" - ], - "jsx-a11y/aria-unsupported-elements": [ - "off" - ], - "jsx-a11y/autocomplete-valid": [ - "off" - ], - "jsx-a11y/click-events-have-key-events": [ - "off" - ], - "jsx-a11y/heading-has-content": [ - "off" - ], - "jsx-a11y/html-has-lang": [ - "off" - ], - "jsx-a11y/iframe-has-title": [ - "off" - ], - "jsx-a11y/img-redundant-alt": [ - "off" - ], - "jsx-a11y/interactive-supports-focus": [ - "off" - ], - "jsx-a11y/label-has-associated-control": [ - "off" - ], - "jsx-a11y/lang": [ - "off" - ], - "jsx-a11y/media-has-caption": [ - "off" - ], - "jsx-a11y/mouse-events-have-key-events": [ - "off" - ], - "jsx-a11y/no-access-key": [ - "off" - ], - "jsx-a11y/no-aria-hidden-on-focusable": [ - "off" - ], - "jsx-a11y/no-autofocus": [ - "off" - ], - "jsx-a11y/no-distracting-elements": [ - "off" - ], - "jsx-a11y/no-interactive-element-to-noninteractive-role": [ - "off" - ], - "jsx-a11y/no-noninteractive-element-to-interactive-role": [ - "off" - ], - "jsx-a11y/no-noninteractive-tabindex": [ - "off" - ], - "jsx-a11y/no-redundant-roles": [ - "off" - ], - "jsx-a11y/no-static-element-interactions": [ - "off" - ], - "jsx-a11y/prefer-tag-over-role": [ - "off" - ], - "jsx-a11y/role-has-required-aria-props": [ - "off" - ], - "jsx-a11y/role-supports-aria-props": [ - "off" - ], - "jsx-a11y/scope": [ - "off" - ], - "jsx-a11y/tabindex-no-positive": [ - "off" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - 0, - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "off" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "off" - ], - "no-class-assign": [ - "off" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "off" - ], - "no-cond-assign": [ - "off" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "off" - ], - "no-constructor-return": [ - "off" - ], - "no-control-regex": [ - "off" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "off" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "off" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "off" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "off" - ], - "no-empty-character-class": [ - "off" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "off" - ], - "no-eval": [ - "off" - ], - "no-ex-assign": [ - "off" - ], - "no-extra-boolean-cast": [ - "off" - ], - "no-extra-label": [ - "off" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "off" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "off" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "off" - ], - "no-label-var": [ - "off" - ], - "no-labels": [ - "off" - ], - "no-lone-blocks": [ - "off" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "off" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "off", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "off" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "off" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "off" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "off" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-return-assign": [ - "off" - ], - "no-self-assign": [ - "off" - ], - "no-self-compare": [ - "off" - ], - "no-sequences": [ - "off" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "off" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "off" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "off" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "off" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unneeded-ternary": [ - "off" - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "off" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "off" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "off" - ], - "no-unused-private-class-members": [ - "off" - ], - "no-unused-vars": [ - "off" - ], - "no-use-before-define": [ - "off" - ], - "no-useless-backreference": [ - "off" - ], - "no-useless-catch": [ - "off" - ], - "no-useless-computed-key": [ - "off" - ], - "no-useless-constructor": [ - "off" - ], - "no-useless-escape": [ - "off" - ], - "no-useless-rename": [ - "off" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "off" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "off" - ], - "prefer-const": [ - "off" - ], - "prefer-exponentiation-operator": [ - "off" - ], - "prefer-numeric-literals": [ - "off" - ], - "prefer-object-has-own": [ - "off" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-regex-literals": [ - "off" - ], - "prefer-rest-params": [ - "off" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "off" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "off" - ], - "react-hooks/exhaustive-deps": [ - "off" - ], - "react-hooks/rules-of-hooks": [ - "off" - ], - "react/button-has-type": [ - "off" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-key": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-no-comment-textnodes": [ - "off" - ], - "react/jsx-no-duplicate-props": [ - "off" - ], - "react/jsx-no-target-blank": [ - "off" - ], - "react/jsx-no-useless-fragment": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "react/no-array-index-key": [ - "off" - ], - "react/no-children-prop": [ - "off" - ], - "react/no-danger": [ - "off" - ], - "react/no-danger-with-children": [ - "off" - ], - "react/void-dom-elements-no-children": [ - "off" - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "off" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "simple-import-sort/imports": [ - "off" - ], - "solid/no-react-specific-props": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "error" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "off" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "off" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "off" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "off" - ], - "unicorn/no-thenable": [ - "off" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "off" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "off" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "off" - ], - "unicorn/prefer-array-index-of": [ - "off" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "off" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "error" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "off" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - 0 - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "off" - ], - "unused-imports/no-unused-vars": [ - "off" - ], - "use-isnan": [ - "off" - ], - "valid-typeof": [ - "off" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@eslint-community/eslint-plugin-mysticatea/no-this-in-static": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@next/eslint-plugin-next/google-font-display": ["off"], + "@next/eslint-plugin-next/google-font-preconnect": ["off"], + "@next/eslint-plugin-next/no-document-import-in-page": ["off"], + "@next/eslint-plugin-next/no-head-element": ["off"], + "@next/eslint-plugin-next/no-head-import-in-document": ["off"], + "@next/eslint-plugin-next/no-img-element": ["off"], + "@next/eslint-plugin-next/no-unwanted-polyfillio": ["off"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["off"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["off"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["error"], + "@typescript-eslint/consistent-indexed-object-style": ["error"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "off", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "off", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["off"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": [ + "error", + { + "accessibility": "explicit", + "overrides": { + "accessors": "explicit", + "constructors": "explicit", + "methods": "explicit", + "properties": "explicit", + "parameterProperties": "explicit" + } + } + ], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["off"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-dupe-class-members": ["off"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "off", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["off"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["off"], + "@typescript-eslint/no-floating-promises": ["off"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["off"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-invalid-void-type": ["off"], + "@typescript-eslint/no-loss-of-precision": ["off"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["off"], + "@typescript-eslint/no-misused-promises": ["off"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["off"], + "@typescript-eslint/no-redeclare": ["off"], + "@typescript-eslint/no-redundant-type-constituents": ["error"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["off"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["off"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["off"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["off"], + "@typescript-eslint/no-unsafe-enum-comparison": ["error"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-useless-constructor": ["off"], + "@typescript-eslint/no-useless-empty-export": ["off"], + "@typescript-eslint/no-useless-template-literals": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["off"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-literal-enum-member": ["off"], + "@typescript-eslint/prefer-namespace-keyword": ["off"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["off"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/switch-exhaustiveness-check": ["off"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-callback-return": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["off"], + "curly": [0], + "default-case": ["error"], + "default-case-last": ["off"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["off", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "eslint-plugin-mysticatea/no-this-in-static": ["off"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["off"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "graphql/no-anonymous-operations": ["off"], + "graphql/no-duplicate-fields": ["off"], + "graphql/require-deprecation-reason": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import-access/eslint-plugin-import-access": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jest/no-duplicate-hooks": ["off"], + "jest/no-export": ["off"], + "jest/no-focused-tests": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-jsdoc": [ + "error", + { + "publicOnly": true, + "enableFixer": false, + "require": { + "ArrowFunctionExpression": true, + "ClassDeclaration": true, + "ClassExpression": true, + "FunctionDeclaration": true, + "FunctionExpression": true, + "MethodDefinition": false + }, + "contexts": [ + "TSEnumDeclaration", + "TSInterfaceDeclaration", + "TSTypeAliasDeclaration", + "ExportNamedDeclaration > VariableDeclaration" + ], + "skipInterveningOverloadedDeclarations": false, + "exemptOverloadedImplementations": true, + "checkConstructors": true, + "checkGetters": true, + "checkSetters": true, + "exemptEmptyConstructors": false, + "exemptEmptyFunctions": false, + "fixerMessage": "" + } + ], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-a11y/alt-text": ["off"], + "jsx-a11y/anchor-has-content": ["off"], + "jsx-a11y/anchor-is-valid": ["off"], + "jsx-a11y/aria-activedescendant-has-tabindex": ["off"], + "jsx-a11y/aria-props": ["off"], + "jsx-a11y/aria-proptypes": ["off"], + "jsx-a11y/aria-role": ["off"], + "jsx-a11y/aria-unsupported-elements": ["off"], + "jsx-a11y/autocomplete-valid": ["off"], + "jsx-a11y/click-events-have-key-events": ["off"], + "jsx-a11y/heading-has-content": ["off"], + "jsx-a11y/html-has-lang": ["off"], + "jsx-a11y/iframe-has-title": ["off"], + "jsx-a11y/img-redundant-alt": ["off"], + "jsx-a11y/interactive-supports-focus": ["off"], + "jsx-a11y/label-has-associated-control": ["off"], + "jsx-a11y/lang": ["off"], + "jsx-a11y/media-has-caption": ["off"], + "jsx-a11y/mouse-events-have-key-events": ["off"], + "jsx-a11y/no-access-key": ["off"], + "jsx-a11y/no-aria-hidden-on-focusable": ["off"], + "jsx-a11y/no-autofocus": ["off"], + "jsx-a11y/no-distracting-elements": ["off"], + "jsx-a11y/no-interactive-element-to-noninteractive-role": ["off"], + "jsx-a11y/no-noninteractive-element-to-interactive-role": ["off"], + "jsx-a11y/no-noninteractive-tabindex": ["off"], + "jsx-a11y/no-redundant-roles": ["off"], + "jsx-a11y/no-static-element-interactions": ["off"], + "jsx-a11y/prefer-tag-over-role": ["off"], + "jsx-a11y/role-has-required-aria-props": ["off"], + "jsx-a11y/role-supports-aria-props": ["off"], + "jsx-a11y/scope": ["off"], + "jsx-a11y/tabindex-no-positive": ["off"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + 0, + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["off"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["off"], + "no-class-assign": ["off"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["off"], + "no-cond-assign": ["off"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["off"], + "no-constructor-return": ["off"], + "no-control-regex": ["off"], + "no-debugger": ["off"], + "no-delete-var": ["off"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["off"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["off"], + "no-duplicate-imports": ["off"], + "no-empty": ["off"], + "no-empty-character-class": ["off"], + "no-empty-function": ["off"], + "no-empty-pattern": ["off"], + "no-eval": ["off"], + "no-ex-assign": ["off"], + "no-extra-boolean-cast": ["off"], + "no-extra-label": ["off"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["off"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["off"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["off"], + "no-label-var": ["off"], + "no-labels": ["off"], + "no-lone-blocks": ["off"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["off"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "off", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["off"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["off"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["off"], + "no-redeclare": ["off"], + "no-regex-spaces": ["off"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-return-assign": ["off"], + "no-self-assign": ["off"], + "no-self-compare": ["off"], + "no-sequences": ["off"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["off"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["off"], + "no-tabs": [0], + "no-template-curly-in-string": ["off"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["off"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unneeded-ternary": ["off"], + "no-unreachable": ["off"], + "no-unsafe-finally": ["off"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["off"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["off"], + "no-unused-private-class-members": ["off"], + "no-unused-vars": ["off"], + "no-use-before-define": ["off"], + "no-useless-backreference": ["off"], + "no-useless-catch": ["off"], + "no-useless-computed-key": ["off"], + "no-useless-constructor": ["off"], + "no-useless-escape": ["off"], + "no-useless-rename": ["off"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["off"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["off"], + "prefer-const": ["off"], + "prefer-exponentiation-operator": ["off"], + "prefer-numeric-literals": ["off"], + "prefer-object-has-own": ["off"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-regex-literals": ["off"], + "prefer-rest-params": ["off"], + "prefer-spread": ["error"], + "prefer-template": ["off"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["off"], + "react-hooks/exhaustive-deps": ["off"], + "react-hooks/rules-of-hooks": ["off"], + "react/button-has-type": ["off"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-key": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-no-comment-textnodes": ["off"], + "react/jsx-no-duplicate-props": ["off"], + "react/jsx-no-target-blank": ["off"], + "react/jsx-no-useless-fragment": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "react/no-array-index-key": ["off"], + "react/no-children-prop": ["off"], + "react/no-danger": ["off"], + "react/no-danger-with-children": ["off"], + "react/void-dom-elements-no-children": ["off"], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["off"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "simple-import-sort/imports": ["off"], + "solid/no-react-specific-props": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["error"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["off"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["off"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["off"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["off"], + "unicorn/no-thenable": ["off"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["off"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["off"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["off"], + "unicorn/prefer-array-index-of": ["off"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["off"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["error"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["off"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": [0], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["off"], + "unused-imports/no-unused-vars": ["off"], + "use-isnan": ["off"], + "valid-typeof": ["off"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/strict.json b/common/build/eslint-config-fluid/printed-configs/strict.json index 17d4ad1e3fd9..4a03debc086e 100644 --- a/common/build/eslint-config-fluid/printed-configs/strict.json +++ b/common/build/eslint-config-fluid/printed-configs/strict.json @@ -1,2429 +1,1020 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "error" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "error" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "error", - { - "accessibility": "explicit", - "overrides": { - "accessors": "explicit", - "constructors": "explicit", - "methods": "explicit", - "properties": "explicit", - "parameterProperties": "explicit" - } - } - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "error", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "error" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ], - "patterns": [ - { - "group": [ - "./index.js", - "**/../index.js" - ], - "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "error" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "error" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error" - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "error" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-jsdoc": [ - "error", - { - "publicOnly": true, - "enableFixer": false, - "require": { - "ArrowFunctionExpression": true, - "ClassDeclaration": true, - "ClassExpression": true, - "FunctionDeclaration": true, - "FunctionExpression": true, - "MethodDefinition": false - }, - "contexts": [ - "TSEnumDeclaration", - "TSInterfaceDeclaration", - "TSTypeAliasDeclaration", - "ExportNamedDeclaration > VariableDeclaration" - ], - "skipInterveningOverloadedDeclarations": false, - "exemptOverloadedImplementations": true, - "checkConstructors": true, - "checkGetters": true, - "checkSetters": true, - "exemptEmptyConstructors": false, - "exemptEmptyFunctions": false, - "fixerMessage": "" - } - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "error" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "error" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "error" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "error" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "error" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "error" - ], - "unicorn/no-thenable": [ - "error" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "error" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "error" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "error" - ], - "unicorn/prefer-array-index-of": [ - "error" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "error" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "error" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "error" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - "off" - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["error"], + "@typescript-eslint/consistent-indexed-object-style": ["error"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "error", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": [ + "error", + { + "accessibility": "explicit", + "overrides": { + "accessors": "explicit", + "constructors": "explicit", + "methods": "explicit", + "properties": "explicit", + "parameterProperties": "explicit" + } + } + ], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "error", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["error"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ], + "patterns": [ + { + "group": ["./index.js", "**/../index.js"], + "message": "Importing from a parent index file tends to cause cyclic dependencies. Import from a more specific sibling file instead." + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["error"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "error", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["error"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": ["error"], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["error"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-jsdoc": [ + "error", + { + "publicOnly": true, + "enableFixer": false, + "require": { + "ArrowFunctionExpression": true, + "ClassDeclaration": true, + "ClassExpression": true, + "FunctionDeclaration": true, + "FunctionExpression": true, + "MethodDefinition": false + }, + "contexts": [ + "TSEnumDeclaration", + "TSInterfaceDeclaration", + "TSTypeAliasDeclaration", + "ExportNamedDeclaration > VariableDeclaration" + ], + "skipInterveningOverloadedDeclarations": false, + "exemptOverloadedImplementations": true, + "checkConstructors": true, + "checkGetters": true, + "checkSetters": true, + "exemptEmptyConstructors": false, + "exemptEmptyFunctions": false, + "fixerMessage": "" + } + ], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["error"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["error"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["error"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["error"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["error"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["error"], + "unicorn/no-thenable": ["error"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["error"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["error"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["error"], + "unicorn/prefer-array-index-of": ["error"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["error"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["error"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["error"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": ["off"], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-config-fluid/printed-configs/test.json b/common/build/eslint-config-fluid/printed-configs/test.json index 7d0c284e0209..b5008d0586ea 100644 --- a/common/build/eslint-config-fluid/printed-configs/test.json +++ b/common/build/eslint-config-fluid/printed-configs/test.json @@ -1,2386 +1,980 @@ { - "env": { - "browser": true, - "es2024": false, - "es6": true, - "node": true - }, - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "ignorePatterns": [ - "**/packageVersion.ts" - ], - "parserOptions": { - "ecmaFeatures": { - "jsx": true - }, - "ecmaVersion": "latest", - "project": "./tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "eslint-comments", - "import", - "@fluid-internal/fluid", - "unused-imports", - "promise", - "jsdoc", - "@typescript-eslint", - "@rushstack/security", - "@rushstack", - "unicorn", - "tsdoc" - ], - "reportUnusedDisableDirectives": true, - "rules": { - "@babel/object-curly-spacing": [ - "off" - ], - "@babel/semi": [ - "off" - ], - "@fluid-internal/fluid/no-file-path-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": [ - "error" - ], - "@fluid-internal/fluid/no-markdown-links-in-jsdoc": [ - "error" - ], - "@fluid-internal/fluid/no-member-release-tags": [ - "error" - ], - "@fluid-internal/fluid/no-unchecked-record-access": [ - "error" - ], - "@rushstack/no-new-null": [ - "error" - ], - "@rushstack/typedef-var": [ - "off" - ], - "@stylistic/array-bracket-newline": [ - "off" - ], - "@stylistic/array-bracket-spacing": [ - "off" - ], - "@stylistic/array-element-newline": [ - "off" - ], - "@stylistic/arrow-parens": [ - "off" - ], - "@stylistic/arrow-spacing": [ - "off" - ], - "@stylistic/block-spacing": [ - "off" - ], - "@stylistic/brace-style": [ - "off" - ], - "@stylistic/comma-dangle": [ - "off" - ], - "@stylistic/comma-spacing": [ - "off" - ], - "@stylistic/comma-style": [ - "off" - ], - "@stylistic/computed-property-spacing": [ - "off" - ], - "@stylistic/dot-location": [ - "off" - ], - "@stylistic/eol-last": [ - "off" - ], - "@stylistic/func-call-spacing": [ - "off" - ], - "@stylistic/function-call-argument-newline": [ - "off" - ], - "@stylistic/function-call-spacing": [ - "off" - ], - "@stylistic/function-paren-newline": [ - "off" - ], - "@stylistic/generator-star-spacing": [ - "off" - ], - "@stylistic/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/indent": [ - "off" - ], - "@stylistic/indent-binary-ops": [ - "off" - ], - "@stylistic/js/array-bracket-newline": [ - "off" - ], - "@stylistic/js/array-bracket-spacing": [ - "off" - ], - "@stylistic/js/array-element-newline": [ - "off" - ], - "@stylistic/js/arrow-parens": [ - "off" - ], - "@stylistic/js/arrow-spacing": [ - "off" - ], - "@stylistic/js/block-spacing": [ - "off" - ], - "@stylistic/js/brace-style": [ - "off" - ], - "@stylistic/js/comma-dangle": [ - "off" - ], - "@stylistic/js/comma-spacing": [ - "off" - ], - "@stylistic/js/comma-style": [ - "off" - ], - "@stylistic/js/computed-property-spacing": [ - "off" - ], - "@stylistic/js/dot-location": [ - "off" - ], - "@stylistic/js/eol-last": [ - "off" - ], - "@stylistic/js/func-call-spacing": [ - "off" - ], - "@stylistic/js/function-call-argument-newline": [ - "off" - ], - "@stylistic/js/function-call-spacing": [ - "off" - ], - "@stylistic/js/function-paren-newline": [ - "off" - ], - "@stylistic/js/generator-star-spacing": [ - "off" - ], - "@stylistic/js/implicit-arrow-linebreak": [ - "off" - ], - "@stylistic/js/indent": [ - "off" - ], - "@stylistic/js/jsx-quotes": [ - "off" - ], - "@stylistic/js/key-spacing": [ - "off" - ], - "@stylistic/js/keyword-spacing": [ - "off" - ], - "@stylistic/js/linebreak-style": [ - "off" - ], - "@stylistic/js/lines-around-comment": [ - 0 - ], - "@stylistic/js/max-len": [ - 0 - ], - "@stylistic/js/max-statements-per-line": [ - "off" - ], - "@stylistic/js/multiline-ternary": [ - "off" - ], - "@stylistic/js/new-parens": [ - "off" - ], - "@stylistic/js/newline-per-chained-call": [ - "off" - ], - "@stylistic/js/no-confusing-arrow": [ - 0 - ], - "@stylistic/js/no-extra-parens": [ - "off" - ], - "@stylistic/js/no-extra-semi": [ - "off" - ], - "@stylistic/js/no-floating-decimal": [ - "off" - ], - "@stylistic/js/no-mixed-operators": [ - 0 - ], - "@stylistic/js/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/js/no-multi-spaces": [ - "off" - ], - "@stylistic/js/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/js/no-tabs": [ - 0 - ], - "@stylistic/js/no-trailing-spaces": [ - "off" - ], - "@stylistic/js/no-whitespace-before-property": [ - "off" - ], - "@stylistic/js/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/js/object-curly-newline": [ - "off" - ], - "@stylistic/js/object-curly-spacing": [ - "off" - ], - "@stylistic/js/object-property-newline": [ - "off" - ], - "@stylistic/js/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/js/operator-linebreak": [ - "off" - ], - "@stylistic/js/padded-blocks": [ - "off" - ], - "@stylistic/js/quote-props": [ - "off" - ], - "@stylistic/js/quotes": [ - 0 - ], - "@stylistic/js/rest-spread-spacing": [ - "off" - ], - "@stylistic/js/semi": [ - "off" - ], - "@stylistic/js/semi-spacing": [ - "off" - ], - "@stylistic/js/semi-style": [ - "off" - ], - "@stylistic/js/space-before-blocks": [ - "off" - ], - "@stylistic/js/space-before-function-paren": [ - "off" - ], - "@stylistic/js/space-in-parens": [ - "off" - ], - "@stylistic/js/space-infix-ops": [ - "off" - ], - "@stylistic/js/space-unary-ops": [ - "off" - ], - "@stylistic/js/switch-colon-spacing": [ - "off" - ], - "@stylistic/js/template-curly-spacing": [ - "off" - ], - "@stylistic/js/template-tag-spacing": [ - "off" - ], - "@stylistic/js/wrap-iife": [ - "off" - ], - "@stylistic/js/wrap-regex": [ - "off" - ], - "@stylistic/js/yield-star-spacing": [ - "off" - ], - "@stylistic/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx-indent": [ - "off" - ], - "@stylistic/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/jsx-newline": [ - "off" - ], - "@stylistic/jsx-one-expression-per-line": [ - "off" - ], - "@stylistic/jsx-props-no-multi-spaces": [ - "off" - ], - "@stylistic/jsx-quotes": [ - "off" - ], - "@stylistic/jsx-tag-spacing": [ - "off" - ], - "@stylistic/jsx-wrap-multilines": [ - "off" - ], - "@stylistic/jsx/jsx-child-element-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-closing-bracket-location": [ - "off" - ], - "@stylistic/jsx/jsx-closing-tag-location": [ - "off" - ], - "@stylistic/jsx/jsx-curly-newline": [ - "off" - ], - "@stylistic/jsx/jsx-curly-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-equals-spacing": [ - "off" - ], - "@stylistic/jsx/jsx-first-prop-new-line": [ - "off" - ], - "@stylistic/jsx/jsx-indent": [ - "off" - ], - "@stylistic/jsx/jsx-indent-props": [ - "off" - ], - "@stylistic/jsx/jsx-max-props-per-line": [ - "off" - ], - "@stylistic/key-spacing": [ - "off" - ], - "@stylistic/keyword-spacing": [ - "off" - ], - "@stylistic/linebreak-style": [ - "off" - ], - "@stylistic/lines-around-comment": [ - 0 - ], - "@stylistic/max-len": [ - 0 - ], - "@stylistic/max-statements-per-line": [ - "off" - ], - "@stylistic/member-delimiter-style": [ - "off" - ], - "@stylistic/multiline-ternary": [ - "off" - ], - "@stylistic/new-parens": [ - "off" - ], - "@stylistic/newline-per-chained-call": [ - "off" - ], - "@stylistic/no-confusing-arrow": [ - 0 - ], - "@stylistic/no-extra-parens": [ - "off" - ], - "@stylistic/no-extra-semi": [ - "off" - ], - "@stylistic/no-floating-decimal": [ - "off" - ], - "@stylistic/no-mixed-operators": [ - 0 - ], - "@stylistic/no-mixed-spaces-and-tabs": [ - "off" - ], - "@stylistic/no-multi-spaces": [ - "off" - ], - "@stylistic/no-multiple-empty-lines": [ - "off" - ], - "@stylistic/no-tabs": [ - 0 - ], - "@stylistic/no-trailing-spaces": [ - "off" - ], - "@stylistic/no-whitespace-before-property": [ - "off" - ], - "@stylistic/nonblock-statement-body-position": [ - "off" - ], - "@stylistic/object-curly-newline": [ - "off" - ], - "@stylistic/object-curly-spacing": [ - "off" - ], - "@stylistic/object-property-newline": [ - "off" - ], - "@stylistic/one-var-declaration-per-line": [ - "off" - ], - "@stylistic/operator-linebreak": [ - "off" - ], - "@stylistic/padded-blocks": [ - "off" - ], - "@stylistic/quote-props": [ - "off" - ], - "@stylistic/quotes": [ - 0 - ], - "@stylistic/rest-spread-spacing": [ - "off" - ], - "@stylistic/semi": [ - "off" - ], - "@stylistic/semi-spacing": [ - "off" - ], - "@stylistic/semi-style": [ - "off" - ], - "@stylistic/space-before-blocks": [ - "off" - ], - "@stylistic/space-before-function-paren": [ - "off" - ], - "@stylistic/space-in-parens": [ - "off" - ], - "@stylistic/space-infix-ops": [ - "off" - ], - "@stylistic/space-unary-ops": [ - "off" - ], - "@stylistic/switch-colon-spacing": [ - "off" - ], - "@stylistic/template-curly-spacing": [ - "off" - ], - "@stylistic/template-tag-spacing": [ - "off" - ], - "@stylistic/ts/block-spacing": [ - "off" - ], - "@stylistic/ts/brace-style": [ - "off" - ], - "@stylistic/ts/comma-dangle": [ - "off" - ], - "@stylistic/ts/comma-spacing": [ - "off" - ], - "@stylistic/ts/func-call-spacing": [ - "off" - ], - "@stylistic/ts/function-call-spacing": [ - "off" - ], - "@stylistic/ts/indent": [ - "off" - ], - "@stylistic/ts/key-spacing": [ - "off" - ], - "@stylistic/ts/keyword-spacing": [ - "off" - ], - "@stylistic/ts/lines-around-comment": [ - 0 - ], - "@stylistic/ts/member-delimiter-style": [ - "off" - ], - "@stylistic/ts/no-extra-parens": [ - "off" - ], - "@stylistic/ts/no-extra-semi": [ - "off" - ], - "@stylistic/ts/object-curly-spacing": [ - "off" - ], - "@stylistic/ts/quotes": [ - 0 - ], - "@stylistic/ts/semi": [ - "off" - ], - "@stylistic/ts/space-before-blocks": [ - "off" - ], - "@stylistic/ts/space-before-function-paren": [ - "off" - ], - "@stylistic/ts/space-infix-ops": [ - "off" - ], - "@stylistic/ts/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-annotation-spacing": [ - "off" - ], - "@stylistic/type-generic-spacing": [ - "off" - ], - "@stylistic/type-named-tuple-spacing": [ - "off" - ], - "@stylistic/wrap-iife": [ - "off" - ], - "@stylistic/wrap-regex": [ - "off" - ], - "@stylistic/yield-star-spacing": [ - "off" - ], - "@typescript-eslint/adjacent-overload-signatures": [ - "error" - ], - "@typescript-eslint/array-type": [ - "error" - ], - "@typescript-eslint/await-thenable": [ - "error" - ], - "@typescript-eslint/ban-ts-comment": [ - "error" - ], - "@typescript-eslint/ban-tslint-comment": [ - "error" - ], - "@typescript-eslint/ban-types": [ - "off" - ], - "@typescript-eslint/block-spacing": [ - "off" - ], - "@typescript-eslint/brace-style": [ - "off" - ], - "@typescript-eslint/class-literal-property-style": [ - "error" - ], - "@typescript-eslint/comma-dangle": [ - "off", - "always-multiline" - ], - "@typescript-eslint/comma-spacing": [ - "off" - ], - "@typescript-eslint/consistent-generic-constructors": [ - "off" - ], - "@typescript-eslint/consistent-indexed-object-style": [ - "off" - ], - "@typescript-eslint/consistent-type-assertions": [ - "error", - { - "assertionStyle": "as", - "objectLiteralTypeAssertions": "never" - } - ], - "@typescript-eslint/consistent-type-definitions": [ - "error" - ], - "@typescript-eslint/consistent-type-exports": [ - "error", - { - "fixMixedExportsWithInlineTypeSpecifier": true - } - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "fixStyle": "separate-type-imports" - } - ], - "@typescript-eslint/dot-notation": [ - "error" - ], - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true, - "allowHigherOrderFunctions": true, - "allowDirectConstAssertionInArrowFunctions": true, - "allowConciseArrowFunctionExpressionsStartingWithVoid": false - } - ], - "@typescript-eslint/explicit-member-accessibility": [ - "off" - ], - "@typescript-eslint/explicit-module-boundary-types": [ - "error" - ], - "@typescript-eslint/func-call-spacing": [ - "off" - ], - "@typescript-eslint/indent": [ - "off" - ], - "@typescript-eslint/key-spacing": [ - "off" - ], - "@typescript-eslint/keyword-spacing": [ - "off" - ], - "@typescript-eslint/lines-around-comment": [ - 0 - ], - "@typescript-eslint/member-delimiter-style": [ - "off" - ], - "@typescript-eslint/member-ordering": [ - "off" - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "accessor", - "modifiers": [ - "private" - ], - "format": [ - "camelCase" - ], - "leadingUnderscore": "allow" - } - ], - "@typescript-eslint/no-array-constructor": [ - "error" - ], - "@typescript-eslint/no-base-to-string": [ - "error" - ], - "@typescript-eslint/no-confusing-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-duplicate-enum-values": [ - "error" - ], - "@typescript-eslint/no-duplicate-type-constituents": [ - "off" - ], - "@typescript-eslint/no-dynamic-delete": [ - "error" - ], - "@typescript-eslint/no-empty-function": [ - "off" - ], - "@typescript-eslint/no-empty-interface": [ - "off" - ], - "@typescript-eslint/no-empty-object-type": [ - "error" - ], - "@typescript-eslint/no-explicit-any": [ - "error", - { - "ignoreRestArgs": true - } - ], - "@typescript-eslint/no-extra-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-extra-parens": [ - "off" - ], - "@typescript-eslint/no-extra-semi": [ - "off" - ], - "@typescript-eslint/no-extraneous-class": [ - "error" - ], - "@typescript-eslint/no-floating-promises": [ - "error" - ], - "@typescript-eslint/no-for-in-array": [ - "error" - ], - "@typescript-eslint/no-implied-eval": [ - "error" - ], - "@typescript-eslint/no-import-type-side-effects": [ - "error" - ], - "@typescript-eslint/no-inferrable-types": [ - "off" - ], - "@typescript-eslint/no-invalid-this": [ - "off" - ], - "@typescript-eslint/no-loss-of-precision": [ - "error" - ], - "@typescript-eslint/no-magic-numbers": [ - "off" - ], - "@typescript-eslint/no-misused-new": [ - "error" - ], - "@typescript-eslint/no-misused-promises": [ - "error" - ], - "@typescript-eslint/no-namespace": [ - "error" - ], - "@typescript-eslint/no-non-null-asserted-optional-chain": [ - "error" - ], - "@typescript-eslint/no-non-null-assertion": [ - "error" - ], - "@typescript-eslint/no-redundant-type-constituents": [ - "off" - ], - "@typescript-eslint/no-require-imports": [ - "error" - ], - "@typescript-eslint/no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - }, - { - "name": "node:assert", - "importNames": [ - "default" - ], - "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" - } - ] - } - ], - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all", - "ignoreTypeValueShadow": true - } - ], - "@typescript-eslint/no-this-alias": [ - "error" - ], - "@typescript-eslint/no-throw-literal": [ - "error" - ], - "@typescript-eslint/no-unnecessary-qualifier": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-arguments": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-assertion": [ - "error" - ], - "@typescript-eslint/no-unnecessary-type-constraint": [ - "error" - ], - "@typescript-eslint/no-unsafe-argument": [ - "error" - ], - "@typescript-eslint/no-unsafe-assignment": [ - "error" - ], - "@typescript-eslint/no-unsafe-call": [ - "error" - ], - "@typescript-eslint/no-unsafe-declaration-merging": [ - "error" - ], - "@typescript-eslint/no-unsafe-enum-comparison": [ - "off" - ], - "@typescript-eslint/no-unsafe-function-type": [ - "error" - ], - "@typescript-eslint/no-unsafe-member-access": [ - "error" - ], - "@typescript-eslint/no-unsafe-return": [ - "error" - ], - "@typescript-eslint/no-unused-expressions": [ - "error" - ], - "@typescript-eslint/no-unused-vars": [ - "off" - ], - "@typescript-eslint/no-use-before-define": [ - "off" - ], - "@typescript-eslint/no-var-requires": [ - "error" - ], - "@typescript-eslint/no-wrapper-object-types": [ - "error" - ], - "@typescript-eslint/non-nullable-type-assertion-style": [ - "off" - ], - "@typescript-eslint/object-curly-spacing": [ - "off" - ], - "@typescript-eslint/prefer-as-const": [ - "error" - ], - "@typescript-eslint/prefer-for-of": [ - "error" - ], - "@typescript-eslint/prefer-function-type": [ - "error" - ], - "@typescript-eslint/prefer-includes": [ - "error" - ], - "@typescript-eslint/prefer-namespace-keyword": [ - "error" - ], - "@typescript-eslint/prefer-nullish-coalescing": [ - "error" - ], - "@typescript-eslint/prefer-optional-chain": [ - "error" - ], - "@typescript-eslint/prefer-readonly": [ - "error" - ], - "@typescript-eslint/prefer-string-starts-ends-with": [ - "error" - ], - "@typescript-eslint/promise-function-async": [ - "error" - ], - "@typescript-eslint/quotes": [ - 0, - "double", - { - "allowTemplateLiterals": true, - "avoidEscape": true - } - ], - "@typescript-eslint/require-await": [ - "off" - ], - "@typescript-eslint/restrict-plus-operands": [ - "error" - ], - "@typescript-eslint/restrict-template-expressions": [ - "off" - ], - "@typescript-eslint/return-await": [ - "error" - ], - "@typescript-eslint/semi": [ - "off", - "always" - ], - "@typescript-eslint/space-before-blocks": [ - "off" - ], - "@typescript-eslint/space-before-function-paren": [ - "off", - { - "anonymous": "never", - "asyncArrow": "always", - "named": "never" - } - ], - "@typescript-eslint/space-infix-ops": [ - "off" - ], - "@typescript-eslint/strict-boolean-expressions": [ - "error" - ], - "@typescript-eslint/triple-slash-reference": [ - "error" - ], - "@typescript-eslint/type-annotation-spacing": [ - "off" - ], - "@typescript-eslint/typedef": [ - "off" - ], - "@typescript-eslint/unbound-method": [ - "off", - { - "ignoreStatic": true - } - ], - "@typescript-eslint/unified-signatures": [ - "off" - ], - "array-bracket-newline": [ - "off" - ], - "array-bracket-spacing": [ - "off" - ], - "array-element-newline": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "arrow-parens": [ - "off", - "always" - ], - "arrow-spacing": [ - "off" - ], - "babel/object-curly-spacing": [ - "off" - ], - "babel/quotes": [ - 0 - ], - "babel/semi": [ - "off" - ], - "block-spacing": [ - "off" - ], - "brace-style": [ - "off" - ], - "camelcase": [ - "off" - ], - "capitalized-comments": [ - "off" - ], - "comma-dangle": [ - "off" - ], - "comma-spacing": [ - "off" - ], - "comma-style": [ - "off" - ], - "complexity": [ - "off" - ], - "computed-property-spacing": [ - "off" - ], - "constructor-super": [ - "error" - ], - "curly": [ - 0 - ], - "default-case": [ - "error" - ], - "dot-location": [ - "off" - ], - "dot-notation": [ - "off" - ], - "eol-last": [ - "off" - ], - "eqeqeq": [ - "error", - "smart" - ], - "eslint-comments/disable-enable-pair": [ - "error", - { - "allowWholeFile": true - } - ], - "eslint-comments/no-aggregating-enable": [ - "error" - ], - "eslint-comments/no-duplicate-disable": [ - "error" - ], - "eslint-comments/no-unlimited-disable": [ - "error" - ], - "eslint-comments/no-unused-enable": [ - "error" - ], - "flowtype/boolean-style": [ - "off" - ], - "flowtype/delimiter-dangle": [ - "off" - ], - "flowtype/generic-spacing": [ - "off" - ], - "flowtype/object-type-curly-spacing": [ - "off" - ], - "flowtype/object-type-delimiter": [ - "off" - ], - "flowtype/quotes": [ - "off" - ], - "flowtype/semi": [ - "off" - ], - "flowtype/space-after-type-colon": [ - "off" - ], - "flowtype/space-before-generic-bracket": [ - "off" - ], - "flowtype/space-before-type-colon": [ - "off" - ], - "flowtype/union-intersection-spacing": [ - "off" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "off" - ], - "function-call-argument-newline": [ - "off" - ], - "function-paren-newline": [ - "off" - ], - "generator-star": [ - "off" - ], - "generator-star-spacing": [ - "off" - ], - "getter-return": [ - "off" - ], - "guard-for-in": [ - "error" - ], - "id-match": [ - "error" - ], - "implicit-arrow-linebreak": [ - "off" - ], - "import/default": [ - 2 - ], - "import/export": [ - 2 - ], - "import/named": [ - "off" - ], - "import/namespace": [ - 2 - ], - "import/no-default-export": [ - "error" - ], - "import/no-deprecated": [ - "off" - ], - "import/no-duplicates": [ - 1 - ], - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": true - } - ], - "import/no-internal-modules": [ - "error", - { - "allow": [ - "@fluid*/*/test*", - "@fluid*/*/internal/test*", - "@fluid-example/*/internal", - "@fluid-experimental/*/internal", - "@fluid-internal/*/internal", - "@fluid-private/*/internal", - "@fluid-tools/*/internal", - "@fluidframework/*/internal", - "@fluid-experimental/**", - "*/index.js" - ] - } - ], - "import/no-named-as-default": [ - 1 - ], - "import/no-named-as-default-member": [ - 1 - ], - "import/no-nodejs-modules": [ - "off" - ], - "import/no-unassigned-import": [ - "error" - ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": true, - "caseSensitiveStrict": false - } - ], - "import/no-unused-modules": [ - "error" - ], - "import/order": [ - "error", - { - "newlines-between": "always", - "alphabetize": { - "order": "asc", - "caseInsensitive": false, - "orderImportKind": "ignore" - }, - "distinctGroup": true, - "warnOnUnassignedImports": false - } - ], - "indent": [ - "off" - ], - "indent-legacy": [ - "off" - ], - "jsdoc/check-access": [ - "error" - ], - "jsdoc/check-examples": [ - "off" - ], - "jsdoc/check-indentation": [ - "error" - ], - "jsdoc/check-line-alignment": [ - "warn" - ], - "jsdoc/check-tag-names": [ - "off" - ], - "jsdoc/empty-tags": [ - "error" - ], - "jsdoc/multiline-blocks": [ - "error", - { - "noSingleLineBlocks": true - } - ], - "jsdoc/no-bad-blocks": [ - "error" - ], - "jsdoc/require-asterisk-prefix": [ - "error" - ], - "jsdoc/require-description": [ - "error", - { - "checkConstructors": false, - "checkGetters": true, - "checkSetters": true - } - ], - "jsdoc/require-hyphen-before-param-description": [ - "error" - ], - "jsdoc/require-param-description": [ - "error" - ], - "jsdoc/require-returns-description": [ - "error" - ], - "jsx-quotes": [ - "off" - ], - "key-spacing": [ - "off" - ], - "keyword-spacing": [ - "off" - ], - "linebreak-style": [ - "off" - ], - "lines-around-comment": [ - 0 - ], - "max-classes-per-file": [ - "off" - ], - "max-len": [ - "error", - { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true - } - ], - "max-lines": [ - "off" - ], - "max-statements-per-line": [ - "off" - ], - "multiline-ternary": [ - "off" - ], - "new-parens": [ - "off" - ], - "newline-per-chained-call": [ - "off" - ], - "no-array-constructor": [ - "off" - ], - "no-arrow-condition": [ - "off" - ], - "no-async-promise-executor": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-comma-dangle": [ - "off" - ], - "no-compare-neg-zero": [ - "error" - ], - "no-cond-assign": [ - "error" - ], - "no-confusing-arrow": [ - 0 - ], - "no-const-assign": [ - "off" - ], - "no-constant-condition": [ - "error" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "off" - ], - "no-delete-var": [ - "error" - ], - "no-dupe-args": [ - "off" - ], - "no-dupe-class-members": [ - "off" - ], - "no-dupe-else-if": [ - "error" - ], - "no-dupe-keys": [ - "off" - ], - "no-duplicate-case": [ - "error" - ], - "no-duplicate-imports": [ - "off" - ], - "no-empty": [ - "error" - ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "off" - ], - "no-empty-pattern": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], - "no-extra-parens": [ - "off" - ], - "no-extra-semi": [ - "off" - ], - "no-fallthrough": [ - "off" - ], - "no-floating-decimal": [ - "off" - ], - "no-func-assign": [ - "off" - ], - "no-global-assign": [ - "error" - ], - "no-implied-eval": [ - "off" - ], - "no-import-assign": [ - "off" - ], - "no-inner-declarations": [ - "error" - ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "off" - ], - "no-irregular-whitespace": [ - "error" - ], - "no-loss-of-precision": [ - "off" - ], - "no-magic-numbers": [ - "off" - ], - "no-misleading-character-class": [ - "error" - ], - "no-mixed-operators": [ - 0 - ], - "no-mixed-spaces-and-tabs": [ - "off" - ], - "no-multi-spaces": [ - "error", - { - "ignoreEOLComments": true - } - ], - "no-multi-str": [ - "off" - ], - "no-multiple-empty-lines": [ - "off", - { - "max": 1, - "maxBOF": 0, - "maxEOF": 0 - } - ], - "no-negated-condition": [ - "off" - ], - "no-nested-ternary": [ - "off" - ], - "no-new-func": [ - "error" - ], - "no-new-native-nonconstructor": [ - "off" - ], - "no-new-symbol": [ - "off" - ], - "no-new-wrappers": [ - "error" - ], - "no-nonoctal-decimal-escape": [ - "error" - ], - "no-obj-calls": [ - "off" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "off" - ], - "no-regex-spaces": [ - "error" - ], - "no-reserved-keys": [ - "off" - ], - "no-restricted-syntax": [ - "error", - { - "selector": "ExportAllDeclaration", - "message": "Exporting * is not permitted. You should export only named items you intend to export." - }, - "ForInStatement" - ], - "no-self-assign": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-setter-return": [ - "off" - ], - "no-shadow": [ - "off" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-space-before-semi": [ - "off" - ], - "no-spaced-func": [ - "off" - ], - "no-sparse-arrays": [ - "error" - ], - "no-tabs": [ - 0 - ], - "no-template-curly-in-string": [ - "error" - ], - "no-this-before-super": [ - "off" - ], - "no-throw-literal": [ - "off" - ], - "no-trailing-spaces": [ - "off" - ], - "no-undef": [ - "off" - ], - "no-undef-init": [ - "error" - ], - "no-underscore-dangle": [ - "off" - ], - "no-unexpected-multiline": [ - 0 - ], - "no-unreachable": [ - "off" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "off" - ], - "no-unsafe-optional-chaining": [ - "error" - ], - "no-unused-expressions": [ - "off" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "off" - ], - "no-useless-backreference": [ - "error" - ], - "no-useless-catch": [ - "error" - ], - "no-useless-escape": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-whitespace-before-property": [ - "off" - ], - "no-with": [ - "error" - ], - "no-wrap-func": [ - "off" - ], - "nonblock-statement-body-position": [ - "off" - ], - "object-curly-newline": [ - "off" - ], - "object-curly-spacing": [ - "off" - ], - "object-property-newline": [ - "off" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "error", - "never" - ], - "one-var-declaration-per-line": [ - "off" - ], - "operator-linebreak": [ - "off" - ], - "padded-blocks": [ - "off", - "never" - ], - "padding-line-between-statements": [ - "off", - { - "blankLine": "always", - "prev": "*", - "next": "return" - } - ], - "prefer-arrow-callback": [ - "error" - ], - "prefer-const": [ - "error" - ], - "prefer-object-spread": [ - "error" - ], - "prefer-promise-reject-errors": [ - "error" - ], - "prefer-rest-params": [ - "error" - ], - "prefer-spread": [ - "error" - ], - "prefer-template": [ - "error" - ], - "promise/param-names": [ - "warn" - ], - "quote-props": [ - "off", - "consistent-as-needed" - ], - "quotes": [ - 0 - ], - "radix": [ - "error" - ], - "react/jsx-child-element-spacing": [ - "off" - ], - "react/jsx-closing-bracket-location": [ - "off" - ], - "react/jsx-closing-tag-location": [ - "off" - ], - "react/jsx-curly-newline": [ - "off" - ], - "react/jsx-curly-spacing": [ - "off" - ], - "react/jsx-equals-spacing": [ - "off" - ], - "react/jsx-first-prop-new-line": [ - "off" - ], - "react/jsx-indent": [ - "off" - ], - "react/jsx-indent-props": [ - "off" - ], - "react/jsx-max-props-per-line": [ - "off" - ], - "react/jsx-newline": [ - "off" - ], - "react/jsx-one-expression-per-line": [ - "off" - ], - "react/jsx-props-no-multi-spaces": [ - "off" - ], - "react/jsx-space-before-closing": [ - "off" - ], - "react/jsx-tag-spacing": [ - "off" - ], - "react/jsx-wrap-multilines": [ - "off" - ], - "require-atomic-updates": [ - "error" - ], - "require-await": [ - "off" - ], - "require-yield": [ - "error" - ], - "rest-spread-spacing": [ - "off" - ], - "semi": [ - "off" - ], - "semi-spacing": [ - "off" - ], - "semi-style": [ - "off" - ], - "space-after-function-name": [ - "off" - ], - "space-after-keywords": [ - "off" - ], - "space-before-blocks": [ - "off" - ], - "space-before-function-paren": [ - "off" - ], - "space-before-function-parentheses": [ - "off" - ], - "space-before-keywords": [ - "off" - ], - "space-in-brackets": [ - "off" - ], - "space-in-parens": [ - "off", - "never" - ], - "space-infix-ops": [ - "off" - ], - "space-return-throw-case": [ - "off" - ], - "space-unary-ops": [ - "off" - ], - "space-unary-word-ops": [ - "off" - ], - "spaced-comment": [ - "error", - "always", - { - "block": { - "markers": [ - "!" - ], - "balanced": true - } - } - ], - "standard/array-bracket-even-spacing": [ - "off" - ], - "standard/computed-property-even-spacing": [ - "off" - ], - "standard/object-curly-even-spacing": [ - "off" - ], - "switch-colon-spacing": [ - "off" - ], - "template-curly-spacing": [ - "off" - ], - "template-tag-spacing": [ - "off" - ], - "tsdoc/syntax": [ - "error" - ], - "unicorn/better-regex": [ - "error" - ], - "unicorn/catch-error-name": [ - "error" - ], - "unicorn/consistent-destructuring": [ - "error" - ], - "unicorn/consistent-function-scoping": [ - "off" - ], - "unicorn/custom-error-definition": [ - "off" - ], - "unicorn/empty-brace-spaces": [ - "off" - ], - "unicorn/error-message": [ - "error" - ], - "unicorn/escape-case": [ - "error" - ], - "unicorn/expiring-todo-comments": [ - "off" - ], - "unicorn/explicit-length-check": [ - "error" - ], - "unicorn/filename-case": [ - "error", - { - "cases": { - "camelCase": true, - "pascalCase": true - } - } - ], - "unicorn/import-style": [ - "error" - ], - "unicorn/new-for-builtins": [ - "error" - ], - "unicorn/no-abusive-eslint-disable": [ - "error" - ], - "unicorn/no-array-callback-reference": [ - "error" - ], - "unicorn/no-array-for-each": [ - "error" - ], - "unicorn/no-array-method-this-argument": [ - "error" - ], - "unicorn/no-array-push-push": [ - "off" - ], - "unicorn/no-array-reduce": [ - "error" - ], - "unicorn/no-await-expression-member": [ - "error" - ], - "unicorn/no-console-spaces": [ - "error" - ], - "unicorn/no-document-cookie": [ - "error" - ], - "unicorn/no-empty-file": [ - "error" - ], - "unicorn/no-for-loop": [ - "off" - ], - "unicorn/no-hex-escape": [ - "error" - ], - "unicorn/no-instanceof-array": [ - "error" - ], - "unicorn/no-invalid-remove-event-listener": [ - "error" - ], - "unicorn/no-keyword-prefix": [ - "off" - ], - "unicorn/no-lonely-if": [ - "error" - ], - "unicorn/no-negated-condition": [ - "error" - ], - "unicorn/no-nested-ternary": [ - "off" - ], - "unicorn/no-new-array": [ - "error" - ], - "unicorn/no-new-buffer": [ - "error" - ], - "unicorn/no-null": [ - "error" - ], - "unicorn/no-object-as-default-parameter": [ - "error" - ], - "unicorn/no-process-exit": [ - "error" - ], - "unicorn/no-static-only-class": [ - "error" - ], - "unicorn/no-thenable": [ - "error" - ], - "unicorn/no-this-assignment": [ - "error" - ], - "unicorn/no-typeof-undefined": [ - "error" - ], - "unicorn/no-unnecessary-await": [ - "error" - ], - "unicorn/no-unreadable-array-destructuring": [ - "error" - ], - "unicorn/no-unreadable-iife": [ - "error" - ], - "unicorn/no-unused-properties": [ - "off" - ], - "unicorn/no-useless-fallback-in-spread": [ - "error" - ], - "unicorn/no-useless-length-check": [ - "error" - ], - "unicorn/no-useless-promise-resolve-reject": [ - "error" - ], - "unicorn/no-useless-spread": [ - "off" - ], - "unicorn/no-useless-switch-case": [ - "error" - ], - "unicorn/no-useless-undefined": [ - "off" - ], - "unicorn/no-zero-fractions": [ - "error" - ], - "unicorn/number-literal-case": [ - "off" - ], - "unicorn/numeric-separators-style": [ - "error", - { - "onlyIfContainsSeparator": true - } - ], - "unicorn/prefer-add-event-listener": [ - "error" - ], - "unicorn/prefer-array-find": [ - "error" - ], - "unicorn/prefer-array-flat": [ - "error" - ], - "unicorn/prefer-array-flat-map": [ - "error" - ], - "unicorn/prefer-array-index-of": [ - "error" - ], - "unicorn/prefer-array-some": [ - "error" - ], - "unicorn/prefer-at": [ - "off" - ], - "unicorn/prefer-blob-reading-methods": [ - "error" - ], - "unicorn/prefer-code-point": [ - "error" - ], - "unicorn/prefer-date-now": [ - "error" - ], - "unicorn/prefer-default-parameters": [ - "error" - ], - "unicorn/prefer-dom-node-append": [ - "error" - ], - "unicorn/prefer-dom-node-dataset": [ - "error" - ], - "unicorn/prefer-dom-node-remove": [ - "error" - ], - "unicorn/prefer-dom-node-text-content": [ - "error" - ], - "unicorn/prefer-event-target": [ - "off" - ], - "unicorn/prefer-export-from": [ - "error" - ], - "unicorn/prefer-includes": [ - "error" - ], - "unicorn/prefer-json-parse-buffer": [ - "off" - ], - "unicorn/prefer-keyboard-event-key": [ - "error" - ], - "unicorn/prefer-logical-operator-over-ternary": [ - "error" - ], - "unicorn/prefer-math-trunc": [ - "error" - ], - "unicorn/prefer-modern-dom-apis": [ - "error" - ], - "unicorn/prefer-modern-math-apis": [ - "error" - ], - "unicorn/prefer-module": [ - "off" - ], - "unicorn/prefer-native-coercion-functions": [ - "error" - ], - "unicorn/prefer-negative-index": [ - "error" - ], - "unicorn/prefer-node-protocol": [ - "error" - ], - "unicorn/prefer-number-properties": [ - "error" - ], - "unicorn/prefer-object-from-entries": [ - "error" - ], - "unicorn/prefer-optional-catch-binding": [ - "error" - ], - "unicorn/prefer-prototype-methods": [ - "error" - ], - "unicorn/prefer-query-selector": [ - "error" - ], - "unicorn/prefer-reflect-apply": [ - "error" - ], - "unicorn/prefer-regexp-test": [ - "error" - ], - "unicorn/prefer-set-has": [ - "error" - ], - "unicorn/prefer-set-size": [ - "error" - ], - "unicorn/prefer-spread": [ - "error" - ], - "unicorn/prefer-string-replace-all": [ - "off" - ], - "unicorn/prefer-string-slice": [ - "error" - ], - "unicorn/prefer-string-starts-ends-with": [ - "error" - ], - "unicorn/prefer-string-trim-start-end": [ - "error" - ], - "unicorn/prefer-switch": [ - "error" - ], - "unicorn/prefer-ternary": [ - "error" - ], - "unicorn/prefer-top-level-await": [ - "error" - ], - "unicorn/prefer-type-error": [ - "error" - ], - "unicorn/prevent-abbreviations": [ - "off" - ], - "unicorn/relative-url-style": [ - "error" - ], - "unicorn/require-array-join-separator": [ - "error" - ], - "unicorn/require-number-to-fixed-digits-argument": [ - "error" - ], - "unicorn/require-post-message-target-origin": [ - "off" - ], - "unicorn/string-content": [ - "off" - ], - "unicorn/switch-case-braces": [ - "error" - ], - "unicorn/template-indent": [ - "off" - ], - "unicorn/text-encoding-identifier-case": [ - "error" - ], - "unicorn/throw-new-error": [ - "error" - ], - "unused-imports/no-unused-imports": [ - "error" - ], - "use-isnan": [ - "error" - ], - "valid-typeof": [ - "error" - ], - "vue/array-bracket-newline": [ - "off" - ], - "vue/array-bracket-spacing": [ - "off" - ], - "vue/array-element-newline": [ - "off" - ], - "vue/arrow-spacing": [ - "off" - ], - "vue/block-spacing": [ - "off" - ], - "vue/block-tag-newline": [ - "off" - ], - "vue/brace-style": [ - "off" - ], - "vue/comma-dangle": [ - "off" - ], - "vue/comma-spacing": [ - "off" - ], - "vue/comma-style": [ - "off" - ], - "vue/dot-location": [ - "off" - ], - "vue/func-call-spacing": [ - "off" - ], - "vue/html-closing-bracket-newline": [ - "off" - ], - "vue/html-closing-bracket-spacing": [ - "off" - ], - "vue/html-end-tags": [ - "off" - ], - "vue/html-indent": [ - "off" - ], - "vue/html-quotes": [ - "off" - ], - "vue/html-self-closing": [ - 0 - ], - "vue/key-spacing": [ - "off" - ], - "vue/keyword-spacing": [ - "off" - ], - "vue/max-attributes-per-line": [ - "off" - ], - "vue/max-len": [ - 0 - ], - "vue/multiline-html-element-content-newline": [ - "off" - ], - "vue/multiline-ternary": [ - "off" - ], - "vue/mustache-interpolation-spacing": [ - "off" - ], - "vue/no-extra-parens": [ - "off" - ], - "vue/no-multi-spaces": [ - "off" - ], - "vue/no-spaces-around-equal-signs-in-attribute": [ - "off" - ], - "vue/object-curly-newline": [ - "off" - ], - "vue/object-curly-spacing": [ - "off" - ], - "vue/object-property-newline": [ - "off" - ], - "vue/operator-linebreak": [ - "off" - ], - "vue/quote-props": [ - "off" - ], - "vue/script-indent": [ - "off" - ], - "vue/singleline-html-element-content-newline": [ - "off" - ], - "vue/space-in-parens": [ - "off" - ], - "vue/space-infix-ops": [ - "off" - ], - "vue/space-unary-ops": [ - "off" - ], - "vue/template-curly-spacing": [ - "off" - ], - "wrap-iife": [ - "off" - ], - "wrap-regex": [ - "off" - ], - "yield-star-spacing": [ - "off" - ], - "yoda": [ - "off" - ] - }, - "settings": { - "import/extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx", - ".jsx" - ], - "import/external-module-folders": [ - "node_modules", - "node_modules/@types" - ], - "import/parsers": { - "@typescript-eslint/parser": [ - ".ts", - ".tsx", - ".d.ts", - ".tsx" - ] - }, - "import/resolver": { - "typescript": { - "extensions": [ - ".ts", - ".tsx", - ".d.ts", - ".js", - ".jsx" - ], - "conditionNames": [ - "allow-ff-test-exports", - "types", - "import", - "esm2020", - "es2020", - "es2015", - "require", - "node", - "node-addons", - "browser", - "default" - ] - }, - "node": { - "extensions": [ - ".ts", - ".cts", - ".mts", - ".tsx", - ".js", - ".jsx" - ] - } - }, - "jsdoc": { - "mode": "typescript", - "tagNamePreference": { - "arg": { - "message": "Please use @param instead of @arg.", - "replacement": "param" - }, - "argument": { - "message": "Please use @param instead of @argument.", - "replacement": "param" - }, - "return": { - "message": "Please use @returns instead of @return.", - "replacement": "returns" - } - } - } - } + "env": { + "browser": true, + "es2024": false, + "es6": true, + "node": true + }, + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "ignorePatterns": ["**/packageVersion.ts"], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": "latest", + "project": "./tsconfig.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-comments", + "import", + "@fluid-internal/fluid", + "unused-imports", + "promise", + "jsdoc", + "@typescript-eslint", + "@rushstack/security", + "@rushstack", + "unicorn", + "tsdoc" + ], + "reportUnusedDisableDirectives": true, + "rules": { + "@babel/object-curly-spacing": ["off"], + "@babel/semi": ["off"], + "@fluid-internal/fluid/no-file-path-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-hyphen-after-jsdoc-tag": ["error"], + "@fluid-internal/fluid/no-markdown-links-in-jsdoc": ["error"], + "@fluid-internal/fluid/no-member-release-tags": ["error"], + "@fluid-internal/fluid/no-unchecked-record-access": ["error"], + "@rushstack/no-new-null": ["error"], + "@rushstack/typedef-var": ["off"], + "@stylistic/array-bracket-newline": ["off"], + "@stylistic/array-bracket-spacing": ["off"], + "@stylistic/array-element-newline": ["off"], + "@stylistic/arrow-parens": ["off"], + "@stylistic/arrow-spacing": ["off"], + "@stylistic/block-spacing": ["off"], + "@stylistic/brace-style": ["off"], + "@stylistic/comma-dangle": ["off"], + "@stylistic/comma-spacing": ["off"], + "@stylistic/comma-style": ["off"], + "@stylistic/computed-property-spacing": ["off"], + "@stylistic/dot-location": ["off"], + "@stylistic/eol-last": ["off"], + "@stylistic/func-call-spacing": ["off"], + "@stylistic/function-call-argument-newline": ["off"], + "@stylistic/function-call-spacing": ["off"], + "@stylistic/function-paren-newline": ["off"], + "@stylistic/generator-star-spacing": ["off"], + "@stylistic/implicit-arrow-linebreak": ["off"], + "@stylistic/indent": ["off"], + "@stylistic/indent-binary-ops": ["off"], + "@stylistic/js/array-bracket-newline": ["off"], + "@stylistic/js/array-bracket-spacing": ["off"], + "@stylistic/js/array-element-newline": ["off"], + "@stylistic/js/arrow-parens": ["off"], + "@stylistic/js/arrow-spacing": ["off"], + "@stylistic/js/block-spacing": ["off"], + "@stylistic/js/brace-style": ["off"], + "@stylistic/js/comma-dangle": ["off"], + "@stylistic/js/comma-spacing": ["off"], + "@stylistic/js/comma-style": ["off"], + "@stylistic/js/computed-property-spacing": ["off"], + "@stylistic/js/dot-location": ["off"], + "@stylistic/js/eol-last": ["off"], + "@stylistic/js/func-call-spacing": ["off"], + "@stylistic/js/function-call-argument-newline": ["off"], + "@stylistic/js/function-call-spacing": ["off"], + "@stylistic/js/function-paren-newline": ["off"], + "@stylistic/js/generator-star-spacing": ["off"], + "@stylistic/js/implicit-arrow-linebreak": ["off"], + "@stylistic/js/indent": ["off"], + "@stylistic/js/jsx-quotes": ["off"], + "@stylistic/js/key-spacing": ["off"], + "@stylistic/js/keyword-spacing": ["off"], + "@stylistic/js/linebreak-style": ["off"], + "@stylistic/js/lines-around-comment": [0], + "@stylistic/js/max-len": [0], + "@stylistic/js/max-statements-per-line": ["off"], + "@stylistic/js/multiline-ternary": ["off"], + "@stylistic/js/new-parens": ["off"], + "@stylistic/js/newline-per-chained-call": ["off"], + "@stylistic/js/no-confusing-arrow": [0], + "@stylistic/js/no-extra-parens": ["off"], + "@stylistic/js/no-extra-semi": ["off"], + "@stylistic/js/no-floating-decimal": ["off"], + "@stylistic/js/no-mixed-operators": [0], + "@stylistic/js/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/js/no-multi-spaces": ["off"], + "@stylistic/js/no-multiple-empty-lines": ["off"], + "@stylistic/js/no-tabs": [0], + "@stylistic/js/no-trailing-spaces": ["off"], + "@stylistic/js/no-whitespace-before-property": ["off"], + "@stylistic/js/nonblock-statement-body-position": ["off"], + "@stylistic/js/object-curly-newline": ["off"], + "@stylistic/js/object-curly-spacing": ["off"], + "@stylistic/js/object-property-newline": ["off"], + "@stylistic/js/one-var-declaration-per-line": ["off"], + "@stylistic/js/operator-linebreak": ["off"], + "@stylistic/js/padded-blocks": ["off"], + "@stylistic/js/quote-props": ["off"], + "@stylistic/js/quotes": [0], + "@stylistic/js/rest-spread-spacing": ["off"], + "@stylistic/js/semi": ["off"], + "@stylistic/js/semi-spacing": ["off"], + "@stylistic/js/semi-style": ["off"], + "@stylistic/js/space-before-blocks": ["off"], + "@stylistic/js/space-before-function-paren": ["off"], + "@stylistic/js/space-in-parens": ["off"], + "@stylistic/js/space-infix-ops": ["off"], + "@stylistic/js/space-unary-ops": ["off"], + "@stylistic/js/switch-colon-spacing": ["off"], + "@stylistic/js/template-curly-spacing": ["off"], + "@stylistic/js/template-tag-spacing": ["off"], + "@stylistic/js/wrap-iife": ["off"], + "@stylistic/js/wrap-regex": ["off"], + "@stylistic/js/yield-star-spacing": ["off"], + "@stylistic/jsx-child-element-spacing": ["off"], + "@stylistic/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx-closing-tag-location": ["off"], + "@stylistic/jsx-curly-newline": ["off"], + "@stylistic/jsx-curly-spacing": ["off"], + "@stylistic/jsx-equals-spacing": ["off"], + "@stylistic/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx-indent": ["off"], + "@stylistic/jsx-indent-props": ["off"], + "@stylistic/jsx-max-props-per-line": ["off"], + "@stylistic/jsx-newline": ["off"], + "@stylistic/jsx-one-expression-per-line": ["off"], + "@stylistic/jsx-props-no-multi-spaces": ["off"], + "@stylistic/jsx-quotes": ["off"], + "@stylistic/jsx-tag-spacing": ["off"], + "@stylistic/jsx-wrap-multilines": ["off"], + "@stylistic/jsx/jsx-child-element-spacing": ["off"], + "@stylistic/jsx/jsx-closing-bracket-location": ["off"], + "@stylistic/jsx/jsx-closing-tag-location": ["off"], + "@stylistic/jsx/jsx-curly-newline": ["off"], + "@stylistic/jsx/jsx-curly-spacing": ["off"], + "@stylistic/jsx/jsx-equals-spacing": ["off"], + "@stylistic/jsx/jsx-first-prop-new-line": ["off"], + "@stylistic/jsx/jsx-indent": ["off"], + "@stylistic/jsx/jsx-indent-props": ["off"], + "@stylistic/jsx/jsx-max-props-per-line": ["off"], + "@stylistic/key-spacing": ["off"], + "@stylistic/keyword-spacing": ["off"], + "@stylistic/linebreak-style": ["off"], + "@stylistic/lines-around-comment": [0], + "@stylistic/max-len": [0], + "@stylistic/max-statements-per-line": ["off"], + "@stylistic/member-delimiter-style": ["off"], + "@stylistic/multiline-ternary": ["off"], + "@stylistic/new-parens": ["off"], + "@stylistic/newline-per-chained-call": ["off"], + "@stylistic/no-confusing-arrow": [0], + "@stylistic/no-extra-parens": ["off"], + "@stylistic/no-extra-semi": ["off"], + "@stylistic/no-floating-decimal": ["off"], + "@stylistic/no-mixed-operators": [0], + "@stylistic/no-mixed-spaces-and-tabs": ["off"], + "@stylistic/no-multi-spaces": ["off"], + "@stylistic/no-multiple-empty-lines": ["off"], + "@stylistic/no-tabs": [0], + "@stylistic/no-trailing-spaces": ["off"], + "@stylistic/no-whitespace-before-property": ["off"], + "@stylistic/nonblock-statement-body-position": ["off"], + "@stylistic/object-curly-newline": ["off"], + "@stylistic/object-curly-spacing": ["off"], + "@stylistic/object-property-newline": ["off"], + "@stylistic/one-var-declaration-per-line": ["off"], + "@stylistic/operator-linebreak": ["off"], + "@stylistic/padded-blocks": ["off"], + "@stylistic/quote-props": ["off"], + "@stylistic/quotes": [0], + "@stylistic/rest-spread-spacing": ["off"], + "@stylistic/semi": ["off"], + "@stylistic/semi-spacing": ["off"], + "@stylistic/semi-style": ["off"], + "@stylistic/space-before-blocks": ["off"], + "@stylistic/space-before-function-paren": ["off"], + "@stylistic/space-in-parens": ["off"], + "@stylistic/space-infix-ops": ["off"], + "@stylistic/space-unary-ops": ["off"], + "@stylistic/switch-colon-spacing": ["off"], + "@stylistic/template-curly-spacing": ["off"], + "@stylistic/template-tag-spacing": ["off"], + "@stylistic/ts/block-spacing": ["off"], + "@stylistic/ts/brace-style": ["off"], + "@stylistic/ts/comma-dangle": ["off"], + "@stylistic/ts/comma-spacing": ["off"], + "@stylistic/ts/func-call-spacing": ["off"], + "@stylistic/ts/function-call-spacing": ["off"], + "@stylistic/ts/indent": ["off"], + "@stylistic/ts/key-spacing": ["off"], + "@stylistic/ts/keyword-spacing": ["off"], + "@stylistic/ts/lines-around-comment": [0], + "@stylistic/ts/member-delimiter-style": ["off"], + "@stylistic/ts/no-extra-parens": ["off"], + "@stylistic/ts/no-extra-semi": ["off"], + "@stylistic/ts/object-curly-spacing": ["off"], + "@stylistic/ts/quotes": [0], + "@stylistic/ts/semi": ["off"], + "@stylistic/ts/space-before-blocks": ["off"], + "@stylistic/ts/space-before-function-paren": ["off"], + "@stylistic/ts/space-infix-ops": ["off"], + "@stylistic/ts/type-annotation-spacing": ["off"], + "@stylistic/type-annotation-spacing": ["off"], + "@stylistic/type-generic-spacing": ["off"], + "@stylistic/type-named-tuple-spacing": ["off"], + "@stylistic/wrap-iife": ["off"], + "@stylistic/wrap-regex": ["off"], + "@stylistic/yield-star-spacing": ["off"], + "@typescript-eslint/adjacent-overload-signatures": ["error"], + "@typescript-eslint/array-type": ["error"], + "@typescript-eslint/await-thenable": ["error"], + "@typescript-eslint/ban-ts-comment": ["error"], + "@typescript-eslint/ban-tslint-comment": ["error"], + "@typescript-eslint/ban-types": ["off"], + "@typescript-eslint/block-spacing": ["off"], + "@typescript-eslint/brace-style": ["off"], + "@typescript-eslint/class-literal-property-style": ["error"], + "@typescript-eslint/comma-dangle": ["off", "always-multiline"], + "@typescript-eslint/comma-spacing": ["off"], + "@typescript-eslint/consistent-generic-constructors": ["off"], + "@typescript-eslint/consistent-indexed-object-style": ["off"], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { + "assertionStyle": "as", + "objectLiteralTypeAssertions": "never" + } + ], + "@typescript-eslint/consistent-type-definitions": ["error"], + "@typescript-eslint/consistent-type-exports": [ + "error", + { + "fixMixedExportsWithInlineTypeSpecifier": true + } + ], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "fixStyle": "separate-type-imports" + } + ], + "@typescript-eslint/dot-notation": ["error"], + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true, + "allowHigherOrderFunctions": true, + "allowDirectConstAssertionInArrowFunctions": true, + "allowConciseArrowFunctionExpressionsStartingWithVoid": false + } + ], + "@typescript-eslint/explicit-member-accessibility": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["error"], + "@typescript-eslint/func-call-spacing": ["off"], + "@typescript-eslint/indent": ["off"], + "@typescript-eslint/key-spacing": ["off"], + "@typescript-eslint/keyword-spacing": ["off"], + "@typescript-eslint/lines-around-comment": [0], + "@typescript-eslint/member-delimiter-style": ["off"], + "@typescript-eslint/member-ordering": ["off"], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "accessor", + "modifiers": ["private"], + "format": ["camelCase"], + "leadingUnderscore": "allow" + } + ], + "@typescript-eslint/no-array-constructor": ["error"], + "@typescript-eslint/no-base-to-string": ["error"], + "@typescript-eslint/no-confusing-non-null-assertion": ["error"], + "@typescript-eslint/no-duplicate-enum-values": ["error"], + "@typescript-eslint/no-duplicate-type-constituents": ["off"], + "@typescript-eslint/no-dynamic-delete": ["error"], + "@typescript-eslint/no-empty-function": ["off"], + "@typescript-eslint/no-empty-interface": ["off"], + "@typescript-eslint/no-empty-object-type": ["error"], + "@typescript-eslint/no-explicit-any": [ + "error", + { + "ignoreRestArgs": true + } + ], + "@typescript-eslint/no-extra-non-null-assertion": ["error"], + "@typescript-eslint/no-extra-parens": ["off"], + "@typescript-eslint/no-extra-semi": ["off"], + "@typescript-eslint/no-extraneous-class": ["error"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-for-in-array": ["error"], + "@typescript-eslint/no-implied-eval": ["error"], + "@typescript-eslint/no-import-type-side-effects": ["error"], + "@typescript-eslint/no-inferrable-types": ["off"], + "@typescript-eslint/no-invalid-this": ["off"], + "@typescript-eslint/no-loss-of-precision": ["error"], + "@typescript-eslint/no-magic-numbers": ["off"], + "@typescript-eslint/no-misused-new": ["error"], + "@typescript-eslint/no-misused-promises": ["error"], + "@typescript-eslint/no-namespace": ["error"], + "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], + "@typescript-eslint/no-non-null-assertion": ["error"], + "@typescript-eslint/no-redundant-type-constituents": ["off"], + "@typescript-eslint/no-require-imports": ["error"], + "@typescript-eslint/no-restricted-imports": [ + "error", + { + "paths": [ + { + "name": "assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + }, + { + "name": "node:assert", + "importNames": ["default"], + "message": "Use `strict` instead. E.g. `import { strict as assert } from \"node:assert\";`" + } + ] + } + ], + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all", + "ignoreTypeValueShadow": true + } + ], + "@typescript-eslint/no-this-alias": ["error"], + "@typescript-eslint/no-throw-literal": ["error"], + "@typescript-eslint/no-unnecessary-qualifier": ["error"], + "@typescript-eslint/no-unnecessary-type-arguments": ["error"], + "@typescript-eslint/no-unnecessary-type-assertion": ["error"], + "@typescript-eslint/no-unnecessary-type-constraint": ["error"], + "@typescript-eslint/no-unsafe-argument": ["error"], + "@typescript-eslint/no-unsafe-assignment": ["error"], + "@typescript-eslint/no-unsafe-call": ["error"], + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], + "@typescript-eslint/no-unsafe-function-type": ["error"], + "@typescript-eslint/no-unsafe-member-access": ["error"], + "@typescript-eslint/no-unsafe-return": ["error"], + "@typescript-eslint/no-unused-expressions": ["error"], + "@typescript-eslint/no-unused-vars": ["off"], + "@typescript-eslint/no-use-before-define": ["off"], + "@typescript-eslint/no-var-requires": ["error"], + "@typescript-eslint/no-wrapper-object-types": ["error"], + "@typescript-eslint/non-nullable-type-assertion-style": ["off"], + "@typescript-eslint/object-curly-spacing": ["off"], + "@typescript-eslint/prefer-as-const": ["error"], + "@typescript-eslint/prefer-for-of": ["error"], + "@typescript-eslint/prefer-function-type": ["error"], + "@typescript-eslint/prefer-includes": ["error"], + "@typescript-eslint/prefer-namespace-keyword": ["error"], + "@typescript-eslint/prefer-nullish-coalescing": ["error"], + "@typescript-eslint/prefer-optional-chain": ["error"], + "@typescript-eslint/prefer-readonly": ["error"], + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], + "@typescript-eslint/promise-function-async": ["error"], + "@typescript-eslint/quotes": [ + 0, + "double", + { + "allowTemplateLiterals": true, + "avoidEscape": true + } + ], + "@typescript-eslint/require-await": ["off"], + "@typescript-eslint/restrict-plus-operands": ["error"], + "@typescript-eslint/restrict-template-expressions": ["off"], + "@typescript-eslint/return-await": ["error"], + "@typescript-eslint/semi": ["off", "always"], + "@typescript-eslint/space-before-blocks": ["off"], + "@typescript-eslint/space-before-function-paren": [ + "off", + { + "anonymous": "never", + "asyncArrow": "always", + "named": "never" + } + ], + "@typescript-eslint/space-infix-ops": ["off"], + "@typescript-eslint/strict-boolean-expressions": ["error"], + "@typescript-eslint/triple-slash-reference": ["error"], + "@typescript-eslint/type-annotation-spacing": ["off"], + "@typescript-eslint/typedef": ["off"], + "@typescript-eslint/unbound-method": [ + "off", + { + "ignoreStatic": true + } + ], + "@typescript-eslint/unified-signatures": ["off"], + "array-bracket-newline": ["off"], + "array-bracket-spacing": ["off"], + "array-element-newline": ["off"], + "arrow-body-style": ["off"], + "arrow-parens": ["off", "always"], + "arrow-spacing": ["off"], + "babel/object-curly-spacing": ["off"], + "babel/quotes": [0], + "babel/semi": ["off"], + "block-spacing": ["off"], + "brace-style": ["off"], + "camelcase": ["off"], + "capitalized-comments": ["off"], + "comma-dangle": ["off"], + "comma-spacing": ["off"], + "comma-style": ["off"], + "complexity": ["off"], + "computed-property-spacing": ["off"], + "constructor-super": ["error"], + "curly": [0], + "default-case": ["error"], + "dot-location": ["off"], + "dot-notation": ["off"], + "eol-last": ["off"], + "eqeqeq": ["error", "smart"], + "eslint-comments/disable-enable-pair": [ + "error", + { + "allowWholeFile": true + } + ], + "eslint-comments/no-aggregating-enable": ["error"], + "eslint-comments/no-duplicate-disable": ["error"], + "eslint-comments/no-unlimited-disable": ["error"], + "eslint-comments/no-unused-enable": ["error"], + "flowtype/boolean-style": ["off"], + "flowtype/delimiter-dangle": ["off"], + "flowtype/generic-spacing": ["off"], + "flowtype/object-type-curly-spacing": ["off"], + "flowtype/object-type-delimiter": ["off"], + "flowtype/quotes": ["off"], + "flowtype/semi": ["off"], + "flowtype/space-after-type-colon": ["off"], + "flowtype/space-before-generic-bracket": ["off"], + "flowtype/space-before-type-colon": ["off"], + "flowtype/union-intersection-spacing": ["off"], + "for-direction": ["error"], + "func-call-spacing": ["off"], + "function-call-argument-newline": ["off"], + "function-paren-newline": ["off"], + "generator-star": ["off"], + "generator-star-spacing": ["off"], + "getter-return": ["off"], + "guard-for-in": ["error"], + "id-match": ["error"], + "implicit-arrow-linebreak": ["off"], + "import/default": [2], + "import/export": [2], + "import/named": ["off"], + "import/namespace": [2], + "import/no-default-export": ["error"], + "import/no-deprecated": ["off"], + "import/no-duplicates": [1], + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": true + } + ], + "import/no-internal-modules": [ + "error", + { + "allow": [ + "@fluid*/*/test*", + "@fluid*/*/internal/test*", + "@fluid-example/*/internal", + "@fluid-experimental/*/internal", + "@fluid-internal/*/internal", + "@fluid-private/*/internal", + "@fluid-tools/*/internal", + "@fluidframework/*/internal", + "@fluid-experimental/**", + "*/index.js" + ] + } + ], + "import/no-named-as-default": [1], + "import/no-named-as-default-member": [1], + "import/no-nodejs-modules": ["off"], + "import/no-unassigned-import": ["error"], + "import/no-unresolved": [ + 2, + { + "caseSensitive": true, + "caseSensitiveStrict": false + } + ], + "import/no-unused-modules": ["error"], + "import/order": [ + "error", + { + "newlines-between": "always", + "alphabetize": { + "order": "asc", + "caseInsensitive": false, + "orderImportKind": "ignore" + }, + "distinctGroup": true, + "warnOnUnassignedImports": false + } + ], + "indent": ["off"], + "indent-legacy": ["off"], + "jsdoc/check-access": ["error"], + "jsdoc/check-examples": ["off"], + "jsdoc/check-indentation": ["error"], + "jsdoc/check-line-alignment": ["warn"], + "jsdoc/check-tag-names": ["off"], + "jsdoc/empty-tags": ["error"], + "jsdoc/multiline-blocks": [ + "error", + { + "noSingleLineBlocks": true + } + ], + "jsdoc/no-bad-blocks": ["error"], + "jsdoc/require-asterisk-prefix": ["error"], + "jsdoc/require-description": [ + "error", + { + "checkConstructors": false, + "checkGetters": true, + "checkSetters": true + } + ], + "jsdoc/require-hyphen-before-param-description": ["error"], + "jsdoc/require-param-description": ["error"], + "jsdoc/require-returns-description": ["error"], + "jsx-quotes": ["off"], + "key-spacing": ["off"], + "keyword-spacing": ["off"], + "linebreak-style": ["off"], + "lines-around-comment": [0], + "max-classes-per-file": ["off"], + "max-len": [ + "error", + { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + } + ], + "max-lines": ["off"], + "max-statements-per-line": ["off"], + "multiline-ternary": ["off"], + "new-parens": ["off"], + "newline-per-chained-call": ["off"], + "no-array-constructor": ["off"], + "no-arrow-condition": ["off"], + "no-async-promise-executor": ["error"], + "no-bitwise": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-class-assign": ["error"], + "no-comma-dangle": ["off"], + "no-compare-neg-zero": ["error"], + "no-cond-assign": ["error"], + "no-confusing-arrow": [0], + "no-const-assign": ["off"], + "no-constant-condition": ["error"], + "no-control-regex": ["error"], + "no-debugger": ["off"], + "no-delete-var": ["error"], + "no-dupe-args": ["off"], + "no-dupe-class-members": ["off"], + "no-dupe-else-if": ["error"], + "no-dupe-keys": ["off"], + "no-duplicate-case": ["error"], + "no-duplicate-imports": ["off"], + "no-empty": ["error"], + "no-empty-character-class": ["error"], + "no-empty-function": ["off"], + "no-empty-pattern": ["error"], + "no-eval": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], + "no-extra-parens": ["off"], + "no-extra-semi": ["off"], + "no-fallthrough": ["off"], + "no-floating-decimal": ["off"], + "no-func-assign": ["off"], + "no-global-assign": ["error"], + "no-implied-eval": ["off"], + "no-import-assign": ["off"], + "no-inner-declarations": ["error"], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["off"], + "no-irregular-whitespace": ["error"], + "no-loss-of-precision": ["off"], + "no-magic-numbers": ["off"], + "no-misleading-character-class": ["error"], + "no-mixed-operators": [0], + "no-mixed-spaces-and-tabs": ["off"], + "no-multi-spaces": [ + "error", + { + "ignoreEOLComments": true + } + ], + "no-multi-str": ["off"], + "no-multiple-empty-lines": [ + "off", + { + "max": 1, + "maxBOF": 0, + "maxEOF": 0 + } + ], + "no-negated-condition": ["off"], + "no-nested-ternary": ["off"], + "no-new-func": ["error"], + "no-new-native-nonconstructor": ["off"], + "no-new-symbol": ["off"], + "no-new-wrappers": ["error"], + "no-nonoctal-decimal-escape": ["error"], + "no-obj-calls": ["off"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-param-reassign": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["off"], + "no-regex-spaces": ["error"], + "no-reserved-keys": ["off"], + "no-restricted-syntax": [ + "error", + { + "selector": "ExportAllDeclaration", + "message": "Exporting * is not permitted. You should export only named items you intend to export." + }, + "ForInStatement" + ], + "no-self-assign": ["error"], + "no-sequences": ["error"], + "no-setter-return": ["off"], + "no-shadow": ["off"], + "no-shadow-restricted-names": ["error"], + "no-space-before-semi": ["off"], + "no-spaced-func": ["off"], + "no-sparse-arrays": ["error"], + "no-tabs": [0], + "no-template-curly-in-string": ["error"], + "no-this-before-super": ["off"], + "no-throw-literal": ["off"], + "no-trailing-spaces": ["off"], + "no-undef": ["off"], + "no-undef-init": ["error"], + "no-underscore-dangle": ["off"], + "no-unexpected-multiline": [0], + "no-unreachable": ["off"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["off"], + "no-unsafe-optional-chaining": ["error"], + "no-unused-expressions": ["off"], + "no-unused-labels": ["error"], + "no-unused-vars": ["off"], + "no-useless-backreference": ["error"], + "no-useless-catch": ["error"], + "no-useless-escape": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-whitespace-before-property": ["off"], + "no-with": ["error"], + "no-wrap-func": ["off"], + "nonblock-statement-body-position": ["off"], + "object-curly-newline": ["off"], + "object-curly-spacing": ["off"], + "object-property-newline": ["off"], + "object-shorthand": ["error"], + "one-var": ["error", "never"], + "one-var-declaration-per-line": ["off"], + "operator-linebreak": ["off"], + "padded-blocks": ["off", "never"], + "padding-line-between-statements": [ + "off", + { + "blankLine": "always", + "prev": "*", + "next": "return" + } + ], + "prefer-arrow-callback": ["error"], + "prefer-const": ["error"], + "prefer-object-spread": ["error"], + "prefer-promise-reject-errors": ["error"], + "prefer-rest-params": ["error"], + "prefer-spread": ["error"], + "prefer-template": ["error"], + "promise/param-names": ["warn"], + "quote-props": ["off", "consistent-as-needed"], + "quotes": [0], + "radix": ["error"], + "react/jsx-child-element-spacing": ["off"], + "react/jsx-closing-bracket-location": ["off"], + "react/jsx-closing-tag-location": ["off"], + "react/jsx-curly-newline": ["off"], + "react/jsx-curly-spacing": ["off"], + "react/jsx-equals-spacing": ["off"], + "react/jsx-first-prop-new-line": ["off"], + "react/jsx-indent": ["off"], + "react/jsx-indent-props": ["off"], + "react/jsx-max-props-per-line": ["off"], + "react/jsx-newline": ["off"], + "react/jsx-one-expression-per-line": ["off"], + "react/jsx-props-no-multi-spaces": ["off"], + "react/jsx-space-before-closing": ["off"], + "react/jsx-tag-spacing": ["off"], + "react/jsx-wrap-multilines": ["off"], + "require-atomic-updates": ["error"], + "require-await": ["off"], + "require-yield": ["error"], + "rest-spread-spacing": ["off"], + "semi": ["off"], + "semi-spacing": ["off"], + "semi-style": ["off"], + "space-after-function-name": ["off"], + "space-after-keywords": ["off"], + "space-before-blocks": ["off"], + "space-before-function-paren": ["off"], + "space-before-function-parentheses": ["off"], + "space-before-keywords": ["off"], + "space-in-brackets": ["off"], + "space-in-parens": ["off", "never"], + "space-infix-ops": ["off"], + "space-return-throw-case": ["off"], + "space-unary-ops": ["off"], + "space-unary-word-ops": ["off"], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": ["!"], + "balanced": true + } + } + ], + "standard/array-bracket-even-spacing": ["off"], + "standard/computed-property-even-spacing": ["off"], + "standard/object-curly-even-spacing": ["off"], + "switch-colon-spacing": ["off"], + "template-curly-spacing": ["off"], + "template-tag-spacing": ["off"], + "tsdoc/syntax": ["error"], + "unicorn/better-regex": ["error"], + "unicorn/catch-error-name": ["error"], + "unicorn/consistent-destructuring": ["error"], + "unicorn/consistent-function-scoping": ["off"], + "unicorn/custom-error-definition": ["off"], + "unicorn/empty-brace-spaces": ["off"], + "unicorn/error-message": ["error"], + "unicorn/escape-case": ["error"], + "unicorn/expiring-todo-comments": ["off"], + "unicorn/explicit-length-check": ["error"], + "unicorn/filename-case": [ + "error", + { + "cases": { + "camelCase": true, + "pascalCase": true + } + } + ], + "unicorn/import-style": ["error"], + "unicorn/new-for-builtins": ["error"], + "unicorn/no-abusive-eslint-disable": ["error"], + "unicorn/no-array-callback-reference": ["error"], + "unicorn/no-array-for-each": ["error"], + "unicorn/no-array-method-this-argument": ["error"], + "unicorn/no-array-push-push": ["off"], + "unicorn/no-array-reduce": ["error"], + "unicorn/no-await-expression-member": ["error"], + "unicorn/no-console-spaces": ["error"], + "unicorn/no-document-cookie": ["error"], + "unicorn/no-empty-file": ["error"], + "unicorn/no-for-loop": ["off"], + "unicorn/no-hex-escape": ["error"], + "unicorn/no-instanceof-array": ["error"], + "unicorn/no-invalid-remove-event-listener": ["error"], + "unicorn/no-keyword-prefix": ["off"], + "unicorn/no-lonely-if": ["error"], + "unicorn/no-negated-condition": ["error"], + "unicorn/no-nested-ternary": ["off"], + "unicorn/no-new-array": ["error"], + "unicorn/no-new-buffer": ["error"], + "unicorn/no-null": ["error"], + "unicorn/no-object-as-default-parameter": ["error"], + "unicorn/no-process-exit": ["error"], + "unicorn/no-static-only-class": ["error"], + "unicorn/no-thenable": ["error"], + "unicorn/no-this-assignment": ["error"], + "unicorn/no-typeof-undefined": ["error"], + "unicorn/no-unnecessary-await": ["error"], + "unicorn/no-unreadable-array-destructuring": ["error"], + "unicorn/no-unreadable-iife": ["error"], + "unicorn/no-unused-properties": ["off"], + "unicorn/no-useless-fallback-in-spread": ["error"], + "unicorn/no-useless-length-check": ["error"], + "unicorn/no-useless-promise-resolve-reject": ["error"], + "unicorn/no-useless-spread": ["off"], + "unicorn/no-useless-switch-case": ["error"], + "unicorn/no-useless-undefined": ["off"], + "unicorn/no-zero-fractions": ["error"], + "unicorn/number-literal-case": ["off"], + "unicorn/numeric-separators-style": [ + "error", + { + "onlyIfContainsSeparator": true + } + ], + "unicorn/prefer-add-event-listener": ["error"], + "unicorn/prefer-array-find": ["error"], + "unicorn/prefer-array-flat": ["error"], + "unicorn/prefer-array-flat-map": ["error"], + "unicorn/prefer-array-index-of": ["error"], + "unicorn/prefer-array-some": ["error"], + "unicorn/prefer-at": ["off"], + "unicorn/prefer-blob-reading-methods": ["error"], + "unicorn/prefer-code-point": ["error"], + "unicorn/prefer-date-now": ["error"], + "unicorn/prefer-default-parameters": ["error"], + "unicorn/prefer-dom-node-append": ["error"], + "unicorn/prefer-dom-node-dataset": ["error"], + "unicorn/prefer-dom-node-remove": ["error"], + "unicorn/prefer-dom-node-text-content": ["error"], + "unicorn/prefer-event-target": ["off"], + "unicorn/prefer-export-from": ["error"], + "unicorn/prefer-includes": ["error"], + "unicorn/prefer-json-parse-buffer": ["off"], + "unicorn/prefer-keyboard-event-key": ["error"], + "unicorn/prefer-logical-operator-over-ternary": ["error"], + "unicorn/prefer-math-trunc": ["error"], + "unicorn/prefer-modern-dom-apis": ["error"], + "unicorn/prefer-modern-math-apis": ["error"], + "unicorn/prefer-module": ["off"], + "unicorn/prefer-native-coercion-functions": ["error"], + "unicorn/prefer-negative-index": ["error"], + "unicorn/prefer-node-protocol": ["error"], + "unicorn/prefer-number-properties": ["error"], + "unicorn/prefer-object-from-entries": ["error"], + "unicorn/prefer-optional-catch-binding": ["error"], + "unicorn/prefer-prototype-methods": ["error"], + "unicorn/prefer-query-selector": ["error"], + "unicorn/prefer-reflect-apply": ["error"], + "unicorn/prefer-regexp-test": ["error"], + "unicorn/prefer-set-has": ["error"], + "unicorn/prefer-set-size": ["error"], + "unicorn/prefer-spread": ["error"], + "unicorn/prefer-string-replace-all": ["off"], + "unicorn/prefer-string-slice": ["error"], + "unicorn/prefer-string-starts-ends-with": ["error"], + "unicorn/prefer-string-trim-start-end": ["error"], + "unicorn/prefer-switch": ["error"], + "unicorn/prefer-ternary": ["error"], + "unicorn/prefer-top-level-await": ["error"], + "unicorn/prefer-type-error": ["error"], + "unicorn/prevent-abbreviations": ["off"], + "unicorn/relative-url-style": ["error"], + "unicorn/require-array-join-separator": ["error"], + "unicorn/require-number-to-fixed-digits-argument": ["error"], + "unicorn/require-post-message-target-origin": ["off"], + "unicorn/string-content": ["off"], + "unicorn/switch-case-braces": ["error"], + "unicorn/template-indent": ["off"], + "unicorn/text-encoding-identifier-case": ["error"], + "unicorn/throw-new-error": ["error"], + "unused-imports/no-unused-imports": ["error"], + "use-isnan": ["error"], + "valid-typeof": ["error"], + "vue/array-bracket-newline": ["off"], + "vue/array-bracket-spacing": ["off"], + "vue/array-element-newline": ["off"], + "vue/arrow-spacing": ["off"], + "vue/block-spacing": ["off"], + "vue/block-tag-newline": ["off"], + "vue/brace-style": ["off"], + "vue/comma-dangle": ["off"], + "vue/comma-spacing": ["off"], + "vue/comma-style": ["off"], + "vue/dot-location": ["off"], + "vue/func-call-spacing": ["off"], + "vue/html-closing-bracket-newline": ["off"], + "vue/html-closing-bracket-spacing": ["off"], + "vue/html-end-tags": ["off"], + "vue/html-indent": ["off"], + "vue/html-quotes": ["off"], + "vue/html-self-closing": [0], + "vue/key-spacing": ["off"], + "vue/keyword-spacing": ["off"], + "vue/max-attributes-per-line": ["off"], + "vue/max-len": [0], + "vue/multiline-html-element-content-newline": ["off"], + "vue/multiline-ternary": ["off"], + "vue/mustache-interpolation-spacing": ["off"], + "vue/no-extra-parens": ["off"], + "vue/no-multi-spaces": ["off"], + "vue/no-spaces-around-equal-signs-in-attribute": ["off"], + "vue/object-curly-newline": ["off"], + "vue/object-curly-spacing": ["off"], + "vue/object-property-newline": ["off"], + "vue/operator-linebreak": ["off"], + "vue/quote-props": ["off"], + "vue/script-indent": ["off"], + "vue/singleline-html-element-content-newline": ["off"], + "vue/space-in-parens": ["off"], + "vue/space-infix-ops": ["off"], + "vue/space-unary-ops": ["off"], + "vue/template-curly-spacing": ["off"], + "wrap-iife": ["off"], + "wrap-regex": ["off"], + "yield-star-spacing": ["off"], + "yoda": ["off"] + }, + "settings": { + "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx", ".jsx"], + "import/external-module-folders": ["node_modules", "node_modules/@types"], + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts", ".tsx"] + }, + "import/resolver": { + "typescript": { + "extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], + "conditionNames": [ + "allow-ff-test-exports", + "types", + "import", + "esm2020", + "es2020", + "es2015", + "require", + "node", + "node-addons", + "browser", + "default" + ] + }, + "node": { + "extensions": [".ts", ".cts", ".mts", ".tsx", ".js", ".jsx"] + } + }, + "jsdoc": { + "mode": "typescript", + "tagNamePreference": { + "arg": { + "message": "Please use @param instead of @arg.", + "replacement": "param" + }, + "argument": { + "message": "Please use @param instead of @argument.", + "replacement": "param" + }, + "return": { + "message": "Please use @returns instead of @return.", + "replacement": "returns" + } + } + } + } } diff --git a/common/build/eslint-plugin-fluid/src/rules/no-unchecked-record-access.js b/common/build/eslint-plugin-fluid/src/rules/no-unchecked-record-access.js index 920fd9a2caa6..20beb5ae7b32 100644 --- a/common/build/eslint-plugin-fluid/src/rules/no-unchecked-record-access.js +++ b/common/build/eslint-plugin-fluid/src/rules/no-unchecked-record-access.js @@ -200,8 +200,7 @@ function isIndexSignatureType(parserServices, node) { if (node.computed) { const prop = node.property; if ( - (prop.type === "Literal" && - (typeof prop.value === "number" || !isNaN(prop.value))) || + (prop.type === "Literal" && (typeof prop.value === "number" || !isNaN(prop.value))) || prop.kind === 8 || // TypeScript's SyntaxKind.NumericLiteral prop.argumentExpression?.kind === 8 ) { @@ -369,8 +368,7 @@ function propertyHasBeenChecked(node, context) { (parent.test.operator === "!==" || parent.test.operator === "!=") && ((nodesAreEquivalent(parent.test.left, node) && isUndefinedNode(parent.test.right)) || - (nodesAreEquivalent(parent.test.right, node) && - isUndefinedNode(parent.test.left))) + (nodesAreEquivalent(parent.test.right, node) && isUndefinedNode(parent.test.left))) ) { return true; } @@ -391,10 +389,7 @@ function propertyHasBeenChecked(node, context) { const testKey = statement.test.left; if (testBase === baseObj && nodesAreEquivalent(testKey, currentKeyNode)) { const elseBlock = statement.alternate; - if ( - elseBlock && - checkElseBlockAssignsKey(elseBlock, testBase, testKey, context) - ) { + if (elseBlock && checkElseBlockAssignsKey(elseBlock, testBase, testKey, context)) { return true; } } @@ -532,7 +527,10 @@ function isTypeAllowedToBeUndefined(tsNode, typeChecker) { } const signatureDeclaration = symbol.valueDeclaration; // Check for Promise - if (signatureDeclaration.type && signatureDeclaration.type.kind === SyntaxKind.TypeReference) { + if ( + signatureDeclaration.type && + signatureDeclaration.type.kind === SyntaxKind.TypeReference + ) { const typeNode = signatureDeclaration.type; if (typeNode.typeName.text === "Promise") { return ( diff --git a/common/build/eslint-plugin-fluid/src/test/example/no-unchecked-record-access/indexedRecordOfStrings.ts b/common/build/eslint-plugin-fluid/src/test/example/no-unchecked-record-access/indexedRecordOfStrings.ts index cf5496dcc423..d133f2c1d9ed 100644 --- a/common/build/eslint-plugin-fluid/src/test/example/no-unchecked-record-access/indexedRecordOfStrings.ts +++ b/common/build/eslint-plugin-fluid/src/test/example/no-unchecked-record-access/indexedRecordOfStrings.ts @@ -13,7 +13,10 @@ interface ExtendedIndexSignatureType extends IndexSignatureType { a: string; } const indexedRecordOfStrings: IndexSignatureType = { a: "hello", b: "goodbye" }; -const extendedIndexedRecordOfStrings: ExtendedIndexSignatureType = { a: "hello", b: "goodbye" }; +const extendedIndexedRecordOfStrings: ExtendedIndexSignatureType = { + a: "hello", + b: "goodbye", +}; const a = "a"; const b = "b"; diff --git a/common/lib/common-utils/package.json b/common/lib/common-utils/package.json index b504501ca213..a862634ccdef 100644 --- a/common/lib/common-utils/package.json +++ b/common/lib/common-utils/package.json @@ -143,8 +143,12 @@ } }, "pnpm": { - "ignoredBuiltDependencies": ["core-js"], - "onlyBuiltDependencies": ["puppeteer"], + "ignoredBuiltDependencies": [ + "core-js" + ], + "onlyBuiltDependencies": [ + "puppeteer" + ], "overridesComments": [ "sharp <0.32.6 has a vulnerability that Component Governance flags (https://github.com/advisories/GHSA-54xq-cgqr-rpm3). It's a transitive dependency through jssm-viz-cli, which hasn't updated to a version with the fix" ], diff --git a/common/lib/common-utils/src/hashFileBrowser.ts b/common/lib/common-utils/src/hashFileBrowser.ts index 54904001d602..377281519d87 100644 --- a/common/lib/common-utils/src/hashFileBrowser.ts +++ b/common/lib/common-utils/src/hashFileBrowser.ts @@ -7,7 +7,10 @@ import * as base64js from "base64-js"; import { IsoBuffer } from "./bufferBrowser"; -async function digestBuffer(file: IsoBuffer, algorithm: "SHA-1" | "SHA-256"): Promise { +async function digestBuffer( + file: IsoBuffer, + algorithm: "SHA-1" | "SHA-256", +): Promise { const hash = await crypto.subtle.digest(algorithm, file); return new Uint8Array(hash); } diff --git a/common/lib/common-utils/src/index.ts b/common/lib/common-utils/src/index.ts index bc1eabc6ba85..3a718cffc902 100644 --- a/common/lib/common-utils/src/index.ts +++ b/common/lib/common-utils/src/index.ts @@ -27,7 +27,11 @@ export { Heap, type IComparer, type IHeapNode, NumberComparer } from "./heap"; export * from "./indexNode"; export { Lazy } from "./lazy"; export type { IsomorphicPerformance } from "./performanceIsomorphic"; -export { PromiseCache, type PromiseCacheExpiry, type PromiseCacheOptions } from "./promiseCache"; +export { + PromiseCache, + type PromiseCacheExpiry, + type PromiseCacheOptions, +} from "./promiseCache"; export { Deferred, LazyPromise } from "./promises"; export { type IRange, type IRangeTrackerSnapshot, RangeTracker } from "./rangeTracker"; export { RateLimiter } from "./rateLimiter"; diff --git a/common/lib/common-utils/src/test/types/validateCommonUtilsPrevious.generated.ts b/common/lib/common-utils/src/test/types/validateCommonUtilsPrevious.generated.ts index f035ebc5f1dd..43b8017f8afe 100644 --- a/common/lib/common-utils/src/test/types/validateCommonUtilsPrevious.generated.ts +++ b/common/lib/common-utils/src/test/types/validateCommonUtilsPrevious.generated.ts @@ -8,12 +8,23 @@ * Generated by flub generate:typetests in @fluid-tools/build-cli. */ -import type { TypeOnly, MinimalType, FullType, requireAssignableTo } from "@fluidframework/build-tools"; +import type { + TypeOnly, + MinimalType, + FullType, + requireAssignableTo, +} from "@fluidframework/build-tools"; import type * as old from "@fluidframework/common-utils-previous"; import type * as current from "../../index.js"; -declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | FullType | typeof old | typeof current | requireAssignableTo; +declare type MakeUnusedImportErrorsGoAway = + | TypeOnly + | MinimalType + | FullType + | typeof old + | typeof current + | requireAssignableTo; /* * Validate forward compatibility by using the old type in place of the current type. @@ -23,7 +34,10 @@ declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | Fu * "Class_BaseTelemetryNullLogger": {"forwardCompat": false} */ // @ts-expect-error compatibility expected to be broken -declare type old_as_current_for_Class_BaseTelemetryNullLogger = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_BaseTelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -33,7 +47,10 @@ declare type old_as_current_for_Class_BaseTelemetryNullLogger = requireAssignabl * "Class_BaseTelemetryNullLogger": {"backCompat": false} */ // @ts-expect-error compatibility expected to be broken -declare type current_as_old_for_Class_BaseTelemetryNullLogger = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_BaseTelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -42,7 +59,10 @@ declare type current_as_old_for_Class_BaseTelemetryNullLogger = requireAssignabl * typeValidation.broken: * "Class_Buffer": {"forwardCompat": false} */ -declare type old_as_current_for_Class_Buffer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_Buffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -51,7 +71,10 @@ declare type old_as_current_for_Class_Buffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_Buffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -60,7 +83,10 @@ declare type current_as_old_for_Class_Buffer = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_Deferred = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -69,7 +95,10 @@ declare type old_as_current_for_Class_Deferred = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_Deferred = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -79,7 +108,10 @@ declare type current_as_old_for_Class_Deferred = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_EventForwarder = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -89,7 +121,10 @@ declare type old_as_current_for_Class_EventForwarder = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_EventForwarder = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -98,7 +133,10 @@ declare type current_as_old_for_Class_EventForwarder = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_Heap = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -107,7 +145,10 @@ declare type old_as_current_for_Class_Heap = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_Heap = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -116,7 +157,10 @@ declare type current_as_old_for_Class_Heap = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_Lazy = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -125,7 +169,10 @@ declare type old_as_current_for_Class_Lazy = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_Lazy = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -134,7 +181,10 @@ declare type current_as_old_for_Class_Lazy = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_LazyPromise = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -143,7 +193,10 @@ declare type old_as_current_for_Class_LazyPromise = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_LazyPromise = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -152,7 +205,10 @@ declare type current_as_old_for_Class_LazyPromise = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_PromiseCache = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -161,7 +217,10 @@ declare type old_as_current_for_Class_PromiseCache = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_PromiseCache = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -170,7 +229,10 @@ declare type current_as_old_for_Class_PromiseCache = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_PromiseTimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -179,7 +241,10 @@ declare type old_as_current_for_Class_PromiseTimer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_PromiseTimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -188,7 +253,10 @@ declare type current_as_old_for_Class_PromiseTimer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_RangeTracker = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -197,7 +265,10 @@ declare type old_as_current_for_Class_RangeTracker = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_RangeTracker = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -206,7 +277,10 @@ declare type current_as_old_for_Class_RangeTracker = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_RateLimiter = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -215,7 +289,10 @@ declare type old_as_current_for_Class_RateLimiter = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_RateLimiter = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -225,7 +302,10 @@ declare type current_as_old_for_Class_RateLimiter = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_TelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -235,7 +315,10 @@ declare type old_as_current_for_Class_TelemetryNullLogger = requireAssignableTo< * "Class_TelemetryNullLogger": {"backCompat": false} */ // @ts-expect-error compatibility expected to be broken -declare type current_as_old_for_Class_TelemetryNullLogger = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_TelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -244,7 +327,10 @@ declare type current_as_old_for_Class_TelemetryNullLogger = requireAssignableTo< * typeValidation.broken: * "Class_Timer": {"forwardCompat": false} */ -declare type old_as_current_for_Class_Timer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_Timer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -253,7 +339,10 @@ declare type old_as_current_for_Class_Timer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_Timer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -262,7 +351,10 @@ declare type current_as_old_for_Class_Timer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Class_Trace = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -271,7 +363,10 @@ declare type old_as_current_for_Class_Trace = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Class_Trace = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -280,7 +375,10 @@ declare type current_as_old_for_Class_Trace = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Class_TypedEventEmitter = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -289,7 +387,10 @@ declare type old_as_current_for_Class_TypedEventEmitter = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Class_TypedEventEmitter = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -299,7 +400,10 @@ declare type current_as_old_for_Class_TypedEventEmitter = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_BaseTelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -308,7 +412,10 @@ declare type current_as_old_for_ClassStatics_BaseTelemetryNullLogger = requireAs * typeValidation.broken: * "ClassStatics_Buffer": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_Buffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Buffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -317,7 +424,10 @@ declare type current_as_old_for_ClassStatics_Buffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Deferred = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -327,7 +437,10 @@ declare type current_as_old_for_ClassStatics_Deferred = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_EventForwarder = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -336,7 +449,10 @@ declare type current_as_old_for_ClassStatics_EventForwarder = requireAssignableT * typeValidation.broken: * "ClassStatics_Heap": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_Heap = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Heap = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -345,7 +461,10 @@ declare type current_as_old_for_ClassStatics_Heap = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Lazy = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -354,7 +473,10 @@ declare type current_as_old_for_ClassStatics_Lazy = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_LazyPromise = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -363,7 +485,10 @@ declare type current_as_old_for_ClassStatics_LazyPromise = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_PromiseCache = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -372,7 +497,10 @@ declare type current_as_old_for_ClassStatics_PromiseCache = requireAssignableTo< * typeValidation.broken: * "ClassStatics_PromiseTimer": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_PromiseTimer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_PromiseTimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -381,7 +509,10 @@ declare type current_as_old_for_ClassStatics_PromiseTimer = requireAssignableTo< * typeValidation.broken: * "ClassStatics_RangeTracker": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_RangeTracker = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_RangeTracker = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -390,7 +521,10 @@ declare type current_as_old_for_ClassStatics_RangeTracker = requireAssignableTo< * typeValidation.broken: * "ClassStatics_RateLimiter": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_RateLimiter = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_RateLimiter = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -400,7 +534,10 @@ declare type current_as_old_for_ClassStatics_RateLimiter = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_TelemetryNullLogger = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -409,7 +546,10 @@ declare type current_as_old_for_ClassStatics_TelemetryNullLogger = requireAssign * typeValidation.broken: * "ClassStatics_Timer": {"backCompat": false} */ -declare type current_as_old_for_ClassStatics_Timer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Timer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -418,7 +558,10 @@ declare type current_as_old_for_ClassStatics_Timer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_Trace = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -427,7 +570,10 @@ declare type current_as_old_for_ClassStatics_Trace = requireAssignableTo, TypeOnly> +declare type current_as_old_for_ClassStatics_TypedEventEmitter = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -436,7 +582,10 @@ declare type current_as_old_for_ClassStatics_TypedEventEmitter = requireAssignab * typeValidation.broken: * "Function_assert": {"backCompat": false} */ -declare type current_as_old_for_Function_assert = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_assert = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -445,7 +594,10 @@ declare type current_as_old_for_Function_assert = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_doIfNotDisposed = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -454,7 +606,10 @@ declare type current_as_old_for_Function_doIfNotDisposed = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_gitHashFile = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -463,7 +618,10 @@ declare type current_as_old_for_Function_gitHashFile = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_hashFile = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -472,7 +630,10 @@ declare type current_as_old_for_Function_hashFile = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_safelyParseJSON = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -481,7 +642,10 @@ declare type current_as_old_for_Function_safelyParseJSON = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_setLongTimeout = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -490,7 +654,10 @@ declare type current_as_old_for_Function_setLongTimeout = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_stringToBuffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -499,7 +666,10 @@ declare type current_as_old_for_Function_stringToBuffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_Uint8ArrayToArrayBuffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -508,7 +678,10 @@ declare type current_as_old_for_Function_Uint8ArrayToArrayBuffer = requireAssign * typeValidation.broken: * "Function_Uint8ArrayToString": {"backCompat": false} */ -declare type current_as_old_for_Function_Uint8ArrayToString = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_Uint8ArrayToString = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -517,7 +690,10 @@ declare type current_as_old_for_Function_Uint8ArrayToString = requireAssignableT * typeValidation.broken: * "Function_unreachableCase": {"backCompat": false} */ -declare type current_as_old_for_Function_unreachableCase = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Function_unreachableCase = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -526,7 +702,10 @@ declare type current_as_old_for_Function_unreachableCase = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Interface_IComparer = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -535,7 +714,10 @@ declare type old_as_current_for_Interface_IComparer = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Interface_IComparer = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -544,7 +726,10 @@ declare type current_as_old_for_Interface_IComparer = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_Interface_IHeapNode = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -553,7 +738,10 @@ declare type old_as_current_for_Interface_IHeapNode = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_Interface_IHeapNode = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -562,7 +750,10 @@ declare type current_as_old_for_Interface_IHeapNode = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IPromiseTimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -571,7 +762,10 @@ declare type old_as_current_for_Interface_IPromiseTimer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IPromiseTimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -580,7 +774,10 @@ declare type current_as_old_for_Interface_IPromiseTimer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IPromiseTimerResult = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -589,7 +786,10 @@ declare type old_as_current_for_Interface_IPromiseTimerResult = requireAssignabl * typeValidation.broken: * "Interface_IPromiseTimerResult": {"backCompat": false} */ -declare type current_as_old_for_Interface_IPromiseTimerResult = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IPromiseTimerResult = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -598,7 +798,10 @@ declare type current_as_old_for_Interface_IPromiseTimerResult = requireAssignabl * typeValidation.broken: * "Interface_IRange": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IRange = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IRange = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -607,7 +810,10 @@ declare type old_as_current_for_Interface_IRange = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IRange = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -616,7 +822,10 @@ declare type current_as_old_for_Interface_IRange = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IRangeTrackerSnapshot = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -625,7 +834,10 @@ declare type old_as_current_for_Interface_IRangeTrackerSnapshot = requireAssigna * typeValidation.broken: * "Interface_IRangeTrackerSnapshot": {"backCompat": false} */ -declare type current_as_old_for_Interface_IRangeTrackerSnapshot = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IRangeTrackerSnapshot = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -634,7 +846,10 @@ declare type current_as_old_for_Interface_IRangeTrackerSnapshot = requireAssigna * typeValidation.broken: * "Interface_ITimer": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ITimer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -643,7 +858,10 @@ declare type old_as_current_for_Interface_ITimer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITimer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -652,7 +870,10 @@ declare type current_as_old_for_Interface_ITimer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITraceEvent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -661,7 +882,10 @@ declare type old_as_current_for_Interface_ITraceEvent = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITraceEvent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -670,7 +894,10 @@ declare type current_as_old_for_Interface_ITraceEvent = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_PromiseCacheOptions = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -679,7 +906,10 @@ declare type old_as_current_for_Interface_PromiseCacheOptions = requireAssignabl * typeValidation.broken: * "Interface_PromiseCacheOptions": {"backCompat": false} */ -declare type current_as_old_for_Interface_PromiseCacheOptions = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_PromiseCacheOptions = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -688,7 +918,10 @@ declare type current_as_old_for_Interface_PromiseCacheOptions = requireAssignabl * typeValidation.broken: * "TypeAlias_EventEmitterEventType": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_EventEmitterEventType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_EventEmitterEventType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -697,7 +930,10 @@ declare type old_as_current_for_TypeAlias_EventEmitterEventType = requireAssigna * typeValidation.broken: * "TypeAlias_EventEmitterEventType": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_EventEmitterEventType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_EventEmitterEventType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -706,7 +942,10 @@ declare type current_as_old_for_TypeAlias_EventEmitterEventType = requireAssigna * typeValidation.broken: * "TypeAlias_IsoBuffer": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_IsoBuffer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_IsoBuffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -715,7 +954,10 @@ declare type old_as_current_for_TypeAlias_IsoBuffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_IsoBuffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -724,7 +966,10 @@ declare type current_as_old_for_TypeAlias_IsoBuffer = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_IsomorphicPerformance = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -733,7 +978,10 @@ declare type old_as_current_for_TypeAlias_IsomorphicPerformance = requireAssigna * typeValidation.broken: * "TypeAlias_IsomorphicPerformance": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_IsomorphicPerformance = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_IsomorphicPerformance = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -742,7 +990,10 @@ declare type current_as_old_for_TypeAlias_IsomorphicPerformance = requireAssigna * typeValidation.broken: * "TypeAlias_PromiseCacheExpiry": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_PromiseCacheExpiry = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_PromiseCacheExpiry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -751,7 +1002,10 @@ declare type old_as_current_for_TypeAlias_PromiseCacheExpiry = requireAssignable * typeValidation.broken: * "TypeAlias_PromiseCacheExpiry": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_PromiseCacheExpiry = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_PromiseCacheExpiry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -760,7 +1014,10 @@ declare type current_as_old_for_TypeAlias_PromiseCacheExpiry = requireAssignable * typeValidation.broken: * "TypeAlias_TypedEventTransform": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_TypedEventTransform = requireAssignableTo>, TypeOnly>> +declare type old_as_current_for_TypeAlias_TypedEventTransform = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -769,7 +1026,10 @@ declare type old_as_current_for_TypeAlias_TypedEventTransform = requireAssignabl * typeValidation.broken: * "TypeAlias_TypedEventTransform": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_TypedEventTransform = requireAssignableTo>, TypeOnly>> +declare type current_as_old_for_TypeAlias_TypedEventTransform = requireAssignableTo< + TypeOnly>, + TypeOnly> +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -778,7 +1038,10 @@ declare type current_as_old_for_TypeAlias_TypedEventTransform = requireAssignabl * typeValidation.broken: * "Variable_bufferToString": {"backCompat": false} */ -declare type current_as_old_for_Variable_bufferToString = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_bufferToString = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -787,7 +1050,10 @@ declare type current_as_old_for_Variable_bufferToString = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_delay = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -796,7 +1062,10 @@ declare type current_as_old_for_Variable_delay = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_fromBase64ToUtf8 = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -805,7 +1074,10 @@ declare type current_as_old_for_Variable_fromBase64ToUtf8 = requireAssignableTo< * typeValidation.broken: * "Variable_fromUtf8ToBase64": {"backCompat": false} */ -declare type current_as_old_for_Variable_fromUtf8ToBase64 = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_fromUtf8ToBase64 = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -814,7 +1086,10 @@ declare type current_as_old_for_Variable_fromUtf8ToBase64 = requireAssignableTo< * typeValidation.broken: * "Variable_IsoBuffer": {"backCompat": false} */ -declare type current_as_old_for_Variable_IsoBuffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_IsoBuffer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -823,7 +1098,10 @@ declare type current_as_old_for_Variable_IsoBuffer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_NumberComparer = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -832,7 +1110,10 @@ declare type current_as_old_for_Variable_NumberComparer = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_performance = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -841,4 +1122,7 @@ declare type current_as_old_for_Variable_performance = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Variable_toUtf8 = requireAssignableTo< + TypeOnly, + TypeOnly +>; diff --git a/common/lib/common-utils/src/typedEventEmitter.ts b/common/lib/common-utils/src/typedEventEmitter.ts index 49c0a24026e4..1c2a0c6a25b3 100644 --- a/common/lib/common-utils/src/typedEventEmitter.ts +++ b/common/lib/common-utils/src/typedEventEmitter.ts @@ -183,258 +183,258 @@ export type IEventTransformer = TEvent extends { TransformedEvent & TransformedEvent : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: infer E9, listener: (...args: infer A9) => void); - (event: infer E10, listener: (...args: infer A10) => void); - (event: infer E11, listener: (...args: infer A11) => void); - (event: infer E12, listener: (...args: infer A12) => void); - (event: infer E13, listener: (...args: infer A13) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: infer E9, listener: (...args: infer A9) => void); - (event: infer E10, listener: (...args: infer A10) => void); - (event: infer E11, listener: (...args: infer A11) => void); - (event: infer E12, listener: (...args: infer A12) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: infer E9, listener: (...args: infer A9) => void); - (event: infer E10, listener: (...args: infer A10) => void); - (event: infer E11, listener: (...args: infer A11) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: infer E9, listener: (...args: infer A9) => void); - (event: infer E10, listener: (...args: infer A10) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: infer E9, listener: (...args: infer A9) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: infer E8, listener: (...args: infer A8) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: infer E7, listener: (...args: infer A7) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: infer E6, listener: (...args: infer A6) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: infer E5, listener: (...args: infer A5) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); - (event: infer E4, listener: (...args: infer A4) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: infer E9, listener: (...args: infer A9) => void); + (event: infer E10, listener: (...args: infer A10) => void); + (event: infer E11, listener: (...args: infer A11) => void); + (event: infer E12, listener: (...args: infer A12) => void); + (event: infer E13, listener: (...args: infer A13) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: infer E9, listener: (...args: infer A9) => void); + (event: infer E10, listener: (...args: infer A10) => void); + (event: infer E11, listener: (...args: infer A11) => void); + (event: infer E12, listener: (...args: infer A12) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: infer E9, listener: (...args: infer A9) => void); + (event: infer E10, listener: (...args: infer A10) => void); + (event: infer E11, listener: (...args: infer A11) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: infer E9, listener: (...args: infer A9) => void); + (event: infer E10, listener: (...args: infer A10) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: infer E9, listener: (...args: infer A9) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: infer E8, listener: (...args: infer A8) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: infer E7, listener: (...args: infer A7) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: infer E6, listener: (...args: infer A6) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: infer E5, listener: (...args: infer A5) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); + (event: infer E4, listener: (...args: infer A4) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: infer E3, listener: (...args: infer A3) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: infer E2, listener: (...args: infer A2) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & - TransformedEvent & - TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: infer E1, listener: (...args: infer A1) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent & TransformedEvent - : TEvent extends { - (event: infer E0, listener: (...args: infer A0) => void); - (event: string, listener: (...args: any[]) => void); - } - ? TransformedEvent - : TransformedEvent; + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: infer E2, listener: (...args: infer A2) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & + TransformedEvent & + TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: infer E1, listener: (...args: infer A1) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent & TransformedEvent + : TEvent extends { + (event: infer E0, listener: (...args: infer A0) => void); + (event: string, listener: (...args: any[]) => void); + } + ? TransformedEvent + : TransformedEvent; /** * The event emitter polyfill and the node event emitter have different event types: diff --git a/common/lib/protocol-definitions/src/test/types/validateProtocolDefinitionsPrevious.generated.ts b/common/lib/protocol-definitions/src/test/types/validateProtocolDefinitionsPrevious.generated.ts index 939d57a326ba..bf138f058725 100644 --- a/common/lib/protocol-definitions/src/test/types/validateProtocolDefinitionsPrevious.generated.ts +++ b/common/lib/protocol-definitions/src/test/types/validateProtocolDefinitionsPrevious.generated.ts @@ -8,12 +8,23 @@ * Generated by flub generate:typetests in @fluid-tools/build-cli. */ -import type { TypeOnly, MinimalType, FullType, requireAssignableTo } from "@fluidframework/build-tools"; +import type { + TypeOnly, + MinimalType, + FullType, + requireAssignableTo, +} from "@fluidframework/build-tools"; import type * as old from "@fluidframework/protocol-definitions-previous"; import type * as current from "../../index.js"; -declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | FullType | typeof old | typeof current | requireAssignableTo; +declare type MakeUnusedImportErrorsGoAway = + | TypeOnly + | MinimalType + | FullType + | typeof old + | typeof current + | requireAssignableTo; /* * Validate forward compatibility by using the old type in place of the current type. @@ -22,7 +33,10 @@ declare type MakeUnusedImportErrorsGoAway = TypeOnly | MinimalType | Fu * typeValidation.broken: * "Enum_FileMode": {"forwardCompat": false} */ -declare type old_as_current_for_Enum_FileMode = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_FileMode = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -31,7 +45,10 @@ declare type old_as_current_for_Enum_FileMode = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_FileMode = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -40,7 +57,10 @@ declare type current_as_old_for_Enum_FileMode = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_MessageType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -49,7 +69,10 @@ declare type old_as_current_for_Enum_MessageType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_MessageType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -58,7 +81,10 @@ declare type current_as_old_for_Enum_MessageType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_NackErrorType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -67,7 +93,10 @@ declare type old_as_current_for_Enum_NackErrorType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_NackErrorType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -76,7 +105,10 @@ declare type current_as_old_for_Enum_NackErrorType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_ScopeType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -85,7 +117,10 @@ declare type old_as_current_for_Enum_ScopeType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_ScopeType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -94,7 +129,10 @@ declare type current_as_old_for_Enum_ScopeType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_SignalType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -103,7 +141,10 @@ declare type old_as_current_for_Enum_SignalType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_SignalType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -112,7 +153,10 @@ declare type current_as_old_for_Enum_SignalType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Enum_TreeEntry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -121,7 +165,10 @@ declare type old_as_current_for_Enum_TreeEntry = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Enum_TreeEntry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -130,7 +177,10 @@ declare type current_as_old_for_Enum_TreeEntry = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IActorClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -139,7 +189,10 @@ declare type old_as_current_for_Interface_IActorClient = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IActorClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -148,7 +201,10 @@ declare type current_as_old_for_Interface_IActorClient = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IAttachment = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -157,7 +213,10 @@ declare type old_as_current_for_Interface_IAttachment = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IAttachment = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -166,7 +225,10 @@ declare type current_as_old_for_Interface_IAttachment = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IBlob = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -175,7 +237,10 @@ declare type old_as_current_for_Interface_IBlob = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IBlob = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -184,7 +249,10 @@ declare type current_as_old_for_Interface_IBlob = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IBranchOrigin = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -193,7 +261,10 @@ declare type old_as_current_for_Interface_IBranchOrigin = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IBranchOrigin = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -202,7 +273,10 @@ declare type current_as_old_for_Interface_IBranchOrigin = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ICapabilities = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -211,7 +285,10 @@ declare type old_as_current_for_Interface_ICapabilities = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ICapabilities = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -220,7 +297,10 @@ declare type current_as_old_for_Interface_ICapabilities = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -229,7 +309,10 @@ declare type old_as_current_for_Interface_IClient = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -238,7 +321,10 @@ declare type current_as_old_for_Interface_IClient = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IClientConfiguration = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -247,7 +333,10 @@ declare type old_as_current_for_Interface_IClientConfiguration = requireAssignab * typeValidation.broken: * "Interface_IClientConfiguration": {"backCompat": false} */ -declare type current_as_old_for_Interface_IClientConfiguration = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IClientConfiguration = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -256,7 +345,10 @@ declare type current_as_old_for_Interface_IClientConfiguration = requireAssignab * typeValidation.broken: * "Interface_IClientDetails": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IClientDetails = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IClientDetails = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -265,7 +357,10 @@ declare type old_as_current_for_Interface_IClientDetails = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IClientDetails = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -274,7 +369,10 @@ declare type current_as_old_for_Interface_IClientDetails = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IClientJoin = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -283,7 +381,10 @@ declare type old_as_current_for_Interface_IClientJoin = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IClientJoin = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -292,7 +393,10 @@ declare type current_as_old_for_Interface_IClientJoin = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IConnect = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -301,7 +405,10 @@ declare type old_as_current_for_Interface_IConnect = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IConnect = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -310,7 +417,10 @@ declare type current_as_old_for_Interface_IConnect = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IConnected = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -319,7 +429,10 @@ declare type old_as_current_for_Interface_IConnected = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IConnected = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -328,7 +441,10 @@ declare type current_as_old_for_Interface_IConnected = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ICreateBlobResponse = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -337,7 +453,10 @@ declare type old_as_current_for_Interface_ICreateBlobResponse = requireAssignabl * typeValidation.broken: * "Interface_ICreateBlobResponse": {"backCompat": false} */ -declare type current_as_old_for_Interface_ICreateBlobResponse = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ICreateBlobResponse = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -346,7 +465,10 @@ declare type current_as_old_for_Interface_ICreateBlobResponse = requireAssignabl * typeValidation.broken: * "Interface_IDocumentAttributes": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IDocumentAttributes = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IDocumentAttributes = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -355,7 +477,10 @@ declare type old_as_current_for_Interface_IDocumentAttributes = requireAssignabl * typeValidation.broken: * "Interface_IDocumentAttributes": {"backCompat": false} */ -declare type current_as_old_for_Interface_IDocumentAttributes = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IDocumentAttributes = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -364,7 +489,10 @@ declare type current_as_old_for_Interface_IDocumentAttributes = requireAssignabl * typeValidation.broken: * "Interface_IDocumentMessage": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IDocumentMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IDocumentMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -373,7 +501,10 @@ declare type old_as_current_for_Interface_IDocumentMessage = requireAssignableTo * typeValidation.broken: * "Interface_IDocumentMessage": {"backCompat": false} */ -declare type current_as_old_for_Interface_IDocumentMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IDocumentMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -382,7 +513,10 @@ declare type current_as_old_for_Interface_IDocumentMessage = requireAssignableTo * typeValidation.broken: * "Interface_IDocumentSystemMessage": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IDocumentSystemMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IDocumentSystemMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -391,7 +525,10 @@ declare type old_as_current_for_Interface_IDocumentSystemMessage = requireAssign * typeValidation.broken: * "Interface_IDocumentSystemMessage": {"backCompat": false} */ -declare type current_as_old_for_Interface_IDocumentSystemMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IDocumentSystemMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -400,7 +537,10 @@ declare type current_as_old_for_Interface_IDocumentSystemMessage = requireAssign * typeValidation.broken: * "Interface_INack": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_INack = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_INack = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -409,7 +549,10 @@ declare type old_as_current_for_Interface_INack = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_INack = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -418,7 +561,10 @@ declare type current_as_old_for_Interface_INack = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_INackContent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -427,7 +573,10 @@ declare type old_as_current_for_Interface_INackContent = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_INackContent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -436,7 +585,10 @@ declare type current_as_old_for_Interface_INackContent = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IProcessMessageResult = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -445,7 +597,10 @@ declare type old_as_current_for_Interface_IProcessMessageResult = requireAssigna * typeValidation.broken: * "Interface_IProcessMessageResult": {"backCompat": false} */ -declare type current_as_old_for_Interface_IProcessMessageResult = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IProcessMessageResult = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -454,7 +609,10 @@ declare type current_as_old_for_Interface_IProcessMessageResult = requireAssigna * typeValidation.broken: * "Interface_IProposal": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IProposal = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -463,7 +621,10 @@ declare type old_as_current_for_Interface_IProposal = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -472,7 +633,10 @@ declare type current_as_old_for_Interface_IProposal = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IProtocolState = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -481,7 +645,10 @@ declare type old_as_current_for_Interface_IProtocolState = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IProtocolState = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -490,7 +657,10 @@ declare type current_as_old_for_Interface_IProtocolState = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IQuorum = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -499,7 +669,10 @@ declare type old_as_current_for_Interface_IQuorum = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IQuorum = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -508,7 +681,10 @@ declare type current_as_old_for_Interface_IQuorum = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IQuorumClients = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -517,7 +693,10 @@ declare type old_as_current_for_Interface_IQuorumClients = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IQuorumClients = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -526,7 +705,10 @@ declare type current_as_old_for_Interface_IQuorumClients = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IQuorumClientsEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -535,7 +717,10 @@ declare type old_as_current_for_Interface_IQuorumClientsEvents = requireAssignab * typeValidation.broken: * "Interface_IQuorumClientsEvents": {"backCompat": false} */ -declare type current_as_old_for_Interface_IQuorumClientsEvents = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IQuorumClientsEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -544,7 +729,10 @@ declare type current_as_old_for_Interface_IQuorumClientsEvents = requireAssignab * typeValidation.broken: * "Interface_IQuorumProposals": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IQuorumProposals = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IQuorumProposals = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -553,7 +741,10 @@ declare type old_as_current_for_Interface_IQuorumProposals = requireAssignableTo * typeValidation.broken: * "Interface_IQuorumProposals": {"backCompat": false} */ -declare type current_as_old_for_Interface_IQuorumProposals = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IQuorumProposals = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -562,7 +753,10 @@ declare type current_as_old_for_Interface_IQuorumProposals = requireAssignableTo * typeValidation.broken: * "Interface_IQuorumProposalsEvents": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IQuorumProposalsEvents = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IQuorumProposalsEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -571,7 +765,10 @@ declare type old_as_current_for_Interface_IQuorumProposalsEvents = requireAssign * typeValidation.broken: * "Interface_IQuorumProposalsEvents": {"backCompat": false} */ -declare type current_as_old_for_Interface_IQuorumProposalsEvents = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IQuorumProposalsEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -580,7 +777,10 @@ declare type current_as_old_for_Interface_IQuorumProposalsEvents = requireAssign * typeValidation.broken: * "Interface_ISequencedClient": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISequencedClient = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISequencedClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -589,7 +789,10 @@ declare type old_as_current_for_Interface_ISequencedClient = requireAssignableTo * typeValidation.broken: * "Interface_ISequencedClient": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISequencedClient = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISequencedClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -598,7 +801,11 @@ declare type current_as_old_for_Interface_ISequencedClient = requireAssignableTo * typeValidation.broken: * "Interface_ISequencedDocumentAugmentedMessage": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISequencedDocumentAugmentedMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISequencedDocumentAugmentedMessage = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate backward compatibility by using the current type in place of the old type. @@ -607,7 +814,11 @@ declare type old_as_current_for_Interface_ISequencedDocumentAugmentedMessage = r * typeValidation.broken: * "Interface_ISequencedDocumentAugmentedMessage": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISequencedDocumentAugmentedMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISequencedDocumentAugmentedMessage = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate forward compatibility by using the old type in place of the current type. @@ -616,7 +827,10 @@ declare type current_as_old_for_Interface_ISequencedDocumentAugmentedMessage = r * typeValidation.broken: * "Interface_ISequencedDocumentMessage": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISequencedDocumentMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISequencedDocumentMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -625,7 +839,10 @@ declare type old_as_current_for_Interface_ISequencedDocumentMessage = requireAss * typeValidation.broken: * "Interface_ISequencedDocumentMessage": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISequencedDocumentMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISequencedDocumentMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -634,7 +851,11 @@ declare type current_as_old_for_Interface_ISequencedDocumentMessage = requireAss * typeValidation.broken: * "Interface_ISequencedDocumentSystemMessage": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISequencedDocumentSystemMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISequencedDocumentSystemMessage = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate backward compatibility by using the current type in place of the old type. @@ -643,7 +864,11 @@ declare type old_as_current_for_Interface_ISequencedDocumentSystemMessage = requ * typeValidation.broken: * "Interface_ISequencedDocumentSystemMessage": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISequencedDocumentSystemMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISequencedDocumentSystemMessage = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate forward compatibility by using the old type in place of the current type. @@ -652,7 +877,10 @@ declare type current_as_old_for_Interface_ISequencedDocumentSystemMessage = requ * typeValidation.broken: * "Interface_IServerError": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IServerError = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IServerError = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -661,7 +889,10 @@ declare type old_as_current_for_Interface_IServerError = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IServerError = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -670,7 +901,10 @@ declare type current_as_old_for_Interface_IServerError = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISignalClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -679,7 +913,10 @@ declare type old_as_current_for_Interface_ISignalClient = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISignalClient = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -688,7 +925,10 @@ declare type current_as_old_for_Interface_ISignalClient = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISignalMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -697,7 +937,10 @@ declare type old_as_current_for_Interface_ISignalMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISignalMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -706,7 +949,10 @@ declare type current_as_old_for_Interface_ISignalMessage = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISignalMessageBase = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -715,7 +961,10 @@ declare type old_as_current_for_Interface_ISignalMessageBase = requireAssignable * typeValidation.broken: * "Interface_ISignalMessageBase": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISignalMessageBase = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISignalMessageBase = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -724,7 +973,10 @@ declare type current_as_old_for_Interface_ISignalMessageBase = requireAssignable * typeValidation.broken: * "Interface_ISnapshotTree": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISnapshotTree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISnapshotTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -733,7 +985,10 @@ declare type old_as_current_for_Interface_ISnapshotTree = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISnapshotTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -742,7 +997,10 @@ declare type current_as_old_for_Interface_ISnapshotTree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISnapshotTreeEx = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -751,7 +1009,10 @@ declare type old_as_current_for_Interface_ISnapshotTreeEx = requireAssignableTo< * typeValidation.broken: * "Interface_ISnapshotTreeEx": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISnapshotTreeEx = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISnapshotTreeEx = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -760,7 +1021,10 @@ declare type current_as_old_for_Interface_ISnapshotTreeEx = requireAssignableTo< * typeValidation.broken: * "Interface_ISummaryAck": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISummaryAck = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryAck = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -769,7 +1033,10 @@ declare type old_as_current_for_Interface_ISummaryAck = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryAck = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -778,7 +1045,10 @@ declare type current_as_old_for_Interface_ISummaryAck = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryAttachment = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -787,7 +1057,10 @@ declare type old_as_current_for_Interface_ISummaryAttachment = requireAssignable * typeValidation.broken: * "Interface_ISummaryAttachment": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISummaryAttachment = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryAttachment = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -796,7 +1069,10 @@ declare type current_as_old_for_Interface_ISummaryAttachment = requireAssignable * typeValidation.broken: * "Interface_ISummaryBlob": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISummaryBlob = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryBlob = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -805,7 +1081,10 @@ declare type old_as_current_for_Interface_ISummaryBlob = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryBlob = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -814,7 +1093,10 @@ declare type current_as_old_for_Interface_ISummaryBlob = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryContent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -823,7 +1105,10 @@ declare type old_as_current_for_Interface_ISummaryContent = requireAssignableTo< * typeValidation.broken: * "Interface_ISummaryContent": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISummaryContent = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryContent = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -832,7 +1117,10 @@ declare type current_as_old_for_Interface_ISummaryContent = requireAssignableTo< * typeValidation.broken: * "Interface_ISummaryHandle": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISummaryHandle = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryHandle = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -841,7 +1129,10 @@ declare type old_as_current_for_Interface_ISummaryHandle = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryHandle = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -850,7 +1141,10 @@ declare type current_as_old_for_Interface_ISummaryHandle = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryNack = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -859,7 +1153,10 @@ declare type old_as_current_for_Interface_ISummaryNack = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryNack = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -868,7 +1165,10 @@ declare type current_as_old_for_Interface_ISummaryNack = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -877,7 +1177,10 @@ declare type old_as_current_for_Interface_ISummaryProposal = requireAssignableTo * typeValidation.broken: * "Interface_ISummaryProposal": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISummaryProposal = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -886,7 +1189,10 @@ declare type current_as_old_for_Interface_ISummaryProposal = requireAssignableTo * typeValidation.broken: * "Interface_ISummaryTokenClaims": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISummaryTokenClaims = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryTokenClaims = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -895,7 +1201,10 @@ declare type old_as_current_for_Interface_ISummaryTokenClaims = requireAssignabl * typeValidation.broken: * "Interface_ISummaryTokenClaims": {"backCompat": false} */ -declare type current_as_old_for_Interface_ISummaryTokenClaims = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryTokenClaims = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -904,7 +1213,10 @@ declare type current_as_old_for_Interface_ISummaryTokenClaims = requireAssignabl * typeValidation.broken: * "Interface_ISummaryTree": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_ISummaryTree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ISummaryTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -913,7 +1225,10 @@ declare type old_as_current_for_Interface_ISummaryTree = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ISummaryTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -922,7 +1237,10 @@ declare type current_as_old_for_Interface_ISummaryTree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITokenClaims = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -931,7 +1249,10 @@ declare type old_as_current_for_Interface_ITokenClaims = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITokenClaims = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -940,7 +1261,10 @@ declare type current_as_old_for_Interface_ITokenClaims = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITokenProvider = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -949,7 +1273,10 @@ declare type old_as_current_for_Interface_ITokenProvider = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITokenProvider = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -958,7 +1285,10 @@ declare type current_as_old_for_Interface_ITokenProvider = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITokenService = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -967,7 +1297,10 @@ declare type old_as_current_for_Interface_ITokenService = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITokenService = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -976,7 +1309,10 @@ declare type current_as_old_for_Interface_ITokenService = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITrace = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -985,7 +1321,10 @@ declare type old_as_current_for_Interface_ITrace = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITrace = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -994,7 +1333,10 @@ declare type current_as_old_for_Interface_ITrace = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_ITree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1003,7 +1345,10 @@ declare type old_as_current_for_Interface_ITree = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_ITree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1012,7 +1357,10 @@ declare type current_as_old_for_Interface_ITree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IUploadedSummaryDetails = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1021,7 +1369,10 @@ declare type old_as_current_for_Interface_IUploadedSummaryDetails = requireAssig * typeValidation.broken: * "Interface_IUploadedSummaryDetails": {"backCompat": false} */ -declare type current_as_old_for_Interface_IUploadedSummaryDetails = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IUploadedSummaryDetails = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1030,7 +1381,10 @@ declare type current_as_old_for_Interface_IUploadedSummaryDetails = requireAssig * typeValidation.broken: * "Interface_IUser": {"forwardCompat": false} */ -declare type old_as_current_for_Interface_IUser = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IUser = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1039,7 +1393,10 @@ declare type old_as_current_for_Interface_IUser = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IUser = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1048,7 +1405,10 @@ declare type current_as_old_for_Interface_IUser = requireAssignableTo, TypeOnly> +declare type old_as_current_for_Interface_IVersion = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1057,7 +1417,10 @@ declare type old_as_current_for_Interface_IVersion = requireAssignableTo, TypeOnly> +declare type current_as_old_for_Interface_IVersion = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1066,7 +1429,10 @@ declare type current_as_old_for_Interface_IVersion = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ConnectionMode = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1075,7 +1441,10 @@ declare type old_as_current_for_TypeAlias_ConnectionMode = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ConnectionMode = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1084,7 +1453,10 @@ declare type current_as_old_for_TypeAlias_ConnectionMode = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_IApprovedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1093,7 +1465,10 @@ declare type old_as_current_for_TypeAlias_IApprovedProposal = requireAssignableT * typeValidation.broken: * "TypeAlias_IApprovedProposal": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_IApprovedProposal = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_IApprovedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1102,7 +1477,10 @@ declare type current_as_old_for_TypeAlias_IApprovedProposal = requireAssignableT * typeValidation.broken: * "TypeAlias_ICommittedProposal": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_ICommittedProposal = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ICommittedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1111,7 +1489,10 @@ declare type old_as_current_for_TypeAlias_ICommittedProposal = requireAssignable * typeValidation.broken: * "TypeAlias_ICommittedProposal": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_ICommittedProposal = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ICommittedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1120,7 +1501,10 @@ declare type current_as_old_for_TypeAlias_ICommittedProposal = requireAssignable * typeValidation.broken: * "TypeAlias_IQuorumEvents": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_IQuorumEvents = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_IQuorumEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1129,7 +1513,10 @@ declare type old_as_current_for_TypeAlias_IQuorumEvents = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_IQuorumEvents = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1138,7 +1525,10 @@ declare type current_as_old_for_TypeAlias_IQuorumEvents = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ISentSignalMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1147,7 +1537,10 @@ declare type old_as_current_for_TypeAlias_ISentSignalMessage = requireAssignable * typeValidation.broken: * "TypeAlias_ISentSignalMessage": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_ISentSignalMessage = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ISentSignalMessage = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1156,7 +1549,11 @@ declare type current_as_old_for_TypeAlias_ISentSignalMessage = requireAssignable * typeValidation.broken: * "TypeAlias_ISequencedDocumentMessageExperimental": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_ISequencedDocumentMessageExperimental = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ISequencedDocumentMessageExperimental = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1165,7 +1562,11 @@ declare type old_as_current_for_TypeAlias_ISequencedDocumentMessageExperimental * typeValidation.broken: * "TypeAlias_ISequencedDocumentMessageExperimental": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_ISequencedDocumentMessageExperimental = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ISequencedDocumentMessageExperimental = + requireAssignableTo< + TypeOnly, + TypeOnly + >; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1174,7 +1575,10 @@ declare type current_as_old_for_TypeAlias_ISequencedDocumentMessageExperimental * typeValidation.broken: * "TypeAlias_ISequencedProposal": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_ISequencedProposal = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ISequencedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1183,7 +1587,10 @@ declare type old_as_current_for_TypeAlias_ISequencedProposal = requireAssignable * typeValidation.broken: * "TypeAlias_ISequencedProposal": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_ISequencedProposal = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ISequencedProposal = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1192,7 +1599,10 @@ declare type current_as_old_for_TypeAlias_ISequencedProposal = requireAssignable * typeValidation.broken: * "TypeAlias_IsoDate": {"forwardCompat": false} */ -declare type old_as_current_for_TypeAlias_IsoDate = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_IsoDate = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1201,7 +1611,10 @@ declare type old_as_current_for_TypeAlias_IsoDate = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_IsoDate = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1210,7 +1623,10 @@ declare type current_as_old_for_TypeAlias_IsoDate = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_ITreeEntry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1219,7 +1635,10 @@ declare type old_as_current_for_TypeAlias_ITreeEntry = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_ITreeEntry = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1228,7 +1647,10 @@ declare type current_as_old_for_TypeAlias_ITreeEntry = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_SummaryObject = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1237,7 +1659,10 @@ declare type old_as_current_for_TypeAlias_SummaryObject = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_SummaryObject = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1246,7 +1671,10 @@ declare type current_as_old_for_TypeAlias_SummaryObject = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_SummaryTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1255,7 +1683,10 @@ declare type old_as_current_for_TypeAlias_SummaryTree = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_SummaryTree = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1264,7 +1695,10 @@ declare type current_as_old_for_TypeAlias_SummaryTree = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_SummaryType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1273,7 +1707,10 @@ declare type old_as_current_for_TypeAlias_SummaryType = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_SummaryType = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate forward compatibility by using the old type in place of the current type. @@ -1282,7 +1719,10 @@ declare type current_as_old_for_TypeAlias_SummaryType = requireAssignableTo, TypeOnly> +declare type old_as_current_for_TypeAlias_SummaryTypeNoHandle = requireAssignableTo< + TypeOnly, + TypeOnly +>; /* * Validate backward compatibility by using the current type in place of the old type. @@ -1291,4 +1731,7 @@ declare type old_as_current_for_TypeAlias_SummaryTypeNoHandle = requireAssignabl * typeValidation.broken: * "TypeAlias_SummaryTypeNoHandle": {"backCompat": false} */ -declare type current_as_old_for_TypeAlias_SummaryTypeNoHandle = requireAssignableTo, TypeOnly> +declare type current_as_old_for_TypeAlias_SummaryTypeNoHandle = requireAssignableTo< + TypeOnly, + TypeOnly +>; diff --git a/docs/infra/api-markdown-documenter/api-documentation-layout.mjs b/docs/infra/api-markdown-documenter/api-documentation-layout.mjs index b9b44b5ac643..de8e7186849f 100644 --- a/docs/infra/api-markdown-documenter/api-documentation-layout.mjs +++ b/docs/infra/api-markdown-documenter/api-documentation-layout.mjs @@ -262,7 +262,9 @@ export function layoutContent(apiItem, itemSpecificContent, config) { addSection(LayoutUtilities.createRemarksSection(apiItem, config)); // Add examples (if any) - addSection(LayoutUtilities.createExamplesSection(apiItem, config, customExamplesSectionTitle)); + addSection( + LayoutUtilities.createExamplesSection(apiItem, config, customExamplesSectionTitle), + ); // Add provided contents // Flatten contents into this section diff --git a/docs/infra/api-markdown-documenter/render-api-documentation.mjs b/docs/infra/api-markdown-documenter/render-api-documentation.mjs index e19e294821a1..2844a5ebbc89 100644 --- a/docs/infra/api-markdown-documenter/render-api-documentation.mjs +++ b/docs/infra/api-markdown-documenter/render-api-documentation.mjs @@ -172,9 +172,7 @@ export async function renderApiDocumentation(inputDir, outputDir, uriRootDir, ap // Skip packages that are published, but are not intended for direct public consumption. // TODO: Also skip `@fluid-internal` packages once we no longer have public, user-facing APIs that reference their contents. if ( - ["@fluid-example", "@fluid-experimental", "@fluid-private"].includes( - packageScope, - ) + ["@fluid-example", "@fluid-experimental", "@fluid-private"].includes(packageScope) ) { return true; } @@ -234,9 +232,7 @@ export async function renderApiDocumentation(inputDir, outputDir, uriRootDir, ap const frontMatter = createFrontMatter(documentApiItem, config); - fileContents = [frontMatter, generatedContentNotice, documentBody] - .join("\n\n") - .trim(); + fileContents = [frontMatter, generatedContentNotice, documentBody].join("\n\n").trim(); } catch (error) { logErrorAndRethrow( `Encountered error while rendering Markdown contents for "${documentApiItem.displayName}"`, diff --git a/docs/src/components/community.tsx b/docs/src/components/community.tsx index 17bf079cecbf..b8911b2b701d 100644 --- a/docs/src/components/community.tsx +++ b/docs/src/components/community.tsx @@ -35,8 +35,8 @@ const links: CommunityLinkItem[] = [ Icon: DiscussionIcon, description: ( <> - Our GitHub Discussions are a great way to participate. Feel free to ask questions - or, if you can, give us a hand by answering some. + Our GitHub Discussions are a great way to participate. Feel free to ask questions or, + if you can, give us a hand by answering some. ), linkUrl: "https://www.github.com/Microsoft/fluidframework/discussions", @@ -46,8 +46,8 @@ const links: CommunityLinkItem[] = [ Icon: ReportIssuesIcon, description: ( <> - Found something not working as expected? Please file a GitHub issue, so we can take - a look together. + Found something not working as expected? Please file a GitHub issue, so we can take a + look together. ), linkUrl: "https://www.github.com/Microsoft/fluidframework/issues", diff --git a/docs/src/components/shortLinks.tsx b/docs/src/components/shortLinks.tsx index e32281bb36c7..f7fcdd009c1b 100644 --- a/docs/src/components/shortLinks.tsx +++ b/docs/src/components/shortLinks.tsx @@ -25,7 +25,11 @@ export interface PackageLinkProps { /** * A convenient mechanism for linking to a package's API documentation. */ -export function PackageLink({ headingId, packageName, children }: PackageLinkProps): JSX.Element { +export function PackageLink({ + headingId, + packageName, + children, +}: PackageLinkProps): JSX.Element { const root = useLinkPathBase(); const headingPostfix = headingId === undefined ? "" : `#${headingId}`; return {children ?? packageName}; diff --git a/docs/src/css/home/banner.css b/docs/src/css/home/banner.css index 5b1739a02c0a..26275f5084f9 100644 --- a/docs/src/css/home/banner.css +++ b/docs/src/css/home/banner.css @@ -31,17 +31,15 @@ /* Light mode override */ [data-theme="light"] .ffcom-banner { - background-image: linear-gradient( - 90.5deg, - rgba(255, 255, 255, 0.9) 19.21%, - rgba(255, 255, 255, 0.1) 94.15% - ), + background-image: + linear-gradient(90.5deg, rgba(255, 255, 255, 0.9) 19.21%, rgba(255, 255, 255, 0.1) 94.15%), url("https://storage.fluidframework.com/static/images/website/home/banner-light.png"); } /* Dark mode override */ [data-theme="dark"] .ffcom-banner { - background-image: linear-gradient(90.5deg, rgba(0, 0, 0, 0.8) 19.21%, rgba(0, 0, 0, 0.3)), + background-image: + linear-gradient(90.5deg, rgba(0, 0, 0, 0.8) 19.21%, rgba(0, 0, 0, 0.3)), url("https://storage.fluidframework.com/static/images/website/home/banner-dark.png"); } diff --git a/docs/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx b/docs/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx index 0e82b3fe47fe..cc4440550ee2 100644 --- a/docs/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +++ b/docs/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx @@ -78,7 +78,10 @@ export default function DocsVersionDropdownNavbarItem({ const versions = useVersions(docsPluginId); const { savePreferredVersionName } = useDocsPreferredVersion(docsPluginId); - function versionToAccessibleLink(version: GlobalVersion, index: number): AccessibleLinkProps { + function versionToAccessibleLink( + version: GlobalVersion, + index: number, + ): AccessibleLinkProps { const targetDoc = getVersionTargetDoc(version, activeDocContext); return { "label": version.label, diff --git a/docs/static/dompurify/purify.min.js b/docs/static/dompurify/purify.min.js index 6f72325ca46f..750f0e9abf8b 100644 --- a/docs/static/dompurify/purify.min.js +++ b/docs/static/dompurify/purify.min.js @@ -944,10 +944,7 @@ if ( ((e && "object" == typeof e) || (e = {}), (e = D(e)), - (ut = - -1 === mt.indexOf(e.PARSER_MEDIA_TYPE) - ? "text/html" - : e.PARSER_MEDIA_TYPE), + (ut = -1 === mt.indexOf(e.PARSER_MEDIA_TYPE) ? "text/html" : e.PARSER_MEDIA_TYPE), (pt = "application/xhtml+xml" === ut ? g : h), (Ne = _(e, "ALLOWED_TAGS") ? w({}, e.ALLOWED_TAGS, pt) : Re), (we = _(e, "ALLOWED_ATTR") ? w({}, e.ALLOWED_ATTR, pt) : Oe), @@ -985,8 +982,7 @@ ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (De.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && - "boolean" == - typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && + "boolean" == typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (De.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ke && (xe = !1), @@ -1001,8 +997,7 @@ e.ADD_TAGS && (Ne === Re && (Ne = D(Ne)), w(Ne, e.ADD_TAGS, pt)), e.ADD_ATTR && (we === Oe && (we = D(we)), w(we, e.ADD_ATTR, pt)), e.ADD_URI_SAFE_ATTR && w(Je, e.ADD_URI_SAFE_ATTR, pt), - e.FORBID_CONTENTS && - ($e === Ke && ($e = D($e)), w($e, e.FORBID_CONTENTS, pt)), + e.FORBID_CONTENTS && ($e === Ke && ($e = D($e)), w($e, e.FORBID_CONTENTS, pt)), je && (Ne["#text"] = !0), ze && w(Ne, ["html", "head", "body"]), Ne.table && (w(Ne, ["tbody"]), delete ve.tbody), @@ -1020,8 +1015,7 @@ } else void 0 === le && (le = (function (e, t) { - if ("object" != typeof e || "function" != typeof e.createPolicy) - return null; + if ("object" != typeof e || "function" != typeof e.createPolicy) return null; let n = null; const o = "data-tt-policy-suffix"; t && t.hasAttribute(o) && (n = t.getAttribute(o)); @@ -1033,10 +1027,7 @@ }); } catch (e) { return ( - console.warn( - "TrustedTypes policy " + r + " could not be created.", - ), - null + console.warn("TrustedTypes policy " + r + " could not be created."), null ); } })(j, c)), @@ -1161,8 +1152,7 @@ if (n && t) { for (let o = n.length - 1; o >= 0; --o) { const r = $(n[o], !0); - (r.__removalCount = (e.__removalCount || 0) + 1), - t.insertBefore(r, re(e)); + (r.__removalCount = (e.__removalCount || 0) + 1), t.insertBefore(r, re(e)); } } } @@ -1198,7 +1188,7 @@ })(e) ? (Et(e), !0) : ("noscript" !== n && "noembed" !== n && "noframes" !== n) || - !S(/<\/no(script|embed|frames)/i, e.innerHTML) + !S(/<\/no(script|embed|frames)/i, e.innerHTML) ? (ke && e.nodeType === Q && ((t = e.textContent), @@ -1206,8 +1196,7 @@ t = y(t, e, " "); }), e.textContent !== t && - (f(o.removed, { element: e.cloneNode() }), - (e.textContent = t))), + (f(o.removed, { element: e.cloneNode() }), (e.textContent = t))), Rt(de.afterSanitizeElements, e, null), !1) : (Et(e), !0); @@ -1222,10 +1211,8 @@ (Dt(e) && ((De.tagNameCheck instanceof RegExp && S(De.tagNameCheck, e)) || (De.tagNameCheck instanceof Function && De.tagNameCheck(e))) && - ((De.attributeNameCheck instanceof RegExp && - S(De.attributeNameCheck, t)) || - (De.attributeNameCheck instanceof Function && - De.attributeNameCheck(t)))) || + ((De.attributeNameCheck instanceof RegExp && S(De.attributeNameCheck, t)) || + (De.attributeNameCheck instanceof Function && De.attributeNameCheck(t)))) || ("is" === t && De.allowCustomizedBuiltInElements && ((De.tagNameCheck instanceof RegExp && S(De.tagNameCheck, n)) || @@ -1274,9 +1261,7 @@ (n.forceKeepAttr = void 0), Rt(de.uponSanitizeAttribute, e, n), (f = n.attrValue), - !Ye || - ("id" !== s && "name" !== s) || - (At(a, e), (f = "user-content-" + f)), + !Ye || ("id" !== s && "name" !== s) || (At(a, e), (f = "user-content-" + f)), Ue && S(/((--!?|])>)|<\/(style|title)/i, f)) ) { At(a, e); @@ -1364,8 +1349,7 @@ if (Xe) return e; if (Fe) { if (Be) - for (l = me.call(n.ownerDocument); n.firstChild; ) - l.appendChild(n.firstChild); + for (l = me.call(n.ownerDocument); n.firstChild; ) l.appendChild(n.firstChild); else l = n; return (we.shadowroot || we.shadowrootmode) && (l = fe.call(a, l, !0)), l; } diff --git a/docs/swa-cli.config.json b/docs/swa-cli.config.json index 243ef24131c9..84a0104df51c 100644 --- a/docs/swa-cli.config.json +++ b/docs/swa-cli.config.json @@ -1,16 +1,16 @@ { - "$schema": "https://aka.ms/azure/static-web-apps-cli/schema", - "configurations": { - "ff-doc-site": { - "appLocation": ".", - "outputLocation": "./build", - "appBuildCommand": "npm run build", - "run": "npm run serve", - "appDevserverUrl": "http://localhost:3000", - "swaConfigLocation": ".", - "apiLocation": "./api", - "appName": "ff-doc-site", - "resourceGroup": "website" - } - } + "$schema": "https://aka.ms/azure/static-web-apps-cli/schema", + "configurations": { + "ff-doc-site": { + "appLocation": ".", + "outputLocation": "./build", + "appBuildCommand": "npm run build", + "run": "npm run serve", + "appDevserverUrl": "http://localhost:3000", + "swaConfigLocation": ".", + "apiLocation": "./api", + "appName": "ff-doc-site", + "resourceGroup": "website" + } + } } diff --git a/examples/apps/ai-collab/.eslintrc.cjs b/examples/apps/ai-collab/.eslintrc.cjs index 64497b2a43d0..31f2683a0bea 100644 --- a/examples/apps/ai-collab/.eslintrc.cjs +++ b/examples/apps/ai-collab/.eslintrc.cjs @@ -47,7 +47,10 @@ module.exports = { files: ["src/actions/task.ts"], rules: { // This file runs on server side - "import/no-nodejs-modules": ["error", { allow: ["node:fs", "node:path", "node:url"] }], + "import/no-nodejs-modules": [ + "error", + { allow: ["node:fs", "node:path", "node:url"] }, + ], }, }, ], diff --git a/examples/apps/ai-collab/biome.jsonc b/examples/apps/ai-collab/biome.jsonc index 4b65e1c0aea2..bff6a48b6caf 100644 --- a/examples/apps/ai-collab/biome.jsonc +++ b/examples/apps/ai-collab/biome.jsonc @@ -1,4 +1,4 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"] + "root": false, + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json" } diff --git a/examples/apps/ai-collab/src/app/layout.tsx b/examples/apps/ai-collab/src/app/layout.tsx index f311efb55476..ed032ed94b03 100644 --- a/examples/apps/ai-collab/src/app/layout.tsx +++ b/examples/apps/ai-collab/src/app/layout.tsx @@ -48,7 +48,9 @@ export default function RootLayout({ }} /> - + {children} diff --git a/examples/apps/ai-collab/src/app/page.tsx b/examples/apps/ai-collab/src/app/page.tsx index 52ad53f837ed..a78774487be9 100644 --- a/examples/apps/ai-collab/src/app/page.tsx +++ b/examples/apps/ai-collab/src/app/page.tsx @@ -35,13 +35,19 @@ import { useSharedTreeRerender } from "@/useSharedTreeRerender"; // Uncomment the import line that corresponds to the server you want to use // import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./spe"; // eslint-disable-line import/order -import { createContainer, loadContainer, postAttach, containerIdFromUrl } from "./tinylicious"; // eslint-disable-line import/order +import { + createContainer, + loadContainer, + postAttach, + containerIdFromUrl, +} from "./tinylicious"; // eslint-disable-line import/order export async function createAndInitializeContainer(): Promise< IFluidContainer > { const container = await createContainer(CONTAINER_SCHEMA); - const treeView = container.initialObjects.appState.viewWith(TREE_CONFIGURATION); + const treeView = + container.initialObjects.appState.viewWith(TREE_CONFIGURATION); treeView.initialize(new SharedTreeAppState(INITIAL_APP_STATE)); treeView.dispose(); // After initializing, dispose the tree view so later loading of the data can work correctly return container; @@ -49,9 +55,12 @@ export async function createAndInitializeContainer(): Promise< // eslint-disable-next-line import/no-default-export -- NextJS uses default exports export default function TasksListPage(): JSX.Element { - const [selectedTaskGroup, setSelectedTaskGroup] = useState(); - const [treeView, setTreeView] = useState>(); - const [presenceManagerContext, setPresenceManagerContext] = useState(); + const [selectedTaskGroup, setSelectedTaskGroup] = + useState(); + const [treeView, setTreeView] = + useState>(); + const [presenceManagerContext, setPresenceManagerContext] = + useState(); const { container, isFluidInitialized, data } = useFluidContainerNextJs( containerIdFromUrl(), @@ -60,7 +69,8 @@ export default function TasksListPage(): JSX.Element { async (id) => loadContainer(CONTAINER_SCHEMA, id), // Get data from existing container (fluidContainer) => { - const _treeView = fluidContainer.initialObjects.appState.viewWith(TREE_CONFIGURATION); + const _treeView = + fluidContainer.initialObjects.appState.viewWith(TREE_CONFIGURATION); setTreeView(_treeView); const presence = getPresence(fluidContainer); @@ -115,7 +125,11 @@ export default function TasksListPage(): JSX.Element { }} > {taskGroups?.map((taskGroup) => ( - + ))} @@ -124,13 +138,18 @@ export default function TasksListPage(): JSX.Element { variant="contained" size="small" color="success" - onClick={() => taskGroups.insertAtEnd(getNewTaskGroup(taskGroups.length))} + onClick={() => + taskGroups.insertAtEnd(getNewTaskGroup(taskGroups.length)) + } > New Group - + )} @@ -175,7 +194,8 @@ const getNewTaskGroup = (groupLength: number) => { { name: "Alice", maxCapacity: 15, - skills: "Senior engineer capable of handling complex tasks. Versed in most languages", + skills: + "Senior engineer capable of handling complex tasks. Versed in most languages", }, { name: "Bob", @@ -186,7 +206,8 @@ const getNewTaskGroup = (groupLength: number) => { { name: "Charlie", maxCapacity: 7, - skills: "Junior engineer capable of handling simple tasks. Versed in Node.JS", + skills: + "Junior engineer capable of handling simple tasks. Versed in Node.JS", }, ], }; diff --git a/examples/apps/ai-collab/src/app/presence.ts b/examples/apps/ai-collab/src/app/presence.ts index 375f015dfce8..c5e5119068d0 100644 --- a/examples/apps/ai-collab/src/app/presence.ts +++ b/examples/apps/ai-collab/src/app/presence.ts @@ -25,7 +25,10 @@ export type UserPresence = StatesWorkspace; // Takes a presence object and returns the user presence object that contains the shared object states export function buildUserPresence(presence: Presence): UserPresence { - const states = presence.states.getWorkspace(`name:user-avatar-states`, statesSchema); + const states = presence.states.getWorkspace( + `name:user-avatar-states`, + statesSchema, + ); return states; } @@ -35,7 +38,8 @@ export class PresenceManager { // A map of SessionClient to UserInfo, where users can share their info with other users private readonly userInfoMap: Map = new Map(); // A callback method to get updates when remote UserInfo changes - private userInfoCallback: (userInfoMap: Map) => void = () => {}; + private userInfoCallback: (userInfoMap: Map) => void = + () => {}; constructor(private readonly presence: Presence) { // Address for the presence state, this is used to organize the presence states and avoid conflicts @@ -90,7 +94,9 @@ export class PresenceManager { } // Allows the app to listen for updates to the userInfoMap - setUserInfoUpdateListener(callback: (userInfoMap: Map) => void): void { + setUserInfoUpdateListener( + callback: (userInfoMap: Map) => void, + ): void { this.userInfoCallback = callback; } @@ -101,9 +107,13 @@ export class PresenceManager { for (const sessionClient of sessionList) { // If local user or remote user is connected, then only add it to the list try { - const userInfo = this.usersState.states.onlineUsers.getRemote(sessionClient).value; + const userInfo = + this.usersState.states.onlineUsers.getRemote(sessionClient).value; // If the user is local user, then add it to the beginning of the list - if (sessionClient.attendeeId === this.presence.attendees.getMyself().attendeeId) { + if ( + sessionClient.attendeeId === + this.presence.attendees.getMyself().attendeeId + ) { userInfoList.push(userInfo); } else { // If the user is remote user, then add it to the end of the list diff --git a/examples/apps/ai-collab/src/app/tinylicious.ts b/examples/apps/ai-collab/src/app/tinylicious.ts index af335b093fc7..bbba3e700cc9 100644 --- a/examples/apps/ai-collab/src/app/tinylicious.ts +++ b/examples/apps/ai-collab/src/app/tinylicious.ts @@ -11,20 +11,28 @@ const tinyliciousClient = new TinyliciousClient({}); export const containerIdFromUrl = (): string => typeof window === "undefined" // Need to check if window exists because this function is called during server-side rendering ? "" - : (new URL(window.location.href).searchParams.get("fluidContainerId") ?? ""); + : (new URL(window.location.href).searchParams.get("fluidContainerId") ?? + ""); export async function loadContainer( containerSchema: T, id: string, ): Promise> { - const { container } = await tinyliciousClient.getContainer(id, containerSchema, "2"); + const { container } = await tinyliciousClient.getContainer( + id, + containerSchema, + "2", + ); return container; } export async function createContainer( containerSchema: T, ): Promise> { - const { container } = await tinyliciousClient.createContainer(containerSchema, "2"); + const { container } = await tinyliciousClient.createContainer( + containerSchema, + "2", + ); return container; } diff --git a/examples/apps/ai-collab/src/components/TaskCard.tsx b/examples/apps/ai-collab/src/components/TaskCard.tsx index a2ec8469bf9c..ec49f5d7347d 100644 --- a/examples/apps/ai-collab/src/components/TaskCard.tsx +++ b/examples/apps/ai-collab/src/components/TaskCard.tsx @@ -14,7 +14,11 @@ import { type MoveDiff, type Diff, } from "@fluidframework/ai-collab/alpha"; -import { TreeAlpha, type TreeBranch, type TreeViewAlpha } from "@fluidframework/tree/alpha"; +import { + TreeAlpha, + type TreeBranch, + type TreeViewAlpha, +} from "@fluidframework/tree/alpha"; import { Icon } from "@iconify/react"; import { LoadingButton } from "@mui/lab"; import { @@ -66,12 +70,17 @@ export function TaskCard(props: { const [diffOldValue, setDiffOldValue] = useState(); const [isAiTaskRunning, setIsAiTaskRunning] = useState(false); - useSharedTreeRerender({ sharedTreeNode: props.sharedTreeTask, logId: "TaskCard" }); + useSharedTreeRerender({ + sharedTreeNode: props.sharedTreeTask, + logId: "TaskCard", + }); const [diffs, setdiffs] = useState(props.diffs); const deleteTask = (): void => { - const taskIndex = props.sharedTreeTaskGroup.tasks.indexOf(props.sharedTreeTask); + const taskIndex = props.sharedTreeTaskGroup.tasks.indexOf( + props.sharedTreeTask, + ); props.sharedTreeTaskGroup.tasks.removeAt(taskIndex); }; @@ -94,11 +103,15 @@ export function TaskCard(props: { if (diff.type === "modify") { if (typeof diff.nodePath[0]?.parentField !== "string") { - throw new TypeError("Invalid 'modify' diff. Expected 'parentField' to be a string."); + throw new TypeError( + "Invalid 'modify' diff. Expected 'parentField' to be a string.", + ); } const targetField = diff.nodePath[0]?.parentField; if (targetField === undefined) { - console.error("Received modify ui diff but could not identify target field"); + console.error( + "Received modify ui diff but could not identify target field", + ); continue; } @@ -107,7 +120,9 @@ export function TaskCard(props: { if (diff.type === "move" && diff.moveType === "move-single") { if (typeof diff.sourceNodePath[0]?.parentField !== "number") { - throw new TypeError("Invalid 'move' diff. Expected 'parentField' to be a number."); + throw new TypeError( + "Invalid 'move' diff. Expected 'parentField' to be a number.", + ); } fieldDifferences.moved = { diff, @@ -175,56 +190,61 @@ export function TaskCard(props: { try { // 1. Get the current branch, the new branch and associated task to be used for ai collaboration - const { currentBranch, newBranchTree, newBranchTask } = getNewSharedTreeBranchAndTask( - props.sharedTreeBranch.root, - props.sharedTreeTask, - ); + const { currentBranch, newBranchTree, newBranchTask } = + getNewSharedTreeBranchAndTask( + props.sharedTreeBranch.root, + props.sharedTreeTask, + ); console.log("ai-collab Branch Task BEFORE:", { ...newBranchTask }); // 2. execute the ai collaboration - const response: AiCollabSuccessResponse | AiCollabErrorResponse = await aiCollab({ - openAI: { - client: getOpenAiClient(), - modelName: "gpt-4o", - }, - treeNode: newBranchTask, - prompt: { - systemRoleContext: - "You are a manager that is helping out with a project management tool. You have been asked to edit a specific task.", - userAsk: userRequest, - }, - planningStep: true, - finalReviewStep: true, - validator: aiCollabLlmTreeNodeValidator, - debugEventLogHandler: (event) => { - console.log(`Received event: ${event.eventName}`); - if ( - event.eventName === "APPLIED_EDIT_SUCCESS" || - event.eventName === "APPLIED_EDIT_FAILURE" - ) { - console.log( - `${ - event.eventName === "APPLIED_EDIT_SUCCESS" - ? "Succesfully applied" - : "Failed to appply" - } tree edit: ${JSON.stringify( - (event as unknown as ApplyEditSuccess).edit, - undefined, - 2, - )}`, - ); - } - }, - }); + const response: AiCollabSuccessResponse | AiCollabErrorResponse = + await aiCollab({ + openAI: { + client: getOpenAiClient(), + modelName: "gpt-4o", + }, + treeNode: newBranchTask, + prompt: { + systemRoleContext: + "You are a manager that is helping out with a project management tool. You have been asked to edit a specific task.", + userAsk: userRequest, + }, + planningStep: true, + finalReviewStep: true, + validator: aiCollabLlmTreeNodeValidator, + debugEventLogHandler: (event) => { + console.log(`Received event: ${event.eventName}`); + if ( + event.eventName === "APPLIED_EDIT_SUCCESS" || + event.eventName === "APPLIED_EDIT_FAILURE" + ) { + console.log( + `${ + event.eventName === "APPLIED_EDIT_SUCCESS" + ? "Succesfully applied" + : "Failed to appply" + } tree edit: ${JSON.stringify( + (event as unknown as ApplyEditSuccess).edit, + undefined, + 2, + )}`, + ); + } + }, + }); if (response.status !== "success") { throw new Error(response.errorMessage); } - enqueueSnackbar(`Copilot: I've completed your request - "${userRequest}"`, { - variant: "success", - autoHideDuration: 5000, - }); + enqueueSnackbar( + `Copilot: I've completed your request - "${userRequest}"`, + { + variant: "success", + autoHideDuration: 5000, + }, + ); console.log("ai-collab Branch Task AFTER:", { ...newBranchTask }); console.log("ai-collab Branch Task differences:", response.diffs); @@ -257,9 +277,17 @@ export function TaskCard(props: { key={`${props.sharedTreeTask.title}`} > {fieldDifferences.isNewCreation && ( - + - + )} @@ -269,7 +297,12 @@ export function TaskCard(props: { - + )} @@ -281,7 +314,11 @@ export function TaskCard(props: { - + {props.sharedTreeTask.title} @@ -305,7 +342,12 @@ export function TaskCard(props: { > { e.preventDefault(); @@ -395,7 +437,9 @@ export function TaskCard(props: { sx: { alignItems: "flex-start", backgroundColor: - fieldDifferences.changes.description === undefined ? "white" : "#a4dbfc", + fieldDifferences.changes.description === undefined + ? "white" + : "#a4dbfc", }, }, inputLabel: { @@ -407,7 +451,8 @@ export function TaskCard(props: { { setDiffOldValue( - fieldDifferences.changes.description?.oldValue as SetStateAction, + fieldDifferences.changes.description + ?.oldValue as SetStateAction, ); setDiffOldValuePopoverAnchor(event.currentTarget); }} @@ -430,12 +475,15 @@ export function TaskCard(props: { value={props.sharedTreeTask.priority} label="Priority" onChange={(e) => { - props.sharedTreeTask.priority = e.target.value as TaskPriority; + props.sharedTreeTask.priority = e.target + .value as TaskPriority; }} inputProps={{ sx: { backgroundColor: - fieldDifferences.changes.priority === undefined ? "white" : "#a4dbfc", + fieldDifferences.changes.priority === undefined + ? "white" + : "#a4dbfc", }, }} size="small" @@ -450,7 +498,11 @@ export function TaskCard(props: { > Medium - + High @@ -460,12 +512,17 @@ export function TaskCard(props: { { setDiffOldValue( - fieldDifferences.changes.priority?.oldValue as SetStateAction, + fieldDifferences.changes.priority + ?.oldValue as SetStateAction, ); setDiffOldValuePopoverAnchor(event.currentTarget); }} > - + )} @@ -485,7 +542,9 @@ export function TaskCard(props: { inputProps={{ sx: { backgroundColor: - fieldDifferences.changes.status === undefined ? "white" : "#a4dbfc", + fieldDifferences.changes.status === undefined + ? "white" + : "#a4dbfc", }, }} > @@ -499,7 +558,11 @@ export function TaskCard(props: { > In Progress - + Done @@ -518,12 +581,16 @@ export function TaskCard(props: { id="select-assignee-id" value={props.sharedTreeTask.assignee} label="Assignee" - onChange={(e) => (props.sharedTreeTask.assignee = e.target.value)} + onChange={(e) => + (props.sharedTreeTask.assignee = e.target.value) + } size="small" inputProps={{ sx: { backgroundColor: - fieldDifferences.changes.assignee === undefined ? "white" : "#a4dbfc", + fieldDifferences.changes.assignee === undefined + ? "white" + : "#a4dbfc", }, }} > @@ -541,12 +608,17 @@ export function TaskCard(props: { { setDiffOldValue( - fieldDifferences.changes.assignee?.oldValue as SetStateAction, + fieldDifferences.changes.assignee + ?.oldValue as SetStateAction, ); setDiffOldValuePopoverAnchor(event.currentTarget); }} > - + )} diff --git a/examples/apps/ai-collab/src/components/TaskGroup.tsx b/examples/apps/ai-collab/src/components/TaskGroup.tsx index 0571ba219f76..991cb167207c 100644 --- a/examples/apps/ai-collab/src/components/TaskGroup.tsx +++ b/examples/apps/ai-collab/src/components/TaskGroup.tsx @@ -68,7 +68,9 @@ export function TaskGroup(props: { const [isDescriptionEditing, setIsDescriptionEditing] = useState(false); const [isDiffModalOpen, setIsDiffModalOpen] = useState(false); - const [popoverAnchor, setPopoverAnchor] = useState(undefined); + const [popoverAnchor, setPopoverAnchor] = useState< + HTMLButtonElement | undefined + >(undefined); const [isAiTaskRunning, setIsAiTaskRunning] = useState(false); const [llmBranchData, setLlmBranchData] = useState<{ readonly diffs: readonly Diff[]; @@ -80,7 +82,10 @@ export function TaskGroup(props: { const [undoStack, setUndoStack] = useState([]); const [redoStack, setRedoStack] = useState([]); - useSharedTreeRerender({ sharedTreeNode: props.sharedTreeTaskGroup, logId: "TaskGroup" }); + useSharedTreeRerender({ + sharedTreeNode: props.sharedTreeTaskGroup, + logId: "TaskGroup", + }); /** * Create undo and redo stacks of {@link Revertible}. @@ -152,12 +157,18 @@ export function TaskGroup(props: { const revertible = getRevertible(onRevertibleDisposed); if (commit.kind === CommitKind.Undo) { setRedoStack((prevRedoStack) => { - const newRedoStack = trimStackToMaxSize([...prevRedoStack, revertible]); + const newRedoStack = trimStackToMaxSize([ + ...prevRedoStack, + revertible, + ]); return newRedoStack; }); } else { setUndoStack((prevUndoStack) => { - const newUndoStack = trimStackToMaxSize([...prevUndoStack, revertible]); + const newUndoStack = trimStackToMaxSize([ + ...prevUndoStack, + revertible, + ]); return newUndoStack; }); } @@ -216,54 +227,62 @@ export function TaskGroup(props: { try { // 1. Get the current branch, the new branch and associated task group to be used for ai collaboration const { currentBranch, newBranchTree, newBranchTaskGroup } = - getNewSharedTreeBranchAndTaskGroup(props.treeView.root, props.sharedTreeTaskGroup); - console.log("ai-collab Branch Task Group BEFORE:", { ...newBranchTaskGroup }); + getNewSharedTreeBranchAndTaskGroup( + props.treeView.root, + props.sharedTreeTaskGroup, + ); + console.log("ai-collab Branch Task Group BEFORE:", { + ...newBranchTaskGroup, + }); // 2. execute the ai collaboration - const response: AiCollabSuccessResponse | AiCollabErrorResponse = await aiCollab({ - openAI: { - client: getOpenAiClient(), - modelName: "gpt-4o", - }, - treeNode: newBranchTaskGroup, - prompt: { - systemRoleContext: - "You are a manager that is helping out with a project management tool. You have been asked to edit a group of tasks.", - userAsk: userRequest, - }, - limiters: { - maxModelCalls: 30, - }, - planningStep: true, - finalReviewStep: false, - validator: aiCollabLlmTreeNodeValidator, - debugEventLogHandler: (event) => { - console.log(`Received event: ${event.eventName}`); - if ( - event.eventName === "APPLIED_EDIT_SUCCESS" || - event.eventName === "APPLIED_EDIT_FAILURE" - ) { - console.log( - `${ - event.eventName === "APPLIED_EDIT_SUCCESS" - ? "Succesfully applied" - : "Failed to appply" - } tree edit: ${JSON.stringify( - (event as unknown as ApplyEditSuccess).edit, - undefined, - 2, - )}`, - ); - } - }, - }); + const response: AiCollabSuccessResponse | AiCollabErrorResponse = + await aiCollab({ + openAI: { + client: getOpenAiClient(), + modelName: "gpt-4o", + }, + treeNode: newBranchTaskGroup, + prompt: { + systemRoleContext: + "You are a manager that is helping out with a project management tool. You have been asked to edit a group of tasks.", + userAsk: userRequest, + }, + limiters: { + maxModelCalls: 30, + }, + planningStep: true, + finalReviewStep: false, + validator: aiCollabLlmTreeNodeValidator, + debugEventLogHandler: (event) => { + console.log(`Received event: ${event.eventName}`); + if ( + event.eventName === "APPLIED_EDIT_SUCCESS" || + event.eventName === "APPLIED_EDIT_FAILURE" + ) { + console.log( + `${ + event.eventName === "APPLIED_EDIT_SUCCESS" + ? "Succesfully applied" + : "Failed to appply" + } tree edit: ${JSON.stringify( + (event as unknown as ApplyEditSuccess).edit, + undefined, + 2, + )}`, + ); + } + }, + }); // 3. Handle the response from the ai collaboration if (response.status !== "success") { throw new Error(response.errorMessage); } - console.log("ai-collab Branch Task Group AFTER:", { ...newBranchTaskGroup }); + console.log("ai-collab Branch Task Group AFTER:", { + ...newBranchTaskGroup, + }); setLlmBranchData({ diffs: response.diffs, @@ -272,10 +291,13 @@ export function TaskGroup(props: { newBranchTargetNode: newBranchTaskGroup, }); setIsDiffModalOpen(true); - enqueueSnackbar(`Copilot: I've completed your request - "${userRequest}"`, { - variant: "success", - autoHideDuration: 5000, - }); + enqueueSnackbar( + `Copilot: I've completed your request - "${userRequest}"`, + { + variant: "success", + autoHideDuration: 5000, + }, + ); } catch (error) { enqueueSnackbar( `Copilot: Something went wrong processing your request - ${error instanceof Error ? error.message : "unknown error"}`, @@ -427,7 +449,12 @@ export function TaskGroup(props: { > { e.preventDefault(); @@ -475,7 +502,9 @@ export function TaskGroup(props: { id="input-description-label-id" label="Description" value={props.sharedTreeTaskGroup.description} - onChange={(e) => (props.sharedTreeTaskGroup.description = e.target.value)} + onChange={(e) => + (props.sharedTreeTaskGroup.description = e.target.value) + } fullWidth slotProps={{ input: { @@ -503,18 +532,28 @@ export function TaskGroup(props: { {/* Render Task Card list */} - + {props.sharedTreeTaskGroup.tasks.map((task) => { const modifyDiffs = - props.diffs?.filter((diff): diff is ModifyDiff => diff.type === "modify") ?? []; + props.diffs?.filter( + (diff): diff is ModifyDiff => diff.type === "modify", + ) ?? []; const matchingModifyDiffs = modifyDiffs.filter( (diff: ModifyDiff) => // Modify diffs are a field level edit, so the first path will be the field and the second will be the node. - diff.nodePath.length > 1 && diff.nodePath[1]?.shortId === Tree.shortId(task), + diff.nodePath.length > 1 && + diff.nodePath[1]?.shortId === Tree.shortId(task), ); const insertDiffs = - props.diffs?.filter((diff): diff is InsertDiff => diff.type === "insert") ?? []; + props.diffs?.filter( + (diff): diff is InsertDiff => diff.type === "insert", + ) ?? []; const matchingInsertDiffs = insertDiffs.filter( (diff: InsertDiff) => // Insert diffs are a node level edit, so the first path will be the node. @@ -522,7 +561,9 @@ export function TaskGroup(props: { ); const removeDiffs = - props.diffs?.filter((diff): diff is RemoveDiff => diff.type === "remove") ?? []; + props.diffs?.filter( + (diff): diff is RemoveDiff => diff.type === "remove", + ) ?? []; // TODO - Since the Target node has been deleted, this will never match to a remove diff. // One possible correct way to handle this case, is to take deleted node ui diffs, take the `RemoveDiff.nodeContent / RemoveDiff.nodeContents` and use that // to render a special 'removed' task card that cannot be interacted with and is not a part of the tree. @@ -541,7 +582,9 @@ export function TaskGroup(props: { }); const moveDiffs = - props.diffs?.filter((diff): diff is MoveDiff => diff.type === "move") ?? []; + props.diffs?.filter( + (diff): diff is MoveDiff => diff.type === "move", + ) ?? []; const matchingMoveDiffs = moveDiffs.filter((diff: MoveDiff) => { if (diff.moveType === "move-single") { return diff.sourceNodePath[0]?.shortId === Tree.shortId(task); @@ -582,13 +625,18 @@ export function TaskGroup(props: { Engineers - + {props.sharedTreeTaskGroup.engineers.map((engineer) => { const engineerCapacity = props.sharedTreeTaskGroup.tasks .filter((task) => task.assignee === engineer.name) .reduce((acc, task) => acc + task.complexity, 0); - const capacityColor = engineerCapacity > engineer.maxCapacity ? "red" : "green"; + const capacityColor = + engineerCapacity > engineer.maxCapacity ? "red" : "green"; return ( @@ -638,7 +686,15 @@ function TaskGroupDiffModal(props: { readonly diffs: readonly Diff[]; newBranchTargetNode: SharedTreeTaskGroup; }): JSX.Element { - const { isOpen, onClose, onAccept, onDecline, treeView, newBranchTargetNode, diffs } = props; + const { + isOpen, + onClose, + onAccept, + onDecline, + treeView, + newBranchTargetNode, + diffs, + } = props; return (

= ({ presenceManager }): JSX.Element => { +const UserPresenceGroup: React.FC = ({ + presenceManager, +}): JSX.Element => { const [invalidations, setInvalidations] = useState(0); useEffect(() => { @@ -92,7 +94,11 @@ const UserPresenceGroup: React.FC = ({ presenceManager }): JS anchorOrigin={{ vertical: "bottom", horizontal: "right" }} variant="dot" > - + ))} {userInfoList.length > 4 && ( diff --git a/examples/apps/ai-collab/src/infra/authHelper.ts b/examples/apps/ai-collab/src/infra/authHelper.ts index 7d4be3a4384d..e1c5ff6b6a4c 100644 --- a/examples/apps/ai-collab/src/infra/authHelper.ts +++ b/examples/apps/ai-collab/src/infra/authHelper.ts @@ -172,7 +172,10 @@ async function signedInStart( try { return await graphHelper.getFileStorageContainerId(); } catch (error) { - console.error("Error while fetching file storage container ID:", error as string); + console.error( + "Error while fetching file storage container ID:", + error as string, + ); return ""; } }; diff --git a/examples/apps/ai-collab/src/infra/graphHelper.ts b/examples/apps/ai-collab/src/infra/graphHelper.ts index fd8dddf01876..eb795ff1b8bb 100644 --- a/examples/apps/ai-collab/src/infra/graphHelper.ts +++ b/examples/apps/ai-collab/src/infra/graphHelper.ts @@ -38,7 +38,10 @@ export class GraphHelper { private readonly intializedPublicClientApplication: PublicClientApplication; private readonly accountInfo: AccountInfo; private readonly graphClient: Client; - constructor(publicClientApplication: PublicClientApplication, accountInfo: AccountInfo) { + constructor( + publicClientApplication: PublicClientApplication, + accountInfo: AccountInfo, + ) { this.intializedPublicClientApplication = publicClientApplication; this.accountInfo = accountInfo; @@ -128,7 +131,9 @@ export class GraphHelper { } // Function to get the shared item using the sharing link - public async getSharedItem(shareId: string): Promise<{ itemId: string; driveId: string }> { + public async getSharedItem( + shareId: string, + ): Promise<{ itemId: string; driveId: string }> { const response = (await this.graphClient .api(`/shares/${shareId}/driveItem`) .header("Prefer", "redeemSharingLink") diff --git a/examples/apps/ai-collab/src/infra/tokenProvider.ts b/examples/apps/ai-collab/src/infra/tokenProvider.ts index 33a053b11784..65e7c1a0029b 100644 --- a/examples/apps/ai-collab/src/infra/tokenProvider.ts +++ b/examples/apps/ai-collab/src/infra/tokenProvider.ts @@ -10,7 +10,10 @@ import { InteractionRequiredAuthError, type PublicClientApplication, } from "@azure/msal-browser"; -import type { IOdspTokenProvider, TokenResponse } from "@fluidframework/odsp-client/beta"; +import type { + IOdspTokenProvider, + TokenResponse, +} from "@fluidframework/odsp-client/beta"; // Sample implementation of the IOdspTokenProvider interface. // Provides the token that the Fluid service expects when asked for the Fluid container and for the WebSocket connection. @@ -22,7 +25,9 @@ export class SampleOdspTokenProvider implements IOdspTokenProvider { // Fetch the token for the orderer service public async fetchWebsocketToken(): Promise { - const pushScope = ["offline_access https://pushchannel.1drv.ms/PushChannel.ReadWrite.All"]; + const pushScope = [ + "offline_access https://pushchannel.1drv.ms/PushChannel.ReadWrite.All", + ]; const token = await this.fetchTokens(pushScope); return { fromCache: true, @@ -45,14 +50,16 @@ export class SampleOdspTokenProvider implements IOdspTokenProvider { private async fetchTokens(scope: string[]): Promise { let response: AuthenticationResult; try { - response = await this.intializedPublicClientApplication.acquireTokenSilent({ - scopes: scope, - }); - } catch (error) { - if (error instanceof InteractionRequiredAuthError) { - response = await this.intializedPublicClientApplication.acquireTokenPopup({ + response = + await this.intializedPublicClientApplication.acquireTokenSilent({ scopes: scope, }); + } catch (error) { + if (error instanceof InteractionRequiredAuthError) { + response = + await this.intializedPublicClientApplication.acquireTokenPopup({ + scopes: scope, + }); } else { throw error; } diff --git a/examples/apps/ai-collab/src/types/sharedTreeAppSchema.ts b/examples/apps/ai-collab/src/types/sharedTreeAppSchema.ts index 6e3465b7fce1..8cac2652009e 100644 --- a/examples/apps/ai-collab/src/types/sharedTreeAppSchema.ts +++ b/examples/apps/ai-collab/src/types/sharedTreeAppSchema.ts @@ -3,7 +3,11 @@ * Licensed under the MIT License. */ -import { Tree, type TreeNode, TreeViewConfiguration } from "@fluidframework/tree"; +import { + Tree, + type TreeNode, + TreeViewConfiguration, +} from "@fluidframework/tree"; import { SchemaFactoryAlpha } from "@fluidframework/tree/alpha"; import { SharedTree } from "fluid-framework"; @@ -83,7 +87,10 @@ export class SharedTreeEngineer extends sf.objectAlpha( }, ) {} -export class SharedTreeEngineerList extends sf.array("EngineerList", SharedTreeEngineer) {} +export class SharedTreeEngineerList extends sf.array( + "EngineerList", + SharedTreeEngineer, +) {} export class SharedTreeTaskGroup extends sf.objectAlpha( "TaskGroup", @@ -112,12 +119,16 @@ export class SharedTreeTaskGroup extends sf.objectAlpha( }, { metadata: { - description: "A collection of tasks and engineers to whom tasks may be assigned.", + description: + "A collection of tasks and engineers to whom tasks may be assigned.", }, }, ) {} -export class SharedTreeTaskGroupList extends sf.array("TaskGroupList", SharedTreeTaskGroup) {} +export class SharedTreeTaskGroupList extends sf.array( + "TaskGroupList", + SharedTreeTaskGroup, +) {} export class SharedTreeAppState extends sf.object("AppState", { taskGroups: sf.required(SharedTreeTaskGroupList, { @@ -191,7 +202,8 @@ export const INITIAL_APP_STATE = { { name: "Charlie", maxCapacity: 7, - skills: "Junior engineer capable of handling simple tasks. Versed in Node.JS", + skills: + "Junior engineer capable of handling simple tasks. Versed in Node.JS", }, ], }, @@ -213,7 +225,9 @@ export const TREE_CONFIGURATION = new TreeViewConfiguration({ * for the 'status' and 'priority' fields of a given Task as this is a common mistake LLM's make despite describing the fields as enums in their metadata. */ function validateLlmTask(task: SharedTreeTask): void { - if (Object.values(TaskStatuses).includes(task.status as TaskStatus) === false) { + if ( + Object.values(TaskStatuses).includes(task.status as TaskStatus) === false + ) { const errorMessage = `The Task status value "${task.status}" is not valid. The accepted values are '${Object.values(TaskStatuses).join(", ")}".`; console.log( `The LLM Produced an invalid Task. Sending the LLM the following error and feedback:`, @@ -222,7 +236,10 @@ function validateLlmTask(task: SharedTreeTask): void { throw new Error(errorMessage); } - if (Object.values(TaskPriorities).includes(task.priority as TaskPriority) === false) { + if ( + Object.values(TaskPriorities).includes(task.priority as TaskPriority) === + false + ) { const errorMessage = `The Task priority value "${task.priority}" is not valid. The accepted values are "${Object.values(TaskPriorities).join(", ")}".`; console.log( `The LLM Produced an invalid Task. Sending the LLM the following error and feedback:`, diff --git a/examples/apps/ai-collab/src/useFluidContainerNextjs.ts b/examples/apps/ai-collab/src/useFluidContainerNextjs.ts index ff0c0ce16464..20d7de299aaf 100644 --- a/examples/apps/ai-collab/src/useFluidContainerNextjs.ts +++ b/examples/apps/ai-collab/src/useFluidContainerNextjs.ts @@ -57,13 +57,18 @@ export function useFluidContainerNextJs( }; // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Inside a React effect we can't await promises - init().then((initResult: { container: IFluidContainer; containerId: string }) => { - const dataInner: V = getDataFromContainer(initResult.container); - setIsFluidInitialized(true); - setContainerId(initResult.containerId); - setContainer(initResult.container); - setData(dataInner); - }); + init().then( + (initResult: { + container: IFluidContainer; + containerId: string; + }) => { + const dataInner: V = getDataFromContainer(initResult.container); + setIsFluidInitialized(true); + setContainerId(initResult.containerId); + setContainer(initResult.container); + setData(dataInner); + }, + ); } }, [containerId]); diff --git a/examples/apps/ai-collab/src/useSharedTreeRerender.ts b/examples/apps/ai-collab/src/useSharedTreeRerender.ts index 7fd0471c1302..f71c3468b2df 100644 --- a/examples/apps/ai-collab/src/useSharedTreeRerender.ts +++ b/examples/apps/ai-collab/src/useSharedTreeRerender.ts @@ -32,7 +32,10 @@ export function useSharedTreeRerender(props: { setForceReRender((prevReRender) => prevReRender + 1); }); - treeNodeListenerStopFunctions.push(listenerStopFunction, listenerStopFunction2); + treeNodeListenerStopFunctions.push( + listenerStopFunction, + listenerStopFunction2, + ); // Clean up tree node listeners. return () => { diff --git a/examples/apps/ai-collab/tsconfig.json b/examples/apps/ai-collab/tsconfig.json index 53f2f1df76de..5577db237915 100644 --- a/examples/apps/ai-collab/tsconfig.json +++ b/examples/apps/ai-collab/tsconfig.json @@ -14,14 +14,14 @@ "incremental": true, "plugins": [ { - "name": "next", - }, + "name": "next" + } ], "paths": { - "@/*": ["./src/*"], + "@/*": ["./src/*"] }, - "allowJs": true, + "allowJs": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules", ".next"], + "exclude": ["node_modules", ".next"] } diff --git a/examples/apps/blobs/biome.jsonc b/examples/apps/blobs/biome.jsonc index 4b65e1c0aea2..bff6a48b6caf 100644 --- a/examples/apps/blobs/biome.jsonc +++ b/examples/apps/blobs/biome.jsonc @@ -1,4 +1,4 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"] + "root": false, + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json" } diff --git a/examples/apps/blobs/src/app.ts b/examples/apps/blobs/src/app.ts index ab7d12363ff9..e23cfff33bb4 100644 --- a/examples/apps/blobs/src/app.ts +++ b/examples/apps/blobs/src/app.ts @@ -36,7 +36,9 @@ const { } = await createExampleDriver(service); const codeLoader: ICodeDetailsLoader = { - load: async (details: IFluidCodeDetails): Promise => { + load: async ( + details: IFluidCodeDetails, + ): Promise => { return { module: { fluidExport: new BlobCollectionContainerRuntimeFactory() }, details, diff --git a/examples/apps/blobs/src/container/blobCollection/blobCollection.ts b/examples/apps/blobs/src/container/blobCollection/blobCollection.ts index 18be81fca547..5560270a45b6 100644 --- a/examples/apps/blobs/src/container/blobCollection/blobCollection.ts +++ b/examples/apps/blobs/src/container/blobCollection/blobCollection.ts @@ -4,13 +4,20 @@ */ import { TypedEventEmitter } from "@fluid-internal/client-utils"; -import type { IEventProvider, IFluidHandle } from "@fluidframework/core-interfaces"; +import type { + IEventProvider, + IFluidHandle, +} from "@fluidframework/core-interfaces"; import { FluidDataStoreRuntime } from "@fluidframework/datastore/legacy"; import type { IChannelFactory, IFluidDataStoreRuntime, } from "@fluidframework/datastore-definitions/legacy"; -import { MapFactory, type ISharedMap, type IValueChanged } from "@fluidframework/map/legacy"; +import { + MapFactory, + type ISharedMap, + type IValueChanged, +} from "@fluidframework/map/legacy"; import type { IFluidDataStoreChannel, IFluidDataStoreContext, @@ -18,9 +25,15 @@ import type { } from "@fluidframework/runtime-definitions/legacy"; import { v4 as uuid } from "uuid"; -import type { IBlobCollection, IBlobCollectionEvents, IBlobRecord } from "./interface.js"; +import type { + IBlobCollection, + IBlobCollectionEvents, + IBlobRecord, +} from "./interface.js"; -type UploadArrayBufferFn = (blob: ArrayBufferLike) => Promise>; +type UploadArrayBufferFn = ( + blob: ArrayBufferLike, +) => Promise>; /** * The BlobCollection is our data object that implements the IBlobCollection interface. @@ -49,7 +62,9 @@ class BlobCollection implements IBlobCollection { }; this.blobs.push(newBlob); // Sort in case timestamps disagree with map insertion order - this.blobs.sort((a, b) => a.id.localeCompare(b.id, "en", { sensitivity: "base" })); + this.blobs.sort((a, b) => + a.id.localeCompare(b.id, "en", { sensitivity: "base" }), + ); this._events.emit("blobAdded", newBlob); }) .catch(console.error); @@ -91,7 +106,9 @@ class BlobCollection implements IBlobCollection { const mapId = "blob-map"; const mapFactory = new MapFactory(); -const sharedObjectRegistry = new Map([[mapFactory.type, mapFactory]]); +const sharedObjectRegistry = new Map([ + [mapFactory.type, mapFactory], +]); export class BlobCollectionFactory implements IFluidDataStoreFactory { public get type(): string { diff --git a/examples/apps/blobs/src/container/runtimeFactory.ts b/examples/apps/blobs/src/container/runtimeFactory.ts index 4ed9b35a37d8..f318d535cda9 100644 --- a/examples/apps/blobs/src/container/runtimeFactory.ts +++ b/examples/apps/blobs/src/container/runtimeFactory.ts @@ -48,7 +48,9 @@ export class BlobCollectionContainerRuntimeFactory implements IRuntimeFactory { }); if (!existing) { - const blobCollection = await runtime.createDataStore(blobCollectionRegistryKey); + const blobCollection = await runtime.createDataStore( + blobCollectionRegistryKey, + ); await blobCollection.trySetAlias(blobCollectionId); } diff --git a/examples/apps/blobs/src/view.tsx b/examples/apps/blobs/src/view.tsx index 9534853c8369..fc96c1bbdb66 100644 --- a/examples/apps/blobs/src/view.tsx +++ b/examples/apps/blobs/src/view.tsx @@ -21,7 +21,13 @@ const drawAPrettyPictureIntoBlob = async (): Promise => { for (let stroke = 0; stroke < 5; stroke++) { ctx.strokeStyle = `rgb(${randInt(255)}, ${randInt(255)}, ${randInt(255)})`; ctx.beginPath(); - ctx.arc(randInt(180) + 10, randInt(180) + 10, randInt(90) + 10, 0, 2 * Math.PI); + ctx.arc( + randInt(180) + 10, + randInt(180) + 10, + randInt(90) + 10, + 0, + 2 * Math.PI, + ); ctx.stroke(); } // Annoyingly, canvas.toBlob is a callback-based API rather than returning a Promise. @@ -45,7 +51,10 @@ interface IBlobUrlRecord { const idSort = (a: { id: string }, b: { id: string }): number => a.id.localeCompare(b.id, "en", { sensitivity: "base" }); -const blobRecordToBlobUrlRecord = ({ id, blob }: IBlobRecord): IBlobUrlRecord => { +const blobRecordToBlobUrlRecord = ({ + id, + blob, +}: IBlobRecord): IBlobUrlRecord => { return { id, url: URL.createObjectURL(blob), @@ -81,11 +90,17 @@ export const BlobCollectionView: FC = ({ }, [blobCollection]); const blobViews = blobUrlRecords.map(({ id, url }) => ( - + )); const addBlob = (): void => { - drawAPrettyPictureIntoBlob().then(blobCollection.addBlob).catch(console.error); + drawAPrettyPictureIntoBlob() + .then(blobCollection.addBlob) + .catch(console.error); }; return ( diff --git a/examples/apps/blobs/tests/app.ts b/examples/apps/blobs/tests/app.ts index fb4714f0e562..26239c9fd976 100644 --- a/examples/apps/blobs/tests/app.ts +++ b/examples/apps/blobs/tests/app.ts @@ -33,9 +33,13 @@ import { import { BlobCollectionView, DebugView } from "../src/view.js"; const urlResolver = new LocalResolver(); -const localServer = LocalDeltaConnectionServer.create(new LocalSessionStorageDbFactory()); +const localServer = LocalDeltaConnectionServer.create( + new LocalSessionStorageDbFactory(), +); const codeLoader: ICodeDetailsLoader = { - load: async (details: IFluidCodeDetails): Promise => { + load: async ( + details: IFluidCodeDetails, + ): Promise => { return { module: { fluidExport: new BlobCollectionContainerRuntimeFactory() }, details, @@ -47,7 +51,9 @@ const codeLoader: ICodeDetailsLoader = { * This is a helper function for loading the page. It's required because getting the Fluid Container * requires making async calls. */ -async function createContainerAndRenderInElement(element: HTMLDivElement): Promise { +async function createContainerAndRenderInElement( + element: HTMLDivElement, +): Promise { let container: IContainer; let attach: (() => void) | undefined; diff --git a/examples/apps/blobs/tsconfig.json b/examples/apps/blobs/tsconfig.json index 80d8d0733737..8e762bea8b1b 100644 --- a/examples/apps/blobs/tsconfig.json +++ b/examples/apps/blobs/tsconfig.json @@ -2,8 +2,13 @@ "extends": "../../../common/build/build-common/tsconfig.node16.json", "compilerOptions": { "outDir": "./lib", - "types": ["jest", "puppeteer", "jest-environment-puppeteer", "expect-puppeteer"], - "exactOptionalPropertyTypes": false, + "types": [ + "jest", + "puppeteer", + "jest-environment-puppeteer", + "expect-puppeteer" + ], + "exactOptionalPropertyTypes": false }, - "include": ["src/**/*", "tests/**/*"], + "include": ["src/**/*", "tests/**/*"] } diff --git a/examples/apps/collaborative-textarea/biome.jsonc b/examples/apps/collaborative-textarea/biome.jsonc index 4b65e1c0aea2..bff6a48b6caf 100644 --- a/examples/apps/collaborative-textarea/biome.jsonc +++ b/examples/apps/collaborative-textarea/biome.jsonc @@ -1,4 +1,4 @@ { - "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", - "extends": ["../../../biome.jsonc"] + "root": false, + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json" } diff --git a/examples/apps/collaborative-textarea/src/app.ts b/examples/apps/collaborative-textarea/src/app.ts index bbb5930918b8..33c51e58c76a 100644 --- a/examples/apps/collaborative-textarea/src/app.ts +++ b/examples/apps/collaborative-textarea/src/app.ts @@ -3,7 +3,10 @@ * Licensed under the MIT License. */ -import { StaticCodeLoader, TinyliciousModelLoader } from "@fluid-example/example-utils"; +import { + StaticCodeLoader, + TinyliciousModelLoader, +} from "@fluid-example/example-utils"; import React from "react"; import ReactDOM from "react-dom"; @@ -18,9 +21,10 @@ import { CollaborativeTextView } from "./view.js"; * requires making async calls. */ async function start(): Promise { - const tinyliciousModelLoader = new TinyliciousModelLoader( - new StaticCodeLoader(new CollaborativeTextContainerRuntimeFactory()), - ); + const tinyliciousModelLoader = + new TinyliciousModelLoader( + new StaticCodeLoader(new CollaborativeTextContainerRuntimeFactory()), + ); let id: string; let model: ICollaborativeTextAppModel; @@ -46,7 +50,9 @@ async function start(): Promise { const contentDiv = document.querySelector("#content"); if (contentDiv !== null) { ReactDOM.render( - React.createElement(CollaborativeTextView, { text: model.collaborativeText.text }), + React.createElement(CollaborativeTextView, { + text: model.collaborativeText.text, + }), contentDiv, ); } diff --git a/examples/apps/collaborative-textarea/src/container.ts b/examples/apps/collaborative-textarea/src/container.ts index 45470147c8a6..afd83f5db191 100644 --- a/examples/apps/collaborative-textarea/src/container.ts +++ b/examples/apps/collaborative-textarea/src/container.ts @@ -32,7 +32,9 @@ export class CollaborativeTextContainerRuntimeFactory extends ModelContainerRunt /** * {@inheritDoc ModelContainerRuntimeFactory.containerInitializingFirstTime} */ - protected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise { + protected async containerInitializingFirstTime( + runtime: IContainerRuntime, + ): Promise { const collaborativeText = await runtime.createDataStore( CollaborativeText.getFactory().type, ); @@ -47,7 +49,10 @@ export class CollaborativeTextContainerRuntimeFactory extends ModelContainerRunt container: IContainer, ): Promise { return new CollaborativeTextAppModel( - await getDataStoreEntryPoint(runtime, collaborativeTextId), + await getDataStoreEntryPoint( + runtime, + collaborativeTextId, + ), ); } } diff --git a/examples/apps/collaborative-textarea/src/fluid-object/index.ts b/examples/apps/collaborative-textarea/src/fluid-object/index.ts index 5e646f6aed66..13a1524234fc 100644 --- a/examples/apps/collaborative-textarea/src/fluid-object/index.ts +++ b/examples/apps/collaborative-textarea/src/fluid-object/index.ts @@ -5,7 +5,10 @@ import { DataObject, DataObjectFactory } from "@fluidframework/aqueduct/legacy"; import type { IFluidHandle } from "@fluidframework/core-interfaces"; -import { SharedString, type ISharedString } from "@fluidframework/sequence/legacy"; +import { + SharedString, + type ISharedString, +} from "@fluidframework/sequence/legacy"; /** * CollaborativeText uses the React CollaborativeTextArea to load a collaborative HTML