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

#191 incorporate stylelint part two #556

Merged
merged 11 commits into from
Nov 18, 2016

Conversation

jwang1919
Copy link
Contributor

Accidentally closed PR #553 when I deleted the remote branch while rebasing.

Hopefully it doesn't happen with the other PR #514

jwang1919 and others added 11 commits October 31, 2016 22:55
The default `stylelint` module wants to load configuration files from
the filesystem in a dynamic way that isn’t possible with `brfs`. We
don’t actually need the file-loading behavior, so instead, we hand-roll
a `stylelint` object in the same manner as
[`createStylelint`](https://github.com/stylelint/stylelint/blob/7.5.0/src/createStylelint.js),
but using configuration defined in code rather than the filesystem. This
definitely builds in knowledge of some non-public APIs in `stylelint`,
but I can’t think of a better approach.

Also a decent amount of Webpack wrangling to get the modules we do
import from stylelint to build. In particular, they *still* want to hit
the filesystem, although they don’t actually need to in order to work
for us. So, instead of building those modules with `brfs`, just use the
string replace loader to turn `require("fs")` into a null object; use
the `substitute` loader to stub out the `isAutoprefixable` method; and
use the null module loader to stub out rules that want access to a
gigantic database of browser capabilities. The usage of
string-replacement is a fragile hack, but I can’t think of another way
to *only* stub out `fs` in that particular context.
Browser-friendly stylelint build
@outoftime outoftime merged commit ccab132 into popcodeorg:master Nov 18, 2016
@jwang1919 jwang1919 deleted the #191-incorporate-stylelint branch June 4, 2017 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants