@teambit/linter 0.0.554 → 0.0.555
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lint.cmd.d.ts +6 -0
- package/dist/linter-context.d.ts +9 -0
- package/dist/linter.d.ts +84 -0
- package/dist/linter.main.runtime.d.ts +10 -0
- package/package-tar/teambit-linter-0.0.555.tgz +0 -0
- package/package.json +10 -10
- package/tsconfig.json +0 -1
- package/package-tar/teambit-linter-0.0.554.tgz +0 -0
package/dist/lint.cmd.d.ts
CHANGED
@@ -10,12 +10,18 @@ export declare type LintCmdOptions = {
|
|
10
10
|
fixType?: string;
|
11
11
|
json?: boolean;
|
12
12
|
};
|
13
|
+
/**
|
14
|
+
* A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component
|
15
|
+
*/
|
13
16
|
export declare type JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {
|
14
17
|
componentId: ComponentID;
|
15
18
|
};
|
16
19
|
export declare type JsonLintDataResults = Omit<LintResults, 'results'> & {
|
17
20
|
results: JsonComponentLintResult[];
|
18
21
|
};
|
22
|
+
/**
|
23
|
+
* A type for result with componentId instead of the entire component, as when output to console, we don't want to print all the component
|
24
|
+
*/
|
19
25
|
export declare type JsonLintResults = {
|
20
26
|
code: number;
|
21
27
|
data: {
|
package/dist/linter-context.d.ts
CHANGED
@@ -2,8 +2,17 @@ import { ExecutionContext } from '@teambit/envs';
|
|
2
2
|
export declare type FixType = 'problem' | 'suggestion' | 'layout';
|
3
3
|
export declare type FixTypes = Array<FixType>;
|
4
4
|
export interface LinterOptions {
|
5
|
+
/**
|
6
|
+
* extensions formats to lint. (e.g. .ts, .tsx, etc.)
|
7
|
+
*/
|
5
8
|
extensionFormats?: string[];
|
9
|
+
/**
|
10
|
+
* automatically fix problems
|
11
|
+
*/
|
6
12
|
fix?: boolean;
|
13
|
+
/**
|
14
|
+
* specify the types of fixes to apply (problem, suggestion, layout)
|
15
|
+
*/
|
7
16
|
fixTypes?: FixTypes;
|
8
17
|
}
|
9
18
|
export interface LinterContext extends ExecutionContext, LinterOptions {
|
package/dist/linter.d.ts
CHANGED
@@ -1,40 +1,124 @@
|
|
1
1
|
import { Component } from '@teambit/component';
|
2
2
|
import { LinterContext } from './linter-context';
|
3
3
|
export declare type ComponentLintResult = {
|
4
|
+
/**
|
5
|
+
* the linted component.
|
6
|
+
*/
|
4
7
|
component: Component;
|
8
|
+
/**
|
9
|
+
* CLI output of the linter.
|
10
|
+
*/
|
5
11
|
output: string;
|
12
|
+
/**
|
13
|
+
* total errors count of the component (from all of the files).
|
14
|
+
*/
|
6
15
|
totalErrorCount: number;
|
16
|
+
/**
|
17
|
+
* total fatal errors count of the component (from all of the files).
|
18
|
+
*/
|
7
19
|
totalFatalErrorCount?: number;
|
20
|
+
/**
|
21
|
+
* total fixable errors count of the component (from all of the files).
|
22
|
+
*/
|
8
23
|
totalFixableErrorCount?: number;
|
24
|
+
/**
|
25
|
+
* total fatal warning count of the component (from all of the files).
|
26
|
+
*/
|
9
27
|
totalFixableWarningCount?: number;
|
28
|
+
/**
|
29
|
+
* total warning count of the component (from all of the files).
|
30
|
+
*/
|
10
31
|
totalWarningCount: number;
|
32
|
+
/**
|
33
|
+
* lint results for each one of the component files
|
34
|
+
*/
|
11
35
|
results: LintResult[];
|
12
36
|
};
|
13
37
|
export declare type LintResult = {
|
38
|
+
/**
|
39
|
+
* path of the linted file.
|
40
|
+
*/
|
14
41
|
filePath: string;
|
42
|
+
/**
|
43
|
+
* numbers of errors found.
|
44
|
+
*/
|
15
45
|
errorCount: number;
|
46
|
+
/**
|
47
|
+
* numbers of errors found.
|
48
|
+
*/
|
16
49
|
fatalErrorCount?: number;
|
50
|
+
/**
|
51
|
+
* numbers of fixable errors found.
|
52
|
+
*/
|
17
53
|
fixableErrorCount?: number;
|
54
|
+
/**
|
55
|
+
* numbers of fixable warning found.
|
56
|
+
*/
|
18
57
|
fixableWarningCount?: number;
|
58
|
+
/**
|
59
|
+
* number of found warnings.
|
60
|
+
*/
|
19
61
|
warningCount: number;
|
62
|
+
/**
|
63
|
+
* lint messages.
|
64
|
+
*/
|
20
65
|
messages: LintMessage[];
|
66
|
+
/**
|
67
|
+
* Raw data as returned from the linter
|
68
|
+
*/
|
21
69
|
raw: any;
|
22
70
|
};
|
23
71
|
export declare type LintMessage = {
|
72
|
+
/**
|
73
|
+
* severity of the issue.
|
74
|
+
*/
|
24
75
|
severity: string;
|
76
|
+
/**
|
77
|
+
* stating column of the issue.
|
78
|
+
*/
|
25
79
|
column: number;
|
80
|
+
/**
|
81
|
+
* line of the issue.
|
82
|
+
*/
|
26
83
|
line: number;
|
84
|
+
/**
|
85
|
+
* end column of the issue.
|
86
|
+
*/
|
27
87
|
endColumn?: number;
|
88
|
+
/**
|
89
|
+
* end line of the issue.
|
90
|
+
*/
|
28
91
|
endLine?: number;
|
92
|
+
/**
|
93
|
+
* message of the issue.
|
94
|
+
*/
|
29
95
|
message: string;
|
96
|
+
/**
|
97
|
+
* lint suggestions.
|
98
|
+
*/
|
30
99
|
suggestions?: string[];
|
31
100
|
};
|
32
101
|
export declare type LintResults = {
|
33
102
|
results: ComponentLintResult[];
|
103
|
+
/**
|
104
|
+
* total errors count of the component (from all of the components).
|
105
|
+
*/
|
34
106
|
totalErrorCount: number;
|
107
|
+
/**
|
108
|
+
* total fatal errors count of the component (from all of the components).
|
109
|
+
*/
|
35
110
|
totalFatalErrorCount?: number;
|
111
|
+
/**
|
112
|
+
* total fixable errors count of the component (from all of the components).
|
113
|
+
*/
|
36
114
|
totalFixableErrorCount?: number;
|
115
|
+
/**
|
116
|
+
* total fatal warning count of the component (from all of the components).
|
117
|
+
*/
|
37
118
|
totalFixableWarningCount?: number;
|
119
|
+
/**
|
120
|
+
* total warning count of the component (from all of the components).
|
121
|
+
*/
|
38
122
|
totalWarningCount: number;
|
39
123
|
errors: Error[];
|
40
124
|
};
|
@@ -7,6 +7,9 @@ import { LinterService } from './linter.service';
|
|
7
7
|
import { LintTask } from './lint.task';
|
8
8
|
import { FixTypes, LinterOptions } from './linter-context';
|
9
9
|
export declare type LinterConfig = {
|
10
|
+
/**
|
11
|
+
* extension formats to lint.
|
12
|
+
*/
|
10
13
|
extensionFormats: string[];
|
11
14
|
fixTypes?: FixTypes;
|
12
15
|
};
|
@@ -15,7 +18,14 @@ export declare class LinterMain {
|
|
15
18
|
private linterService;
|
16
19
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
17
20
|
constructor(envs: EnvsMain, linterService: LinterService);
|
21
|
+
/**
|
22
|
+
* lint an array of components.
|
23
|
+
*/
|
18
24
|
lint(components: Component[], opts: LinterOptions): Promise<import("@teambit/envs").EnvsExecutionResult<import("./linter").LintResults>>;
|
25
|
+
/**
|
26
|
+
* create a lint task for build pipelines.
|
27
|
+
* @param name name of the task.
|
28
|
+
*/
|
19
29
|
createTask(name?: string): LintTask;
|
20
30
|
static dependencies: import("@teambit/harmony").Aspect[];
|
21
31
|
static defaultConfig: LinterConfig;
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/linter",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.555",
|
4
4
|
"homepage": "https://bit.dev/teambit/defender/linter",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.defender",
|
8
8
|
"name": "linter",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.555"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -17,12 +17,12 @@
|
|
17
17
|
"ink": "3.0.8",
|
18
18
|
"@babel/runtime": "7.12.18",
|
19
19
|
"core-js": "^3.0.0",
|
20
|
-
"@teambit/cli": "0.0.
|
21
|
-
"@teambit/component": "0.0.
|
22
|
-
"@teambit/envs": "0.0.
|
23
|
-
"@teambit/workspace": "0.0.
|
24
|
-
"@teambit/builder": "0.0.
|
25
|
-
"@teambit/logger": "0.0.
|
20
|
+
"@teambit/cli": "0.0.386",
|
21
|
+
"@teambit/component": "0.0.555",
|
22
|
+
"@teambit/envs": "0.0.555",
|
23
|
+
"@teambit/workspace": "0.0.555",
|
24
|
+
"@teambit/builder": "0.0.555",
|
25
|
+
"@teambit/logger": "0.0.471"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@types/lodash": "4.14.165",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"@types/node": "12.20.4"
|
35
35
|
},
|
36
36
|
"peerDependencies": {
|
37
|
-
"@teambit/legacy": "1.0.
|
37
|
+
"@teambit/legacy": "1.0.172",
|
38
38
|
"react-dom": "^16.8.0 || ^17.0.0",
|
39
39
|
"react": "^16.8.0 || ^17.0.0"
|
40
40
|
},
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"react": "-"
|
63
63
|
},
|
64
64
|
"peerDependencies": {
|
65
|
-
"@teambit/legacy": "1.0.
|
65
|
+
"@teambit/legacy": "1.0.172",
|
66
66
|
"react-dom": "^16.8.0 || ^17.0.0",
|
67
67
|
"react": "^16.8.0 || ^17.0.0"
|
68
68
|
}
|
package/tsconfig.json
CHANGED
Binary file
|