Skip to content

Commit 269c81c

Browse files
committed
remove eslint danger
1 parent d2ba5fc commit 269c81c

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

dangerfile.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,9 @@ import { promisify } from 'util';
44
import { resolve } from 'path';
55
import tslint from 'danger-plugin-tslint';
66
import { prettyResults } from 'danger-plugin-tslint/dist/prettyResults';
7-
import { CLIEngine } from 'eslint';
87

98
const packages = ['apm', 'core', 'hub', 'integrations', 'minimal', 'node', 'types', 'utils'];
109

11-
/**
12-
* Eslint your code with Danger
13-
* Based on fork from: https://github.com/appcelerator/danger-plugin-eslint
14-
*/
15-
async function eslint(): Promise<void[]> {
16-
const allFiles = danger.git.created_files.concat(danger.git.modified_files);
17-
const cli = new CLIEngine({});
18-
// let eslint filter down to non-ignored, matching the extensions expected
19-
const filesToLint = allFiles.filter(f => !cli.isPathIgnored(f) || !f.endsWith('lock') || !f.endsWith('json'));
20-
return Promise.all(filesToLint.map(f => lintFile(cli, f)));
21-
}
22-
23-
/** JSDoc */
24-
async function lintFile(linter: CLIEngine, path: string): Promise<void> {
25-
const contents = await danger.github.utils.fileContents(path);
26-
const report = linter.executeOnText(contents, path);
27-
28-
if (report.results.length !== 0) {
29-
report.results[0].messages.map(msg => {
30-
if (msg.fatal) {
31-
fail(`Fatal error linting ${path} with eslint.`);
32-
return;
33-
}
34-
35-
const noop = (): void => undefined;
36-
const fn = { 0: noop, 1: warn, 2: fail }[msg.severity];
37-
38-
fn(`${path} line ${msg.line}${msg.message} (${msg.ruleId})`, path, msg.line);
39-
});
40-
}
41-
}
42-
4310
export default async (): Promise<void> => {
4411
if (!danger.github) {
4512
return;
@@ -74,8 +41,6 @@ export default async (): Promise<void> => {
7441
}
7542
});
7643

77-
await eslint();
78-
7944
const hasChangelog = danger.git.modified_files.indexOf('CHANGELOG.md') !== -1;
8045
const isTrivial = (danger.github.pr.body + danger.github.pr.title).includes('#trivial');
8146

0 commit comments

Comments
 (0)