Skip to content

Conversation

@tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Jan 7, 2026

Summary

Migrate build-tools to ESLint 9 flat config format, using the shared @fluidframework/eslint-config-fluid package for consistent linting rules across the Fluid Framework monorepo.

Key Changes

ESLint 9 Migration:

  • Upgrade ESLint from 8.57.0 to 9.39.2
  • Upgrade typescript-eslint from v6 to v8.52.0
  • Convert all packages from .eslintrc.cjs to eslint.config.mts flat config format
  • Remove eslint-config-oclif dependencies (replaced by shared config)

Shared Configuration:

  • Add @fluidframework/eslint-config-fluid to the build-tools workspace
  • Import minimalDeprecated config from the shared flat.mts module
  • Create eslint.config.base.mts that extends shared config with build-tools-specific overrides
  • Simplify per-package configs to just spread the base config with local overrides

Build-tools Overrides:

  • Disable import rules that don't apply to internal tooling (no-internal-modules, no-nodejs-modules)
  • Disable stricter TypeScript rules that require code changes (strict-boolean-expressions, prefer-nullish-coalescing)
  • Disable stylistic rules handled by Biome (import/order)
  • Allow default exports for oclif commands

Infrastructure:

  • Consolidate ESLint dependencies to workspace root
  • Add pnpm override to force ESLint 9.x across the workspace
  • Update syncpack config to ignore eslint-config-fluid's version policies
  • Clean up obsolete eslint-disable directives

- Upgrade ESLint from 8.57.0 to 9.18.0
- Upgrade typescript-eslint from v6 to v8.20.0
- Add @eslint/js and eslint-config-prettier v10
- Remove @fluidframework/eslint-config-fluid dependency
- Remove eslint-config-oclif and eslint-config-oclif-typescript

Create shared base configuration (eslint.config.base.mjs) at workspace
root with reusable building blocks for all packages.

Migrate all 5 packages from .eslintrc.cjs to eslint.config.mjs:
- build-tools
- build-infrastructure
- build-cli
- version-tools
- bundle-size-tools

Clean up obsolete eslint-disable directives for rules that no longer
exist (import-x/*, tsdoc/syntax, n/no-process-exit, @rushstack/*).
Move all ESLint-related dependencies to the workspace root package.json
and enhance the shared base config with plugin configurations:

- Remove duplicate eslint, typescript-eslint, @eslint/js, and
  eslint-config-prettier from all package devDependencies
- Add eslint-plugin-jsdoc, eslint-plugin-unicorn, and
  eslint-plugin-chai-friendly to root
- Add pnpm override to force ESLint 9.x (jssm-viz-cli brings in 8.x)
- Enhance eslint.config.base.mjs with jsdocConfig, unicornConfig,
  and chaiFriendlyConfig exports
- Update createConfig() with optional jsdoc and unicorn flags
- Simplify build-cli config from 107 to 30 lines using createConfig()
- Update build-infrastructure to use shared chaiFriendlyConfig

Net reduction of 262 lines across configs and lockfile.
Signed-off-by: Tyler Butler <[email protected]>
Rename ESLint flat config files from JavaScript (.mjs) to TypeScript
(.mts) for consistency with PR microsoft#26070. Add jiti dependency to enable
runtime transpilation of TypeScript config files.

Also includes the ESLint 9 flat config detection fix from PR microsoft#26147.
Copilot AI review requested due to automatic review settings January 7, 2026 22:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request migrates the build-tools repository from ESLint 8 to ESLint 9 with the new flat config format. The changes include:

  • Upgrading ESLint from 8.57.0 to 9.39.2 and typescript-eslint from v6 to v8.52.0
  • Adding new ESLint-related dependencies (@eslint/js, eslint-config-prettier v10, eslint-plugin-jsdoc, eslint-plugin-unicorn, eslint-plugin-chai-friendly)
  • Removing deprecated packages (@fluidframework/eslint-config-fluid, eslint-config-oclif, eslint-config-oclif-typescript)
  • Creating a shared base configuration (eslint.config.base.mts) and migrating all packages to eslint.config.mts
  • Consolidating ESLint dependencies to the workspace root
  • Cleaning up obsolete eslint-disable directives

Reviewed changes

Copilot reviewed 151 out of 152 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
build-tools/pnpm-lock.yaml Updated dependencies: ESLint 9.39.2, typescript-eslint 8.52.0, added new plugins, removed deprecated configs
build-tools/packages/*/package.json Removed individual ESLint dependencies, updated build-tools-bin versions
build-tools/packages/*/.eslintrc.cjs Deleted legacy ESLint configuration files
build-tools/packages/*/eslint.config.mts Added new flat config files for each package
build-tools/packages//src/**/.ts Removed obsolete eslint-disable comments, fixed unused variable patterns
build-tools/packages/build-tools/src/fluidBuild/tasks/taskUtils.ts Updated to detect both ESLint 9 flat config and legacy eslintrc files

Remove disabled rules from jsdoc, unicorn, and import-x configs to enable
stricter linting. Only unicorn/prevent-abbreviations and unicorn/filename-case
remain disabled as they require extensive codebase changes.

Rules now enabled:
- jsdoc: require-jsdoc, require-param, require-returns, check-param-names, tag-lines
- unicorn: no-null, no-array-for-each, prefer-string-replace-all, no-array-reduce,
  prefer-at, prefer-top-level-await, switch-case-braces, no-useless-undefined,
  prefer-ternary, no-process-exit, import-style, prefer-type-error, no-array-push-push,
  no-nested-ternary, consistent-function-scoping, prefer-string-raw,
  consistent-existence-index-check, consistent-destructuring, no-await-expression-member
- import-x: no-named-as-default-member, no-default-export
Fix low-count ESLint violations across the build-tools workspace:

- Replace .replace(/x/g, ...) with .replaceAll() (unicorn/prefer-string-replace-all)
- Change import * as path to import path (unicorn/import-style)
- Remove useless undefined arguments (unicorn/no-useless-undefined)
- Fix JSDoc @param names to match actual parameters (jsdoc/check-param-names)
- Add inline disables for idiomatic usage patterns:
  - async.mapLimit, semver.parse, sortJson.overwrite (import-x/no-named-as-default-member)
  - prompts default export (import-x/no-named-as-default)
- Remove unused eslint-disable directives for import-x/no-default-export
- Change @module to @packageDocumentation for TSDoc compatibility (tsdoc/syntax)
…at config

Simplify build-tools ESLint configuration by importing from the shared
@fluidframework/eslint-config-fluid package's flat.mts module.

Changes:
- Add eslint-config-fluid to the build-tools pnpm workspace
- Rewrite eslint.config.base.mts to import minimalDeprecated from shared config
- Simplify per-package ESLint configs to spread baseConfig with overrides
- Add syncpack rules to ignore eslint-config-fluid's version policies
- Disable stricter rules from shared config that require code changes

The shared config provides consistent linting rules across the Fluid
Framework monorepo. Build-tools-specific overrides are applied for rules
that don't apply to internal tooling packages.
@tylerbutler tylerbutler changed the title build(eslint): migrate build-tools to ESLint 9 flat config feat(build-tools): migrate to ESLint 9 flat config with shared eslint-config-fluid Jan 8, 2026
tylerbutler and others added 5 commits January 7, 2026 17:02
The eslint-config-fluid package was appearing twice in workspace enumeration
because it was listed in both the root and build-tools pnpm-workspace.yaml files.

Changes:
- Remove eslint-config-fluid from build-tools/pnpm-workspace.yaml
- Use link: protocol instead of workspace:* for eslint-config-fluid dependency
- Add eslint as devDependency to build-tools packages (policy requirement)
- Add common/build/ directory to Build layer in layerInfo.json
Add ignore rules for eslint-config-fluid package and dependency in both
semverGroups and versionGroups. The package is maintained in the parent
workspace and uses link: protocol for cross-workspace reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant