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

4 participants
@ramasilveyra
Contributor

ramasilveyra commented Feb 12, 2017

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

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Feb 13, 2017

@ramasilveyra need add test 👍

@jeddy3 jeddy3 changed the title from wip: Add support for async rules to Add support for async rules Feb 16, 2017

@ramasilveyra ramasilveyra force-pushed the ramasilveyra:support-async-rules branch from c72a425 to 6486f2d Feb 17, 2017

@ramasilveyra

This comment has been minimized.

Contributor

ramasilveyra commented Feb 17, 2017

@evilebottnawi Tests added! 😀

@davidtheclark

@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 ramasilveyra:support-async-rules branch 2 times, most recently from 9fc8c69 to 54d102e Feb 19, 2017

@ramasilveyra ramasilveyra force-pushed the ramasilveyra:support-async-rules branch from 54d102e to 81d3967 Feb 19, 2017

@ramasilveyra

This comment has been minimized.

Contributor

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)).
@davidtheclark

@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.

This comment has been minimized.

@davidtheclark

davidtheclark Feb 19, 2017

Contributor

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

This comment has been minimized.

Contributor

davidtheclark commented Feb 19, 2017

@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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@davidtheclark

This comment has been minimized.

Contributor

davidtheclark commented Feb 19, 2017

Added to changelog:

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

This comment has been minimized.

Contributor

ramasilveyra commented Feb 19, 2017

💥 Thanks all for your time!

@ramasilveyra ramasilveyra deleted the ramasilveyra:support-async-rules branch Feb 19, 2017

m-allanson added a commit that referenced this pull request Feb 22, 2017

Merge branch 'master' into jest-coverage
* 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

Merge branch 'master' into v8
* 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 (stylelint#2351)
* 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