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 fix and output behaviour for Node.js API usage #5971

Merged
merged 9 commits into from
Mar 17, 2022

Conversation

jlarmstrongiv
Copy link
Contributor

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

Closes #5964

Is there anything in the PR that needs further explanation?

No, it’s documentation related.

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.

@jlarmstrongiv Thank you for creating the pull request. LGTM 👍🏼

It might be better if we could add an example using the fix option, but I want to hear @jeddy3's idea.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@jlarmstrongiv Thanks for the pull request.

I've requested some changes.

As @ybiquitous suggested, lets add an "Example H". Something along the lines of:


Example H

Using a string and the fix option:

stylelint
  .lint({
    code: "a { color: pink; }",
    config: { rules: { "hue-degree-notation": "angle" } },
    fix: true
  })
  .then(function () {
    /* .. */
  });

The autofixed code will be available as the value of the output property in the returned object.


docs/user-guide/usage/node-api.md Outdated Show resolved Hide resolved
docs/user-guide/usage/node-api.md Outdated Show resolved Hide resolved
jlarmstrongiv and others added 3 commits March 17, 2022 05:25
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@jlarmstrongiv
Copy link
Contributor Author

@jeddy3 great suggestions! I’ve updated the PR accordingly

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@jlarmstrongiv Thanks for making those changes.

I've added two minor nits suggestions.

Let's also update the options page as detailed in #5971 (comment)

docs/user-guide/usage/node-api.md Outdated Show resolved Hide resolved
docs/user-guide/usage/node-api.md Outdated Show resolved Hide resolved
jlarmstrongiv and others added 3 commits March 17, 2022 06:15
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@jlarmstrongiv
Copy link
Contributor Author

@jeddy3 thank you! Should be all set 🤞

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes.

Almost there... the markdown is lost when copying and pasting.

Two suggestions are to add the link and backticks back in.

docs/user-guide/usage/options.md Outdated Show resolved Hide resolved
docs/user-guide/usage/options.md Outdated Show resolved Hide resolved
jlarmstrongiv and others added 2 commits March 17, 2022 06:53
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@jlarmstrongiv
Copy link
Contributor Author

@jeddy3 great catch! Thank you for your patience

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Thank you for your patience

I'm always happy to help a first-time contributor to the project! 😄

@jeddy3 jeddy3 merged commit 1d76eb7 into stylelint:main Mar 17, 2022
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.

Document fix and output behaviour for Node.js API usage
3 participants