1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-26 10:14:57 +03:00
leon/scripts/lint.js

37 lines
826 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"',
2022-06-26 18:11:37 +03:00
// TODO: put it back once tests have been reintroduced into skills
// '"skills/**/*.js"',
2019-02-10 15:26:50 +03:00
'"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)
}
})()