|
@@ -16,5 +16,15 @@ run();
|
16
|
16
|
function run() {
|
17
|
17
|
const paths = _.chain(dirs).map((d) => `'${d}/**/*.[tj]s*'`).join(' ').value();
|
18
|
18
|
exec.execSync(`tslint ${paths} ${fix} --format verbose`);
|
|
19
|
+ assertAllTsFilesInSrc();
|
19
|
20
|
exec.execSync(`jest --coverage`);
|
20
|
21
|
}
|
|
22
|
+
|
|
23
|
+function assertAllTsFilesInSrc() {
|
|
24
|
+ const allFiles = exec.execSyncRead('find ./lib/src -type f');
|
|
25
|
+ const lines = _.split(allFiles, '\n');
|
|
26
|
+ const offenders = _.filter(lines, (f) => !f.endsWith('.ts') && !f.endsWith('.tsx'));
|
|
27
|
+ if (offenders.length) {
|
|
28
|
+ throw new Error(`\n\nOnly ts/tsx files are allowed:\n${offenders.join('\n')}\n\n\n`);
|
|
29
|
+ }
|
|
30
|
+}
|