"extends": "standard",
"rules": {
"arrow-parens": ["error", "always"],
- "comma-dangle": ["error", "always-multiline"]
+ "comma-dangle": ["error", "always-multiline"],
+ "max-len": [1, 120, 2],
+ "spaced-comment": "off"
}
}
const srcDir = 'src'
const destDir = path.join(previewSiteDestDir, '_')
-const jsFiles = [
- 'gulpfile.js',
- 'tasks/**/*.js',
- path.join(srcDir, '{helpers,js}/**/*.js'),
-]
+const jsFiles = ['gulpfile.js', 'tasks/**/*.js', path.join(srcDir, '{helpers,js}/**/*.js')]
gulp.task('lint:css', () => lintCss(`${srcDir}/css/**/*.css`))
gulp.task('lint:js', () => lintJs(jsFiles))
gulp.task('build', () => build(srcDir, destDir))
-gulp.task('build:preview', ['build'], () =>
- buildPreview(srcDir, destDir, previewSiteSrcDir, previewSiteDestDir)
-)
+gulp.task('build:preview', ['build'], () => buildPreview(srcDir, destDir, previewSiteSrcDir, previewSiteDestDir))
gulp.task('preview', ['build:preview'], () =>
preview(previewSiteDestDir, {
-var hljs = window.hljs = require('highlight.js/lib/highlight')
+var hljs = (window.hljs = require('highlight.js/lib/highlight'))
hljs.registerLanguage('apache', require('highlight.js/lib/languages/apache'))
hljs.registerLanguage('asciidoc', require('highlight.js/lib/languages/asciidoc'))
hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'))
const yaml = require('js-yaml')
module.exports = async (src, dest, siteSrc, siteDest) => {
- const [layouts] = await Promise.all([
- compileLayouts(src),
- registerPartials(src),
- registerHelpers(src),
- ])
+ const [layouts] = await Promise.all([compileLayouts(src), registerPartials(src), registerHelpers(src)])
const mockUIModel = loadSampleUIModel(siteSrc)
.pipe(
map((file, next) => {
const compiledLayout = layouts['default.hbs']
- const siteRootPath = path.relative(
- path.dirname(file.path),
- path.resolve(siteSrc)
- )
+ const siteRootPath = path.relative(path.dirname(file.path), path.resolve(siteSrc))
mockUIModel['siteRootPath'] = siteRootPath
mockUIModel['siteRootUrl'] = path.join(siteRootPath, 'index.html')
mockUIModel['uiRootPath'] = path.join(siteRootPath, '_')
.src('layouts/*.hbs', { base: src, cwd: src })
.pipe(
map((file, next) => {
- layouts[file.basename] = handlebars.compile(
- file.contents.toString(),
- { preventIndent: true }
- )
+ layouts[file.basename] = handlebars.compile(file.contents.toString(), { preventIndent: true })
next(null, file)
})
)
}
function loadSampleUIModel (siteSrc) {
- return yaml.safeLoad(
- fs.readFileSync(path.join(siteSrc, 'ui-model.yml'), 'utf8')
- )
+ return yaml.safeLoad(fs.readFileSync(path.join(siteSrc, 'ui-model.yml'), 'utf8'))
}
vfs
.src('js/vendor/*.js', Object.assign({ read: false }, opts))
- .pipe(tap((file) => {
- file.contents = browserify(file.relative, { basedir: src, detectGlobals: false }).bundle()
- }))
+ .pipe(
+ tap((file) => {
+ file.contents = browserify(file.relative, { basedir: src, detectGlobals: false }).bundle()
+ })
+ )
.pipe(buffer())
.pipe(uglify()),
}
if (file.isStream()) {
- return callback(
- new PluginError('gulp-prettier-eslint', 'Streaming not supported')
- )
+ return callback(new PluginError('gulp-prettier-eslint', 'Streaming not supported'))
}
const input = file.contents.toString()