@teambit/linter 0.0.0-d832662ffc0a6d6a39363696844803cce0c5ed18 → 0.0.0-dec3f217ee4e567e1cade41605b6de2489f2feda
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/linter.d.ts
CHANGED
@@ -145,7 +145,7 @@ export interface Linter {
|
|
145
145
|
/**
|
146
146
|
* returns the version of the current linter instance (e.g. '4.0.1').
|
147
147
|
*/
|
148
|
-
version?(): string
|
148
|
+
version?(): string | Promise<string>;
|
149
149
|
/**
|
150
150
|
* returns the display name of the current linter instance (e.g. 'ESlint')
|
151
151
|
*/
|
package/dist/linter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import type { BuildContext } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport type { 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 * whether the component is clean (have no issues at all)\n */\n isClean: boolean;\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 /**\n * whether all the linted components is clean (have no issues at all)\n */\n isClean?: boolean;\n\n errors: Error[];\n};\n\nexport interface Linter {\n id: string;\n /**\n * serialized config of the linter.\n */\n displayConfig?(): string;\n\n /**\n * returns the version of the current linter instance (e.g. '4.0.1').\n */\n version?(): string
|
1
|
+
{"version":3,"names":[],"sources":["linter.ts"],"sourcesContent":["import type { BuildContext } from '@teambit/builder';\nimport type { Component } from '@teambit/component';\nimport type { 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 * whether the component is clean (have no issues at all)\n */\n isClean: boolean;\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 /**\n * whether all the linted components is clean (have no issues at all)\n */\n isClean?: boolean;\n\n errors: Error[];\n};\n\nexport interface Linter {\n id: string;\n /**\n * serialized config of the linter.\n */\n displayConfig?(): string;\n\n /**\n * returns the version of the current linter instance (e.g. '4.0.1').\n */\n version?(): string | Promise<string>;\n\n /**\n * returns the display name of the current linter instance (e.g. 'ESlint')\n */\n displayName?: string;\n\n /**\n * lint the given component.\n */\n lint(context: LinterContext, buildContext?: BuildContext): Promise<LintResults>;\n}\n"],"mappings":"","ignoreList":[]}
|
package/dist/linter.service.d.ts
CHANGED
@@ -16,14 +16,14 @@ export declare class LinterService implements EnvService<LintResults> {
|
|
16
16
|
private optionsWithDefaults;
|
17
17
|
private mergeContext;
|
18
18
|
private getComponentsDirectory;
|
19
|
-
render(env: EnvDefinition): string
|
19
|
+
render(env: EnvDefinition): Promise<string>;
|
20
20
|
transform(env: Env, context: EnvContext): LinterTransformationMap | undefined;
|
21
|
-
getDescriptor(env: EnvDefinition): {
|
21
|
+
getDescriptor(env: EnvDefinition): Promise<{
|
22
22
|
id: any;
|
23
23
|
icon: any;
|
24
24
|
config: any;
|
25
25
|
version: any;
|
26
26
|
displayName: any;
|
27
|
-
} | undefined
|
27
|
+
} | undefined>;
|
28
28
|
}
|
29
29
|
export {};
|
package/dist/linter.service.js
CHANGED
@@ -84,8 +84,8 @@ class LinterService {
|
|
84
84
|
relative: true
|
85
85
|
}));
|
86
86
|
}
|
87
|
-
render(env) {
|
88
|
-
const descriptor = this.getDescriptor(env);
|
87
|
+
async render(env) {
|
88
|
+
const descriptor = await this.getDescriptor(env);
|
89
89
|
const name = `${_chalk().default.green('configured linter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${descriptor?.version})`;
|
90
90
|
const configLabel = _chalk().default.green('linter config:');
|
91
91
|
const configObj = descriptor?.config ? (0, _cliHighlight().default)(descriptor?.config, {
|
@@ -101,7 +101,7 @@ class LinterService {
|
|
101
101
|
getLinter: () => env.linter()(context)
|
102
102
|
};
|
103
103
|
}
|
104
|
-
getDescriptor(env) {
|
104
|
+
async getDescriptor(env) {
|
105
105
|
if (!env.env.getLinter) return undefined;
|
106
106
|
const mergedOpts = this.optionsWithDefaults({});
|
107
107
|
const linterContext = this.mergeContext(mergedOpts);
|
@@ -110,7 +110,7 @@ class LinterService {
|
|
110
110
|
id: linter.id,
|
111
111
|
icon: linter.icon,
|
112
112
|
config: linter.displayConfig ? linter.displayConfig() : undefined,
|
113
|
-
version: linter.version ? linter.version() : '?',
|
113
|
+
version: linter.version ? await linter.version() : '?',
|
114
114
|
displayName: linter.displayName ? linter.displayName : '?'
|
115
115
|
};
|
116
116
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_component","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterService","constructor","linterConfig","workspace","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","getLinter","results","errors","lint","env","undefined","defaults","componentsDirMap","components","getComponentsDirectory","ComponentMap","create","assign","rootDir","path","quiet","extensionFormats","fixTypes","fix","as","component","componentDir","id","relative","render","descriptor","getDescriptor","name","chalk","green","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","icon","displayConfig","exports"],"sources":["linter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport type {\n EnvService,\n ExecutionContext,\n EnvDefinition,\n ServiceTransformationMap,\n EnvContext,\n Env,\n} from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport highlight from 'cli-highlight';\nimport type { Component } from '@teambit/component';\nimport { ComponentMap } from '@teambit/component';\nimport type { Linter, LintResults } from './linter';\nimport type { LinterContext, LinterOptions } from './linter-context';\nimport type { LinterConfig } from './linter.main.runtime';\n\ntype LinterTransformationMap = ServiceTransformationMap & {\n getLinter: () => Linter;\n};\n\nexport class LinterService implements EnvService<LintResults> {\n name = 'linter';\n\n constructor(\n private linterConfig: LinterConfig,\n private workspace: Workspace\n ) {}\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 = this.getLinter(context, options);\n if (!linter) {\n return {\n results: [],\n errors: [],\n };\n }\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n getLinter(context: ExecutionContext, options: LinterOptions): Linter | undefined {\n if (!context.env.getLinter) {\n return undefined;\n }\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter: Linter = context.env.getLinter(linterContext);\n return linter;\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 componentsDirMap = context?.components\n ? this.getComponentsDirectory(context.components)\n : ComponentMap.create<string>([]);\n const linterContext: LinterContext = Object.assign(\n {},\n {\n rootDir: this.workspace?.path,\n quiet: false,\n extensionFormats: options.extensionFormats,\n fixTypes: options.fixTypes,\n fix: options.fix,\n componentsDirMap,\n },\n context\n );\n return linterContext;\n }\n\n private getComponentsDirectory(components: Component[]): ComponentMap<string> {\n return ComponentMap.as<string>(components, (component) =>\n this.workspace.componentDir(component.id, undefined, { relative: true })\n );\n }\n\n render(env: EnvDefinition) {\n const descriptor = this.getDescriptor(env);\n const name = `${chalk.green('configured linter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('linter config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): LinterTransformationMap | undefined {\n // Old env\n if (!env?.linter) return undefined;\n return {\n getLinter: () => env.linter()(context),\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,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkD,SAAAC,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,C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GAAGN,OAAO,CAACW,GAAG,CAACJ,SAAS,CAACH,aAAa,CAAC;IAC3D,OAAOE,MAAM;EACf;EAEQH,mBAAmBA,CAACF,OAAsB,EAAiB;IACjE,OAAO,IAAAY,kBAAQ,EAACZ,OAAO,EAAE,IAAI,CAACJ,YAAY,CAAC;EAC7C;EAEQQ,YAAYA,CAACJ,OAAsB,EAAED,OAA0B,EAAiB;IACtF,MAAMc,gBAAgB,GAAGd,OAAO,EAAEe,UAAU,GACxC,IAAI,CAACC,sBAAsB,CAAChB,OAAO,CAACe,UAAU,CAAC,GAC/CE,yBAAY,CAACC,MAAM,CAAS,EAAE,CAAC;IACnC,MAAMd,aAA4B,GAAGvB,MAAM,CAACsC,MAAM,CAChD,CAAC,CAAC,EACF;MACEC,OAAO,EAAE,IAAI,CAACtB,SAAS,EAAEuB,IAAI;MAC7BC,KAAK,EAAE,KAAK;MACZC,gBAAgB,EAAEtB,OAAO,CAACsB,gBAAgB;MAC1CC,QAAQ,EAAEvB,OAAO,CAACuB,QAAQ;MAC1BC,GAAG,EAAExB,OAAO,CAACwB,GAAG;MAChBX;IACF,CAAC,EACDd,OACF,CAAC;IACD,OAAOI,aAAa;EACtB;EAEQY,sBAAsBA,CAACD,UAAuB,EAAwB;IAC5E,OAAOE,yBAAY,CAACS,EAAE,CAASX,UAAU,EAAGY,SAAS,IACnD,IAAI,CAAC7B,SAAS,CAAC8B,YAAY,CAACD,SAAS,CAACE,EAAE,EAAEjB,SAAS,EAAE;MAAEkB,QAAQ,EAAE;IAAK,CAAC,CACzE,CAAC;EACH;
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_cliHighlight","_component","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LinterService","constructor","linterConfig","workspace","run","context","options","mergedOpts","optionsWithDefaults","linterContext","mergeContext","linter","getLinter","results","errors","lint","env","undefined","defaults","componentsDirMap","components","getComponentsDirectory","ComponentMap","create","assign","rootDir","path","quiet","extensionFormats","fixTypes","fix","as","component","componentDir","id","relative","render","descriptor","getDescriptor","name","chalk","green","displayName","version","configLabel","configObj","config","highlight","language","ignoreIllegals","transform","icon","displayConfig","exports"],"sources":["linter.service.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { defaults } from 'lodash';\nimport type {\n EnvService,\n ExecutionContext,\n EnvDefinition,\n ServiceTransformationMap,\n EnvContext,\n Env,\n} from '@teambit/envs';\nimport type { Workspace } from '@teambit/workspace';\nimport highlight from 'cli-highlight';\nimport type { Component } from '@teambit/component';\nimport { ComponentMap } from '@teambit/component';\nimport type { Linter, LintResults } from './linter';\nimport type { LinterContext, LinterOptions } from './linter-context';\nimport type { LinterConfig } from './linter.main.runtime';\n\ntype LinterTransformationMap = ServiceTransformationMap & {\n getLinter: () => Linter;\n};\n\nexport class LinterService implements EnvService<LintResults> {\n name = 'linter';\n\n constructor(\n private linterConfig: LinterConfig,\n private workspace: Workspace\n ) {}\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 = this.getLinter(context, options);\n if (!linter) {\n return {\n results: [],\n errors: [],\n };\n }\n\n const results = await linter.lint(linterContext);\n return results;\n }\n\n getLinter(context: ExecutionContext, options: LinterOptions): Linter | undefined {\n if (!context.env.getLinter) {\n return undefined;\n }\n const mergedOpts = this.optionsWithDefaults(options);\n const linterContext = this.mergeContext(mergedOpts, context);\n const linter: Linter = context.env.getLinter(linterContext);\n return linter;\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 componentsDirMap = context?.components\n ? this.getComponentsDirectory(context.components)\n : ComponentMap.create<string>([]);\n const linterContext: LinterContext = Object.assign(\n {},\n {\n rootDir: this.workspace?.path,\n quiet: false,\n extensionFormats: options.extensionFormats,\n fixTypes: options.fixTypes,\n fix: options.fix,\n componentsDirMap,\n },\n context\n );\n return linterContext;\n }\n\n private getComponentsDirectory(components: Component[]): ComponentMap<string> {\n return ComponentMap.as<string>(components, (component) =>\n this.workspace.componentDir(component.id, undefined, { relative: true })\n );\n }\n\n async render(env: EnvDefinition) {\n const descriptor = await this.getDescriptor(env);\n const name = `${chalk.green('configured linter:')} ${descriptor?.id} (${descriptor?.displayName} @ ${\n descriptor?.version\n })`;\n const configLabel = chalk.green('linter config:');\n const configObj = descriptor?.config\n ? highlight(descriptor?.config, { language: 'json', ignoreIllegals: true })\n : '';\n return `${name}\\n${configLabel}\\n${configObj}`;\n }\n\n transform(env: Env, context: EnvContext): LinterTransformationMap | undefined {\n // Old env\n if (!env?.linter) return undefined;\n return {\n getLinter: () => env.linter()(context),\n };\n }\n\n async 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 ? await linter.version() : '?',\n displayName: linter.displayName ? linter.displayName : '?',\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;A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AACA,GAAG,CAACA,GAAG,CAACJ,SAAS,EAAE,OAAOK,SAAS;IACxC,MAAMV,UAAU,GAAG,IAAI,CAACC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC/C,MAAMC,aAAa,GAAG,IAAI,CAACC,YAAY,CAACH,UAAU,CAAC;IACnD,MAAMI,MAAM,GAAGK,GAAG,CAACA,GAAG,CAACJ,SAAS,CAACH,aAAa,CAAC;IAE/C,OAAO;MACLyB,EAAE,EAAEvB,MAAM,CAACuB,EAAE;MACbiB,IAAI,EAAExC,MAAM,CAACwC,IAAI;MACjBL,MAAM,EAAEnC,MAAM,CAACyC,aAAa,GAAGzC,MAAM,CAACyC,aAAa,CAAC,CAAC,GAAGnC,SAAS;MACjE0B,OAAO,EAAEhC,MAAM,CAACgC,OAAO,GAAG,MAAMhC,MAAM,CAACgC,OAAO,CAAC,CAAC,GAAG,GAAG;MACtDD,WAAW,EAAE/B,MAAM,CAAC+B,WAAW,GAAG/B,MAAM,CAAC+B,WAAW,GAAG;IACzD,CAAC;EACH;AACF;AAACW,OAAA,CAAArD,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@dec3f217ee4e567e1cade41605b6de2489f2feda/dist/linter.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.defender_linter@dec3f217ee4e567e1cade41605b6de2489f2feda/dist/linter.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/linter",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-dec3f217ee4e567e1cade41605b6de2489f2feda",
|
4
4
|
"homepage": "https://bit.cloud/teambit/defender/linter",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.defender",
|
8
8
|
"name": "linter",
|
9
|
-
"version": "
|
9
|
+
"version": "dec3f217ee4e567e1cade41605b6de2489f2feda"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "4.1.2",
|
13
13
|
"lodash": "4.17.21",
|
14
14
|
"graphql-tag": "2.12.1",
|
15
15
|
"cli-highlight": "2.1.9",
|
16
|
-
"@teambit/
|
17
|
-
"@teambit/
|
16
|
+
"@teambit/cli": "0.0.1268",
|
17
|
+
"@teambit/legacy.constants": "0.0.15",
|
18
|
+
"@teambit/toolbox.time.timer": "0.0.6",
|
18
19
|
"@teambit/harmony": "0.4.7",
|
19
|
-
"@teambit/
|
20
|
-
"@teambit/component": "0.0.0-
|
21
|
-
"@teambit/envs": "0.0.0-
|
22
|
-
"@teambit/workspace": "0.0.0-
|
23
|
-
"@teambit/builder": "0.0.0-
|
24
|
-
"@teambit/isolator": "0.0.0-
|
25
|
-
"@teambit/logger": "0.0.0-1b255d990bc9ddce8eb94deb3e304cc996c6124d"
|
20
|
+
"@teambit/logger": "0.0.1361",
|
21
|
+
"@teambit/component": "0.0.0-49a53d1a573a9dc4d1b328f821e23fe9ada004a1",
|
22
|
+
"@teambit/envs": "0.0.0-28f3c29f809c1dc4f184e00a339886987fcd9efc",
|
23
|
+
"@teambit/workspace": "0.0.0-9f3c344a06d5266c74b1c3a1aafbd03142cd1dcb",
|
24
|
+
"@teambit/builder": "0.0.0-77f85abe7186ede5cdf0c414f0c403efd9814200",
|
25
|
+
"@teambit/isolator": "0.0.0-9f4029b819a1b6b73e00687bc930f0176bbd1cdd"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@types/lodash": "4.14.165",
|
29
29
|
"@types/mocha": "9.1.0",
|
30
30
|
"@teambit/defender.content.linter-overview": "1.95.0",
|
31
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
31
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.77"
|
32
32
|
},
|
33
33
|
"peerDependencies": {
|
34
34
|
"react": "^17.0.0 || ^18.0.0",
|