1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-18 06:11:34 +03:00
leon/scripts/lint.js

36 lines
752 B
JavaScript
Raw Normal View History

import { command } from 'execa'
2019-02-10 15:26:50 +03:00
import log from '@/helpers/log'
import loader from '@/helpers/loader'
2019-02-10 15:26:50 +03:00
/**
* This script ensures the correct coding syntax of the whole project
*/
(async () => {
loader.start()
log.info('Linting...')
try {
const globs = [
2021-03-15 20:11:40 +03:00
'"app/src/js/*.js"',
2019-02-10 15:26:50 +03:00
'"hotword/index.js"',
'"packages/**/*.js"',
'"scripts/**/*.js"',
'"server/src/**/*.js"',
'"test/*.js"',
'"test/e2e/**/*.js"',
'"test/json/**/*.js"',
'"test/unit/**/*.js"'
]
await command(`npx eslint ${globs.join(' ')}`, { shell: true })
2019-02-10 15:26:50 +03:00
log.success('Looks great')
loader.stop()
} catch (e) {
log.error(`Does not look great: ${e.stdout}`)
loader.stop()
process.exit(1)
}
})()