import { ESLintGenerator } from "generator/types" ; import { identity , pipe } from "utils/utility" ; import { browserESLintEnvConfig , nodeESLintEnvConfig } from "generator/base-configs" ; import { concatConfig } from "generator/generate" ; import { EnvInfo } from "types" ; const generateBrowserEnvESLintConfig = ( userAnswers ) => { return userAnswers . env . includes ( EnvInfo . Browser ) ? concatConfig ( browserESLintEnvConfig ) : identity ; } ; const generateNodeEnvESLintConfig = ( userAnswers ) => { return userAnswers . env . includes ( EnvInfo . Node ) ? concatConfig ( nodeESLintEnvConfig ) : identity ; } ; export const generateEnvESLintConfig = ( userAnswers ) => { return pipe ( generateBrowserEnvESLintConfig ( userAnswers ) , generateNodeEnvESLintConfig ( userAnswers ) ) ; } ;