Skip to content
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

Document list of rules by what-they-do groups #6390

Merged
merged 17 commits into from Oct 3, 2022
Merged

Conversation

jeddy3
Copy link
Member

@jeddy3 jeddy3 commented Oct 3, 2022

Which issue, if any, is this issue related to?

Ref: #6376 (comment)

Is there anything in the PR that needs further explanation?

This pull request groups our list of rules by what they do rather than what they're applied to.

I believe this approach helps our users more easily:

  • understand what the built-in rules do
  • find related built-in rules

You can view the page here.

I think it does a better job of communicating the number of powerful rules we have for enforcing non-stylistic conventions that are unique to Stylelint.

This change also surfaced a lot of inconsistencies in our rule descriptions, which I've fixed in this pull request.

Grouping by the thing the rule applies to was mostly redundant as the rule name starts with it. I've still used those sub groups for the larger no-* and *-list group for readability, though. And I kept the old system for the stylistic rules as they'll be removed at some point.

The list of rules page now leads with just enough information for users to understand what they're looking at, i.e.:

  • what makes a Stylelint rule
  • and how it's named

I've moved other information that lived on the "About rules" page to the "Working on rules" page in the developer guide, which feel like a better home for it as it's more useful for people writing rules than using them.

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2022

⚠️ No Changeset found

Latest commit: 911adb1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeddy3 Thank you for the significant improvements! 👏🏼

I've left comments to suggest fixing trivial mistakes, but any comments don't block this PR. Please feel free to address or reject them.

docs/developer-guide/rules.md Outdated Show resolved Hide resolved
docs/user-guide/configure.md Outdated Show resolved Hide resolved
docs/user-guide/rules.md Outdated Show resolved Hide resolved
docs/user-guide/rules.md Outdated Show resolved Hide resolved
docs/user-guide/rules.md Outdated Show resolved Hide resolved
docs/user-guide/rules.md Show resolved Hide resolved
lib/rules/font-family-name-quotes/README.md Outdated Show resolved Hide resolved
lib/rules/font-family-no-duplicate-names/README.md Outdated Show resolved Hide resolved
docs/user-guide/rules.md Outdated Show resolved Hide resolved
@ybiquitous
Copy link
Member

ybiquitous commented Oct 3, 2022

Note: Perhaps, we may need to update meta.url in all rules later like this if rule URLs are changed in stylelint.io:

const meta = {
url: 'https://stylelint.io/user-guide/rules/list/alpha-value-notation',

- url: 'https://stylelint.io/user-guide/rules/list/alpha-value-notation',
+ url: 'https://stylelint.io/user-guide/rules/alpha-value-notation',

But then, because redirecting also will be added, it seems we can do it after publishing the new documents.

jeddy3 and others added 13 commits October 3, 2022 18:06
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@jeddy3
Copy link
Member Author

jeddy3 commented Oct 3, 2022

@ybiquitous Thanks for all the suggestions.

Latest version.

Note: Perhaps, we may need to update meta.url in all rules later

Done also. The URL is nicer without list.

Prepped the stylelint.io repo: stylelint/stylelint.io#285

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM 👍🏼

lib/rules/shorthand-property-no-redundant-values/README.md Outdated Show resolved Hide resolved
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@jeddy3 jeddy3 changed the title Document list of rules better Document list of rules by what-they-do groups Oct 3, 2022
@jeddy3 jeddy3 merged commit eccf683 into main Oct 3, 2022
@jeddy3 jeddy3 deleted the document-rule-list branch October 3, 2022 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants