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 = [
|
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"'
|
|
|
|
]
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
})()
|