mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 09:23:21 +01:00
[WIP] Add packages and tasks for linting scss
This commit is contained in:
parent
1743ccbdb5
commit
b8aa529d29
10
.stylelintignore
Normal file
10
.stylelintignore
Normal file
@ -0,0 +1,10 @@
|
||||
app/
|
||||
development/
|
||||
dist/
|
||||
docs/
|
||||
fonts/
|
||||
images/
|
||||
mascara/
|
||||
node_modules/
|
||||
notices/
|
||||
test/
|
52
.stylelintrc
Normal file
52
.stylelintrc
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"extends": "stylelint-config-standard",
|
||||
"rules": {
|
||||
"color-named": "never",
|
||||
"font-family-name-quotes": "always-where-recommended",
|
||||
"font-weight-notation": "numeric",
|
||||
"function-url-quotes": "always",
|
||||
"number-leading-zero": "never",
|
||||
"value-no-vendor-prefix": true,
|
||||
"value-list-comma-newline-before": "never-multi-line",
|
||||
"custom-property-empty-line-before": "never",
|
||||
"property-no-unknown": [
|
||||
true,
|
||||
{
|
||||
"ignoreProperties": [
|
||||
"composes",
|
||||
"all",
|
||||
"-webkit-appearance"
|
||||
]
|
||||
}
|
||||
],
|
||||
"declaration-block-semicolon-newline-after": "always",
|
||||
"block-opening-brace-newline-after": "always",
|
||||
"selector-attribute-quotes": "always",
|
||||
"selector-max-specificity": "0,5,2",
|
||||
"selector-pseudo-class-no-unknown": [
|
||||
true,
|
||||
{
|
||||
"ignorePseudoClasses": ["local", "global"]
|
||||
}
|
||||
],
|
||||
"at-rule-empty-line-before": [
|
||||
"always",
|
||||
{
|
||||
"ignore": [
|
||||
"after-comment",
|
||||
"all-nested",
|
||||
"blockless-group"
|
||||
]
|
||||
}
|
||||
],
|
||||
"indentation": [
|
||||
2,
|
||||
{
|
||||
"indentInsideParens": "once-at-root-twice-in-block"
|
||||
}
|
||||
],
|
||||
"max-nesting-depth": 3,
|
||||
"no-duplicate-selectors": true,
|
||||
"no-unknown-animations": true
|
||||
}
|
||||
}
|
22
gulpfile.js
22
gulpfile.js
@ -21,10 +21,14 @@ var replace = require('gulp-replace')
|
||||
var mkdirp = require('mkdirp')
|
||||
var sass = require('gulp-sass')
|
||||
var autoprefixer = require('gulp-autoprefixer')
|
||||
var gulpStylelint = require('gulp-stylelint')
|
||||
var stylefmt = require('gulp-stylefmt')
|
||||
|
||||
|
||||
var disableDebugTools = gutil.env.disableDebugTools
|
||||
var debug = gutil.env.debug
|
||||
|
||||
|
||||
// browser reload
|
||||
|
||||
gulp.task('dev:reload', function() {
|
||||
@ -182,10 +186,26 @@ gulp.task('build:scss', function () {
|
||||
.pipe(autoprefixer())
|
||||
.pipe(gulp.dest('ui/app/css/output'))
|
||||
})
|
||||
gulp.task('watch:scss', function(){
|
||||
gulp.task('watch:scss', function() {
|
||||
gulp.watch(['ui/app/css/**/*.scss'], gulp.series(['build:scss']))
|
||||
})
|
||||
|
||||
gulp.task('lint-scss', function() {
|
||||
return gulp
|
||||
.src('ui/app/css/itcss/**/*.scss')
|
||||
.pipe(gulpStylelint({
|
||||
reporters: [
|
||||
{formatter: 'string', console: true}
|
||||
]
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('fmt-scss', function () {
|
||||
return gulp.src('ui/app/css/itcss/**/*.scss')
|
||||
.pipe(stylefmt())
|
||||
.pipe(gulp.dest('ui/app/css/itcss'));
|
||||
});
|
||||
|
||||
// bundle tasks
|
||||
|
||||
var jsDevStrings = jsFiles.map(jsFile => `dev:js:${jsFile}`)
|
||||
|
@ -54,8 +54,8 @@
|
||||
"babel-runtime": "^6.23.0",
|
||||
"bip39": "^2.2.0",
|
||||
"bluebird": "^3.5.0",
|
||||
"boron": "^0.2.3",
|
||||
"bn.js": "^4.11.7",
|
||||
"boron": "^0.2.3",
|
||||
"browser-passworder": "^2.0.3",
|
||||
"browserify-derequire": "^0.9.4",
|
||||
"client-sw-ready-event": "^3.3.0",
|
||||
@ -85,10 +85,10 @@
|
||||
"extension-link-enabler": "^1.0.0",
|
||||
"extensionizer": "^1.0.0",
|
||||
"fast-levenshtein": "^2.0.6",
|
||||
"gulp-autoprefixer": "^4.0.0",
|
||||
"gulp-sass": "^3.1.0",
|
||||
"gulp": "github:gulpjs/gulp#4.0",
|
||||
"gulp-autoprefixer": "^4.0.0",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-sass": "^3.1.0",
|
||||
"hat": "0.0.3",
|
||||
"idb-global": "^2.1.0",
|
||||
"identicon.js": "^2.3.1",
|
||||
@ -169,6 +169,8 @@
|
||||
"gulp-livereload": "^3.8.1",
|
||||
"gulp-replace": "^0.6.1",
|
||||
"gulp-sourcemaps": "^2.6.0",
|
||||
"gulp-stylefmt": "^1.1.0",
|
||||
"gulp-stylelint": "^4.0.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-watch": "^4.3.5",
|
||||
"gulp-zip": "^4.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user