Bauke/tildes-issue-log
Bauke
/
tildes-issue-log
Archived
1
Fork 0

chore: switch to xo and stylelint-xo

This commit is contained in:
Bauke 2019-07-05 23:43:30 +02:00
parent 2ad2b53611
commit 9b7e616ab6
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
5 changed files with 2219 additions and 1268 deletions

View File

@ -1,29 +0,0 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"sourceType": "module"
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
2
],
"no-console": "off",
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
],
"comma-dangle": [
"error",
"always-multiline"
]
}
}

View File

@ -1,8 +0,0 @@
{
"extends": "stylelint-config-recommended",
"rules": {
"indentation": 2,
"string-quotes": "single",
"no-descending-specificity": null
}
}

View File

@ -12,7 +12,6 @@ const
merge2 = require('merge2'), merge2 = require('merge2'),
path = require('path'), path = require('path'),
scss = require('gulp-sass'), scss = require('gulp-sass'),
stylelint = require('gulp-stylelint'),
sync = require('browser-sync') sync = require('browser-sync')
// Require statistic functions // Require statistic functions
@ -37,16 +36,11 @@ const paths = {
scss: path.join(__dirname, 'src/scss/*.scss'), scss: path.join(__dirname, 'src/scss/*.scss'),
} }
// Define options for Node Sass, Stylelint and Browser Sync // Define options for Node Sass and Browser Sync
const opts = { const opts = {
scss: { scss: {
outputStyle: 'compressed', outputStyle: 'compressed',
}, },
stylelint: {
reporters: [{
formatter: 'string', console: true,
}],
},
sync: { sync: {
server: { server: {
baseDir: paths.out, baseDir: paths.out,
@ -115,18 +109,11 @@ function buildExtra() {
.pipe(gulp.dest(paths.out)) .pipe(gulp.dest(paths.out))
} }
// Lint the Scss with Stylelint
function lintSCSS() {
return gulp
.src(paths.scss)
.pipe(stylelint(opts.stylelint))
}
// Start the Browser Sync server and watch individual file types with appropriate build functions // Start the Browser Sync server and watch individual file types with appropriate build functions
function watch() { function watch() {
server.init(opts.sync) server.init(opts.sync)
gulp.watch([ paths.html.index, paths.html.posts ], gulp.series(buildHTML, createFeeds, reload)) gulp.watch([ paths.html.index, paths.html.posts ], gulp.series(buildHTML, createFeeds, reload))
gulp.watch(paths.scss, gulp.series(lintSCSS, buildCSS, reload)) gulp.watch(paths.scss, gulp.series(buildCSS, reload))
gulp.watch(paths.extra, gulp.series(buildExtra, reload)) gulp.watch(paths.extra, gulp.series(buildExtra, reload))
} }
@ -454,8 +441,7 @@ function createFeeds() {
return Promise.resolve() return Promise.resolve()
} }
exports.build = gulp.series(lintSCSS, gulp.parallel(buildHTML, buildCSS, buildExtra), createFeeds) exports.build = gulp.series(gulp.parallel(buildHTML, buildCSS, buildExtra), createFeeds)
exports.download = gulp.series(download, gulp.parallel(createIssueTable, createStatistics)) exports.download = gulp.series(download, gulp.parallel(createIssueTable, createStatistics))
exports.no_download = gulp.parallel(createIssueTable, createStatistics) exports.no_download = gulp.parallel(createIssueTable, createStatistics)
exports.lint = lintSCSS exports.watch = gulp.series(gulp.parallel(buildHTML, buildCSS, buildExtra), createFeeds, watch)
exports.watch = gulp.series(lintSCSS, gulp.parallel(buildHTML, buildCSS, buildExtra), createFeeds, watch)

View File

@ -8,26 +8,38 @@
"build": "gulp build", "build": "gulp build",
"dl": "gulp download", "dl": "gulp download",
"nodl": "gulp no_download", "nodl": "gulp no_download",
"lint": "gulp lint" "test": "xo ; stylelint src/scss/"
}, },
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"browser-sync": "^2.24.5", "browser-sync": "^2.24.5",
"cheerio": "^1.0.0-rc.3", "cheerio": "^1.0.0-rc.3",
"date-format": "^2.0.0", "date-format": "^2.0.0",
"eslint": "^5.1.0",
"fancy-log": "^1.3.3", "fancy-log": "^1.3.3",
"feed": "^3.0.0", "feed": "^3.0.0",
"fs-extra": "^7.0.1", "fs-extra": "^8.1.0",
"gitlab": "^4.3.0", "gitlab": "^4.3.0",
"gulp": "^4.0.0", "gulp": "^4.0.0",
"gulp-htmlclean": "^2.7.22", "gulp-htmlclean": "^2.7.22",
"gulp-pug": "^4.0.1", "gulp-pug": "^4.0.1",
"gulp-sass": "^4.0.1", "gulp-sass": "^4.0.1",
"gulp-stylelint": "^8.0.0",
"klaw-sync": "^6.0.0", "klaw-sync": "^6.0.0",
"merge2": "^1.2.3", "merge2": "^1.2.3",
"stylelint": "^9.3.0", "stylelint": "^10.1.0",
"stylelint-config-recommended": "^2.1.0" "stylelint-config-xo-scss": "^0.9.0",
"stylelint-config-xo-space": "^0.13.0",
"xo": "^0.24.0"
},
"stylelint": {
"extends": [
"stylelint-config-xo-scss",
"stylelint-config-xo-space"
],
"rules": {
"block-no-empty": null
}
},
"xo": {
"space": true
} }
} }

3404
yarn.lock

File diff suppressed because it is too large Load Diff