This repository branch modifies Stylelint and creates a bundle:
config.customSyntax === "sugarss"
.npm install
npm run build
.stylelint-bundle.min.js
is created in dist
directory using the modified version of Stylelint.npm test
for testing.The resulting bundle:
fs
) or path (path
) are bypassed or removed.Within your HTML page, load the bundle.
<script src="https://github.com/openstyles/stylelint-bundle/raw/master/stylelint-bundle.min.js"></script>
Access the stylelint
global:
stylelint.lint({
code: "body { color: #000; }",
config: {
customSyntax: 'sugarss',
rules: { /*...*/ },
formatter: () => {}
}
}).then(({results}) => {
console.log(results[0]);
});
To get more details, including all the options and return promise values, see the stylelint Node API page; but, don't forget the limitations of this bundle!
To update to a new version of Stylelint:
npm install stylelint@latest
npm run build
It will install the latest stylelint, bump the version number in package.json
and package-lock.json
, then build the bundle.
To test it:
npm test
Set environment variable DEBUG
to 1
then run npm run build
:
stats.json
.