Skip to content

Conversation

tylerbutler
Copy link
Member

Updated the no-unchecked-record-access rule to be compatible with ESLint 9's
flat config API changes while maintaining backward compatibility with ESLint 8.

Changes:

  • Updated parserServices access to use context.sourceCode.parserServices
    with fallback to context.parserServices for ESLint 8
  • Created getScope helper that properly handles ESLint 9's requirement
    for node argument while supporting ESLint 8's no-argument version
  • Updated all getScope() calls to pass appropriate node arguments
  • Fixed getKeyValue function to use correct ESLint 9 getScope API

All tests now pass successfully.

@github-actions github-actions bot added base: main PRs targeted against main branch area: build Build related issues labels Oct 9, 2025
@tylerbutler tylerbutler marked this pull request as ready for review October 9, 2025 19:10
@tylerbutler tylerbutler requested review from a team and Copilot October 9, 2025 19:10
Copy link
Contributor

@Copilot 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 updates the eslint-plugin-fluid to maintain compatibility with both ESLint 8 and ESLint 9, addressing breaking API changes in ESLint 9's flat config system.

  • Updated parser services access to use context.sourceCode.parserServices with fallback for ESLint 8
  • Created helper functions for getScope() API that handles ESLint 9's requirement for node arguments
  • Migrated all test files to use a unified configuration helper that supports both ESLint versions

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

File Description
eslintConfigHelper.js New helper utility to create ESLint configuration compatible with both ESLint 8 and 9
no-unchecked-record-access.js Updated parser services access and getScope() calls to support both ESLint versions
package.json Updated dependencies and test scripts to support both ESLint 8 and 9 testing
*.test.js files Migrated test configurations to use the new helper for cross-version compatibility
Files not reviewed (1)
  • common/build/eslint-plugin-fluid/pnpm-lock.yaml: Language not supported

tylerbutler and others added 6 commits October 9, 2025 12:42
Updated the no-unchecked-record-access rule to be compatible with ESLint 9's
flat config API changes while maintaining backward compatibility with ESLint 8.

Changes:
- Updated parserServices access to use context.sourceCode.parserServices
  with fallback to context.parserServices for ESLint 8
- Created getScope helper that properly handles ESLint 9's requirement
  for node argument while supporting ESLint 8's no-argument version
- Updated all getScope() calls to pass appropriate node arguments
- Fixed getKeyValue function to use correct ESLint 9 getScope API

All tests now pass successfully.
This makes the plugin compatible with both ESLint 8 and 9 by:

1. Updating dependencies to ESLint 9 compatible versions:
   - ESLint: 8.57.0 → 9.37.0
   - @typescript-eslint/eslint-plugin & parser: 7.18.0 → 8.46.0
   - Added @typescript-eslint/utils: 8.46.0

2. Updating no-unchecked-record-access rule with dual API support:
   - Uses context.sourceCode.parserServices with fallback to context.parserServices
   - Uses context.sourceCode.getScope(node) with fallback to context.getScope()
   - Maintains backward compatibility with ESLint 8

3. Migrating all test files to ESLint 9's flat config API:
   - Replaced deprecated useEslintrc and rulePaths options
   - Updated to use overrideConfigFile and languageOptions structure
   - Fixed rule references to include plugin prefix
   - Changed parser from string to require() call

All 19 tests passing successfully with both ESLint 8 and 9 API patterns.

Co-authored-by: tylerbutler <19589+tylerbutler@users.noreply.github.com>
…-record-access/enforce-no-unchecked-record-access.test.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tylerbutler tylerbutler force-pushed the copilot/eslint-plugin-fluid-eslint-9-compat branch from 448be31 to 7e78d78 Compare October 9, 2025 19:42
@tylerbutler
Copy link
Member Author

@copilot Address the PR feedback.

@tylerbutler tylerbutler requested review from a team and alexvy86 October 14, 2025 00:07
@alexvy86
Copy link
Contributor

@microsoft-github-policy-service rerun

Copy link
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

 ELIFECYCLE  Command failed with exit code 1.

@tylerbutler tylerbutler merged commit 171717f into microsoft:main Oct 14, 2025
31 checks passed
@tylerbutler tylerbutler deleted the copilot/eslint-plugin-fluid-eslint-9-compat branch October 14, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants