/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.53.0
script/lint
35 строк
992 B
Antonio Scandurra
Add script/lint
29 авг 2016, 11:37
29 авг 2016, 11:37
870b3c8
Код
Авторство
О чём код?
#!/usr/bin/env node 'use strict' require('colors') const lintCoffeeScriptPaths = require('./lib/lint-coffee-script-paths') const lintJavaScriptPaths = require('./lib/lint-java-script-paths') const lintLessPaths = require('./lib/lint-less-paths') const path = require('path') const CONFIG = require('./config') process.on('unhandledRejection', function (e) { console.error(e.stack || e) process.exit(1) }) Promise.all([lintCoffeeScriptPaths(), lintJavaScriptPaths(), lintLessPaths()]) .then((lintResults) => { let hasLintErrors = false for (let errors of lintResults) { for (let error of errors) { hasLintErrors = true const relativePath = path.relative(CONFIG.repositoryRootPath, error.path) console.log(`${relativePath}:${error.lineNumber}`.yellow + ` ${error.message} (${error.rule})`.red) } } if (hasLintErrors) { process.exit(1) } else { console.log('No lint errors!'.green) process.exit(0) } })