-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(eslint-plugin-react-components): support ESM imports #36287
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
KirtiRamchandani
wants to merge
1
commit into
microsoft:master
Choose a base branch
from
KirtiRamchandani:fix/eslint-plugin-esm-entry
base: master
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.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-eslint-plugin-react-components-3091f3d8-8015-47e4-b973-bcdbbcb4e852.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: support ESM plugin imports", | ||
| "packageName": "@fluentui/eslint-plugin-react-components", | ||
| "email": "kirtiar15502@gmail.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| import type { ESLint } from 'eslint'; | ||
|
|
||
| import { name, version } from '../package.json'; | ||
| import packageJson from '../package.json'; | ||
| import { RULE_NAME as enforceUseClientName, rule as enforceUseClient } from './rules/enforce-use-client'; | ||
| import { RULE_NAME as preferFluentUIV9Name, rule as preferFluentUIV9 } from './rules/prefer-fluentui-v9'; | ||
|
|
||
| const { name, version } = packageJson; | ||
|
|
||
| export const meta = { | ||
| name, | ||
| version, | ||
|
|
@@ -35,10 +37,13 @@ const plugin = { | |
| configs, | ||
| rules, | ||
| }; | ||
| export default plugin; | ||
|
|
||
| // Flat config for eslint v9 | ||
| configs['flat/recommended'].plugins = { | ||
| [name]: plugin as unknown as ESLint.Plugin, | ||
| }; | ||
|
|
||
| module.exports = plugin; | ||
| if (typeof module !== 'undefined') { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even with this "hack" we don't ship ESM. we follow TS Eslint pattern so what needs to be done is to set explicitly type in package.json https://app.unpkg.com/@typescript-eslint/eslint-plugin@8.61.0/files/package.json#L15 |
||
| module.exports = plugin; | ||
| } | ||
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
3 changes: 3 additions & 0 deletions
3
...orkspace-plugin/src/executors/build/__fixtures__/executor/libs/proj/src/package-info.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "name": "proj" | ||
| } |
3 changes: 3 additions & 0 deletions
3
.../workspace-plugin/src/executors/build/__fixtures__/executor/libs/proj/src/package-info.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import packageJson from './package-info.json'; | ||
|
|
||
| export const packageName = packageJson.name; |
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
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
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
Oops, something went wrong.
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.
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.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/CalendarCompat 4 screenshots
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
vr-tests-react-components/Positioning 2 screenshots
vr-tests-react-components/ProgressBar converged 1 screenshots
vr-tests-react-components/Skeleton converged 1 screenshots
vr-tests-react-components/TagPicker 1 screenshots
vr-tests-web-components/MenuList 3 screenshots
vr-tests-web-components/TextInput 1 screenshots
vr-tests/Callout 3 screenshots
vr-tests/react-charting-AreaChart 1 screenshots
vr-tests/react-charting-GaugeChart 1 screenshots
vr-tests/react-charting-MultiStackBarChart 4 screenshots
vr-tests/react-charting-SankeyChart 1 screenshots
There were 5 duplicate changes discarded. Check the build logs for more information.