@teambit/linter 0.0.857 → 0.0.859

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.
@@ -22,13 +22,14 @@ export declare type JsonLintDataResults = Omit<LintResults, 'results'> & {
22
22
  /**
23
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
24
  */
25
+ export declare type JsonLintResultsData = {
26
+ duration: TimerResponse;
27
+ lintResults: JsonLintDataResults;
28
+ componentsIdsToLint: string[];
29
+ };
25
30
  export declare type JsonLintResults = {
26
31
  code: number;
27
- data: {
28
- duration: TimerResponse;
29
- lintResults: JsonLintDataResults;
30
- componentsIdsToLint: string[];
31
- };
32
+ data: JsonLintResultsData;
32
33
  };
33
34
  export declare class LintCmd implements Command {
34
35
  private linter;
@@ -43,6 +44,8 @@ export declare class LintCmd implements Command {
43
44
  code: number;
44
45
  data: string;
45
46
  }>;
47
+ private getSummarySection;
48
+ private renderTotalLine;
46
49
  json([components]: [string[]], linterOptions: LintCmdOptions): Promise<JsonLintResults>;
47
50
  private getIdsToLint;
48
51
  }
package/dist/lint.cmd.js CHANGED
@@ -70,7 +70,6 @@ class LintCmd {
70
70
  data
71
71
  } = await this.json([components], linterOptions);
72
72
  const {
73
- duration,
74
73
  lintResults,
75
74
  componentsIdsToLint
76
75
  } = data;
@@ -85,16 +84,54 @@ class LintCmd {
85
84
  const compOutput = lintRes.output;
86
85
  return `${compTitle}\n${compOutput}`;
87
86
  }).join('\n');
88
- const {
89
- seconds
90
- } = duration;
91
- const summery = `linted ${_chalk().default.cyan(componentsIdsToLint.length.toString())} components in ${_chalk().default.cyan(seconds.toString())}.`;
87
+ const summary = this.getSummarySection(data);
92
88
  return {
93
89
  code,
94
- data: `${title}\n\n${componentsOutputs}\n\n${summery}`
90
+ data: `${title}\n\n${componentsOutputs}\n\n${summary}`
95
91
  };
96
92
  }
97
93
 
94
+ getSummarySection(data) {
95
+ const {
96
+ duration,
97
+ lintResults,
98
+ componentsIdsToLint
99
+ } = data;
100
+ const {
101
+ seconds
102
+ } = duration;
103
+ const summaryTitle = `linted ${_chalk().default.cyan(componentsIdsToLint.length.toString())} components in ${_chalk().default.cyan(seconds.toString())} seconds`;
104
+ const totalFieldsMap = [{
105
+ itemsDataField: 'totalErrorCount',
106
+ componentsDataField: 'totalComponentsWithErrorCount',
107
+ label: 'Errors'
108
+ }, {
109
+ itemsDataField: 'totalFatalErrorCount',
110
+ componentsDataField: 'totalComponentsWithFatalErrorCount',
111
+ label: 'FatalErrors'
112
+ }, {
113
+ itemsDataField: 'totalFixableErrorCount',
114
+ componentsDataField: 'totalComponentsWithFixableErrorCount',
115
+ label: 'FixableErrors'
116
+ }, {
117
+ itemsDataField: 'totalFixableWarningCount',
118
+ componentsDataField: 'totalComponentsWithFixableWarningCount',
119
+ label: 'FixableWarnings'
120
+ }, {
121
+ itemsDataField: 'totalWarningCount',
122
+ componentsDataField: 'totalComponentsWithWarningCount',
123
+ label: 'Warnings'
124
+ }];
125
+ const summaryTotals = totalFieldsMap.map(item => this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)).filter(Boolean).join('\n');
126
+ const summary = `${summaryTitle}\n${summaryTotals}`;
127
+ return summary;
128
+ }
129
+
130
+ renderTotalLine(componentsCount, itemsCount, fieldLabel) {
131
+ if (itemsCount === 0) return undefined;
132
+ return `total of ${_chalk().default.green(itemsCount.toString())} ${_chalk().default.cyan(fieldLabel)} (from ${_chalk().default.green(componentsCount.toString())} components)`;
133
+ }
134
+
98
135
  async json([components = []], linterOptions) {
99
136
  const timer = _timer().Timer.create();
100
137
 
@@ -106,8 +143,7 @@ class LintCmd {
106
143
  fixTypes: linterOptions.fixType ? linterOptions.fixType.split(',') : undefined
107
144
  };
108
145
  const linterResults = await this.linter.lint(componentsToLint, opts);
109
- const jsonLinterResults = toJsonLintResults(linterResults); // console.log('jsonLinterResults', JSON.stringify(jsonLinterResults, null, 2));
110
-
146
+ const jsonLinterResults = toJsonLintResults(linterResults);
111
147
  const timerResponse = timer.stop();
112
148
  let code = 0;
113
149
 
@@ -147,6 +183,11 @@ function toJsonLintResults(results) {
147
183
  let totalFixableErrorCount = 0;
148
184
  let totalFixableWarningCount = 0;
149
185
  let totalWarningCount = 0;
186
+ let totalComponentsWithErrorCount = 0;
187
+ let totalComponentsWithFatalErrorCount = 0;
188
+ let totalComponentsWithFixableErrorCount = 0;
189
+ let totalComponentsWithFixableWarningCount = 0;
190
+ let totalComponentsWithWarningCount = 0;
150
191
  const newResults = results.results.map(res => {
151
192
  var _res$data;
152
193
 
@@ -157,13 +198,40 @@ function toJsonLintResults(results) {
157
198
  });
158
199
 
159
200
  if (res.data) {
160
- var _res$data$totalErrorC, _res$data$totalFatalE, _res$data$totalFixabl, _res$data$totalFixabl2, _res$data$totalWarnin;
201
+ if (res.data.totalErrorCount) {
202
+ var _res$data$totalCompon;
203
+
204
+ totalErrorCount += res.data.totalErrorCount;
205
+ totalComponentsWithErrorCount += (_res$data$totalCompon = res.data.totalComponentsWithErrorCount) !== null && _res$data$totalCompon !== void 0 ? _res$data$totalCompon : 0;
206
+ }
207
+
208
+ if (res.data.totalFatalErrorCount) {
209
+ var _res$data$totalCompon2;
210
+
211
+ totalFatalErrorCount += res.data.totalFatalErrorCount;
212
+ totalComponentsWithFatalErrorCount += (_res$data$totalCompon2 = res.data.totalComponentsWithFatalErrorCount) !== null && _res$data$totalCompon2 !== void 0 ? _res$data$totalCompon2 : 0;
213
+ }
214
+
215
+ if (res.data.totalFixableErrorCount) {
216
+ var _res$data$totalCompon3;
161
217
 
162
- totalErrorCount += (_res$data$totalErrorC = res.data.totalErrorCount) !== null && _res$data$totalErrorC !== void 0 ? _res$data$totalErrorC : 0;
163
- totalFatalErrorCount += (_res$data$totalFatalE = res.data.totalFatalErrorCount) !== null && _res$data$totalFatalE !== void 0 ? _res$data$totalFatalE : 0;
164
- totalFixableErrorCount += (_res$data$totalFixabl = res.data.totalFixableErrorCount) !== null && _res$data$totalFixabl !== void 0 ? _res$data$totalFixabl : 0;
165
- totalFixableWarningCount += (_res$data$totalFixabl2 = res.data.totalFixableWarningCount) !== null && _res$data$totalFixabl2 !== void 0 ? _res$data$totalFixabl2 : 0;
166
- totalWarningCount += (_res$data$totalWarnin = res.data.totalWarningCount) !== null && _res$data$totalWarnin !== void 0 ? _res$data$totalWarnin : 0;
218
+ totalFixableErrorCount += res.data.totalFixableErrorCount;
219
+ totalComponentsWithFixableErrorCount += (_res$data$totalCompon3 = res.data.totalComponentsWithFixableErrorCount) !== null && _res$data$totalCompon3 !== void 0 ? _res$data$totalCompon3 : 0;
220
+ }
221
+
222
+ if (res.data.totalFixableWarningCount) {
223
+ var _res$data$totalCompon4;
224
+
225
+ totalFixableWarningCount += res.data.totalFixableWarningCount;
226
+ totalComponentsWithFixableWarningCount += (_res$data$totalCompon4 = res.data.totalComponentsWithFixableWarningCount) !== null && _res$data$totalCompon4 !== void 0 ? _res$data$totalCompon4 : 0;
227
+ }
228
+
229
+ if (res.data.totalWarningCount) {
230
+ var _res$data$totalCompon5;
231
+
232
+ totalWarningCount += res.data.totalWarningCount;
233
+ totalComponentsWithWarningCount += (_res$data$totalCompon5 = res.data.totalComponentsWithWarningCount) !== null && _res$data$totalCompon5 !== void 0 ? _res$data$totalCompon5 : 0;
234
+ }
167
235
  }
168
236
 
169
237
  return (0, _lodash().compact)(resultsWithoutComponent);
@@ -175,6 +243,11 @@ function toJsonLintResults(results) {
175
243
  totalFixableErrorCount,
176
244
  totalFixableWarningCount,
177
245
  totalWarningCount,
246
+ totalComponentsWithErrorCount,
247
+ totalComponentsWithFatalErrorCount,
248
+ totalComponentsWithFixableErrorCount,
249
+ totalComponentsWithFixableWarningCount,
250
+ totalComponentsWithWarningCount,
178
251
  errors: results === null || results === void 0 ? void 0 : results.errors
179
252
  };
180
253
  }
@@ -1 +1 @@
1
- {"version":3,"names":["LintCmd","constructor","linter","componentHost","workspace","report","components","linterOptions","code","data","json","duration","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","name","componentsOutputs","results","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","seconds","summery","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","undefined","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","totalErrorCount","totalFatalErrorCount","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","newResults","res","resultsWithoutComponent","result","Object","assign","component","omit","compact","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten, omit } from 'lodash';\nimport { LinterMain } from './linter.main.runtime';\nimport { ComponentLintResult, LintResults } from './linter';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: boolean;\n};\n\n/**\n * 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\n */\nexport type JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\n/**\n * 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\n */\nexport type JsonLintResults = {\n code: number;\n data: {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n };\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component...]';\n description = 'lint components in the development workspace';\n group = 'development';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([components = []]: [string[]], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([components], linterOptions);\n const { duration, lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const componentsOutputs = lintResults.results\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const { seconds } = duration;\n const summery = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )}.`;\n return { code, data: `${title}\\n\\n${componentsOutputs}\\n\\n${summery}` };\n }\n\n async json([components = []]: [string[]], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(components, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n // console.log('jsonLinterResults', JSON.stringify(jsonLinterResults, null, 2));\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(components: string[], changed = false): Promise<ComponentID[]> {\n if (components.length) {\n return this.workspace.resolveMultipleComponentIds(components);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n}\n\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n totalErrorCount += res.data.totalErrorCount ?? 0;\n totalFatalErrorCount += res.data.totalFatalErrorCount ?? 0;\n totalFixableErrorCount += res.data.totalFixableErrorCount ?? 0;\n totalFixableWarningCount += res.data.totalFixableWarningCount ?? 0;\n totalWarningCount += res.data.totalWarningCount ?? 0;\n }\n\n return compact(resultsWithoutComponent);\n });\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAgCO,MAAMA,OAAN,CAAiC;EAWtCC,WAAW,CAASC,MAAT,EAAqCC,aAArC,EAA8EC,SAA9E,EAAoG;IAAA,KAA3FF,MAA2F,GAA3FA,MAA2F;IAAA,KAA/DC,aAA+D,GAA/DA,aAA+D;IAAA,KAAtBC,SAAsB,GAAtBA,SAAsB;IAAA,8CAVxG,qBAUwG;IAAA,qDATjG,8CASiG;IAAA,+CARvG,aAQuG;IAAA,iDAPrG,CACR,CAAC,GAAD,EAAM,SAAN,EAAiB,uCAAjB,CADQ,EAER,CAAC,GAAD,EAAM,KAAN,EAAa,4BAAb,CAFQ,EAGR,CAAC,EAAD,EAAK,oBAAL,EAA2B,mEAA3B,CAHQ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6BAAIE,GAAG,CAACxD,IAAJ,CAASsD,iBAAb,yEAAkC,CAAnD;IACD;;IAED,OAAO,IAAAS,iBAAA,EAAQN,uBAAR,CAAP;EACD,CAdkB,CAAnB;EAeA,OAAO;IACL5C,OAAO,EAAE,IAAAkD,iBAAA,EAAQ,IAAAC,iBAAA,EAAQT,UAAR,CAAR,CADJ;IAELV,eAFK;IAGLC,oBAHK;IAILM,sBAJK;IAKLC,wBALK;IAMLC,iBANK;IAOLW,MAAM,EAAEpD,OAAF,aAAEA,OAAF,uBAAEA,OAAO,CAAEoD;EAPZ,CAAP;AASD"}
1
+ {"version":3,"names":["LintCmd","constructor","linter","componentHost","workspace","report","components","linterOptions","code","data","json","lintResults","componentsIdsToLint","title","chalk","bold","cyan","length","toString","name","componentsOutputs","results","map","lintRes","compTitle","componentId","ignoreVersion","compOutput","output","join","summary","getSummarySection","duration","seconds","summaryTitle","totalFieldsMap","itemsDataField","componentsDataField","label","summaryTotals","item","renderTotalLine","filter","Boolean","componentsCount","itemsCount","fieldLabel","undefined","green","timer","Timer","create","start","componentsIds","getIdsToLint","changed","componentsToLint","getMany","opts","fix","fixTypes","fixType","split","linterResults","lint","jsonLinterResults","toJsonLintResults","timerResponse","stop","totalErrorCount","totalFatalErrorCount","comp","id","resolveMultipleComponentIds","getNewAndModifiedIds","listIds","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","newResults","res","resultsWithoutComponent","result","Object","assign","component","omit","compact","flatten","errors"],"sources":["lint.cmd.ts"],"sourcesContent":["import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentFactory, ComponentID } from '@teambit/component';\nimport chalk from 'chalk';\nimport { EnvsExecutionResult } from '@teambit/envs';\nimport { Workspace } from '@teambit/workspace';\nimport { compact, flatten, omit } from 'lodash';\nimport { LinterMain } from './linter.main.runtime';\nimport { ComponentLintResult, LintResults } from './linter';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LintCmdOptions = {\n changed?: boolean;\n fix?: boolean;\n fixType?: string;\n json?: boolean;\n};\n\n/**\n * 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\n */\nexport type JsonComponentLintResult = Omit<ComponentLintResult, 'component'> & {\n componentId: ComponentID;\n};\n\nexport type JsonLintDataResults = Omit<LintResults, 'results'> & { results: JsonComponentLintResult[] };\n/**\n * 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\n */\nexport type JsonLintResultsData = {\n duration: TimerResponse;\n lintResults: JsonLintDataResults;\n componentsIdsToLint: string[];\n}\n\nexport type JsonLintResults = {\n code: number;\n data: JsonLintResultsData\n};\n\nexport class LintCmd implements Command {\n name = 'lint [component...]';\n description = 'lint components in the development workspace';\n group = 'development';\n options = [\n ['c', 'changed', 'lint only new and modified components'],\n ['f', 'fix', 'automatically fix problems'],\n ['', 'fix-type <fixType>', 'specify the types of fixes to apply (problem, suggestion, layout)'],\n ['j', 'json', 'return the lint results in json format'],\n ] as CommandOptions;\n\n constructor(private linter: LinterMain, private componentHost: ComponentFactory, private workspace: Workspace) {}\n\n async report([components = []]: [string[]], linterOptions: LintCmdOptions) {\n const { code, data } = await this.json([components], linterOptions);\n const { lintResults, componentsIdsToLint } = data;\n const title = chalk.bold(\n `linting total of ${chalk.cyan(componentsIdsToLint.length.toString())} component(s) in workspace '${chalk.cyan(\n this.componentHost.name\n )}'`\n );\n\n const componentsOutputs = lintResults.results\n .map((lintRes) => {\n const compTitle = chalk.bold.cyan(lintRes.componentId.toString({ ignoreVersion: true }));\n const compOutput = lintRes.output;\n return `${compTitle}\\n${compOutput}`;\n })\n .join('\\n');\n\n const summary = this.getSummarySection(data);\n return { code, data: `${title}\\n\\n${componentsOutputs}\\n\\n${summary}` };\n }\n\n private getSummarySection(data: JsonLintResultsData){\n const { duration, lintResults, componentsIdsToLint } = data;\n const { seconds } = duration;\n const summaryTitle = `linted ${chalk.cyan(componentsIdsToLint.length.toString())} components in ${chalk.cyan(\n seconds.toString()\n )} seconds`;\n\n\n const totalFieldsMap = [\n {itemsDataField: 'totalErrorCount', componentsDataField: 'totalComponentsWithErrorCount', label: 'Errors'},\n {itemsDataField: 'totalFatalErrorCount', componentsDataField: 'totalComponentsWithFatalErrorCount', label: 'FatalErrors'},\n {itemsDataField: 'totalFixableErrorCount', componentsDataField: 'totalComponentsWithFixableErrorCount', label: 'FixableErrors'},\n {itemsDataField: 'totalFixableWarningCount', componentsDataField: 'totalComponentsWithFixableWarningCount', label: 'FixableWarnings'},\n {itemsDataField: 'totalWarningCount', componentsDataField: 'totalComponentsWithWarningCount', label: 'Warnings'},\n ];\n\n const summaryTotals = totalFieldsMap.map(item => this.renderTotalLine(lintResults[item.componentsDataField], lintResults[item.itemsDataField], item.label)).filter(Boolean).join('\\n');\n const summary = `${summaryTitle}\\n${summaryTotals}`;\n return summary;\n }\n\n private renderTotalLine(componentsCount: number, itemsCount:number, fieldLabel: string): string | undefined {\n if (itemsCount === 0) return undefined;\n return `total of ${chalk.green(itemsCount.toString())} ${chalk.cyan(fieldLabel)} (from ${chalk.green(componentsCount.toString())} components)`;\n }\n\n async json([components = []]: [string[]], linterOptions: LintCmdOptions): Promise<JsonLintResults> {\n const timer = Timer.create();\n timer.start();\n const componentsIds = await this.getIdsToLint(components, linterOptions.changed);\n const componentsToLint = await this.workspace.getMany(componentsIds);\n const opts: LinterOptions = {\n fix: linterOptions.fix,\n fixTypes: linterOptions.fixType ? (linterOptions.fixType.split(',') as FixTypes) : undefined,\n };\n const linterResults = await this.linter.lint(componentsToLint, opts);\n const jsonLinterResults = toJsonLintResults(linterResults);\n const timerResponse = timer.stop();\n let code = 0;\n if (jsonLinterResults.totalErrorCount || jsonLinterResults.totalFatalErrorCount) {\n code = 1;\n }\n return {\n code,\n data: {\n duration: timerResponse,\n lintResults: jsonLinterResults,\n componentsIdsToLint: componentsToLint.map((comp) => comp.id.toString()),\n },\n };\n }\n\n private async getIdsToLint(components: string[], changed = false): Promise<ComponentID[]> {\n if (components.length) {\n return this.workspace.resolveMultipleComponentIds(components);\n }\n if (changed) {\n return this.workspace.getNewAndModifiedIds();\n }\n return this.componentHost.listIds();\n }\n}\n\nfunction toJsonLintResults(results: EnvsExecutionResult<LintResults>): JsonLintDataResults {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n let totalComponentsWithErrorCount = 0;\n let totalComponentsWithFatalErrorCount = 0;\n let totalComponentsWithFixableErrorCount = 0;\n let totalComponentsWithFixableWarningCount = 0;\n let totalComponentsWithWarningCount = 0;\n\n const newResults = results.results.map((res) => {\n const resultsWithoutComponent = res.data?.results.map((result) => {\n return Object.assign({}, { componentId: result.component.id }, omit(result, ['component']));\n });\n\n if (res.data) {\n if (res.data.totalErrorCount){\n totalErrorCount += res.data.totalErrorCount;\n totalComponentsWithErrorCount += res.data.totalComponentsWithErrorCount ?? 0;\n }\n if (res.data.totalFatalErrorCount){\n totalFatalErrorCount += res.data.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += res.data.totalComponentsWithFatalErrorCount ?? 0;\n }\n if (res.data.totalFixableErrorCount){\n totalFixableErrorCount += res.data.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += res.data.totalComponentsWithFixableErrorCount ?? 0;\n }\n if (res.data.totalFixableWarningCount){\n totalFixableWarningCount += res.data.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += res.data.totalComponentsWithFixableWarningCount ?? 0;\n }\n if (res.data.totalWarningCount){\n totalWarningCount += res.data.totalWarningCount;\n totalComponentsWithWarningCount += res.data.totalComponentsWithWarningCount ?? 0;\n }\n }\n\n return compact(resultsWithoutComponent);\n });\n return {\n results: compact(flatten(newResults)),\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n errors: results?.errors,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAkCO,MAAMA,OAAN,CAAiC;EAWtCC,WAAW,CAASC,MAAT,EAAqCC,aAArC,EAA8EC,SAA9E,EAAoG;IAAA,KAA3FF,MAA2F,GAA3FA,MAA2F;IAAA,KAA/DC,aAA+D,GAA/DA,aAA+D;IAAA,KAAtBC,SAAsB,GAAtBA,SAAsB;IAAA,8CAVxG,qBAUwG;IAAA,qDATjG,8CASiG;IAAA,+CARvG,aAQuG;IAAA,iDAPrG,CACR,CAAC,GAAD,EAAM,SAAN,EAAiB,uCAAjB,CADQ,EAER,CAAC,GAAD,EAAM,KAAN,EAAa,4BAAb,CAFQ,EAGR,CAAC,EAAD,EAAK,oBAAL,EAA2B,mEAA3B,CAHQ,EAIR,CAAC,GAAD,EAAM,MAAN,EAAc,wCAAd,CAJQ,CAOqG;EAAE;;EAErG,MAANC,MAAM,CAAC,CAACC,UAAU,GAAG,EAAd,CAAD,EAAgCC,aAAhC,EAA+D;IACzE,MAAM;MAAEC,IAAF;MAAQC;IAAR,IAAiB,MAAM,KAAKC,IAAL,CAAU,CAACJ,UAAD,CAAV,EAAwBC,aAAxB,CAA7B;IACA,MAAM;MAAEI,WAAF;MAAeC;IAAf,IAAuCH,IAA7C;;IACA,MAAMI,KAAK,GAAGC,gBAAA,CAAMC,IAAN,CACX,oBAAmBD,gBAAA,CAAME,IAAN,CAAWJ,mBAAmB,CAACK,MAApB,CAA2BC,QAA3B,EAAX,CAAkD,+BAA8BJ,gBAAA,CAAME,I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AAsB,IAAIS,GAAG,CAAC5E,IAAJ,CAASmE,sBAAnC;QACAK,oCAAoC,8BAAII,GAAG,CAAC5E,IAAJ,CAASwE,oCAAb,2EAAqD,CAAzF;MACD;;MACD,IAAII,GAAG,CAAC5E,IAAJ,CAASoE,wBAAb,EAAsC;QAAA;;QACpCA,wBAAwB,IAAIQ,GAAG,CAAC5E,IAAJ,CAASoE,wBAArC;QACAK,sCAAsC,8BAAIG,GAAG,CAAC5E,IAAJ,CAASyE,sCAAb,2EAAuD,CAA7F;MACD;;MACD,IAAIG,GAAG,CAAC5E,IAAJ,CAASqE,iBAAb,EAA+B;QAAA;;QAC7BA,iBAAiB,IAAIO,GAAG,CAAC5E,IAAJ,CAASqE,iBAA9B;QACAK,+BAA+B,8BAAIE,GAAG,CAAC5E,IAAJ,CAAS0E,+BAAb,2EAAgD,CAA/E;MACD;IACF;;IAED,OAAO,IAAAS,iBAAA,EAAQN,uBAAR,CAAP;EACD,CA7BkB,CAAnB;EA8BA,OAAO;IACLjE,OAAO,EAAE,IAAAuE,iBAAA,EAAQ,IAAAC,iBAAA,EAAQT,UAAR,CAAR,CADJ;IAELf,eAFK;IAGLC,oBAHK;IAILM,sBAJK;IAKLC,wBALK;IAMLC,iBANK;IAOLC,6BAPK;IAQLC,kCARK;IASLC,oCATK;IAULC,sCAVK;IAWLC,+BAXK;IAYLW,MAAM,EAAEzE,OAAF,aAAEA,OAAF,uBAAEA,OAAO,CAAEyE;EAZZ,CAAP;AAcD"}
package/dist/lint.task.js CHANGED
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  require("core-js/modules/es.promise.js");
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
@@ -7,6 +9,20 @@ Object.defineProperty(exports, "__esModule", {
7
9
  });
8
10
  exports.LintTask = void 0;
9
11
 
12
+ function _defineProperty2() {
13
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+
15
+ _defineProperty2 = function () {
16
+ return data;
17
+ };
18
+
19
+ return data;
20
+ }
21
+
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+
10
26
  class LintTask {
11
27
  constructor(aspectId, name = 'lint') {
12
28
  this.aspectId = aspectId;
@@ -14,8 +30,13 @@ class LintTask {
14
30
  }
15
31
 
16
32
  async execute(context) {
17
- const linter = context.env.getLinter();
18
- const results = await linter.lint(context);
33
+ const linter = context.env.getLinter(); // @ts-ignore TODO: fix this
34
+
35
+ const linterContext = _objectSpread({
36
+ rootDir: context.capsuleNetwork.capsulesRootDir
37
+ }, context);
38
+
39
+ const results = await linter.lint(linterContext);
19
40
  const componentsResults = results.results.map(lintResult => {
20
41
  return {
21
42
  component: lintResult.component,
@@ -1 +1 @@
1
- {"version":3,"names":["LintTask","constructor","aspectId","name","execute","context","linter","env","getLinter","results","lint","componentsResults","map","lintResult","component","metadata","output","errors"],"sources":["lint.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { Linter } from './linter';\n\nexport class LintTask implements BuildTask {\n constructor(readonly aspectId: string, readonly name = 'lint') {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const linter: Linter = context.env.getLinter();\n const results = await linter.lint(context);\n const componentsResults = results.results.map(\n (lintResult): ComponentResult => {\n return {\n component: lintResult.component,\n metadata: {\n output: lintResult.output,\n results: lintResult.results,\n },\n errors: [],\n };\n }\n );\n\n return {\n componentsResults,\n };\n }\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,QAAN,CAAoC;EACzCC,WAAW,CAAUC,QAAV,EAAqCC,IAAI,GAAG,MAA5C,EAAoD;IAAA,KAA1CD,QAA0C,GAA1CA,QAA0C;IAAA,KAAfC,IAAe,GAAfA,IAAe;EAAE;;EAEpD,MAAPC,OAAO,CAACC,OAAD,EAAkD;IAC7D,MAAMC,MAAc,GAAGD,OAAO,CAACE,GAAR,CAAYC,SAAZ,EAAvB;IACA,MAAMC,OAAO,GAAG,MAAMH,MAAM,CAACI,IAAP,CAAYL,OAAZ,CAAtB;IACA,MAAMM,iBAAiB,GAAGF,OAAO,CAACA,OAAR,CAAgBG,GAAhB,CACvBC,UAAD,IAAiC;MAC/B,OAAO;QACLC,SAAS,EAAED,UAAU,CAACC,SADjB;QAELC,QAAQ,EAAE;UACRC,MAAM,EAAEH,UAAU,CAACG,MADX;UAERP,OAAO,EAAEI,UAAU,CAACJ;QAFZ,CAFL;QAMLQ,MAAM,EAAE;MANH,CAAP;IAQD,CAVuB,CAA1B;IAaA,OAAO;MACLN;IADK,CAAP;EAGD;;AAtBwC"}
1
+ {"version":3,"names":["LintTask","constructor","aspectId","name","execute","context","linter","env","getLinter","linterContext","rootDir","capsuleNetwork","capsulesRootDir","results","lint","componentsResults","map","lintResult","component","metadata","output","errors"],"sources":["lint.task.ts"],"sourcesContent":["import { BuildTask, BuiltTaskResult, BuildContext, ComponentResult } from '@teambit/builder';\nimport { Linter } from './linter';\nimport { LinterContext } from './linter-context';\n\nexport class LintTask implements BuildTask {\n constructor(readonly aspectId: string, readonly name = 'lint') {}\n\n async execute(context: BuildContext): Promise<BuiltTaskResult> {\n const linter: Linter = context.env.getLinter();\n // @ts-ignore TODO: fix this\n const linterContext: LinterContext = {\n rootDir: context.capsuleNetwork.capsulesRootDir,\n ...context,\n }\n const results = await linter.lint(linterContext);\n const componentsResults = results.results.map(\n (lintResult): ComponentResult => {\n return {\n component: lintResult.component,\n metadata: {\n output: lintResult.output,\n results: lintResult.results,\n },\n errors: [],\n };\n }\n );\n\n return {\n componentsResults,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIO,MAAMA,QAAN,CAAoC;EACzCC,WAAW,CAAUC,QAAV,EAAqCC,IAAI,GAAG,MAA5C,EAAoD;IAAA,KAA1CD,QAA0C,GAA1CA,QAA0C;IAAA,KAAfC,IAAe,GAAfA,IAAe;EAAE;;EAEpD,MAAPC,OAAO,CAACC,OAAD,EAAkD;IAC7D,MAAMC,MAAc,GAAGD,OAAO,CAACE,GAAR,CAAYC,SAAZ,EAAvB,CAD6D,CAE7D;;IACA,MAAMC,aAA4B;MAChCC,OAAO,EAAEL,OAAO,CAACM,cAAR,CAAuBC;IADA,GAE7BP,OAF6B,CAAlC;;IAIA,MAAMQ,OAAO,GAAG,MAAMP,MAAM,CAACQ,IAAP,CAAYL,aAAZ,CAAtB;IACA,MAAMM,iBAAiB,GAAGF,OAAO,CAACA,OAAR,CAAgBG,GAAhB,CACvBC,UAAD,IAAiC;MAC/B,OAAO;QACLC,SAAS,EAAED,UAAU,CAACC,SADjB;QAELC,QAAQ,EAAE;UACRC,MAAM,EAAEH,UAAU,CAACG,MADX;UAERP,OAAO,EAAEI,UAAU,CAACJ;QAFZ,CAFL;QAMLQ,MAAM,EAAE;MANH,CAAP;IAQD,CAVuB,CAA1B;IAaA,OAAO;MACLN;IADK,CAAP;EAGD;;AA3BwC"}
@@ -17,4 +17,9 @@ export interface LinterOptions {
17
17
  }
18
18
  export interface LinterContext extends ExecutionContext, LinterOptions {
19
19
  quiet?: boolean;
20
+ /**
21
+ * Root dir that contains all the components in the fs that are about to be linted
22
+ * Usually it's the workspace root dir or the capsule root dir
23
+ */
24
+ rootDir?: string;
20
25
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["linter-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport type FixType = 'problem' | 'suggestion' | 'layout';\nexport type FixTypes = Array<FixType>;\n\nexport interface LinterOptions {\n /**\n * extensions formats to lint. (e.g. .ts, .tsx, etc.)\n */\n extensionFormats?: string[];\n\n /**\n * automatically fix problems\n */\n fix?: boolean;\n\n /**\n * specify the types of fixes to apply (problem, suggestion, layout)\n */\n fixTypes?: FixTypes;\n}\nexport interface LinterContext extends ExecutionContext, LinterOptions {\n quiet?: boolean;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["linter-context.ts"],"sourcesContent":["import { ExecutionContext } from '@teambit/envs';\n\nexport type FixType = 'problem' | 'suggestion' | 'layout';\nexport type FixTypes = Array<FixType>;\n\nexport interface LinterOptions {\n /**\n * extensions formats to lint. (e.g. .ts, .tsx, etc.)\n */\n extensionFormats?: string[];\n\n /**\n * automatically fix problems\n */\n fix?: boolean;\n\n /**\n * specify the types of fixes to apply (problem, suggestion, layout)\n */\n fixTypes?: FixTypes;\n}\nexport interface LinterContext extends ExecutionContext, LinterOptions {\n quiet?: boolean;\n /**\n * Root dir that contains all the components in the fs that are about to be linted\n * Usually it's the workspace root dir or the capsule root dir\n */\n rootDir?: string;\n}\n"],"mappings":""}
package/dist/linter.d.ts CHANGED
@@ -120,6 +120,11 @@ export declare type LintResults = {
120
120
  * total warning count of the component (from all of the components).
121
121
  */
122
122
  totalWarningCount: number;
123
+ totalComponentsWithErrorCount: number;
124
+ totalComponentsWithFatalErrorCount?: number;
125
+ totalComponentsWithFixableErrorCount?: number;
126
+ totalComponentsWithFixableWarningCount?: number;
127
+ totalComponentsWithWarningCount: number;
123
128
  errors: Error[];
124
129
  };
125
130
  export interface Linter {
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { LinterContext } from './linter-context';\n\nexport type ComponentLintResult = {\n /**\n * the linted component.\n */\n component: Component;\n\n /**\n * CLI output of the linter.\n */\n output: string;\n\n /**\n * total errors count of the component (from all of the files).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the files).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the files).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the files).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the files).\n */\n totalWarningCount: number;\n\n /**\n * lint results for each one of the component files\n */\n results: LintResult[];\n};\n\nexport type LintResult = {\n /**\n * path of the linted file.\n */\n filePath: string;\n\n /**\n * numbers of errors found.\n */\n errorCount: number;\n\n /**\n * numbers of errors found.\n */\n fatalErrorCount?: number;\n\n /**\n * numbers of fixable errors found.\n */\n fixableErrorCount?: number;\n\n /**\n * numbers of fixable warning found.\n */\n fixableWarningCount?: number;\n\n /**\n * number of found warnings.\n */\n warningCount: number;\n\n /**\n * lint messages.\n */\n messages: LintMessage[];\n\n /**\n * Raw data as returned from the linter\n */\n raw: any;\n};\n\nexport type LintMessage = {\n /**\n * severity of the issue.\n */\n severity: string;\n /**\n * stating column of the issue.\n */\n column: number;\n\n /**\n * line of the issue.\n */\n line: number;\n\n /**\n * end column of the issue.\n */\n endColumn?: number;\n\n /**\n * end line of the issue.\n */\n endLine?: number;\n\n /**\n * message of the issue.\n */\n message: string;\n\n /**\n * lint suggestions.\n */\n suggestions?: string[];\n};\n\nexport type LintResults = {\n results: ComponentLintResult[];\n /**\n * total errors count of the component (from all of the components).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the components).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the components).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the components).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the components).\n */\n totalWarningCount: number;\n errors: Error[];\n};\n\nexport interface Linter {\n lint(context: LinterContext): Promise<LintResults>;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import { Component } from '@teambit/component';\nimport { LinterContext } from './linter-context';\n\nexport type ComponentLintResult = {\n /**\n * the linted component.\n */\n component: Component;\n\n /**\n * CLI output of the linter.\n */\n output: string;\n\n /**\n * total errors count of the component (from all of the files).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the files).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the files).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the files).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the files).\n */\n totalWarningCount: number;\n\n /**\n * lint results for each one of the component files\n */\n results: LintResult[];\n};\n\nexport type LintResult = {\n /**\n * path of the linted file.\n */\n filePath: string;\n\n /**\n * numbers of errors found.\n */\n errorCount: number;\n\n /**\n * numbers of errors found.\n */\n fatalErrorCount?: number;\n\n /**\n * numbers of fixable errors found.\n */\n fixableErrorCount?: number;\n\n /**\n * numbers of fixable warning found.\n */\n fixableWarningCount?: number;\n\n /**\n * number of found warnings.\n */\n warningCount: number;\n\n /**\n * lint messages.\n */\n messages: LintMessage[];\n\n /**\n * Raw data as returned from the linter\n */\n raw: any;\n};\n\nexport type LintMessage = {\n /**\n * severity of the issue.\n */\n severity: string;\n /**\n * stating column of the issue.\n */\n column: number;\n\n /**\n * line of the issue.\n */\n line: number;\n\n /**\n * end column of the issue.\n */\n endColumn?: number;\n\n /**\n * end line of the issue.\n */\n endLine?: number;\n\n /**\n * message of the issue.\n */\n message: string;\n\n /**\n * lint suggestions.\n */\n suggestions?: string[];\n};\n\nexport type LintResults = {\n results: ComponentLintResult[];\n /**\n * total errors count of the component (from all of the components).\n */\n totalErrorCount: number;\n /**\n * total fatal errors count of the component (from all of the components).\n */\n totalFatalErrorCount?: number;\n /**\n * total fixable errors count of the component (from all of the components).\n */\n totalFixableErrorCount?: number;\n /**\n * total fatal warning count of the component (from all of the components).\n */\n totalFixableWarningCount?: number;\n /**\n * total warning count of the component (from all of the components).\n */\n totalWarningCount: number;\n\n totalComponentsWithErrorCount: number;\n totalComponentsWithFatalErrorCount?: number;\n totalComponentsWithFixableErrorCount?: number;\n totalComponentsWithFixableWarningCount?: number;\n totalComponentsWithWarningCount: number;\n\n errors: Error[];\n};\n\nexport interface Linter {\n lint(context: LinterContext): Promise<LintResults>;\n}\n"],"mappings":""}
@@ -139,7 +139,7 @@ class LinterMain {
139
139
  static async provider([envs, cli, component, loggerAspect, workspace], config) {
140
140
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
141
141
  const logger = loggerAspect.createLogger(_linter().LinterAspect.id);
142
- const linterService = new (_linter2().LinterService)(config);
142
+ const linterService = new (_linter2().LinterService)(config, workspace === null || workspace === void 0 ? void 0 : workspace.path);
143
143
  const linterAspect = new LinterMain(envs, linterService);
144
144
  envs.registerService(linterService);
145
145
  cli.register(new (_lint2().LintCmd)(linterAspect, component.getHost(), workspace));
@@ -1 +1 @@
1
- {"version":3,"names":["LinterMain","constructor","envs","linterService","lint","components","opts","envsRuntime","createEnvironment","lintResults","run","createTask","name","LintTask","LinterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","LinterService","linterAspect","registerService","register","LintCmd","getHost","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","extensionFormats","fixTypes","addRuntime"],"sources":["linter.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { LinterAspect } from './linter.aspect';\nimport { LinterService } from './linter.service';\nimport { LintTask } from './lint.task';\nimport { LintCmd } from './lint.cmd';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LinterConfig = {\n /**\n * extension formats to lint.\n */\n extensionFormats: string[];\n fixTypes?: FixTypes;\n};\n\nexport class LinterMain {\n static runtime = MainRuntime;\n\n constructor(private envs: EnvsMain, private linterService: LinterService) {}\n\n /**\n * lint an array of components.\n */\n async lint(components: Component[], opts: LinterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const lintResults = envsRuntime.run(this.linterService, opts);\n return lintResults;\n }\n\n /**\n * create a lint task for build pipelines.\n * @param name name of the task.\n */\n createTask(name?: string): LintTask {\n return new LintTask(LinterAspect.id, name);\n }\n\n static dependencies = [EnvsAspect, CLIAspect, ComponentAspect, LoggerAspect, WorkspaceAspect];\n\n static defaultConfig: LinterConfig = {\n extensionFormats: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],\n fixTypes: ['layout', 'problem', 'suggestion'],\n };\n\n static async provider(\n [envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace],\n config: LinterConfig\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const logger = loggerAspect.createLogger(LinterAspect.id);\n const linterService = new LinterService(config);\n const linterAspect = new LinterMain(envs, linterService);\n envs.registerService(linterService);\n cli.register(new LintCmd(linterAspect, component.getHost(), workspace));\n\n return linterAspect;\n }\n}\n\nLinterAspect.addRuntime(LinterMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA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C,sBAAzC,EAAuDC,4BAAvD,C;gCAtBXnC,U,mBAwB0B;EACnCoC,gBAAgB,EAAE,CAAC,KAAD,EAAQ,MAAR,EAAgB,KAAhB,EAAuB,MAAvB,EAA+B,MAA/B,CADiB;EAEnCC,QAAQ,EAAE,CAAC,QAAD,EAAW,SAAX,EAAsB,YAAtB;AAFyB,C;;AAoBvCvB,sBAAA,CAAawB,UAAb,CAAwBtC,UAAxB"}
1
+ {"version":3,"names":["LinterMain","constructor","envs","linterService","lint","components","opts","envsRuntime","createEnvironment","lintResults","run","createTask","name","LintTask","LinterAspect","id","provider","cli","component","loggerAspect","workspace","config","logger","createLogger","LinterService","path","linterAspect","registerService","register","LintCmd","getHost","MainRuntime","EnvsAspect","CLIAspect","ComponentAspect","LoggerAspect","WorkspaceAspect","extensionFormats","fixTypes","addRuntime"],"sources":["linter.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Component, ComponentAspect, ComponentMain } from '@teambit/component';\nimport { EnvsAspect, EnvsMain } from '@teambit/envs';\nimport { LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport { LinterAspect } from './linter.aspect';\nimport { LinterService } from './linter.service';\nimport { LintTask } from './lint.task';\nimport { LintCmd } from './lint.cmd';\nimport { FixTypes, LinterOptions } from './linter-context';\n\nexport type LinterConfig = {\n /**\n * extension formats to lint.\n */\n extensionFormats: string[];\n fixTypes?: FixTypes;\n};\n\nexport class LinterMain {\n static runtime = MainRuntime;\n\n constructor(private envs: EnvsMain, private linterService: LinterService) {}\n\n /**\n * lint an array of components.\n */\n async lint(components: Component[], opts: LinterOptions) {\n const envsRuntime = await this.envs.createEnvironment(components);\n const lintResults = envsRuntime.run(this.linterService, opts);\n return lintResults;\n }\n\n /**\n * create a lint task for build pipelines.\n * @param name name of the task.\n */\n createTask(name?: string): LintTask {\n return new LintTask(LinterAspect.id, name);\n }\n\n static dependencies = [EnvsAspect, CLIAspect, ComponentAspect, LoggerAspect, WorkspaceAspect];\n\n static defaultConfig: LinterConfig = {\n extensionFormats: ['.ts', '.tsx', '.js', '.jsx', '.mjs'],\n fixTypes: ['layout', 'problem', 'suggestion'],\n };\n\n static async provider(\n [envs, cli, component, loggerAspect, workspace]: [EnvsMain, CLIMain, ComponentMain, LoggerMain, Workspace],\n config: LinterConfig\n ) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const logger = loggerAspect.createLogger(LinterAspect.id);\n const linterService = new LinterService(config, workspace?.path);\n const linterAspect = new LinterMain(envs, linterService);\n envs.registerService(linterService);\n cli.register(new LintCmd(linterAspect, component.getHost(), workspace));\n\n return linterAspect;\n }\n}\n\nLinterAspect.addRuntime(LinterMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAWO,MAAMA,UAAN,CAAiB;EAGtBC,WAAW,CAASC,IAAT,EAAiCC,aAAjC,EAA+D;IAAA,KAAtDD,IAAsD,GAAtDA,IAAsD;IAAA,KAA9BC,aAA8B,GAA9BA,aAA8B;EAAE;EAE5E;AACF;AACA;;;EACY,MAAJC,IAAI,CAACC,UAAD,EAA0BC,IAA1B,EAA+C;IACvD,MAAMC,WAAW,GAAG,MAAM,KAAKL,IAAL,CAAUM,iBAAV,CAA4BH,UAA5B,CAA1B;IACA,MAA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} from './linter-context';
5
5
  import { LinterConfig } from './linter.main.runtime';
6
6
  export declare class LinterService implements EnvService<LintResults> {
7
7
  private linterConfig;
8
+ private rootDir?;
8
9
  name: string;
9
- constructor(linterConfig: LinterConfig);
10
+ constructor(linterConfig: LinterConfig, rootDir?: string | undefined);
10
11
  run(context: ExecutionContext, options: LinterOptions): Promise<LintResults>;
11
12
  private optionsWithDefaults;
12
13
  private mergeContext;
@@ -60,8 +60,9 @@ function _cliHighlight() {
60
60
  }
61
61
 
62
62
  class LinterService {
63
- constructor(linterConfig) {
63
+ constructor(linterConfig, rootDir) {
64
64
  this.linterConfig = linterConfig;
65
+ this.rootDir = rootDir;
65
66
  (0, _defineProperty2().default)(this, "name", 'linter');
66
67
  }
67
68
 
@@ -79,6 +80,7 @@ class LinterService {
79
80
 
80
81
  mergeContext(options, context) {
81
82
  const linterContext = Object.assign({}, {
83
+ rootDir: this.rootDir,
82
84
  quiet: false,
83
85
  extensionFormats: options.extensionFormats,
84
86
  fixTypes: options.fixTypes,
@@ -1 +1 @@
1
- {"version":3,"names":["LinterService","constructor","linterConfig","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","env","getLinter","results","lint","defaults","Object","assign","quiet","extensionFormats","fixTypes","fix","render","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","undefined","icon","displayConfig"],"sources":["linter.service.tsx"],"sourcesContent":["import React from 'react';\nimport { defaults } from 'lodash';\nimport { EnvService, ExecutionContext, EnvDefinition } from '@teambit/envs';\nimport { Text, Newline } from 'ink';\nimport highlight from 'cli-highlight';\nimport { Linter, LintResults } from './linter';\nimport { LinterContext, LinterOptions } from './linter-context';\nimport { LinterConfig } from './linter.main.runtime';\n\nexport class LinterService implements EnvService<LintResults> {\n name = 'linter';\n\n constructor(private linterConfig: LinterConfig) {}\n\n async run(context: ExecutionContext, options: LinterOptions): Promise<LintResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter: Linter = context.env.getLinter(linterContext);\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n private optionsWithDefaults(options: LinterOptions): LinterOptions {\n return defaults(options, this.linterConfig);\n }\n\n private mergeContext(options: LinterOptions, context?: ExecutionContext): LinterContext {\n const linterContext: LinterContext = Object.assign(\n {},\n {\n quiet: false,\n extensionFormats: options.extensionFormats,\n fixTypes: options.fixTypes,\n fix: options.fix,\n },\n context\n );\n return linterContext;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured linter: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">linter config:</Text>\n <Newline />\n <Text>\n {descriptor?.config && highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\n );\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getLinter) return undefined;\n const mergedOpts = this.optionsWithDefaults({});\n const linterContext = this.mergeContext(mergedOpts);\n const linter = env.env.getLinter(linterContext);\n\n return {\n id: linter.id,\n icon: linter.icon,\n config: linter.displayConfig ? linter.displayConfig() : undefined,\n version: linter.version ? linter.version() : '?',\n displayName: linter.displayName ? linter.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKO,MAAMA,aAAN,CAAuD;EAG5DC,WAAW,CAASC,YAAT,EAAqC;IAAA,KAA5BA,YAA4B,GAA5BA,YAA4B;IAAA,8CAFzC,QAEyC;EAAE;;EAEzC,MAAHC,GAAG,CAACC,OAAD,EAA4BC,OAA5B,EAA0E;IACjF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,+BAAC,cAAD,OAPF,eAQE,+BAAC,WAAD,QACG,CAAAJ,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEK,MAAZ,KAAsB,IAAAC,uBAAA,EAAUN,UAAV,aAAUA,UAAV,uBAAUA,UAAU,CAAEK,MAAtB,EAA8B;MAAEE,QAAQ,EAAE,YAAZ;MAA0BC,cAAc,EAAE;IAA1C,CAA9B,CADzB,CARF,eAWE,+BAAC,cAAD,OAXF,CADF;EAeD;;EAEDP,aAAa,CAACb,GAAD,EAAqB;IAChC,IAAI,CAACA,GAAG,CAACA,GAAJ,CAAQC,SAAb,EAAwB,OAAOoB,SAAP;IACxB,MAAM1B,UAAU,GAAG,KAAKC,mBAAL,CAAyB,EAAzB,CAAnB;IACA,MAAMC,aAAa,GAAG,KAAKC,YAAL,CAAkBH,UAAlB,CAAtB;IACA,MAAMI,MAAM,GAAGC,GAAG,CAACA,GAAJ,CAAQC,SAAR,CAAkBJ,aAAlB,CAAf;IAEA,OAAO;MACLiB,EAAE,EAAEf,MAAM,CAACe,EADN;MAELQ,IAAI,EAAEvB,MAAM,CAACuB,IAFR;MAGLL,MAAM,EAAElB,MAAM,CAACwB,aAAP,GAAuBxB,MAAM,CAACwB,aAAP,EAAvB,GAAgDF,SAHnD;MAILL,OAAO,EAAEjB,MAAM,CAACiB,OAAP,GAAiBjB,MAAM,CAACiB,OAAP,EAAjB,GAAoC,GAJxC;MAKLD,WAAW,EAAEhB,MAAM,CAACgB,WAAP,GAAqBhB,MAAM,CAACgB,WAA5B,GAA0C;IALlD,CAAP;EAOD;;AAjE2D"}
1
+ {"version":3,"names":["LinterService","constructor","linterConfig","rootDir","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","env","getLinter","results","lint","defaults","Object","assign","quiet","extensionFormats","fixTypes","fix","render","descriptor","getDescriptor","id","displayName","version","config","highlight","language","ignoreIllegals","undefined","icon","displayConfig"],"sources":["linter.service.tsx"],"sourcesContent":["import React from 'react';\nimport { defaults } from 'lodash';\nimport { EnvService, ExecutionContext, EnvDefinition } from '@teambit/envs';\nimport { Text, Newline } from 'ink';\nimport highlight from 'cli-highlight';\nimport { Linter, LintResults } from './linter';\nimport { LinterContext, LinterOptions } from './linter-context';\nimport { LinterConfig } from './linter.main.runtime';\n\nexport class LinterService implements EnvService<LintResults> {\n name = 'linter';\n\n constructor(private linterConfig: LinterConfig, private rootDir?: string) {}\n\n async run(context: ExecutionContext, options: LinterOptions): Promise<LintResults> {\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter: Linter = context.env.getLinter(linterContext);\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n private optionsWithDefaults(options: LinterOptions): LinterOptions {\n return defaults(options, this.linterConfig);\n }\n\n private mergeContext(options: LinterOptions, context?: ExecutionContext): LinterContext {\n const linterContext: LinterContext = Object.assign(\n {},\n {\n rootDir: this.rootDir,\n quiet: false,\n extensionFormats: options.extensionFormats,\n fixTypes: options.fixTypes,\n fix: options.fix,\n },\n context\n );\n return linterContext;\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n\n return (\n <Text key={descriptor?.id}>\n <Text color=\"cyan\">configured linter: </Text>\n <Text>\n {descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})\n </Text>\n <Newline />\n <Text color=\"cyan\">linter config:</Text>\n <Newline />\n <Text>\n {descriptor?.config && highlight(descriptor?.config, { language: 'javascript', ignoreIllegals: true })}\n </Text>\n <Newline />\n </Text>\n );\n }\n\n getDescriptor(env: EnvDefinition) {\n if (!env.env.getLinter) return undefined;\n const mergedOpts = this.optionsWithDefaults({});\n const linterContext = this.mergeContext(mergedOpts);\n const linter = env.env.getLinter(linterContext);\n\n return {\n id: linter.id,\n icon: linter.icon,\n config: linter.displayConfig ? linter.displayConfig() : undefined,\n version: linter.version ? linter.version() : '?',\n displayName: linter.displayName ? linter.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;;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CAACwB,aAAP,EAAvB,GAAgDF,SAHnD;MAILL,OAAO,EAAEjB,MAAM,CAACiB,OAAP,GAAiBjB,MAAM,CAACiB,OAAP,EAAjB,GAAoC,GAJxC;MAKLD,WAAW,EAAEhB,MAAM,CAACgB,WAAP,GAAqBhB,MAAM,CAACgB,WAA5B,GAA0C;IALlD,CAAP;EAOD;;AAlE2D"}
@@ -10,7 +10,7 @@ import { LinterConfig } from './linter.main.runtime';
10
10
  export class LinterService implements EnvService<LintResults> {
11
11
  name = 'linter';
12
12
 
13
- constructor(private linterConfig: LinterConfig) {}
13
+ constructor(private linterConfig: LinterConfig, private rootDir?: string) {}
14
14
 
15
15
  async run(context: ExecutionContext, options: LinterOptions): Promise<LintResults> {
16
16
  const mergedOpts = this.optionsWithDefaults(options);
@@ -29,6 +29,7 @@ export class LinterService implements EnvService<LintResults> {
29
29
  const linterContext: LinterContext = Object.assign(
30
30
  {},
31
31
  {
32
+ rootDir: this.rootDir,
32
33
  quiet: false,
33
34
  extensionFormats: options.extensionFormats,
34
35
  fixTypes: options.fixTypes,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/linter",
3
- "version": "0.0.857",
3
+ "version": "0.0.859",
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.857"
9
+ "version": "0.0.859"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -17,12 +17,12 @@
17
17
  "@babel/runtime": "7.12.18",
18
18
  "core-js": "^3.0.0",
19
19
  "@teambit/harmony": "0.3.3",
20
- "@teambit/cli": "0.0.569",
21
- "@teambit/component": "0.0.857",
22
- "@teambit/envs": "0.0.857",
23
- "@teambit/workspace": "0.0.857",
24
- "@teambit/builder": "0.0.857",
25
- "@teambit/logger": "0.0.662"
20
+ "@teambit/cli": "0.0.571",
21
+ "@teambit/component": "0.0.859",
22
+ "@teambit/envs": "0.0.859",
23
+ "@teambit/workspace": "0.0.859",
24
+ "@teambit/builder": "0.0.859",
25
+ "@teambit/logger": "0.0.664"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/lodash": "4.14.165",
@@ -35,7 +35,7 @@
35
35
  "@teambit/defender.content.linter-overview": "1.95.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@teambit/legacy": "1.0.350",
38
+ "@teambit/legacy": "1.0.351",
39
39
  "react-dom": "^16.8.0 || ^17.0.0",
40
40
  "react": "^16.8.0 || ^17.0.0"
41
41
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.857/dist/linter.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.857/dist/linter.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.859/dist/linter.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_linter@0.0.859/dist/linter.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];