Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
fix: import/order named not working with spread operator#3146
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const test = { | ||
| a: 1, | ||
| browser: 2, | ||
| }; | ||
| module.exports = { | ||
| ...test, | ||
| platform: 'node', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -23,6 +23,11 @@ const rule = require('rules/order'); | ||
| ruleTester.run('order', rule, { | ||
| valid: [ | ||
| test({ | ||
| code: ` | ||
| import { platform, a, browser } from './order/spread-export'; | ||
| `, | ||
| }), | ||
| // Default order using require | ||
| test({ | ||
| code: ` | ||
| @@ -3648,6 +3653,24 @@ flowRuleTester.run('order', rule, { | ||
| import typeof {foo} from 'common'; | ||
| import {bar} from 'common'; | ||
| `, | ||
| }), | ||
| test({ | ||
| options: [ | ||
| { | ||
| named: true, | ||
| }, | ||
| ], | ||
| code: ` | ||
| const test = { | ||
| a: 1, | ||
| browser: 2, | ||
| }; | ||
| module.exports = { | ||
| ...test, | ||
| platform: 'node', | ||
| }; | ||
| `, | ||
Comment on lines +3657 to +3673 Member 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. i'd like to also include a test that demonstrates that we only recognize Author 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. Im not that familiar with this codebase. How could I test this? Member 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. you'd want to make a fixture file with this test code in it, and then make two test cases that import this test file - one that imports Author 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. Im very sorry but can't figure it out. I added the cases but it doesn't fail? I suspect that I'm doing something wrong but cant figure out what. Member 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. Can you push up what you have? I'll take a look. Author 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. I tried looking at#3032 as it had fixture files I believe Author 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. @ljharb did you have a chance to look? Author 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. ? | ||
| })], | ||
| invalid: [ | ||
| test({ | ||
Uh oh!
There was an error while loading.Please reload this page.