Skip to content

Commit

Permalink
Format code with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Mar 27, 2020
1 parent d0e6e34 commit af6b67c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 44 deletions.
6 changes: 1 addition & 5 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ const examples = {
todo
}

const envVars = [
'LOG_LEVEL',
'LOG_FILTER',
'LOG_OUTPUT_MODE'
]
const envVars = ['LOG_LEVEL', 'LOG_FILTER', 'LOG_OUTPUT_MODE']

const defaultOptions = {}

Expand Down
71 changes: 34 additions & 37 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,51 @@ const paths = {
]
}

export const standard = () => (
gulp.src(paths.scripts)
export const standard = () =>
gulp
.src(paths.scripts)
.pipe(gulpStandard())
.pipe(gulpStandard.reporter('default', {
breakOnError: true
}))
)
.pipe(
gulpStandard.reporter('default', {
breakOnError: true
})
)

export const jsonlint = () => (
gulp.src(paths.json)
export const jsonlint = () =>
gulp
.src(paths.json)
.pipe(gulpJsonlint())
.pipe(gulpJsonlint.failAfterError())
.pipe(gulpJsonlint.reporter())
)

export const watchScripts = () => (
gulp.src(paths.scripts)
.pipe(gulpWatch(paths.scripts, vinyl => {
if (vinyl.event === 'change') {
gulplog.info(`Linted ${vinyl.relative}`)
}
}))
export const watchScripts = () =>
gulp
.src(paths.scripts)
.pipe(
gulpWatch(paths.scripts, (vinyl) => {
if (vinyl.event === 'change') {
gulplog.info(`Linted ${vinyl.relative}`)
}
})
)
.pipe(gulpStandard())
.pipe(gulpStandard.reporter('default', {}))
)

export const watchJson = () => (
gulp.src(paths.json)
.pipe(gulpWatch(paths.json, vinyl => {
if (vinyl.event === 'change') {
gulplog.info(`Linted ${vinyl.relative}`)
}
}))
export const watchJson = () =>
gulp
.src(paths.json)
.pipe(
gulpWatch(paths.json, (vinyl) => {
if (vinyl.event === 'change') {
gulplog.info(`Linted ${vinyl.relative}`)
}
})
)
.pipe(gulpJsonlint())
.pipe(gulpJsonlint.reporter())
)

export const lint = gulp.parallel(
jsonlint,
standard
)
export const lint = gulp.parallel(jsonlint, standard)

export const watch = gulp.parallel(
watchJson,
watchScripts
)
export const watch = gulp.parallel(watchJson, watchScripts)

export default gulp.series(
lint,
watch
)
export default gulp.series(lint, watch)
2 changes: 1 addition & 1 deletion lib/todo.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const todo = x => x
export const todo = (x) => x
2 changes: 1 addition & 1 deletion lib/todo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from 'ava'

import { todo } from './todo'

test('todo: returns argument', async t => {
test('todo: returns argument', async (t) => {
t.true(todo(true), 'returns true')
t.false(todo(false), 'returns false')
t.is(todo('todo'), 'todo', 'returns string')
Expand Down

0 comments on commit af6b67c

Please sign in to comment.