You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugin throws an error when parsing a specific file.
That file contains an import for QuoteSelectPet, and that same name is used elsewhere in the file as const QuoteSelectionPet.
To Reproduce
parse this file:
// quote-selection-pets.tsimport{Factory}from'rosie';import{InsurancePlanCode}from'@src/helpers/plan-constants.helper';import{CoInsurancePercentage,DeductibleDollars,}from'@src/helpers/quote-product.helper';// this import is the problemimport{Financials,QuoteSelectionPet,SelectedQuoteProduct,}from'@src/@types/quotes';importfreezefrom'@test/helpers/freeze';importSelectedQuoteProductsFactory,{SelectableProductCodes,}from'@test/fixtures/selected-quote-products';constQuoteSelectionPet=newFactory<QuoteSelectionPet>()classQuoteSelectionPetsFactory{build(name: 'QuoteSelectionPet',attrs?: Partial<QuoteSelectionPet>,options?: {selectedProductKeys?: SelectableProductCodes[];withEmployeeDiscount?: boolean;withMultipetDiscount?: boolean;withBundleDiscount?: boolean;selectedDeductible?: DeductibleDollars;},): QuoteSelectionPet{returnfreeze(QuoteSelectionPet.build(attrs,options));}}exportdefaultnewQuoteSelectionPetsFactory();
Expected behavior
Prettier (with the help of the plugin) should be able to:
1 - Detect when the imports aren't sorted properly (without --write)
or
2 - sort the imports properly (with --write)
Your Environment
Describe the bug
plugin throws an error when parsing a specific file.
That file contains an import for
QuoteSelectPet
, and that same name is used elsewhere in the file asconst QuoteSelectionPet
.To Reproduce
parse this file:
Expected behavior
Prettier (with the help of the plugin) should be able to:
1 - Detect when the imports aren't sorted properly (without --write)
or
2 - sort the imports properly (with --write)
Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @trivago/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: