-
Notifications
You must be signed in to change notification settings - Fork 557
feat(eslint-plugin-fluid): update APIs for cross 8/9 ESLint compat #25654
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
feat(eslint-plugin-fluid): update APIs for cross 8/9 ESLint compat #25654
Conversation
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 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
...fluid/src/test/enforce-no-unchecked-record-access/enforce-no-unchecked-record-access.test.js
Outdated
Show resolved
Hide resolved
...fluid/src/test/enforce-no-restricted-tags-imports/enforce-no-restricted-tags-imports.test.js
Outdated
Show resolved
Hide resolved
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>
448be31
to
7e78d78
Compare
...fluid/src/test/enforce-no-unchecked-record-access/enforce-no-unchecked-record-access.test.js
Outdated
Show resolved
Hide resolved
...fluid/src/test/enforce-no-restricted-tags-imports/enforce-no-restricted-tags-imports.test.js
Outdated
Show resolved
Hide resolved
@copilot Address the PR feedback. |
@microsoft-github-policy-service rerun |
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output
|
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:
with fallback to context.parserServices for ESLint 8
for node argument while supporting ESLint 8's no-argument version
All tests now pass successfully.