new SASSLint(configFileopt)
- Source:
- See:
A SASS linter
Example
import {SASSLint} from 'webcompiler';
// or - import {SASSLint} from 'webcompiler/lib/SASSLint';
// or - var SASSLint = require('webcompiler').SASSLint;
// or - var SASSLint = require('webcompiler/lib/SASSLint').SASSLint;
const linter = new SASSLint();
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
configFile |
string |
<optional> |
"webcompiler/.stylelintrc.yaml"
|
path to the stylelint configuration file |
Methods
run(paths, callback)
- Source:
Execute the linter
Example
import {join} from 'path';
import {logLintingErrors} from 'webcompiler';
// lint "style.scss" as well as the entire contents of the "sass" directory
linter.run([join(__dirname, 'style.scss'), join(__dirname, 'sass', '**', '*.scss')], errors => {
if (errors) {
return logLintingErrors(errors);
}
// there were no linting errors
});
Parameters:
Name | Type | Description |
---|---|---|
paths |
Array.<string> | an array of file globs. Ultimately passed to node-glob to figure out what files you want to lint. |
callback |
LintCallback | a callback function |