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

Add support for async rules #2351

Merged
merged 2 commits into from
Feb 19, 2017

Conversation

ramasilveyra
Copy link
Contributor

@ramasilveyra ramasilveyra commented Feb 12, 2017

PR with the intention of solve #2296: add support for async rules.

@alexander-akait
Copy link
Member

@ramasilveyra need add test 👍

@jeddy3 jeddy3 changed the title wip: Add support for async rules Add support for async rules Feb 16, 2017
@ramasilveyra
Copy link
Contributor Author

@evilebottnawi Tests added! 😀

Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

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

@ramasilveyra Nicely done! Glad it turned out to be simple. Can you please add some documentation so others will know async plugins are possible?

@ramasilveyra ramasilveyra force-pushed the support-async-rules branch 2 times, most recently from 9fc8c69 to 54d102e Compare February 19, 2017 10:00
@ramasilveyra
Copy link
Contributor Author

ramasilveyra commented Feb 19, 2017

@davidtheclark Docs added :) My only concern it's that i'm not sure if I should have called this new doc section as Asynchronous rules or Asynchronous plugins... or both Asynchronous rules/plugins

Also I have to add the change to the CHANGELOG.md file?:

# Head

-   Added: Support for async rules ([#2351](https://github.com/stylelint/stylelint/pull/2351)).

Copy link
Contributor

@davidtheclark davidtheclark left a comment

Choose a reason for hiding this comment

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

@ramasilveyra Excellent! One editing point, then let's merge.

No need to add a note to the Changelog: we do that after merging.

@@ -36,6 +36,39 @@ In order for your plugin rule to work with the [standard configuration format](.

`ruleFunction` should return a function that is essentially a little [PostCSS plugin](https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md): it takes 2 arguments: the PostCSS Root (the parsed AST), and the PostCSS LazyResult. You'll have to [learn about the PostCSS API](https://github.com/postcss/postcss/blob/master/docs/api.md).

### Asynchronous rules

Rules with asynchronous PostCSS plugins are also possible you only need to return a Promise instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add some punctuation here:

Rules with asynchronous PostCSS plugins are also possible! All you need to do is return a Promise instance from your plugin function.

@davidtheclark
Copy link
Contributor

@ramasilveyra I made the copy edit suggestions directly — realized that I could do that easily with the GitHub UI! Will merge on CI green light. Thanks again.

@davidtheclark davidtheclark merged commit ba3412d into stylelint:master Feb 19, 2017
@davidtheclark
Copy link
Contributor

Added to changelog:

  • Added: support for asynchronous plugin rules (#2351).

@ramasilveyra
Copy link
Contributor Author

💥 Thanks all for your time!

@ramasilveyra ramasilveyra deleted the support-async-rules branch February 19, 2017 19:03
m-allanson added a commit that referenced this pull request Feb 22, 2017
* master: (107 commits)
  Update jest to the latest version 🚀 (#2372)
  fix(package): update known-css-properties to version 0.0.7
  chore(package): update eslint to version 3.16.0
  Update CHANGELOG.md
  Add support for async rules (#2351)
  Prepare 7.9.0
  Add a test for a parent selector in no-duplicate-selectors (#2364)
  Update CHANGELOG.md
  Add ignorePattern option to max-line-length (#2333)
  no-browser-hacks: link to external plugin (#2365)
  Update CHANGELOG.md
  Fix placeholder selector case (#2360)
  Always exclude ignored globs from globby search. (#2355)
  Update CHANGELOG.md
  Update lodash (#2353)
  Update CHANGELOG.md
  Add ignoreFontFamilyName option to font-family-no-duplicate (#2314)
  Tests: added tests for nested selectors in `selector-id-pattern` rule. (#2345)
  Fix brace position (#2347)
  Update CHANGELOG.md
  ...

# Conflicts:
#	.gitignore
hudochenkov added a commit that referenced this pull request Feb 23, 2017
* master: (31 commits)
  Update stylehacks and snapshot
  Update jest to the latest version 🚀 (#2372)
  fix(package): update known-css-properties to version 0.0.7
  chore(package): update eslint to version 3.16.0
  Update CHANGELOG.md
  Add support for async rules (#2351)
  Prepare 7.9.0
  Add a test for a parent selector in no-duplicate-selectors (#2364)
  Update CHANGELOG.md
  Add ignorePattern option to max-line-length (#2333)
  no-browser-hacks: link to external plugin (#2365)
  Update CHANGELOG.md
  Fix placeholder selector case (#2360)
  Always exclude ignored globs from globby search. (#2355)
  Update CHANGELOG.md
  Update lodash (#2353)
  Update CHANGELOG.md
  Add ignoreFontFamilyName option to font-family-no-duplicate (#2314)
  Tests: added tests for nested selectors in `selector-id-pattern` rule. (#2345)
  Fix brace position (#2347)
  ...

# Conflicts:
#	CHANGELOG.md
sergesemashko pushed a commit to sergesemashko/stylelint that referenced this pull request Mar 3, 2017
* Add support for async rules

* Copy editing
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.

4 participants