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
docs: Clarify the description of sort-imports
options
#18198
Conversation
Hi @gwBear1!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @gwBear1!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.
To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page. Read more about contributing to ESLint here |
Hi @gwBear1, thanks for the PR, but the docs are correct because it shows both incorrect and correct examples when |
sorry for closing too early. /*eslint sort-imports: "error"*/
import A from 'foo.js';
import b from 'bar.js'; by default rule doesn't report this arrangement of import names. /*eslint sort-imports: "error"*/
import a from 'foo.js';
import B from 'bar.js'; but report this @mdjermanovic is it intended? if yes then we need to show this in docs too |
@Tanujkanti4441 Yeah I was confused too. You right, fixing test case would be better choice. I'll rewrite test cases. |
I added test cases more straightforward. Each options has 3 test cases
"+" updated PR description |
@Tanujkanti4441 Can you check my PR again? |
Co-authored-by: Tanuj Kanti <86398394+Tanujkanti4441@users.noreply.github.com>
This is intended because: any uppercase letter < any lowercase letter. A < b, B < a. |
I'm confused by the PR title. "Fixed incorrect doc description" sounds like the docs were incorrect, but it looks like the docs were correct and we just want to add more examples to further clarify options? |
docs/src/rules/sort-imports.md
Outdated
@@ -194,33 +194,59 @@ import {b, a, c} from 'foo.js' | |||
|
|||
When `true` the rule ignores the case-sensitivity of the imports local name. | |||
|
|||
Examples of **incorrect** code for this rule with the `{ "ignoreCase": true }` option: | |||
Uppercase letters of the alphabet must always precede lowercase letters with default settings. |
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.
If we want to describe both, I think the default behavior should be first.
When `false` (default), uppercase letters of the alphabet must always precede lowercase letters.
When `true`, the rule ignores the case-sensitivity of the imports local name.
I changed the PR title and description |
@Tanujkanti4441 @mdjermanovic Followed your comments. Could you check this PR again? |
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.
everything looks good just a last thing.
Co-authored-by: Tanuj Kanti <86398394+Tanujkanti4441@users.noreply.github.com>
@Tanujkanti4441 I hope this would be the last request 😅 Thanks for reviewing be thorough |
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.
LGTM! thanks.
sort-imports
options
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
What changes did you make? (Give an overview)
Made 4 test cases of the below. It could be more straightforward.
Is there anything you'd like reviewers to focus on?