@ackmann-dickenson/stylelint-config 中文文档教程
@ackmann-dickenson/stylelint-config
扩展 stylelint-config -标准
。 打开附加规则以强制执行 A&D 样式约定。
Installation
$ npm install --save-dev stylelint @ackmann-dickenson/stylelint-config
Usage
安装 stylelint 和配置包后,将您的 .stylelintrc.js
配置文件设置为:
module.exports = {
extends: '@ackmann-dickenson/stylelint-config'
};
您的构建过程将根据项目中使用的工具而有所不同。
NPM
{
"scripts": {
"lint:styles": "stylelint '**/*.{css,scss}'"
}
}
$ npm run lint:styles
Gulp
$ npm install --save-dev gulp gulp-stylelint
var gulp = require('gulp');
var gulpStylelint = require('gulp-stylelint');
gulp.task('lint:styles', function() {
return gulp
.src('**/*.scss')
.pipe(
gulpStylelint({
reporters: [{ formatter: 'string', console: true }]
})
);
});
$ gulp lint:styles
Rules
要查看此配置添加的所有内容,请参阅规则文档。
@ackmann-dickenson/stylelint-config
Extends stylelint-config-standard
. Turns on additional rules to enforce A&D style conventions.
Installation
$ npm install --save-dev stylelint @ackmann-dickenson/stylelint-config
Usage
After installing both stylelint and the configuration packages set your .stylelintrc.js
config file to:
module.exports = {
extends: '@ackmann-dickenson/stylelint-config'
};
Your build process will vary based on the tools used in your project.
NPM
{
"scripts": {
"lint:styles": "stylelint '**/*.{css,scss}'"
}
}
$ npm run lint:styles
Gulp
$ npm install --save-dev gulp gulp-stylelint
var gulp = require('gulp');
var gulpStylelint = require('gulp-stylelint');
gulp.task('lint:styles', function() {
return gulp
.src('**/*.scss')
.pipe(
gulpStylelint({
reporters: [{ formatter: 'string', console: true }]
})
);
});
$ gulp lint:styles
Rules
To see everything that this config adds please refer to the rules documentation.