@darksheep/eslint-formatter-github 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +5 -3
  2. package/types/index.d.ts +53 -0
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@darksheep/eslint-formatter-github",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "ESLint + Github actions",
5
5
  "license": "UNLICENCED",
6
6
  "type": "commonjs",
7
7
  "main": "./src/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "files": [
10
- "./src"
10
+ "./src",
11
+ "./types"
11
12
  ],
12
13
  "scripts": {
13
14
  "lint": "eslint .",
14
- "lint:fix": "eslint . --fix"
15
+ "lint:fix": "eslint . --fix",
16
+ "prepack": "tsc"
15
17
  },
16
18
  "dependencies": {
17
19
  "@darksheep/github-actions": "~0.0.0",
@@ -0,0 +1,53 @@
1
+ export = formatter;
2
+ /**
3
+ * @typedef {Object} LintMessage
4
+ * @property {number} column
5
+ * @property {number} line
6
+ * @property {number} [endColumn]
7
+ * @property {number} [endLine]
8
+ * @property {string | null} ruleId
9
+ * @property {string} message
10
+ * @property {string} [messageId]
11
+ * @property {string} [nodeType]
12
+ * @property {boolean} [fatal]
13
+ * @property {0 | 1 | 2} severity
14
+ */
15
+ /**
16
+ * @typedef {Object} LintResult
17
+ * @property {string} filePath
18
+ * @property {LintMessage[]} messages
19
+ * @property {number} errorCount
20
+ * @property {number} fatalErrorCount
21
+ * @property {number} warningCount
22
+ * @property {number} fixableErrorCount
23
+ * @property {number} fixableWarningCount
24
+ */
25
+ /**
26
+ * @param {LintResult[]} fileResults The eslint results
27
+ * @returns {string}
28
+ */
29
+ declare function formatter(fileResults: LintResult[]): string;
30
+ declare namespace formatter {
31
+ export { LintMessage, LintResult };
32
+ }
33
+ type LintResult = {
34
+ filePath: string;
35
+ messages: LintMessage[];
36
+ errorCount: number;
37
+ fatalErrorCount: number;
38
+ warningCount: number;
39
+ fixableErrorCount: number;
40
+ fixableWarningCount: number;
41
+ };
42
+ type LintMessage = {
43
+ column: number;
44
+ line: number;
45
+ endColumn?: number | undefined;
46
+ endLine?: number | undefined;
47
+ ruleId: string | null;
48
+ message: string;
49
+ messageId?: string | undefined;
50
+ nodeType?: string | undefined;
51
+ fatal?: boolean | undefined;
52
+ severity: 0 | 1 | 2;
53
+ };