/opt/canhelp/node_modules/next/dist/esm/lib/eslint
NameSizeModeActions
customFormatter.js28950644editdlrm
customFormatter.js.map57980644editdlrm
getESLintPromptValues.js8460644editdlrm
getESLintPromptValues.js.map13910644editdlrm
hasEslintConfiguration.js9910644editdlrm
hasEslintConfiguration.js.map20750644editdlrm
runLintCheck.js144540644editdlrm
runLintCheck.js.map242960644editdlrm
writeDefaultConfig.js17320644editdlrm
writeDefaultConfig.js.map35610644editdlrm
writeOutputFile.js14180644editdlrm
writeOutputFile.js.map26640644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/lib/eslint/writeDefaultConfig.js (1732B)
import { promises as fs } from 'fs'; import { bold, green } from '../picocolors'; import os from 'os'; import path from 'path'; import * as CommentJson from 'next/dist/compiled/comment-json'; import * as Log from '../../build/output/log'; export async function writeDefaultConfig(baseDir, { exists, emptyEslintrc, emptyPkgJsonConfig }, selectedConfig, eslintrcFile, pkgJsonPath, packageJsonConfig) { if (!exists && emptyEslintrc && eslintrcFile) { const ext = path.extname(eslintrcFile); let newFileContent; if (ext === '.yaml' || ext === '.yml') { newFileContent = "extends: 'next'"; } else { newFileContent = CommentJson.stringify(selectedConfig, null, 2); if (ext === '.js') { newFileContent = 'module.exports = ' + newFileContent; } } await fs.writeFile(eslintrcFile, newFileContent + os.EOL); Log.info(`We detected an empty ESLint configuration file (${bold(path.basename(eslintrcFile))}) and updated it for you!`); } else if (!exists && emptyPkgJsonConfig && packageJsonConfig) { packageJsonConfig.eslintConfig = selectedConfig; if (pkgJsonPath) await fs.writeFile(pkgJsonPath, CommentJson.stringify(packageJsonConfig, null, 2) + os.EOL); Log.info(`We detected an empty ${bold('eslintConfig')} field in package.json and updated it for you!`); } else if (!exists) { await fs.writeFile(path.join(baseDir, '.eslintrc.json'), CommentJson.stringify(selectedConfig, null, 2) + os.EOL); console.log(green(`We created the ${bold('.eslintrc.json')} file for you and included your selected configuration.`)); } } //# sourceMappingURL=writeDefaultConfig.js.map