-
-
Notifications
You must be signed in to change notification settings - Fork 938
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
Add support for async rules #2351
Conversation
@ramasilveyra need add test 👍 |
c72a425
to
6486f2d
Compare
@evilebottnawi Tests added! 😀 |
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.
@ramasilveyra Nicely done! Glad it turned out to be simple. Can you please add some documentation so others will know async plugins are possible?
9fc8c69
to
54d102e
Compare
54d102e
to
81d3967
Compare
@davidtheclark Docs added :) My only concern it's that i'm not sure if I should have called this new doc section as Also I have to add the change to the # Head
- Added: Support for async rules ([#2351](https://github.com/stylelint/stylelint/pull/2351)). |
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.
@ramasilveyra Excellent! One editing point, then let's merge.
No need to add a note to the Changelog: we do that after merging.
docs/developer-guide/plugins.md
Outdated
@@ -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. |
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.
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.
@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. |
Added to changelog:
|
💥 Thanks all for your time! |
* 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
* 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
* Add support for async rules * Copy editing
PR with the intention of solve #2296: add support for async rules.