@teambit/eslint 0.0.1103 → 0.0.1105

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.
@@ -1,8 +1,7 @@
1
1
  import { Linter, LinterContext, LintResults } from '@teambit/linter';
2
2
  import { Logger } from '@teambit/logger';
3
3
  import { ESLintOptions } from './eslint.main.runtime';
4
- import { EslintLinterInterface } from './eslint-linter-interface';
5
- export declare class ESLintLinter implements EslintLinterInterface, Linter {
4
+ export declare class ESLintLinter implements Linter {
6
5
  private logger;
7
6
  private options;
8
7
  /**
@@ -16,10 +15,6 @@ export declare class ESLintLinter implements EslintLinterInterface, Linter {
16
15
  ESLint?: any);
17
16
  id: string;
18
17
  displayName: string;
19
- generateIdeConfig(): {
20
- eslintConfig: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>;
21
- tsconfig: Record<string, any> | undefined;
22
- };
23
18
  displayConfig(): string;
24
19
  lint(context: LinterContext): Promise<LintResults>;
25
20
  private createTempTsConfigFile;
@@ -70,12 +70,6 @@ class ESLintLinter {
70
70
  (0, _defineProperty2().default)(this, "id", 'eslint-linter');
71
71
  (0, _defineProperty2().default)(this, "displayName", 'ESlint');
72
72
  }
73
- generateIdeConfig() {
74
- return {
75
- eslintConfig: this.options.config.overrideConfig || {},
76
- tsconfig: this.options.tsConfig
77
- };
78
- }
79
73
  displayConfig() {
80
74
  return JSON.stringify(this.options, null, 2);
81
75
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ESLintLinter","constructor","logger","options","ESLint","generateIdeConfig","eslintConfig","config","overrideConfig","tsconfig","tsConfig","displayConfig","JSON","stringify","lint","context","longProcessLogger","createLongProcessLogger","components","length","eslint","createEslint","rootDir","tsConfigPath","createTempTsConfigFile","componentsDirMap","envRuntime","id","parserOptions","project","resultsP","mapSeries","component","logProgress","toString","filesystem","files","filesP","map","file","extensions","includes","extname","undefined","path","compact","Promise","all","lintResults","lintFiles","fix","ESLintLib","outputFixes","results","flatten","formatter","loadFormatter","output","format","totalErrorCount","totalFatalErrorCount","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","componentsResults","computeComponentResultsWithTotals","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","computeManyComponentsTotals","errors","componentDirMap","envId","newTsConfig","compDirs","toArray","compDir","include","includedPath","exclude","excludedPath","cacheDir","getCacheDir","hash","objectHash","tempTsConfigPath","join","fs","existsSync","outputJSONSync","spaces","result","errorCount","fatalErrorCount","fixableErrorCount","fixableWarningCount","warningCount","filePath","messages","raw","forEach","ESLintModule","version"],"sources":["eslint.linter.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { flatten, compact } from 'lodash';\nimport { Linter, LinterContext, LintResults, ComponentLintResult } from '@teambit/linter';\nimport { ESLint as ESLintLib } from 'eslint';\nimport mapSeries from 'p-map-series';\nimport objectHash from 'object-hash';\nimport { ComponentMap } from '@teambit/component';\nimport { Logger } from '@teambit/logger';\nimport { ESLintOptions } from './eslint.main.runtime';\nimport { EslintLinterInterface } from './eslint-linter-interface';\n\nexport class ESLintLinter implements EslintLinterInterface, Linter {\n constructor(\n private logger: Logger,\n\n private options: ESLintOptions,\n\n /**\n * reference to the eslint module.\n */\n private ESLint?: any\n ) {}\n\n id = 'eslint-linter';\n displayName = 'ESlint';\n\n generateIdeConfig() {\n return {\n eslintConfig: this.options.config.overrideConfig || {},\n tsconfig: this.options.tsConfig,\n };\n }\n\n displayConfig() {\n return JSON.stringify(this.options, null, 2);\n }\n\n async lint(context: LinterContext): Promise<LintResults> {\n const longProcessLogger = this.logger.createLongProcessLogger('linting components', context.components.length);\n const eslint = this.createEslint(this.options.config, this.ESLint);\n if (this.options.tsConfig && context.rootDir) {\n const tsConfigPath = this.createTempTsConfigFile(\n context.rootDir,\n context.componentsDirMap,\n context.envRuntime.id,\n this.options.tsConfig\n );\n if (this.options?.config?.overrideConfig?.parserOptions) {\n this.options.config.overrideConfig.parserOptions.project = tsConfigPath;\n }\n }\n const resultsP = mapSeries(context.components, async (component) => {\n longProcessLogger.logProgress(\n `component: ${component.id.toString()}, # of files: ${component.filesystem.files.length}`\n );\n const filesP = component.filesystem.files.map(async (file) => {\n // TODO: now that we moved to lint files, maybe it's not required anymore\n // The eslint api will not ignore extensions by default when using lintText, so we do it manually\n if (!this.options.extensions?.includes(file.extname)) return undefined;\n return file.path;\n });\n\n const files = compact(await Promise.all(filesP));\n const lintResults = await eslint.lintFiles(files);\n\n if (eslint && this.options.config.fix && lintResults) {\n await ESLintLib.outputFixes(lintResults);\n }\n\n const results: ESLintLib.LintResult[] = compact(flatten(lintResults));\n const formatter = await eslint.loadFormatter(this.options.formatter || 'stylish');\n const output = formatter.format(results);\n const {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n } = this.computeComponentResultsWithTotals(results);\n\n return {\n component,\n output,\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n results: componentsResults,\n };\n });\n\n const results = (await resultsP) as any as ComponentLintResult[];\n const {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n } = this.computeManyComponentsTotals(results);\n\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n results,\n errors: [],\n };\n }\n\n private createTempTsConfigFile(\n rootDir: string,\n componentDirMap: ComponentMap<string>,\n envId: string,\n tsConfig: Record<string, any>\n ): string {\n const newTsConfig = {\n ...tsConfig,\n };\n const compDirs: string[] = componentDirMap.toArray().map(([, compDir]) => compDir);\n if (tsConfig.include) {\n newTsConfig.include = flatten(\n tsConfig.include.map((includedPath) => {\n return compDirs.map((compDir) => `../../${compDir}/${includedPath}`);\n })\n );\n }\n if (tsConfig.exclude) {\n newTsConfig.exclude = flatten(\n tsConfig.exclude.map((excludedPath) => {\n return compDirs.map((compDir) => `../../${compDir}/${excludedPath}`);\n })\n );\n }\n const cacheDir = getCacheDir(rootDir);\n const hash = objectHash(newTsConfig);\n // We save the tsconfig with hash here to avoid creating unnecessary tsconfig files\n // this is very important as eslint will be able to cache the tsconfig file and will not need to create another program\n // this affects performance dramatically\n const tempTsConfigPath = path.join(cacheDir, `bit.tsconfig.eslint.${hash}.json`);\n if (!fs.existsSync(tempTsConfigPath)) {\n fs.outputJSONSync(tempTsConfigPath, newTsConfig, { spaces: 2 });\n }\n return tempTsConfigPath;\n }\n\n private computeComponentResultsWithTotals(results: ESLintLib.LintResult[]) {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n const componentsResults = results.map((result) => {\n totalErrorCount += result.errorCount ?? 0;\n // @ts-ignore - missing from the @types/eslint lib\n totalFatalErrorCount += result.fatalErrorCount ?? 0;\n totalFixableErrorCount += result.fixableErrorCount ?? 0;\n totalFixableWarningCount += result.fixableWarningCount ?? 0;\n totalWarningCount += result.warningCount ?? 0;\n return {\n filePath: result.filePath,\n errorCount: result.errorCount,\n // @ts-ignore - missing from the @types/eslint lib\n fatalErrorCount: result.fatalErrorCount,\n fixableErrorCount: result.fixableErrorCount,\n fixableWarningCount: result.fixableWarningCount,\n warningCount: result.warningCount,\n messages: result.messages,\n raw: result,\n };\n });\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n };\n }\n\n private computeManyComponentsTotals(componentsResults: ComponentLintResult[]) {\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 componentsResults.forEach((result) => {\n if (result.totalErrorCount) {\n totalErrorCount += result.totalErrorCount;\n totalComponentsWithErrorCount += 1;\n }\n // @ts-ignore - missing from the @types/eslint lib\n if (result.totalFatalErrorCount) {\n totalFatalErrorCount += result.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += 1;\n }\n if (result.totalFixableErrorCount) {\n totalFixableErrorCount += result.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += 1;\n }\n if (result.totalFixableWarningCount) {\n totalFixableWarningCount += result.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += 1;\n }\n if (result.totalWarningCount) {\n totalWarningCount += result.totalWarningCount;\n totalComponentsWithWarningCount += 1;\n }\n });\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n };\n }\n\n /**\n * Create the eslint instance by options that was already merged with context\n * @param options\n * @param ESLintModule\n * @returns\n */\n private createEslint(options: ESLintLib.Options, ESLintModule?: any): ESLintLib {\n // eslint-disable-next-line no-new\n if (ESLintModule) new ESLintModule.ESLint(options);\n return new ESLintLib(options);\n }\n\n version() {\n if (this.ESLint) return this.ESLint.version;\n return ESLintLib.version;\n }\n}\n\nfunction getCacheDir(rootDir): string {\n return path.join(rootDir, 'node_modules', '.cache');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;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ructor","logger","options","ESLint","displayConfig","JSON","stringify","lint","context","longProcessLogger","createLongProcessLogger","components","length","eslint","createEslint","config","tsConfig","rootDir","tsConfigPath","createTempTsConfigFile","componentsDirMap","envRuntime","id","overrideConfig","parserOptions","project","resultsP","mapSeries","component","logProgress","toString","filesystem","files","filesP","map","file","extensions","includes","extname","undefined","path","compact","Promise","all","lintResults","lintFiles","fix","ESLintLib","outputFixes","results","flatten","formatter","loadFormatter","output","format","totalErrorCount","totalFatalErrorCount","totalFixableErrorCount","totalFixableWarningCount","totalWarningCount","componentsResults","computeComponentResultsWithTotals","totalComponentsWithErrorCount","totalComponentsWithFatalErrorCount","totalComponentsWithFixableErrorCount","totalComponentsWithFixableWarningCount","totalComponentsWithWarningCount","computeManyComponentsTotals","errors","componentDirMap","envId","newTsConfig","compDirs","toArray","compDir","include","includedPath","exclude","excludedPath","cacheDir","getCacheDir","hash","objectHash","tempTsConfigPath","join","fs","existsSync","outputJSONSync","spaces","result","errorCount","fatalErrorCount","fixableErrorCount","fixableWarningCount","warningCount","filePath","messages","raw","forEach","ESLintModule","version"],"sources":["eslint.linter.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport path from 'path';\nimport { flatten, compact } from 'lodash';\nimport { Linter, LinterContext, LintResults, ComponentLintResult } from '@teambit/linter';\nimport { ESLint as ESLintLib } from 'eslint';\nimport mapSeries from 'p-map-series';\nimport objectHash from 'object-hash';\nimport { ComponentMap } from '@teambit/component';\nimport { Logger } from '@teambit/logger';\nimport { ESLintOptions } from './eslint.main.runtime';\n\nexport class ESLintLinter implements Linter {\n constructor(\n private logger: Logger,\n\n private options: ESLintOptions,\n\n /**\n * reference to the eslint module.\n */\n private ESLint?: any\n ) {}\n\n id = 'eslint-linter';\n displayName = 'ESlint';\n\n displayConfig() {\n return JSON.stringify(this.options, null, 2);\n }\n\n async lint(context: LinterContext): Promise<LintResults> {\n const longProcessLogger = this.logger.createLongProcessLogger('linting components', context.components.length);\n const eslint = this.createEslint(this.options.config, this.ESLint);\n if (this.options.tsConfig && context.rootDir) {\n const tsConfigPath = this.createTempTsConfigFile(\n context.rootDir,\n context.componentsDirMap,\n context.envRuntime.id,\n this.options.tsConfig\n );\n if (this.options?.config?.overrideConfig?.parserOptions) {\n this.options.config.overrideConfig.parserOptions.project = tsConfigPath;\n }\n }\n const resultsP = mapSeries(context.components, async (component) => {\n longProcessLogger.logProgress(\n `component: ${component.id.toString()}, # of files: ${component.filesystem.files.length}`\n );\n const filesP = component.filesystem.files.map(async (file) => {\n // TODO: now that we moved to lint files, maybe it's not required anymore\n // The eslint api will not ignore extensions by default when using lintText, so we do it manually\n if (!this.options.extensions?.includes(file.extname)) return undefined;\n return file.path;\n });\n\n const files = compact(await Promise.all(filesP));\n const lintResults = await eslint.lintFiles(files);\n\n if (eslint && this.options.config.fix && lintResults) {\n await ESLintLib.outputFixes(lintResults);\n }\n\n const results: ESLintLib.LintResult[] = compact(flatten(lintResults));\n const formatter = await eslint.loadFormatter(this.options.formatter || 'stylish');\n const output = formatter.format(results);\n const {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n } = this.computeComponentResultsWithTotals(results);\n\n return {\n component,\n output,\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n results: componentsResults,\n };\n });\n\n const results = (await resultsP) as any as ComponentLintResult[];\n const {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n } = this.computeManyComponentsTotals(results);\n\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n results,\n errors: [],\n };\n }\n\n private createTempTsConfigFile(\n rootDir: string,\n componentDirMap: ComponentMap<string>,\n envId: string,\n tsConfig: Record<string, any>\n ): string {\n const newTsConfig = {\n ...tsConfig,\n };\n const compDirs: string[] = componentDirMap.toArray().map(([, compDir]) => compDir);\n if (tsConfig.include) {\n newTsConfig.include = flatten(\n tsConfig.include.map((includedPath) => {\n return compDirs.map((compDir) => `../../${compDir}/${includedPath}`);\n })\n );\n }\n if (tsConfig.exclude) {\n newTsConfig.exclude = flatten(\n tsConfig.exclude.map((excludedPath) => {\n return compDirs.map((compDir) => `../../${compDir}/${excludedPath}`);\n })\n );\n }\n const cacheDir = getCacheDir(rootDir);\n const hash = objectHash(newTsConfig);\n // We save the tsconfig with hash here to avoid creating unnecessary tsconfig files\n // this is very important as eslint will be able to cache the tsconfig file and will not need to create another program\n // this affects performance dramatically\n const tempTsConfigPath = path.join(cacheDir, `bit.tsconfig.eslint.${hash}.json`);\n if (!fs.existsSync(tempTsConfigPath)) {\n fs.outputJSONSync(tempTsConfigPath, newTsConfig, { spaces: 2 });\n }\n return tempTsConfigPath;\n }\n\n private computeComponentResultsWithTotals(results: ESLintLib.LintResult[]) {\n let totalErrorCount = 0;\n let totalFatalErrorCount = 0;\n let totalFixableErrorCount = 0;\n let totalFixableWarningCount = 0;\n let totalWarningCount = 0;\n const componentsResults = results.map((result) => {\n totalErrorCount += result.errorCount ?? 0;\n // @ts-ignore - missing from the @types/eslint lib\n totalFatalErrorCount += result.fatalErrorCount ?? 0;\n totalFixableErrorCount += result.fixableErrorCount ?? 0;\n totalFixableWarningCount += result.fixableWarningCount ?? 0;\n totalWarningCount += result.warningCount ?? 0;\n return {\n filePath: result.filePath,\n errorCount: result.errorCount,\n // @ts-ignore - missing from the @types/eslint lib\n fatalErrorCount: result.fatalErrorCount,\n fixableErrorCount: result.fixableErrorCount,\n fixableWarningCount: result.fixableWarningCount,\n warningCount: result.warningCount,\n messages: result.messages,\n raw: result,\n };\n });\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n };\n }\n\n private computeManyComponentsTotals(componentsResults: ComponentLintResult[]) {\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 componentsResults.forEach((result) => {\n if (result.totalErrorCount) {\n totalErrorCount += result.totalErrorCount;\n totalComponentsWithErrorCount += 1;\n }\n // @ts-ignore - missing from the @types/eslint lib\n if (result.totalFatalErrorCount) {\n totalFatalErrorCount += result.totalFatalErrorCount;\n totalComponentsWithFatalErrorCount += 1;\n }\n if (result.totalFixableErrorCount) {\n totalFixableErrorCount += result.totalFixableErrorCount;\n totalComponentsWithFixableErrorCount += 1;\n }\n if (result.totalFixableWarningCount) {\n totalFixableWarningCount += result.totalFixableWarningCount;\n totalComponentsWithFixableWarningCount += 1;\n }\n if (result.totalWarningCount) {\n totalWarningCount += result.totalWarningCount;\n totalComponentsWithWarningCount += 1;\n }\n });\n return {\n totalErrorCount,\n totalFatalErrorCount,\n totalFixableErrorCount,\n totalFixableWarningCount,\n totalWarningCount,\n componentsResults,\n totalComponentsWithErrorCount,\n totalComponentsWithFatalErrorCount,\n totalComponentsWithFixableErrorCount,\n totalComponentsWithFixableWarningCount,\n totalComponentsWithWarningCount,\n };\n }\n\n /**\n * Create the eslint instance by options that was already merged with context\n * @param options\n * @param ESLintModule\n * @returns\n */\n private createEslint(options: ESLintLib.Options, ESLintModule?: any): ESLintLib {\n // eslint-disable-next-line no-new\n if (ESLintModule) new ESLintModule.ESLint(options);\n return new ESLintLib(options);\n }\n\n version() {\n if (this.ESLint) return this.ESLint.version;\n return ESLintLib.version;\n }\n}\n\nfunction getCacheDir(rootDir): string {\n return path.join(rootDir, 'node_modules', '.cache');\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAqC;AAAA;AAK9B,MAAMA,YAAY,CAAmB;EAC1CC,WAAW,CACDC,MAAc,EAEdC,OAAsB;EAE9B;AACJ;AACA;EACYC,MAAY,EACpB;IAAA,KARQF,MAAc,GAAdA,MAAc;IAAA,KAEdC,OAAsB,GAAtBA,OAAsB;IAAA,KAKtBC,MAAY,GAAZA,MAAY;IAAA,4CAGjB,eAAe;IAAA,qDACN,QAAQ;EAHnB;EAKHC,aAAa,GAAG;IACd,OAAOC,IAAI,CAACC,SAAS,CAAC,IAAI,CAACJ,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;EAC9C;EAEA,MAAMK,IAAI,CAACC,OAAsB,EAAwB;IACvD,MAAMC,iBAAiB,GAAG,IAAI,CAACR,MAAM,CAACS,uBAAuB,CAAC,oBAAoB,EAAEF,OAAO,CAACG,UAAU,CAACC,MAAM,CAAC;IAC9G,MAAMC,MAAM,GAAG,IAAI,CAACC,YAAY,CAAC,IAAI,CAACZ,OAAO,CAACa,MAAM,EAAE,IAAI,CAACZ,MAAM,CAAC;IAClE,IAAI,IAAI,CAACD,OAAO,CAACc,QAAQ,IAAIR,OAAO,CAACS,OAAO,EAAE;MAAA;MAC5C,MAAMC,YAAY,GAAG,IAAI,CAACC,sBAAsB,CAC9CX,OAAO,CAACS,OAAO,EACfT,OAAO,CAACY,gBAAgB,EACxBZ,OAAO,CAACa,UAAU,CA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context: LinterContext, options: ESLintOptions, transformers?: EslintConfigTransformer[], ESLintModule?: any): Linter;
44
44
  static runtime: import("@teambit/harmony").RuntimeDefinition;
45
45
  static dependencies: import("@teambit/harmony").Aspect[];
46
- static provider([loggerExt, workspaceConfigFiles, linter]: [
47
- LoggerMain,
48
- WorkspaceConfigFilesMain,
49
- LinterMain
50
- ]): Promise<ESLintMain>;
46
+ static provider([loggerExt]: [LoggerMain, WorkspaceConfigFilesMain, LinterMain]): Promise<ESLintMain>;
51
47
  }
52
48
  export declare function runTransformersWithContext(config: EslintConfigMutator, transformers: EslintConfigTransformer[] | undefined, context: EslintConfigTransformContext): EslintConfigMutator;
@@ -22,13 +22,6 @@ function _cli() {
22
22
  };
23
23
  return data;
24
24
  }
25
- function _linter() {
26
- const data = _interopRequireDefault(require("@teambit/linter"));
27
- _linter = function () {
28
- return data;
29
- };
30
- return data;
31
- }
32
25
  function _logger() {
33
26
  const data = require("@teambit/logger");
34
27
  _logger = function () {
@@ -43,13 +36,6 @@ function _defenderEslint() {
43
36
  };
44
37
  return data;
45
38
  }
46
- function _workspaceConfigFiles() {
47
- const data = _interopRequireDefault(require("@teambit/workspace-config-files"));
48
- _workspaceConfigFiles = function () {
49
- return data;
50
- };
51
- return data;
52
- }
53
39
  function _eslint() {
54
40
  const data = require("./eslint.aspect");
55
41
  _eslint = function () {
@@ -64,13 +50,6 @@ function _eslint2() {
64
50
  };
65
51
  return data;
66
52
  }
67
- function _eslintConfigWriter() {
68
- const data = require("./eslint-config-writer");
69
- _eslintConfigWriter = function () {
70
- return data;
71
- };
72
- return data;
73
- }
74
53
  class ESLintMain {
75
54
  constructor(logger) {
76
55
  this.logger = logger;
@@ -90,15 +69,14 @@ class ESLintMain {
90
69
  const afterMutation = runTransformersWithContext(configMutator.clone(), transformers, transformerContext);
91
70
  return new (_eslint2().ESLintLinter)(this.logger, afterMutation.raw, ESLintModule);
92
71
  }
93
- static async provider([loggerExt, workspaceConfigFiles, linter]) {
72
+ static async provider([loggerExt]) {
94
73
  const logger = loggerExt.createLogger(_eslint().ESLintAspect.id);
95
- workspaceConfigFiles.registerConfigWriter(new (_eslintConfigWriter().EslintConfigWriter)(linter, logger));
96
74
  return new ESLintMain(logger);
97
75
  }
98
76
  }
99
77
  exports.ESLintMain = ESLintMain;
100
78
  (0, _defineProperty2().default)(ESLintMain, "runtime", _cli().MainRuntime);
101
- (0, _defineProperty2().default)(ESLintMain, "dependencies", [_logger().LoggerAspect, _workspaceConfigFiles().default, _linter().default]);
79
+ (0, _defineProperty2().default)(ESLintMain, "dependencies", [_logger().LoggerAspect]);
102
80
  _eslint().ESLintAspect.addRuntime(ESLintMain);
103
81
 
104
82
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["ESLintMain","constructor","logger","createLinter","context","options","transformers","ESLintModule","mergedOptions","getOptions","configMutator","EslintConfigMutator","transformerContext","fix","afterMutation","runTransformersWithContext","clone","ESLintLinter","raw","provider","loggerExt","workspaceConfigFiles","linter","createLogger","ESLintAspect","id","registerConfigWriter","EslintConfigWriter","MainRuntime","LoggerAspect","WorkspaceConfigFilesAspect","LinterAspect","addRuntime","mergedConfig","overrideConfig","config","extensions","extensionFormats","useEslintrc","cwd","pluginPath","fixTypes","Object","assign","Array","isArray","newConfig","reduce","acc","transformer"],"sources":["eslint.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\n// import { Linter as ESLinter, ESLint as ESLintLib } from 'eslint';\nimport { ESLint as ESLintLib } from 'eslint';\nimport LinterAspect, { Linter, LinterContext, LinterMain } from '@teambit/linter';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EslintConfigMutator } from '@teambit/defender.eslint.config-mutator';\nimport WorkspaceConfigFilesAspect, { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ESLintAspect } from './eslint.aspect';\nimport { ESLintLinter } from './eslint.linter';\nimport { EslintConfigWriter } from './eslint-config-writer';\n\nexport type ESLintOptions = {\n /**\n * linter config for eslint.\n */\n // config: ESLinter.Config;\n config: ESLintLib.Options;\n\n /**\n * specify to path to resolve eslint plugins from.\n */\n pluginPath?: string;\n\n /**\n * decide the formatter for the CLI output.\n */\n formatter?: string;\n\n /**\n * file types to lint.\n */\n extensions?: string[];\n\n // TODO: improve type\n /**\n * typescript config for eslint.\n * If you pass this, bit will auto generate a temp config file in `node_modules/.cache` and pass it to eslint.\n * In case you have include/exclude props in the tsconfig, they will be changed to handle the fact that they are inside the node_modules/.cache folder.\n * a `../../` will be added to the beginning of the path.\n */\n tsConfig?: Record<string, any>;\n};\n\nexport type EslintConfigTransformContext = {\n fix: boolean;\n};\n\nexport type EslintConfigTransformer = (\n config: EslintConfigMutator,\n context: EslintConfigTransformContext\n) => EslintConfigMutator;\n\nexport class ESLintMain {\n constructor(private logger: Logger) {}\n\n /**\n * create a eslint linter instance.\n * @param options eslint options.\n * @param ESLintModule reference to an `eslint` module.\n */\n createLinter(\n context: LinterContext,\n options: ESLintOptions,\n transformers: EslintConfigTransformer[] = [],\n ESLintModule?: any\n ): Linter {\n const mergedOptions = getOptions(options, context);\n const configMutator = new EslintConfigMutator(mergedOptions);\n const transformerContext: EslintConfigTransformContext = { fix: !!context.fix };\n const afterMutation = runTransformersWithContext(configMutator.clone(), transformers, transformerContext);\n\n return new ESLintLinter(this.logger, afterMutation.raw, ESLintModule);\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [LoggerAspect, WorkspaceConfigFilesAspect, LinterAspect];\n\n static async provider([loggerExt, workspaceConfigFiles, linter]: [\n LoggerMain,\n WorkspaceConfigFilesMain,\n LinterMain\n ]): Promise<ESLintMain> {\n const logger = loggerExt.createLogger(ESLintAspect.id);\n workspaceConfigFiles.registerConfigWriter(new EslintConfigWriter(linter, logger));\n return new ESLintMain(logger);\n }\n}\n\nESLintAspect.addRuntime(ESLintMain);\n\n/**\n * get options for eslint.\n */\nfunction getOptions(options: ESLintOptions, context: LinterContext): ESLintOptions {\n const mergedConfig: ESLintLib.Options = {\n // @ts-ignore - this is a bug in the @types/eslint types\n overrideConfig: options.config,\n extensions: context.extensionFormats,\n useEslintrc: false,\n cwd: options.pluginPath,\n fix: !!context.fix,\n fixTypes: context.fixTypes,\n };\n return Object.assign({}, options, { config: mergedConfig, extensions: context.extensionFormats });\n}\n\nexport function runTransformersWithContext(\n config: EslintConfigMutator,\n transformers: EslintConfigTransformer[] = [],\n context: EslintConfigTransformContext\n): EslintConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;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;AA2CO,MAAMA,UAAU,CAAC;EACtBC,WAAW,CAASC,MAAc,EAAE;IAAA,KAAhBA,MAAc,GAAdA,MAAc;EAAG;;EAErC;AACF;AACA;AACA;AACA;EACEC,YAAY,CACVC,OAAsB,EACtBC,OAAsB,EACtBC,YAAuC,GAAG,EAAE,EAC5CC,YAAkB,EACV;IACR,MAAMC,aAAa,GAAGC,UAAU,CAACJ,OAAO,EAAED,OAAO,CAAC;IAClD,MAAMM,aAAa,GAAG,KAAIC,qCAAmB,EAACH,aAAa,CAAC;IAC5D,MAAMI,kBAAgD,GAAG;MAAEC,GAAG,EAAE,CAAC,CAACT,OAAO,CAACS;IAAI,CAAC;IAC/E,MAAMC,aAAa,GAAGC,0BAA0B,CAACL,aAAa,CAACM,KAAK,EAAE,EAAEV,YAAY,EAAEM,kBAAkB,CAA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AY,CAAC,EAAE,OAAO6B,MAAM;EAC/C,MAAMW,SAAS,GAAGxC,YAAY,CAACyC,MAAM,CAAC,CAACC,GAAG,EAAEC,WAAW,KAAK;IAC1D,OAAOA,WAAW,CAACD,GAAG,EAAE5C,OAAO,CAAC;EAClC,CAAC,EAAE+B,MAAM,CAAC;EACV,OAAOW,SAAS;AAClB"}
1
+ {"version":3,"names":["ESLintMain","constructor","logger","createLinter","context","options","transformers","ESLintModule","mergedOptions","getOptions","configMutator","EslintConfigMutator","transformerContext","fix","afterMutation","runTransformersWithContext","clone","ESLintLinter","raw","provider","loggerExt","createLogger","ESLintAspect","id","MainRuntime","LoggerAspect","addRuntime","mergedConfig","overrideConfig","config","extensions","extensionFormats","useEslintrc","cwd","pluginPath","fixTypes","Object","assign","Array","isArray","newConfig","reduce","acc","transformer"],"sources":["eslint.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\n// import { Linter as ESLinter, ESLint as ESLintLib } from 'eslint';\nimport { ESLint as ESLintLib } from 'eslint';\nimport { Linter, LinterContext, LinterMain } from '@teambit/linter';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { EslintConfigMutator } from '@teambit/defender.eslint.config-mutator';\nimport { WorkspaceConfigFilesMain } from '@teambit/workspace-config-files';\nimport { ESLintAspect } from './eslint.aspect';\nimport { ESLintLinter } from './eslint.linter';\n\nexport type ESLintOptions = {\n /**\n * linter config for eslint.\n */\n // config: ESLinter.Config;\n config: ESLintLib.Options;\n\n /**\n * specify to path to resolve eslint plugins from.\n */\n pluginPath?: string;\n\n /**\n * decide the formatter for the CLI output.\n */\n formatter?: string;\n\n /**\n * file types to lint.\n */\n extensions?: string[];\n\n // TODO: improve type\n /**\n * typescript config for eslint.\n * If you pass this, bit will auto generate a temp config file in `node_modules/.cache` and pass it to eslint.\n * In case you have include/exclude props in the tsconfig, they will be changed to handle the fact that they are inside the node_modules/.cache folder.\n * a `../../` will be added to the beginning of the path.\n */\n tsConfig?: Record<string, any>;\n};\n\nexport type EslintConfigTransformContext = {\n fix: boolean;\n};\n\nexport type EslintConfigTransformer = (\n config: EslintConfigMutator,\n context: EslintConfigTransformContext\n) => EslintConfigMutator;\n\nexport class ESLintMain {\n constructor(private logger: Logger) {}\n\n /**\n * create a eslint linter instance.\n * @param options eslint options.\n * @param ESLintModule reference to an `eslint` module.\n */\n createLinter(\n context: LinterContext,\n options: ESLintOptions,\n transformers: EslintConfigTransformer[] = [],\n ESLintModule?: any\n ): Linter {\n const mergedOptions = getOptions(options, context);\n const configMutator = new EslintConfigMutator(mergedOptions);\n const transformerContext: EslintConfigTransformContext = { fix: !!context.fix };\n const afterMutation = runTransformersWithContext(configMutator.clone(), transformers, transformerContext);\n\n return new ESLintLinter(this.logger, afterMutation.raw, ESLintModule);\n }\n\n static runtime = MainRuntime;\n\n static dependencies = [LoggerAspect];\n\n static async provider([loggerExt]: [LoggerMain, WorkspaceConfigFilesMain, LinterMain]): Promise<ESLintMain> {\n const logger = loggerExt.createLogger(ESLintAspect.id);\n return new ESLintMain(logger);\n }\n}\n\nESLintAspect.addRuntime(ESLintMain);\n\n/**\n * get options for eslint.\n */\nfunction getOptions(options: ESLintOptions, context: LinterContext): ESLintOptions {\n const mergedConfig: ESLintLib.Options = {\n // @ts-ignore - this is a bug in the @types/eslint types\n overrideConfig: options.config,\n extensions: context.extensionFormats,\n useEslintrc: false,\n cwd: options.pluginPath,\n fix: !!context.fix,\n fixTypes: context.fixTypes,\n };\n return Object.assign({}, options, { config: mergedConfig, extensions: context.extensionFormats });\n}\n\nexport function runTransformersWithContext(\n config: EslintConfigMutator,\n transformers: EslintConfigTransformer[] = [],\n context: EslintConfigTransformContext\n): EslintConfigMutator {\n if (!Array.isArray(transformers)) return config;\n const newConfig = transformers.reduce((acc, transformer) => {\n return transformer(acc, context);\n }, config);\n return newConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EA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vB,OAAO,CAACwB,MAAM;IAC9BC,UAAU,EAAE1B,OAAO,CAAC2B,gBAAgB;IACpCC,WAAW,EAAE,KAAK;IAClBC,GAAG,EAAE5B,OAAO,CAAC6B,UAAU;IACvBrB,GAAG,EAAE,CAAC,CAACT,OAAO,CAACS,GAAG;IAClBsB,QAAQ,EAAE/B,OAAO,CAAC+B;EACpB,CAAC;EACD,OAAOC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEhC,OAAO,EAAE;IAAEwB,MAAM,EAAEF,YAAY;IAAEG,UAAU,EAAE1B,OAAO,CAAC2B;EAAiB,CAAC,CAAC;AACnG;AAEO,SAAShB,0BAA0B,CACxCc,MAA2B,EAC3BvB,YAAuC,GAAG,EAAE,EAC5CF,OAAqC,EAChB;EACrB,IAAI,CAACkC,KAAK,CAACC,OAAO,CAACjC,YAAY,CAAC,EAAE,OAAOuB,MAAM;EAC/C,MAAMW,SAAS,GAAGlC,YAAY,CAACmC,MAAM,CAAC,CAACC,GAAG,EAAEC,WAAW,KAAK;IAC1D,OAAOA,WAAW,CAACD,GAAG,EAAEtC,OAAO,CAAC;EAClC,CAAC,EAAEyB,MAAM,CAAC;EACV,OAAOW,SAAS;AAClB"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ESLintAspect } from './eslint.aspect';
2
2
  export { ESLintAspect };
3
- export type { EslintLinterInterface } from './eslint-linter-interface';
4
3
  export type { ESLintMain, ESLintOptions, EslintConfigTransformContext, EslintConfigTransformer, } from './eslint.main.runtime';
5
4
  export default ESLintAspect;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ESLintAspect"],"sources":["index.ts"],"sourcesContent":["import { ESLintAspect } from './eslint.aspect';\n\nexport { ESLintAspect };\nexport type { EslintLinterInterface } from './eslint-linter-interface';\nexport type {\n ESLintMain,\n ESLintOptions,\n EslintConfigTransformContext,\n EslintConfigTransformer,\n} from './eslint.main.runtime';\nexport default ESLintAspect;\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+C,eAUhCA,sBAAY;AAAA"}
1
+ {"version":3,"names":["ESLintAspect"],"sources":["index.ts"],"sourcesContent":["import { ESLintAspect } from './eslint.aspect';\n\nexport { ESLintAspect };\nexport type {\n ESLintMain,\n ESLintOptions,\n EslintConfigTransformContext,\n EslintConfigTransformer,\n} from './eslint.main.runtime';\nexport default ESLintAspect;\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA+C,eAShCA,sBAAY;AAAA"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_eslint@0.0.1103/dist/eslint.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_eslint@0.0.1103/dist/eslint.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_eslint@0.0.1105/dist/eslint.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_eslint@0.0.1105/dist/eslint.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,36 +1,34 @@
1
1
  {
2
2
  "name": "@teambit/eslint",
3
- "version": "0.0.1103",
3
+ "version": "0.0.1105",
4
4
  "homepage": "https://bit.cloud/teambit/defender/eslint",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.defender",
8
8
  "name": "eslint",
9
- "version": "0.0.1103"
9
+ "version": "0.0.1105"
10
10
  },
11
11
  "dependencies": {
12
+ "eslint": "7.32.0",
12
13
  "fs-extra": "10.0.0",
13
14
  "lodash": "4.17.21",
14
- "eslint": "7.32.0",
15
15
  "object-hash": "2.1.1",
16
16
  "p-map-series": "2.1.0",
17
17
  "core-js": "^3.0.0",
18
18
  "@babel/runtime": "7.20.0",
19
19
  "@teambit/harmony": "0.4.6",
20
- "@teambit/envs": "0.0.1103",
21
- "@teambit/linter": "0.0.1103",
22
- "@teambit/logger": "0.0.832",
23
- "@teambit/typescript": "0.0.1103",
24
- "@teambit/workspace-config-files": "0.0.83",
25
- "@teambit/component": "0.0.1103",
26
- "@teambit/cli": "0.0.739",
27
- "@teambit/defender.eslint.config-mutator": "0.0.92"
20
+ "@teambit/component": "0.0.1105",
21
+ "@teambit/linter": "0.0.1105",
22
+ "@teambit/logger": "0.0.833",
23
+ "@teambit/cli": "0.0.740",
24
+ "@teambit/defender.eslint.config-mutator": "0.0.92",
25
+ "@teambit/workspace-config-files": "0.0.85"
28
26
  },
29
27
  "devDependencies": {
30
- "@types/fs-extra": "9.0.7",
31
- "@types/lodash": "4.14.165",
32
28
  "@types/react": "^17.0.8",
33
29
  "@types/eslint": "7.28.0",
30
+ "@types/fs-extra": "9.0.7",
31
+ "@types/lodash": "4.14.165",
34
32
  "@types/object-hash": "1.3.4",
35
33
  "@types/node": "12.20.4",
36
34
  "@types/react-dom": "^17.0.5",
@@ -38,7 +36,6 @@
38
36
  "@types/testing-library__jest-dom": "5.9.5"
39
37
  },
40
38
  "peerDependencies": {
41
- "@teambit/legacy": "1.0.520",
42
39
  "react": "^16.8.0 || ^17.0.0",
43
40
  "react-dom": "^16.8.0 || ^17.0.0"
44
41
  },
package/tsconfig.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "ScriptHost"
9
9
  ],
10
10
  "target": "es2015",
11
- "module": "commonjs",
11
+ "module": "CommonJS",
12
12
  "jsx": "react",
13
13
  "allowJs": true,
14
14
  "composite": true,
@@ -1,17 +0,0 @@
1
- import { ExecutionContext } from '@teambit/envs';
2
- import type { ConfigWriterEntry, EnvMapValue, WrittenConfigFile, ExtendingConfigFile, ConfigFile, GenerateExtendingConfigFilesArgs } from '@teambit/workspace-config-files';
3
- import { Logger } from '@teambit/logger';
4
- import { LinterMain } from '@teambit/linter';
5
- export declare class EslintConfigWriter implements ConfigWriterEntry {
6
- private linter;
7
- private logger;
8
- name: string;
9
- cliName: string;
10
- constructor(linter: LinterMain, logger: Logger);
11
- patterns: string[];
12
- calcConfigFiles(executionContext: ExecutionContext, _env: any, configsRootDir: string): ConfigFile[] | undefined;
13
- postProcessConfigFiles(writtenConfigFiles: WrittenConfigFile[], executionContext: ExecutionContext, envMapValue: EnvMapValue): Promise<void>;
14
- private postProcessTSConfig;
15
- generateExtendingFile(args: GenerateExtendingConfigFilesArgs): ExtendingConfigFile | undefined;
16
- isBitGenerated(filePath: string): boolean;
17
- }
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- require("core-js/modules/es.promise.js");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.EslintConfigWriter = void 0;
9
- function _defineProperty2() {
10
- const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- _defineProperty2 = function () {
12
- return data;
13
- };
14
- return data;
15
- }
16
- function _utils() {
17
- const data = require("@teambit/legacy/dist/utils");
18
- _utils = function () {
19
- return data;
20
- };
21
- return data;
22
- }
23
- function _fsExtra() {
24
- const data = _interopRequireDefault(require("fs-extra"));
25
- _fsExtra = function () {
26
- return data;
27
- };
28
- return data;
29
- }
30
- function _typescript() {
31
- const data = require("@teambit/typescript");
32
- _typescript = function () {
33
- return data;
34
- };
35
- return data;
36
- }
37
- function _lodash() {
38
- const data = require("lodash");
39
- _lodash = function () {
40
- return data;
41
- };
42
- return data;
43
- }
44
- const BIT_GENERATED_ESLINT_CONFIG_COMMENT = '// bit-generated-eslint-config';
45
- class EslintConfigWriter {
46
- constructor(linter, logger) {
47
- this.linter = linter;
48
- this.logger = logger;
49
- (0, _defineProperty2().default)(this, "name", 'EslintConfigWriter');
50
- (0, _defineProperty2().default)(this, "cliName", 'eslint');
51
- (0, _defineProperty2().default)(this, "patterns", ['**/.eslintrc.json']);
52
- }
53
- calcConfigFiles(executionContext, _env, configsRootDir) {
54
- var _linter$generateIdeCo;
55
- const linter = this.linter.getLinter(executionContext, {});
56
- if (!linter) return undefined;
57
- if (!linter.id.toLowerCase().includes('eslint')) return undefined;
58
- const config = (_linter$generateIdeCo = linter.generateIdeConfig) === null || _linter$generateIdeCo === void 0 ? void 0 : _linter$generateIdeCo.call(linter);
59
- if (!config || !config.eslintConfig) return undefined;
60
- const eslintConfigFile = {
61
- content: JSON.stringify(config.eslintConfig, null, 2),
62
- name: '.eslintrc.bit.{hash}.json'
63
- };
64
- if (!config.tsconfig) {
65
- return [eslintConfigFile];
66
- }
67
- const tsConfigContent = JSON.stringify(config.tsconfig, null, 2);
68
- const tsConfigHash = (0, _utils().sha1)(tsConfigContent);
69
- const tsConfigName = `tsconfig.bit.eslint.${tsConfigHash}.json`;
70
- const tsConfigFullPath = `${configsRootDir}/${tsConfigName}`;
71
- const tsConfigFile = {
72
- content: tsConfigContent,
73
- hash: tsConfigHash,
74
- name: tsConfigName
75
- };
76
- // This must use abs path, as otherwise eslint will not find the tsconfig file
77
- // because it will search for it relative to the workspace root
78
- (0, _lodash().set)(config.eslintConfig, 'parserOptions.project', tsConfigFullPath);
79
- eslintConfigFile.content = JSON.stringify(config.eslintConfig, null, 2);
80
- return [eslintConfigFile, tsConfigFile];
81
- }
82
- async postProcessConfigFiles(writtenConfigFiles, executionContext, envMapValue) {
83
- await this.postProcessTSConfig(writtenConfigFiles, executionContext, envMapValue);
84
- }
85
- async postProcessTSConfig(writtenConfigFiles, executionContext, envMapValue) {
86
- const tsConfigFile = writtenConfigFiles.find(file => file.name.includes('tsconfig.bit.eslint'));
87
- if (!tsConfigFile) return Promise.resolve();
88
- const tsConfigPath = tsConfigFile.filePath;
89
- const exists = await _fsExtra().default.pathExists(tsConfigPath);
90
- if (!exists) {
91
- this.logger.warn(`EslintConfigWriter, tsconfig file ${tsConfigPath} was not found for post process. if it is part of --dry-run, it is ok.`);
92
- return Promise.resolve();
93
- }
94
- const tsConfig = await _fsExtra().default.readJson(tsConfigPath);
95
- const compDirs = envMapValue.paths;
96
- const newTsConfig = (0, _typescript().expandIncludeExclude)(tsConfigPath, tsConfig, compDirs, _typescript().GLOBAL_TYPES_DIR);
97
- _fsExtra().default.outputJSONSync(tsConfigPath, newTsConfig, {
98
- spaces: 2
99
- });
100
- return Promise.resolve();
101
- }
102
- generateExtendingFile(args) {
103
- const {
104
- writtenConfigFiles
105
- } = args;
106
- const eslintConfigFile = writtenConfigFiles.find(file => file.name.includes('.eslintrc.bit'));
107
- if (!eslintConfigFile) return undefined;
108
- const config = {
109
- // Using DSL to make sure it will be replaced with relative path
110
- extends: [`{${eslintConfigFile.name}}`]
111
- };
112
- const content = `${BIT_GENERATED_ESLINT_CONFIG_COMMENT}\n${JSON.stringify(config, null, 2)}`;
113
- return {
114
- content,
115
- name: '.eslintrc.json',
116
- extendingTarget: eslintConfigFile,
117
- useAbsPaths: false
118
- };
119
- }
120
- isBitGenerated(filePath) {
121
- const content = _fsExtra().default.readFileSync(filePath).toString();
122
- return content.includes(BIT_GENERATED_ESLINT_CONFIG_COMMENT);
123
- }
124
- }
125
- exports.EslintConfigWriter = EslintConfigWriter;
126
-
127
- //# sourceMappingURL=eslint-config-writer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BIT_GENERATED_ESLINT_CONFIG_COMMENT","EslintConfigWriter","constructor","linter","logger","calcConfigFiles","executionContext","_env","configsRootDir","getLinter","undefined","id","toLowerCase","includes","config","generateIdeConfig","eslintConfig","eslintConfigFile","content","JSON","stringify","name","tsconfig","tsConfigContent","tsConfigHash","sha1","tsConfigName","tsConfigFullPath","tsConfigFile","hash","set","postProcessConfigFiles","writtenConfigFiles","envMapValue","postProcessTSConfig","find","file","Promise","resolve","tsConfigPath","filePath","exists","fs","pathExists","warn","tsConfig","readJson","compDirs","paths","newTsConfig","expandIncludeExclude","GLOBAL_TYPES_DIR","outputJSONSync","spaces","generateExtendingFile","args","extends","extendingTarget","useAbsPaths","isBitGenerated","readFileSync","toString"],"sources":["eslint-config-writer.ts"],"sourcesContent":["import { sha1 } from '@teambit/legacy/dist/utils';\nimport fs from 'fs-extra';\nimport { ExecutionContext } from '@teambit/envs';\nimport type {\n ConfigWriterEntry,\n EnvMapValue,\n WrittenConfigFile,\n ExtendingConfigFile,\n ConfigFile,\n GenerateExtendingConfigFilesArgs,\n} from '@teambit/workspace-config-files';\nimport { GLOBAL_TYPES_DIR, expandIncludeExclude } from '@teambit/typescript';\nimport { set } from 'lodash';\nimport { Logger } from '@teambit/logger';\nimport { LinterMain } from '@teambit/linter';\nimport { EslintLinterInterface } from './eslint-linter-interface';\n\nconst BIT_GENERATED_ESLINT_CONFIG_COMMENT = '// bit-generated-eslint-config';\n\nexport class EslintConfigWriter implements ConfigWriterEntry {\n name = 'EslintConfigWriter';\n cliName = 'eslint';\n\n constructor(private linter: LinterMain, private logger: Logger) {}\n patterns: string[] = ['**/.eslintrc.json'];\n\n calcConfigFiles(executionContext: ExecutionContext, _env, configsRootDir: string): ConfigFile[] | undefined {\n const linter = this.linter.getLinter(executionContext, {}) as EslintLinterInterface;\n if (!linter) return undefined;\n if (!linter.id.toLowerCase().includes('eslint')) return undefined;\n const config = linter.generateIdeConfig?.();\n if (!config || !config.eslintConfig) return undefined;\n const eslintConfigFile = {\n content: JSON.stringify(config.eslintConfig, null, 2),\n name: '.eslintrc.bit.{hash}.json',\n };\n if (!config.tsconfig) {\n return [eslintConfigFile];\n }\n const tsConfigContent = JSON.stringify(config.tsconfig, null, 2);\n const tsConfigHash = sha1(tsConfigContent);\n const tsConfigName = `tsconfig.bit.eslint.${tsConfigHash}.json`;\n const tsConfigFullPath = `${configsRootDir}/${tsConfigName}`;\n const tsConfigFile = {\n content: tsConfigContent,\n hash: tsConfigHash,\n name: tsConfigName,\n };\n // This must use abs path, as otherwise eslint will not find the tsconfig file\n // because it will search for it relative to the workspace root\n set(config.eslintConfig, 'parserOptions.project', tsConfigFullPath);\n eslintConfigFile.content = JSON.stringify(config.eslintConfig, null, 2);\n return [eslintConfigFile, tsConfigFile];\n }\n\n async postProcessConfigFiles(\n writtenConfigFiles: WrittenConfigFile[],\n executionContext: ExecutionContext,\n envMapValue: EnvMapValue\n ): Promise<void> {\n await this.postProcessTSConfig(writtenConfigFiles, executionContext, envMapValue);\n }\n\n private async postProcessTSConfig(\n writtenConfigFiles: WrittenConfigFile[],\n executionContext: ExecutionContext,\n envMapValue: EnvMapValue\n ): Promise<void> {\n const tsConfigFile = writtenConfigFiles.find((file) => file.name.includes('tsconfig.bit.eslint'));\n if (!tsConfigFile) return Promise.resolve();\n const tsConfigPath = tsConfigFile.filePath;\n const exists = await fs.pathExists(tsConfigPath);\n if (!exists) {\n this.logger.warn(\n `EslintConfigWriter, tsconfig file ${tsConfigPath} was not found for post process. if it is part of --dry-run, it is ok.`\n );\n return Promise.resolve();\n }\n const tsConfig = await fs.readJson(tsConfigPath);\n const compDirs: string[] = envMapValue.paths;\n const newTsConfig = expandIncludeExclude(tsConfigPath, tsConfig, compDirs, GLOBAL_TYPES_DIR);\n\n fs.outputJSONSync(tsConfigPath, newTsConfig, { spaces: 2 });\n return Promise.resolve();\n }\n\n generateExtendingFile(args: GenerateExtendingConfigFilesArgs): ExtendingConfigFile | undefined {\n const { writtenConfigFiles } = args;\n const eslintConfigFile = writtenConfigFiles.find((file) => file.name.includes('.eslintrc.bit'));\n if (!eslintConfigFile) return undefined;\n const config = {\n // Using DSL to make sure it will be replaced with relative path\n extends: [`{${eslintConfigFile.name}}`],\n };\n const content = `${BIT_GENERATED_ESLINT_CONFIG_COMMENT}\\n${JSON.stringify(config, null, 2)}`;\n return { content, name: '.eslintrc.json', extendingTarget: eslintConfigFile, useAbsPaths: false };\n }\n\n isBitGenerated(filePath: string): boolean {\n const content =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;AACF;AAAC"}
@@ -1,8 +0,0 @@
1
- import { Linter } from '@teambit/linter';
2
- export declare type IdeConfig = {
3
- eslintConfig: Object;
4
- tsconfig?: Object;
5
- };
6
- export interface EslintLinterInterface extends Linter {
7
- generateIdeConfig?: () => IdeConfig;
8
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
-
3
- //# sourceMappingURL=eslint-linter-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["eslint-linter-interface.ts"],"sourcesContent":["import { Linter } from '@teambit/linter';\n\nexport type IdeConfig = {\n eslintConfig: Object;\n tsconfig?: Object;\n};\n\nexport interface EslintLinterInterface extends Linter {\n generateIdeConfig?: () => IdeConfig;\n}\n"],"mappings":""}