2021-03-04 17:49:52 +03:00
|
|
|
import { command } from 'execa'
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
import log from '@/helpers/log'
|
2021-03-02 12:02:55 +03:00
|
|
|
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
|
|
|
]
|
|
|
|
|
2021-03-04 17:49:52 +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)
|
|
|
|
}
|
|
|
|
})()
|