Skip to content

Conversation

@zhangxin511
Copy link
Contributor

@zhangxin511 zhangxin511 commented Jan 9, 2026

How contribute to this repo.

Guidelines for Pull Requests.

The sections included below are suggestions for what you may want to include.
Feel free to remove or alter parts of this template that do not offer value for your specific change.

Description

export the mts defined in eslint config so server package can use it.

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 PR enables external packages to import the ESLint flat configuration from @fluidframework/eslint-config-fluid using the .mts file extension. It adds package exports mapping, moves the jiti dependency to production dependencies (as it's needed at runtime), and creates an ESM wrapper (flat.mjs) that uses jiti to load the TypeScript flat.mts file.

Key changes:

  • Adds package.json exports to map ./flat.mts import to ./flat.mjs
  • Moves jiti from devDependencies to dependencies for runtime TypeScript loading
  • Creates flat.mjs as an ESM wrapper that loads flat.mts using jiti

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
common/build/eslint-config-fluid/package.json Adds exports configuration to enable .mts import path and moves jiti to dependencies
common/build/eslint-config-fluid/flat.mjs New ESM loader wrapper that uses jiti to load the TypeScript flat.mts file
pnpm-lock.yaml Updates lock file to reflect jiti dependency movement
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@tylerbutler
Copy link
Member

export the mts defined in eslint config so server package can use it.

@zhangxin511 can you clarify how you expect to consume this in the server workspace? The package is private right now so no changes have been published since 8.1.0 (see the changelog). The plan is to publish again once we have completed the Eslint 9 migration in client, but until then the changes won't be available in a published package.

@zhangxin511
Copy link
Contributor Author

export the mts defined in eslint config so server package can use it.

@zhangxin511 can you clarify how you expect to consume this in the server workspace? The package is private right now so no changes have been published since 8.1.0 (see the changelog). The plan is to publish again once we have completed the Eslint 9 migration in client, but until then the changes won't be available in a published package.

Hey @tylerbutler , the server already referernced on this package, as "@fluidframework/eslint-config-fluid": "^6.1.0". Beside, the FRS repo referenced version 2 of this repo.

We are facing some build error for server build, that is server build reference on eslint 8, and also reference on some common util packages in client/shared, and these dependencies reference on eslint 9. So at build time time, if you check server build error stack, you will find the version mismatch from using 8 to the non backward compatible 9 and cause build error:

[94/95] x @fluidframework/server-routerlicious: eslint --format stylish src - 2.771s
tinylicious: error during command 'eslint --format stylish src' (exit code 2)
tinylicious: Oops! Something went wrong! :(
tinylicious:
tinylicious: ESLint: 8.57.1
tinylicious:
tinylicious: TypeError: Error while loading rule '@typescript-eslint/dot-notation': Cannot read properties of undefined (reading 'allowKeywords')
tinylicious: Occurred while linting /Users/zhangxin/ws/FluidFramework/server/routerlicious/packages/tinylicious/src/app.ts
tinylicious:     at Object.create (/Users/zhangxin/ws/FluidFramework/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint/lib/rules/dot-notation.js:67:33)
tinylicious:     at create (/Users/zhangxin/ws/FluidFramework/node_modules/.pnpm/@[email protected]_@[email protected][email protected]__dc632a9ad2eaca2f4678597e99331158/node_modules/@typescript-eslint/eslint-plugin/dist/rules/dot-notation.js:101:32)
tinylicious:     at Object.create (/Users/zhangxin/ws/FluidFramework/node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
tinylicious:     at createRuleListeners (/Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:895:21)
tinylicious:     at /Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1066:110
tinylicious:     at Array.forEach (<anonymous>)
tinylicious:     at runRules (/Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1003:34)
tinylicious:     at Linter._verifyWithoutProcessors (/Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1355:31)
tinylicious:     at Linter._verifyWithoutProcessors (/Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected][email protected]/node_modules/eslint-plugin-eslint-comments/lib/utils/patch.js:166:36)
tinylicious:     at Linter._verifyWithConfigArray (/Users/zhangxin/ws/FluidFramework/server/routerlicious/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/linter/linter.js:1807:21)
[95/95] x tinylicious: eslint --format stylish src - 2.452s
Build failed

So for server, I unifed the eslint to 9 as well by doing: https://github.com/microsoft/FluidFramework/pull/26169/files, where referenced the eslint-config-fluid which will be exported the mts from here:
image

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.

6 participants