-
Notifications
You must be signed in to change notification settings - Fork 562
feat(build-tools): migrate to ESLint 9 flat config with shared eslint-config-fluid #26150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tylerbutler
wants to merge
20
commits into
microsoft:main
Choose a base branch
from
tylerbutler:bt-eslint9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+814
−2,497
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 <tylerbu@microsoft.com>
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.
Contributor
There was a problem hiding this 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 |
5abc8df to
00b6150
Compare
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)
tylerbutler
commented
Jan 8, 2026
tylerbutler
commented
Jan 8, 2026
tylerbutler
commented
Jan 8, 2026
build-tools/packages/build-cli/src/commands/publish/tarballs.ts
Outdated
Show resolved
Hide resolved
…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
commented
Jan 8, 2026
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Migrate build-tools to ESLint 9 flat config format, using the shared
@fluidframework/eslint-config-fluidpackage for consistent linting rules across the Fluid Framework monorepo.Key Changes
ESLint 9 Migration:
.eslintrc.cjstoeslint.config.mtsflat config formatShared Configuration:
@fluidframework/eslint-config-fluidto the build-tools workspaceminimalDeprecatedconfig from the sharedflat.mtsmoduleeslint.config.base.mtsthat extends shared config with build-tools-specific overridesBuild-tools Overrides:
Infrastructure: