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

39 lines
973 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 = [
2022-09-03 13:17:16 +03:00
'"app/src/js/*.{ts,js}"',
// TODO: deal with it once handling new hotword
// '"hotword/index.{ts,js}"',
2022-06-26 18:11:37 +03:00
// TODO: put it back once tests have been reintroduced into skills
// '"skills/**/*.js"',
2022-09-03 13:17:16 +03:00
'"scripts/**/*.{ts,js}"',
'"server/src/**/*.{ts,js}"'
// TODO: put it back once tests need to be written
/*'"test/!*.js"',
'"test/e2e/!**!/!*.js"',
'"test/json/!**!/!*.js"',
'"test/unit/!**!/!*.js"'*/
2019-02-10 15:26:50 +03:00
]
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)
}
})()