\n\n\n{\n \"title\": \"onepiece\",\n \"layout\": \"true\"\n}\n\n\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/.eslintrc.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/.fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/.fes.prod.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/app.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":3,"endColumn":1,"fix":{"range":[0,2],"text":""}},{"ruleId":"no-unused-vars","severity":2,"message":"'PageLoading' is defined but never used.","line":4,"column":8,"nodeType":"Identifier","messageId":"unusedVar","endLine":4,"endColumn":19},{"ruleId":"import/extensions","severity":2,"message":"Missing file extension for \"@/components/PageLoading\"","line":4,"column":25,"nodeType":"Literal","endLine":4,"endColumn":51},{"ruleId":"no-unused-vars","severity":2,"message":"'UserCenter' is defined but never used.","line":5,"column":8,"nodeType":"Identifier","messageId":"unusedVar","endLine":5,"endColumn":18},{"ruleId":"import/extensions","severity":2,"message":"Missing file extension for \"@/components/UserCenter\"","line":5,"column":24,"nodeType":"Literal","endLine":5,"endColumn":49}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\n\nimport { access } from '@fesjs/fes';\nimport PageLoading from '@/components/PageLoading';\nimport UserCenter from '@/components/UserCenter';\n\nexport const beforeRender = {\n loading: ,\n action() {\n const { setRole } = access;\n return new Promise((resolve) => {\n setTimeout(() => {\n setRole('admin');\n // 初始化应用的全局状态,可以通过 useModel('@@initialState') 获取,具体用法看@/components/UserCenter 文件\n resolve({\n userName: 'harrywan'\n });\n }, 1000);\n });\n }\n};\n\nexport const layout = {\n customHeader: \n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/common/service.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/common/utils.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/components/PageLoading.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n
\n\n\n\n\n\n{\n \"name\": \"index\",\n \"title\": \"首页\"\n}\n\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/bin/fes.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/build.config.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nmodule.exports = {\n copy: ['index.js']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/cli.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/forkedDev.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":43,"column":1,"nodeType":null,"messageId":"delete","endLine":44,"endColumn":1,"fix":{"range":[958,959],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/umi/src/forkedDev.ts\n */\n\nimport { chalk, yParser } from '@fesjs/utils';\nimport { Service } from './serviceWithBuiltIn';\nimport getCwd from './utils/getCwd';\nimport getPkg from './utils/getPkg';\nimport fesPkg from '../package.json';\n\nconst args = yParser(process.argv.slice(2));\n\nlet closed = false;\nfunction onSignal(signal, service) {\n if (closed) return;\n closed = true;\n\n // 退出时触发插件中的onExit事件\n service.applyPlugins({\n key: 'onExit',\n type: service.ApplyPluginsType.event,\n args: {\n signal\n }\n });\n process.exit(0);\n}\n\n(async () => {\n try {\n process.env.NODE_ENV = 'development';\n const service = new Service({\n cwd: getCwd(),\n pkg: getPkg(process.cwd()),\n fesPkg\n });\n await service.run({\n name: 'dev',\n args\n });\n\n\n // kill(2) Ctrl-C\n process.once('SIGINT', () => onSignal('SIGINT', service));\n // kill(3) Ctrl-\\\n process.once('SIGQUIT', () => onSignal('SIGQUIT', service));\n // kill(15) default\n process.once('SIGTERM', () => onSignal('SIGTERM', service));\n } catch (e) {\n console.error(chalk.red(e.message));\n console.error(e.stack);\n process.exit(1);\n }\n})();\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nexport * from '@@/core/coreExports';\n// @ts-ignore\nexport * from '@@/core/pluginExports';\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/serviceWithBuiltIn.js","messages":[{"ruleId":"import/extensions","severity":2,"message":"Missing file extension \"json\" for \"../package\"","line":11,"column":43,"nodeType":"Literal","endLine":11,"endColumn":55}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/umi/src/ServiceWithBuiltIn.ts\n */\n\nimport { dirname } from 'path';\nimport { Service as CoreService } from '@fesjs/compiler';\n\nclass Service extends CoreService {\n constructor(opts) {\n process.env.FES_VERSION = require('../package').version;\n process.env.FES_DIR = dirname(require.resolve('../package'));\n\n super({\n ...opts,\n presets: [\n require.resolve('@fesjs/preset-built-in'),\n ...(opts.presets || [])\n ],\n plugins: [...(opts.plugins || [])]\n });\n }\n}\n\nexport { Service };\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/utils/fork.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····fork⏎` with `·fork·`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":3,"endColumn":1,"fix":{"range":[8,18],"text":" fork "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····scriptPath⏎` with `·scriptPath·`","line":8,"column":32,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":1,"fix":{"range":[115,131],"text":" scriptPath "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `argv·=>·argv.includes('--inspect-brk'),` with `(argv)·=>⏎········argv.includes('--inspect-brk')⏎····`","line":12,"column":49,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":88,"fix":{"range":[232,271],"text":"(argv) =>\n argv.includes('--inspect-brk')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `,`","line":31,"column":15,"nodeType":null,"messageId":"delete","endLine":31,"endColumn":16,"fix":{"range":[917,918],"text":""}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import {\n fork\n} from 'child_process';\n\nconst usedPorts = [];\nlet CURRENT_PORT;\n\nexport default function start({\n scriptPath\n}) {\n const execArgv = process.execArgv.slice(0);\n const inspectArgvIndex = execArgv.findIndex(argv => argv.includes('--inspect-brk'),);\n\n if (inspectArgvIndex > -1) {\n const inspectArgv = execArgv[inspectArgvIndex];\n execArgv.splice(\n inspectArgvIndex,\n 1,\n inspectArgv.replace(/--inspect-brk=(.*)/, (match, s1) => {\n let port;\n try {\n port = parseInt(s1, 10) + 1;\n } catch (e) {\n port = 9230; // node default inspect port plus 1.\n }\n if (usedPorts.includes(port)) {\n port += 1;\n }\n usedPorts.push(port);\n return `--inspect-brk=${port}`;\n }),\n );\n }\n\n // set port to env when current port has value\n if (CURRENT_PORT) {\n // @ts-ignore\n process.env.PORT = CURRENT_PORT;\n }\n\n const child = fork(scriptPath, process.argv.slice(2), {\n execArgv\n });\n\n child.on('message', (data) => {\n const type = (data && data.type) || null;\n if (type === 'RESTART') {\n child.kill();\n start({\n scriptPath\n });\n } else if (type === 'UPDATE_PORT') {\n // set current used port\n CURRENT_PORT = data.port;\n }\n process.send && process.send(data);\n });\n\n return child;\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/utils/getCwd.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":6,"column":5,"nodeType":null,"messageId":"insert","endLine":6,"endColumn":5,"fix":{"range":[132,132],"text":" "}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { join, isAbsolute } from 'path';\n\nexport default () => {\n const cwd = process.cwd();\n if (process.env.APP_ROOT) {\n // avoid repeat cwd path\n if (!isAbsolute(process.env.APP_ROOT)) {\n return join(cwd, process.env.APP_ROOT);\n }\n return process.env.APP_ROOT;\n }\n return cwd;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/src/utils/getPkg.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes/types.d.ts","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\n// @ts-ignore\nexport * from '@@/core/coreExports';\n// @ts-ignore\nexport * from '@@/core/pluginExports';\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/config/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `key` with `(key)`","line":72,"column":13,"nodeType":null,"messageId":"replace","endLine":72,"endColumn":16,"fix":{"range":[1767,1770],"text":"(key)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `f·=>·existsSync(join(this.cwd,·f))` with `(f)·=>⏎············existsSync(join(this.cwd,·f))⏎········`","line":176,"column":44,"nodeType":null,"messageId":"replace","endLine":176,"endColumn":78,"fix":{"range":[5033,5067],"text":"(f) =>\n existsSync(join(this.cwd, f))\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················configFile,⏎················process.env.FES_ENV⏎············` with `configFile,·process.env.FES_ENV`","line":183,"column":43,"nodeType":null,"messageId":"replace","endLine":186,"endColumn":13,"fix":{"range":[5316,5393],"text":"configFile, process.env.FES_ENV"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `f` with `(f)`","line":198,"column":21,"nodeType":null,"messageId":"replace","endLine":198,"endColumn":22,"fix":{"range":[5843,5844],"text":"(f)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `f` with `(f)`","line":199,"column":18,"nodeType":null,"messageId":"replace","endLine":199,"endColumn":19,"fix":{"range":[5870,5871],"text":"(f)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `f` with `(f)`","line":200,"column":21,"nodeType":null,"messageId":"replace","endLine":200,"endColumn":22,"fix":{"range":[5914,5915],"text":"(f)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `f` with `(f)`","line":224,"column":21,"nodeType":null,"messageId":"replace","endLine":224,"endColumn":22,"fix":{"range":[6738,6739],"text":"(f)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":258,"column":53,"nodeType":null,"messageId":"insert","endLine":258,"endColumn":53,"fix":{"range":[8064,8064],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":259,"column":24,"nodeType":null,"messageId":"delete","endLine":259,"endColumn":27,"fix":{"range":[8088,8091],"text":""}}],"errorCount":9,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":9,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\n\nimport { existsSync } from 'fs';\nimport { extname, join } from 'path';\nimport {\n chalk,\n chokidar,\n compatESModuleRequire,\n deepmerge,\n cleanRequireCache,\n lodash,\n parseRequireDeps,\n winPath\n} from '@fesjs/utils';\nimport assert from 'assert';\nimport joi from 'joi';\nimport { ServiceStage } from '../service/enums';\nimport {\n getUserConfigWithKey,\n updateUserConfigWithKey\n} from './utils/configUtils';\nimport isEqual from './utils/isEqual';\nimport mergeDefault from './utils/mergeDefault';\n\nconst CONFIG_FILES = ['.fes.js'];\n\n// TODO:\n// 1. custom config file\nexport default class Config {\n cwd;\n\n service;\n\n config;\n\n localConfig;\n\n configFile;\n\n constructor(opts) {\n this.cwd = opts.cwd || process.cwd();\n this.service = opts.service;\n this.localConfig = opts.localConfig;\n }\n\n async getDefaultConfig() {\n const pluginIds = Object.keys(this.service.plugins);\n\n // collect default config\n const defaultConfig = pluginIds.reduce((memo, pluginId) => {\n const { key, config = {} } = this.service.plugins[pluginId];\n if ('default' in config) memo[key] = config.default;\n return memo;\n }, {});\n\n return defaultConfig;\n }\n\n getConfig({ defaultConfig }) {\n assert(\n this.service.stage >= ServiceStage.pluginReady,\n 'Config.getConfig() failed, it should not be executed before plugin is ready.'\n );\n\n const userConfig = this.getUserConfig();\n // 用于提示用户哪些 key 是未定义的\n // TODO: 考虑不排除 false 的 key\n const userConfigKeys = Object.keys(userConfig).filter(\n key => userConfig[key] !== false\n );\n\n // get config\n const pluginIds = Object.keys(this.service.plugins);\n pluginIds.forEach((pluginId) => {\n const { key, config = {} } = this.service.plugins[pluginId];\n // recognize as key if have schema config\n if (!config.schema) return;\n\n const value = getUserConfigWithKey({\n key,\n userConfig\n });\n // 不校验 false 的值,此时已禁用插件\n if (value === false) return;\n\n // do validate\n const schema = config.schema(joi);\n assert(\n joi.isSchema(schema),\n `schema return from plugin ${pluginId} is not valid schema.`\n );\n const { error } = schema.validate(value);\n if (error) {\n const e = new Error(\n `Validate config \"${key}\" failed, ${error.message}`\n );\n e.stack = error.stack;\n throw e;\n }\n\n // remove key\n const index = userConfigKeys.indexOf(key.split('.')[0]);\n if (index !== -1) {\n userConfigKeys.splice(index, 1);\n }\n\n // update userConfig with defaultConfig\n if (key in defaultConfig) {\n const newValue = mergeDefault({\n defaultConfig: defaultConfig[key],\n config: value\n });\n updateUserConfigWithKey({\n key,\n value: newValue,\n userConfig\n });\n }\n });\n\n if (userConfigKeys.length) {\n const keys = userConfigKeys.length > 1 ? 'keys' : 'key';\n throw new Error(\n `Invalid config ${keys}: ${userConfigKeys.join(', ')}`\n );\n }\n\n return userConfig;\n }\n\n getUserConfig() {\n const configFile = this.getConfigFile();\n this.configFile = configFile;\n if (configFile.length > 0) {\n // clear require cache and set babel register\n const requireDeps = configFile.reduce((memo, file) => {\n memo = memo.concat(parseRequireDeps(file));\n return memo;\n }, []);\n requireDeps.forEach(cleanRequireCache);\n this.service.babelRegister.setOnlyMap({\n key: 'config',\n value: requireDeps\n });\n\n // require config and merge\n return this.mergeConfig(...this.requireConfigs(configFile));\n }\n return {};\n }\n\n addAffix(file, affix) {\n const ext = extname(file);\n return file.replace(new RegExp(`${ext}$`), `.${affix}${ext}`);\n }\n\n requireConfigs(configFiles) {\n // eslint-disable-next-line\n return configFiles.map((f) => compatESModuleRequire(require(f)));\n }\n\n mergeConfig(...configs) {\n let ret = {};\n for (const config of configs) {\n // TODO: 精细化处理,比如处理 dotted config key\n ret = deepmerge(ret, config);\n }\n return ret;\n }\n\n getConfigFile() {\n // TODO: support custom config file\n let configFile = CONFIG_FILES.find(f => existsSync(join(this.cwd, f)));\n if (!configFile) return [];\n configFile = winPath(configFile);\n let envConfigFile;\n // 潜在问题:\n // .local 和 .env 的配置必须有 configFile 才有效\n if (process.env.FES_ENV) {\n envConfigFile = this.addAffix(\n configFile,\n process.env.FES_ENV\n );\n if (!existsSync(join(this.cwd, envConfigFile))) {\n throw new Error(\n `get user config failed, ${envConfigFile} does not exist, but process.env.FES_ENV is set to ${process.env.FES_ENV}.`\n );\n }\n }\n const files = [\n configFile,\n envConfigFile,\n this.localConfig && this.addAffix(configFile, 'local')\n ]\n .filter(f => !!f)\n .map(f => join(this.cwd, f))\n .filter(f => existsSync(f));\n return files;\n }\n\n getWatchFilesAndDirectories() {\n const fesEnv = process.env.FES_ENV;\n const configFiles = lodash.clone(CONFIG_FILES);\n CONFIG_FILES.forEach((f) => {\n if (this.localConfig) configFiles.push(this.addAffix(f, 'local'));\n if (fesEnv) configFiles.push(this.addAffix(f, fesEnv));\n });\n\n const configDir = winPath(join(this.cwd, 'config'));\n\n const files = configFiles\n .reduce((memo, f) => {\n const file = winPath(join(this.cwd, f));\n if (existsSync(file)) {\n memo = memo.concat(parseRequireDeps(file));\n } else {\n memo.push(file);\n }\n return memo;\n }, [])\n .filter(f => !f.startsWith(configDir));\n\n return [configDir].concat(files);\n }\n\n watch(opts) {\n let paths = this.getWatchFilesAndDirectories();\n let userConfig = opts.userConfig;\n const watcher = chokidar.watch(paths, {\n ignoreInitial: true,\n cwd: this.cwd\n });\n watcher.on('all', (event, path) => {\n console.log(chalk.green(`[${event}] ${path}`));\n const newPaths = this.getWatchFilesAndDirectories();\n const diffs = lodash.difference(newPaths, paths);\n if (diffs.length) {\n watcher.add(diffs);\n paths = paths.concat(diffs);\n }\n\n const newUserConfig = this.getUserConfig();\n const pluginChanged = [];\n const valueChanged = [];\n Object.keys(this.service.plugins).forEach((pluginId) => {\n const { key, config = {} } = this.service.plugins[pluginId];\n // recognize as key if have schema config\n if (!config.schema) return;\n if (!isEqual(newUserConfig[key], userConfig[key])) {\n const changed = {\n key,\n pluginId\n };\n if (\n newUserConfig[key] === false\n || userConfig[key] === false\n ) {\n pluginChanged.push(changed);\n } else {\n valueChanged.push(changed);\n }\n }\n });\n\n if (pluginChanged.length || valueChanged.length) {\n opts.onChange({\n userConfig: newUserConfig,\n pluginChanged,\n valueChanged\n });\n }\n userConfig = newUserConfig;\n });\n\n return () => {\n watcher.close();\n };\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/config/utils/configUtils.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····key,⏎····value,⏎····userConfig⏎` with `·key,·value,·userConfig·`","line":4,"column":42,"nodeType":null,"messageId":"replace","endLine":8,"endColumn":1,"fix":{"range":[110,146],"text":" key, value, userConfig "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····key,⏎····userConfig⏎` with `·key,·userConfig·`","line":12,"column":39,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":1,"fix":{"range":[225,250],"text":" key, userConfig "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { lodash } from '@fesjs/utils';\nimport set from 'set-value';\n\nexport function updateUserConfigWithKey({\n key,\n value,\n userConfig\n}) {\n set(userConfig, key, value);\n}\n\nexport function getUserConfigWithKey({\n key,\n userConfig\n}) {\n return lodash.get(userConfig, key);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/config/utils/isEqual.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/config/utils/mergeDefault.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":3,"column":1,"nodeType":null,"messageId":"delete","endLine":4,"endColumn":1,"fix":{"range":[51,52],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { deepmerge, lodash } from '@fesjs/utils';\n\n\nexport default ({ defaultConfig, config }) => {\n if (lodash.isPlainObject(defaultConfig) && lodash.isPlainObject(config)) {\n return deepmerge(defaultConfig, config);\n }\n return typeof config !== 'undefined' ? config : defaultConfig;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":6,"column":1,"nodeType":null,"messageId":"delete","endLine":7,"endColumn":1,"fix":{"range":[99,100],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····Config,⏎····Service,⏎····PluginAPI,⏎····isPluginOrPreset,⏎····PluginType,⏎····Logger⏎` with `·Config,·Service,·PluginAPI,·isPluginOrPreset,·PluginType,·Logger·`","line":14,"column":9,"nodeType":null,"messageId":"replace","endLine":21,"endColumn":1,"fix":{"range":[359,449],"text":" Config, Service, PluginAPI, isPluginOrPreset, PluginType, Logger "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\n\n\nimport Config from './config';\nimport Logger from './logger';\nimport Service from './service';\nimport PluginAPI from './service/pluginAPI';\nimport { PluginType } from './service/enums';\nimport { isPluginOrPreset } from './service/utils/pluginUtils';\n\nexport {\n Config,\n Service,\n PluginAPI,\n isPluginOrPreset,\n PluginType,\n Logger\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/logger/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····createDebug,⏎····chalk⏎` with `·createDebug,·chalk·`","line":6,"column":9,"nodeType":null,"messageId":"replace","endLine":9,"endColumn":1,"fix":{"range":[107,135],"text":" createDebug, chalk "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `message·||·''` with `⏎················message·||·''⏎············`","line":74,"column":70,"nodeType":null,"messageId":"replace","endLine":74,"endColumn":83,"fix":{"range":[1931,1944],"text":"\n message || ''\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\n\nimport {\n createDebug,\n chalk\n} from '@fesjs/utils';\nimport readline from 'readline';\n\nexport default class Logger {\n LOG = chalk.black.bgBlue('LOG');\n\n INFO = chalk.black.bgBlue('INFO');\n\n WARN = chalk.black.bgHex('#faad14')('WARN');\n\n ERROR = chalk.black.bgRed('ERROR');\n\n PROFILE = chalk.black.bgCyan('PROFILE');\n\n constructor(namespace) {\n // TODO: get namespace filename accounding caller function\n if (!namespace) {\n throw new Error('logger needs namespace');\n }\n this.namespace = namespace;\n this.profilers = {};\n this.debug = createDebug(this.namespace);\n }\n\n log(...args) {\n // TODO: node env production\n console.log(this.LOG, ...args);\n }\n\n /**\n * The {@link logger.info} function is an alias for {@link logger.log()}.\n * @param args\n */\n info(...args) {\n console.log(this.INFO, ...args);\n }\n\n error(...args) {\n console.error(this.ERROR, ...args);\n }\n\n warn(...args) {\n console.warn(this.WARN, ...args);\n }\n\n formatTiming(timing) {\n return timing < 60 * 1000\n ? `${Math.round(timing / 10) / 100}s`\n : `${Math.round(timing / 600) / 100}m`;\n }\n\n profile(id, message) {\n const time = Date.now();\n const namespace = `${this.namespace}:${id}`;\n // for test\n let msg;\n if (this.profilers[id]) {\n const timeEnd = this.profilers[id];\n delete this.profilers[id];\n process.stderr.write(`${this.PROFILE} `);\n msg = `${this.PROFILE} ${chalk.cyan(\n `└ ${namespace}`\n )} Completed in ${this.formatTiming(time - timeEnd)}`;\n console.log(msg);\n } else {\n msg = `${this.PROFILE} ${chalk.cyan(`┌ ${namespace}`)} ${message || ''}`;\n console.log(msg);\n }\n\n this.profilers[id] = time;\n return msg;\n }\n\n clearConsole(title) {\n if (process.stdout.isTTY) {\n const blank = '\\n'.repeat(process.stdout.rows);\n console.log(blank);\n readline.cursorTo(process.stdout, 0, 0);\n readline.clearScreenDown(process.stdout);\n if (title) {\n console.log(title);\n }\n }\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/babelRegister.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····lodash,⏎····winPath⏎}·from·'@fesjs/utils';⏎` with `·lodash,·winPath·}·from·'@fesjs/utils';`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":1,"fix":{"range":[8,56],"text":" lodash, winPath } from '@fesjs/utils';"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········key,⏎········value⏎···` with `·key,·value`","line":10,"column":17,"nodeType":null,"messageId":"replace","endLine":13,"endColumn":4,"fix":{"range":[127,158],"text":" key, value"}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import {\n lodash,\n winPath\n} from '@fesjs/utils';\n\n\nexport default class BabelRegister {\n only = {};\n\n setOnlyMap({\n key,\n value\n }) {\n this.only[key] = value;\n this.register();\n }\n\n register() {\n const only = lodash.uniq(\n Object.keys(this.only)\n .reduce((memo, key) => memo.concat(this.only[key]), [])\n .map(winPath)\n );\n require('@babel/register')({\n presets: [\n [\n require.resolve('@babel/preset-env'),\n {\n targets: {\n node: 'current'\n },\n modules: 'commonjs'\n }\n ]\n ],\n ignore: [/node_modules/],\n only,\n extensions: ['.jsx', '.js', '.ts', '.tsx'],\n babelrc: false,\n cache: false\n });\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/enums.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/getPaths.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `value` with `(value)`","line":15,"column":34,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":39,"fix":{"range":[391,396],"text":"(value)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····cwd,⏎····config,⏎····env⏎` with `·cwd,·config,·env·`","line":18,"column":42,"nodeType":null,"messageId":"replace","endLine":22,"endColumn":1,"fix":{"range":[461,491],"text":" cwd, config, env "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\n\nimport { join } from 'path';\nimport { existsSync, statSync } from 'fs';\nimport { lodash, winPath } from '@fesjs/utils';\n\nfunction isDirectoryAndExist(path) {\n return existsSync(path) && statSync(path).isDirectory();\n}\n\nfunction normalizeWithWinPath(obj) {\n return lodash.mapValues(obj, value => winPath(value));\n}\n\nexport default function getServicePaths({\n cwd,\n config,\n env\n}) {\n let absSrcPath = cwd;\n if (isDirectoryAndExist(join(cwd, 'src'))) {\n absSrcPath = join(cwd, 'src');\n }\n\n const absPagesPath = config.singular\n ? join(absSrcPath, 'page')\n : join(absSrcPath, 'pages');\n\n const tmpDir = ['.fes', env !== 'development' && env]\n .filter(Boolean)\n .join('-');\n return normalizeWithWinPath({\n cwd,\n absNodeModulesPath: join(cwd, 'node_modules'),\n absOutputPath: join(cwd, config.outputPath || './dist'),\n absSrcPath,\n absPagesPath,\n absTmpPath: join(absSrcPath, tmpDir)\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":98,"column":1,"nodeType":null,"messageId":"delete","endLine":99,"endColumn":1,"fix":{"range":[2149,2150],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":124,"column":1,"nodeType":null,"messageId":"delete","endLine":125,"endColumn":1,"fix":{"range":[2854,2855],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path·=>` with `(path)·=>⏎···················`","line":325,"column":32,"nodeType":null,"messageId":"replace","endLine":325,"endColumn":39,"fix":{"range":[9023,9030],"text":"(path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":326,"column":1,"nodeType":null,"messageId":"insert","endLine":326,"endColumn":1,"fix":{"range":[9043,9043],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `························`","line":327,"column":1,"nodeType":null,"messageId":"replace","endLine":327,"endColumn":21,"fix":{"range":[9088,9108],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":328,"column":1,"nodeType":null,"messageId":"insert","endLine":328,"endColumn":1,"fix":{"range":[9114,9114],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎················`","line":329,"column":17,"nodeType":null,"messageId":"replace","endLine":329,"endColumn":19,"fix":{"range":[9164,9166],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path·=>` with `(path)·=>⏎···················`","line":347,"column":32,"nodeType":null,"messageId":"replace","endLine":347,"endColumn":39,"fix":{"range":[9686,9693],"text":"(path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":348,"column":1,"nodeType":null,"messageId":"insert","endLine":348,"endColumn":1,"fix":{"range":[9706,9706],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `························`","line":349,"column":1,"nodeType":null,"messageId":"replace","endLine":349,"endColumn":21,"fix":{"range":[9751,9771],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":350,"column":1,"nodeType":null,"messageId":"insert","endLine":350,"endColumn":1,"fix":{"range":[9777,9777],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················})` with `····················})⏎················`","line":351,"column":1,"nodeType":null,"messageId":"replace","endLine":351,"endColumn":19,"fix":{"range":[9811,9829],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":354,"column":6,"nodeType":null,"messageId":"delete","endLine":355,"endColumn":1,"fix":{"range":[9861,9862],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `memo` with `(memo)`","line":466,"column":31,"nodeType":null,"messageId":"replace","endLine":466,"endColumn":35,"fix":{"range":[13334,13338],"text":"(memo)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace ``@fesjs/fes·${this.fesPkg.version}`,·'-v,·--vers',·'output·the·current·version'` with `⏎················`@fesjs/fes·${this.fesPkg.version}`,⏎················'-v,·--vers',⏎················'output·the·current·version'⏎············`","line":501,"column":22,"nodeType":null,"messageId":"replace","endLine":501,"endColumn":101,"fix":{"range":[14593,14672],"text":"\n `@fesjs/fes ${this.fesPkg.version}`,\n '-v, --vers',\n 'output the current version'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.command(command)` with `⏎················.command(command)⏎················`","line":526,"column":28,"nodeType":null,"messageId":"replace","endLine":526,"endColumn":45,"fix":{"range":[15427,15444],"text":"\n .command(command)\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·args,·options:·c.opts(),` with `⏎························args,⏎························options:·c.opts(),⏎·······················`","line":542,"column":33,"nodeType":null,"messageId":"replace","endLine":542,"endColumn":58,"fix":{"range":[16182,16207],"text":"\n args,\n options: c.opts(),\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `c·=>·c.on('--help',·()·=>·console.log())` with `(c)·=>⏎············c.on('--help',·()·=>·console.log())⏎········`","line":561,"column":39,"nodeType":null,"messageId":"replace","endLine":561,"endColumn":79,"fix":{"range":[16680,16720],"text":"(c) =>\n c.on('--help', () => console.log())\n "}}],"errorCount":18,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":18,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\nimport { join } from 'path';\nimport { EventEmitter } from 'events';\nimport assert from 'assert';\nimport { AsyncSeriesWaterfallHook } from 'tapable';\nimport { existsSync } from 'fs';\nimport { lodash, chalk } from '@fesjs/utils';\nimport { Command, Option } from 'commander';\nimport { resolvePresets, pathToObj, resolvePlugins } from './utils/pluginUtils';\nimport loadDotEnv from './utils/loadDotEnv';\nimport isPromise from './utils/isPromise';\nimport BabelRegister from './babelRegister';\nimport PluginAPI from './pluginAPI';\nimport {\n ApplyPluginsType,\n ConfigChangeType,\n EnableBy,\n PluginType,\n ServiceStage\n} from './enums';\nimport Config from '../config';\nimport { getUserConfigWithKey } from '../config/utils/configUtils';\nimport getPaths from './getPaths';\n\n// TODO\n// 1. duplicated key\n// 2. Logger\nexport default class Service extends EventEmitter {\n cwd;\n\n pkg;\n\n skipPluginIds = new Set();\n\n // lifecycle stage\n stage = ServiceStage.uninitialized;\n\n // registered commands\n commands = {};\n\n // including plugins\n plugins = {};\n\n // plugin methods\n pluginMethods = {};\n\n // initial presets and plugins from arguments, config, process.env, and package.json\n initialPresets = [];\n\n // initial plugins from arguments, config, process.env, and package.json\n initialPlugins = [];\n\n _extraPresets = [];\n\n _extraPlugins = [];\n\n // user config\n userConfig;\n\n configInstance;\n\n config = null;\n\n // babel register\n babelRegister;\n\n // hooks\n hooksByPluginId = {};\n\n hooks = {};\n\n // paths\n paths = {};\n\n env;\n\n ApplyPluginsType = ApplyPluginsType;\n\n EnableBy = EnableBy;\n\n ConfigChangeType = ConfigChangeType;\n\n ServiceStage = ServiceStage;\n\n args;\n\n constructor(opts) {\n super();\n this.cwd = opts.cwd || process.cwd();\n // repoDir should be the root dir of repo\n this.pkg = opts.pkg || this.resolvePackage();\n this.env = opts.env || process.env.NODE_ENV;\n this.fesPkg = opts.fesPkg || {};\n\n\n assert(existsSync(this.cwd), `cwd ${this.cwd} does not exist.`);\n\n // register babel before config parsing\n this.babelRegister = new BabelRegister();\n\n // load .env or .local.env\n this.loadEnv();\n\n // get user config without validation\n this.configInstance = new Config({\n cwd: this.cwd,\n service: this,\n localConfig: this.env === 'development'\n });\n this.userConfig = this.configInstance.getUserConfig();\n\n // get paths\n this.paths = getPaths({\n cwd: this.cwd,\n config: this.userConfig,\n env: this.env\n });\n\n this.program = this.initCommand();\n\n\n // setup initial plugins\n const baseOpts = {\n pkg: this.pkg,\n cwd: this.cwd\n };\n this.initialPresets = resolvePresets({\n ...baseOpts,\n presets: opts.presets || [],\n userConfigPresets: this.userConfig.presets || []\n });\n this.initialPlugins = resolvePlugins({\n ...baseOpts,\n plugins: opts.plugins || [],\n userConfigPlugins: this.userConfig.plugins || []\n });\n }\n\n setStage(stage) {\n this.stage = stage;\n }\n\n resolvePackage() {\n try {\n // eslint-disable-next-line\n return require(join(this.cwd, \"package.json\"));\n } catch (e) {\n return {};\n }\n }\n\n loadEnv() {\n const basePath = join(this.cwd, '.env');\n const localPath = `${basePath}.local`;\n loadDotEnv(basePath);\n if (process.env.FES_ENV) {\n loadDotEnv(`${basePath}.${process.env.FES_ENV}`);\n }\n loadDotEnv(localPath);\n }\n\n async init() {\n this.setStage(ServiceStage.init);\n await this.initPresetsAndPlugins();\n\n // hooksByPluginId -> hooks\n // hooks is mapped with hook key, prepared for applyPlugins()\n this.setStage(ServiceStage.initHooks);\n Object.keys(this.hooksByPluginId).forEach((id) => {\n const hooks = this.hooksByPluginId[id];\n hooks.forEach((hook) => {\n const { key } = hook;\n hook.pluginId = id;\n this.hooks[key] = (this.hooks[key] || []).concat(hook);\n });\n });\n\n // plugin is totally ready\n this.setStage(ServiceStage.pluginReady);\n await this.applyPlugins({\n key: 'onPluginReady',\n type: ApplyPluginsType.event\n });\n\n // get config, including:\n // 1. merge default config\n // 2. validate\n this.setStage(ServiceStage.getConfig);\n await this.setConfig();\n\n // merge paths to keep the this.paths ref\n this.setStage(ServiceStage.getPaths);\n // config.outputPath may be modified by plugins\n if (this.config.outputPath) {\n this.paths.absOutputPath = join(this.cwd, this.config.outputPath);\n }\n const paths = await this.applyPlugins({\n key: 'modifyPaths',\n type: ApplyPluginsType.modify,\n initialValue: this.paths\n });\n Object.keys(paths).forEach((key) => {\n this.paths[key] = paths[key];\n });\n }\n\n async setConfig() {\n const defaultConfig = await this.applyPlugins({\n key: 'modifyDefaultConfig',\n type: this.ApplyPluginsType.modify,\n initialValue: await this.configInstance.getDefaultConfig()\n });\n this.config = await this.applyPlugins({\n key: 'modifyConfig',\n type: this.ApplyPluginsType.modify,\n initialValue: this.configInstance.getConfig({\n defaultConfig\n })\n });\n }\n\n async initPresetsAndPlugins() {\n this.setStage(ServiceStage.initPresets);\n this._extraPlugins = [];\n while (this.initialPresets.length) {\n // eslint-disable-next-line\n await this.initPreset(this.initialPresets.shift());\n }\n\n this.setStage(ServiceStage.initPlugins);\n this._extraPlugins.push(...this.initialPlugins);\n while (this._extraPlugins.length) {\n // eslint-disable-next-line\n await this.initPlugin(this._extraPlugins.shift());\n }\n }\n\n getPluginAPI(opts) {\n const pluginAPI = new PluginAPI(opts);\n\n // register built-in methods\n [\n 'onPluginReady',\n 'modifyPaths',\n 'onStart',\n 'modifyDefaultConfig',\n 'modifyConfig'\n ].forEach((name) => {\n pluginAPI.registerMethod({\n name,\n exitsError: false\n });\n });\n\n return new Proxy(pluginAPI, {\n get: (target, prop) => {\n // 由于 pluginMethods 需要在 register 阶段可用\n // 必须通过 proxy 的方式动态获取最新,以实现边注册边使用的效果\n if (this.pluginMethods[prop]) return this.pluginMethods[prop];\n if (\n [\n 'applyPlugins',\n 'ApplyPluginsType',\n 'EnableBy',\n 'ConfigChangeType',\n 'babelRegister',\n 'stage',\n 'ServiceStage',\n 'paths',\n 'cwd',\n 'pkg',\n 'configInstance',\n 'userConfig',\n 'config',\n 'env',\n 'args',\n 'hasPlugins',\n 'hasPresets',\n 'setConfig'\n ].includes(prop)\n ) {\n return typeof this[prop] === 'function'\n ? this[prop].bind(this)\n : this[prop];\n }\n return target[prop];\n }\n });\n }\n\n async applyAPI(opts) {\n let ret = opts.apply()(opts.api);\n if (isPromise(ret)) {\n ret = await ret;\n }\n return ret || {};\n }\n\n async initPreset(preset) {\n const { id, key, apply } = preset;\n preset.isPreset = true;\n\n const api = this.getPluginAPI({ id, key, service: this });\n\n // register before apply\n this.registerPlugin(preset);\n const { presets, plugins } = await this.applyAPI({\n api,\n apply\n });\n\n // register extra presets and plugins\n if (presets) {\n assert(\n Array.isArray(presets),\n `presets returned from preset ${id} must be Array.`\n );\n // 插到最前面,下个 while 循环优先执行\n this._extraPresets.splice(\n 0,\n 0,\n ...presets.map(path => pathToObj({\n type: PluginType.preset,\n path,\n cwd: this.cwd\n }))\n );\n }\n\n // 深度优先\n const extraPresets = lodash.clone(this._extraPresets);\n this._extraPresets = [];\n while (extraPresets.length) {\n // eslint-disable-next-line\n await this.initPreset(extraPresets.shift());\n }\n\n if (plugins) {\n assert(\n Array.isArray(plugins),\n `plugins returned from preset ${id} must be Array.`\n );\n this._extraPlugins.push(\n ...plugins.map(path => pathToObj({\n type: PluginType.plugin,\n path,\n cwd: this.cwd\n }))\n );\n }\n }\n\n\n async initPlugin(plugin) {\n const { id, key, apply } = plugin;\n\n const api = this.getPluginAPI({\n id,\n key,\n service: this\n });\n\n // register before apply\n this.registerPlugin(plugin);\n await this.applyAPI({\n api,\n apply\n });\n }\n\n getPluginOptsWithKey(key) {\n return getUserConfigWithKey({\n key,\n userConfig: this.userConfig\n });\n }\n\n registerPlugin(plugin) {\n this.plugins[plugin.id] = plugin;\n }\n\n isPluginEnable(pluginId) {\n // api.skipPlugins() 的插件\n if (this.skipPluginIds.has(pluginId)) return false;\n\n const { key, enableBy } = this.plugins[pluginId];\n\n // 手动设置为 false\n if (this.userConfig[key] === false) return false;\n\n // 配置开启\n if (enableBy === this.EnableBy.config && !(key in this.userConfig)) {\n return false;\n }\n\n // 函数自定义开启\n if (typeof enableBy === 'function') {\n return enableBy();\n }\n\n // 注册开启\n return true;\n }\n\n hasPresets(presetIds) {\n return presetIds.every((presetId) => {\n const preset = this.plugins[presetId];\n return preset && preset.isPreset && this.isPluginEnable(presetId);\n });\n }\n\n hasPlugins(pluginIds) {\n return pluginIds.every((pluginId) => {\n const plugin = this.plugins[pluginId];\n return plugin && !plugin.isPreset && this.isPluginEnable(pluginId);\n });\n }\n\n async applyPlugins(opts) {\n const hooks = this.hooks[opts.key] || [];\n switch (opts.type) {\n case ApplyPluginsType.add:\n if ('initialValue' in opts) {\n assert(\n Array.isArray(opts.initialValue),\n 'applyPlugins failed, opts.initialValue must be Array if opts.type is add.'\n );\n }\n // eslint-disable-next-line\n const tAdd = new AsyncSeriesWaterfallHook([\"memo\"]);\n for (const hook of hooks) {\n if (!this.isPluginEnable(hook.pluginId)) {\n continue;\n }\n tAdd.tapPromise(\n {\n name: hook.pluginId,\n stage: hook.stage || 0,\n // @ts-ignore\n before: hook.before\n },\n async (memo) => {\n const items = await hook.fn(opts.args);\n return memo.concat(items);\n }\n );\n }\n return tAdd.promise(opts.initialValue || []);\n case ApplyPluginsType.modify:\n // eslint-disable-next-line\n const tModify = new AsyncSeriesWaterfallHook([\"memo\"]);\n for (const hook of hooks) {\n if (!this.isPluginEnable(hook.pluginId)) {\n continue;\n }\n tModify.tapPromise(\n {\n name: hook.pluginId,\n stage: hook.stage || 0,\n // @ts-ignore\n before: hook.before\n },\n async memo => hook.fn(memo, opts.args)\n );\n }\n return tModify.promise(opts.initialValue);\n case ApplyPluginsType.event:\n // eslint-disable-next-line\n const tEvent = new AsyncSeriesWaterfallHook([\"_\"]);\n for (const hook of hooks) {\n if (!this.isPluginEnable(hook.pluginId)) {\n continue;\n }\n tEvent.tapPromise(\n {\n name: hook.pluginId,\n stage: hook.stage || 0,\n // @ts-ignore\n before: hook.before\n },\n async () => {\n await hook.fn(opts.args);\n }\n );\n }\n return tEvent.promise();\n default:\n throw new Error(\n `applyPlugin failed, type is not defined or is not matched, got ${opts.type}.`\n );\n }\n }\n\n initCommand() {\n const command = new Command();\n command\n .usage(' [options]')\n .version(`@fesjs/fes ${this.fesPkg.version}`, '-v, --vers', 'output the current version')\n .description(chalk.cyan('一个好用的前端应用解决方案'));\n return command;\n }\n\n async run({ rawArgv = {}, args = {} }) {\n await this.init();\n\n this.setStage(ServiceStage.run);\n await this.applyPlugins({\n key: 'onStart',\n type: ApplyPluginsType.event,\n args: {\n args\n }\n });\n\n return this.runCommand({ rawArgv, args });\n }\n\n async runCommand({ rawArgv = {}, args = {} }) {\n assert(this.stage >= ServiceStage.init, 'service is not initialized.');\n Object.keys(this.commands).forEach((command) => {\n const commandOptionConfig = this.commands[command];\n const program = this.program;\n let c = program.command(command).description(commandOptionConfig.description);\n if (Array.isArray(commandOptionConfig.options)) {\n commandOptionConfig.options.forEach((config) => {\n const option = new Option(config.name, config.description);\n if (config.default) {\n option.default(config.default);\n }\n if (config.choices) {\n option.choices(config.choices);\n }\n c = c.addOption(option);\n });\n }\n if (commandOptionConfig.fn) {\n c.action(async () => {\n await commandOptionConfig.fn({\n rawArgv, args, options: c.opts(), program\n });\n });\n }\n });\n\n return this.parseCommand();\n }\n\n async parseCommand() {\n this.program.on('--help', () => {\n console.log();\n console.log(\n ` Run ${chalk.cyan(\n 'fes --help'\n )} for detailed usage of given command.`\n );\n console.log();\n });\n this.program.commands.forEach(c => c.on('--help', () => console.log()));\n return this.program.parseAsync(process.argv);\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/pluginAPI.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········id,⏎········key,⏎········config,⏎········enableBy⏎···` with `·id,·key,·config,·enableBy`","line":24,"column":15,"nodeType":null,"messageId":"replace","endLine":29,"endColumn":4,"fix":{"range":[645,707],"text":" id, key, config, enableBy"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":91,"column":60,"nodeType":null,"messageId":"insert","endLine":91,"endColumn":60,"fix":{"range":[2826,2826],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `||` with `·······`","line":92,"column":9,"nodeType":null,"messageId":"replace","endLine":92,"endColumn":11,"fix":{"range":[2835,2837],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `plugin·=>·(` with `(plugin)·=>⏎············`","line":99,"column":42,"nodeType":null,"messageId":"replace","endLine":99,"endColumn":53,"fix":{"range":[3158,3169],"text":"(plugin) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `?·(plugin)` with `····?·plugin`","line":100,"column":13,"nodeType":null,"messageId":"replace","endLine":100,"endColumn":23,"fix":{"range":[3203,3213],"text":" ? plugin"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":101,"column":1,"nodeType":null,"messageId":"insert","endLine":101,"endColumn":1,"fix":{"range":[3214,3214],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":102,"column":17,"nodeType":null,"messageId":"insert","endLine":102,"endColumn":17,"fix":{"range":[3256,3256],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":103,"column":17,"nodeType":null,"messageId":"insert","endLine":103,"endColumn":17,"fix":{"range":[3297,3297],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `······················`","line":104,"column":1,"nodeType":null,"messageId":"replace","endLine":104,"endColumn":17,"fix":{"range":[3311,3327],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}))` with `······})⏎········`","line":105,"column":13,"nodeType":null,"messageId":"replace","endLine":105,"endColumn":16,"fix":{"range":[3361,3364],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `preset·=>·(` with `(preset)·=>⏎············`","line":122,"column":42,"nodeType":null,"messageId":"replace","endLine":122,"endColumn":53,"fix":{"range":[3962,3973],"text":"(preset) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `?·(preset)` with `····?·preset`","line":123,"column":13,"nodeType":null,"messageId":"replace","endLine":123,"endColumn":23,"fix":{"range":[4007,4017],"text":" ? preset"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":124,"column":1,"nodeType":null,"messageId":"insert","endLine":124,"endColumn":1,"fix":{"range":[4018,4018],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `······················`","line":125,"column":1,"nodeType":null,"messageId":"replace","endLine":125,"endColumn":17,"fix":{"range":[4044,4060],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":126,"column":17,"nodeType":null,"messageId":"insert","endLine":126,"endColumn":17,"fix":{"range":[4101,4101],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `······················`","line":127,"column":1,"nodeType":null,"messageId":"replace","endLine":127,"endColumn":17,"fix":{"range":[4115,4131],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}))` with `······})⏎········`","line":128,"column":13,"nodeType":null,"messageId":"replace","endLine":128,"endColumn":16,"fix":{"range":[4165,4168],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········name,⏎········fn,⏎········exitsError·=·true⏎···` with `·name,·fn,·exitsError·=·true`","line":133,"column":21,"nodeType":null,"messageId":"replace","endLine":137,"endColumn":4,"fix":{"range":[4297,4353],"text":" name, fn, exitsError = true"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·fn` with `⏎············fn·||`","line":147,"column":43,"nodeType":null,"messageId":"replace","endLine":147,"endColumn":46,"fix":{"range":[4684,4687],"text":"\n fn ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":148,"column":1,"nodeType":null,"messageId":"insert","endLine":148,"endColumn":1,"fix":{"range":[4688,4688],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `······` with `············`","line":149,"column":1,"nodeType":null,"messageId":"replace","endLine":149,"endColumn":7,"fix":{"range":[4743,4749],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `||` with `·····`","line":150,"column":7,"nodeType":null,"messageId":"replace","endLine":150,"endColumn":9,"fix":{"range":[4793,4795],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `················`","line":151,"column":1,"nodeType":null,"messageId":"replace","endLine":151,"endColumn":11,"fix":{"range":[4816,4826],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··············` with `····················`","line":152,"column":1,"nodeType":null,"messageId":"replace","endLine":152,"endColumn":15,"fix":{"range":[4841,4855],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··············...(utils.lodash.isPlainObject(hookFn)·?·hookFn` with `····················...(utils.lodash.isPlainObject(hookFn)⏎························?·hookFn⏎·······················`","line":153,"column":1,"nodeType":null,"messageId":"replace","endLine":153,"endColumn":62,"fix":{"range":[4866,4927],"text":" ...(utils.lodash.isPlainObject(hookFn)\n ? hookFn\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `················`","line":154,"column":1,"nodeType":null,"messageId":"replace","endLine":154,"endColumn":11,"fix":{"range":[4946,4956],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":155,"column":1,"nodeType":null,"messageId":"insert","endLine":155,"endColumn":1,"fix":{"range":[4959,4959],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `················`","line":156,"column":1,"nodeType":null,"messageId":"replace","endLine":156,"endColumn":11,"fix":{"range":[4983,4993],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `······`","line":157,"column":1,"nodeType":null,"messageId":"insert","endLine":157,"endColumn":1,"fix":{"range":[5014,5014],"text":" "}}],"errorCount":29,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":29,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/tree/master/packages/core\n */\n\nimport assert from 'assert';\nimport * as utils from '@fesjs/utils';\nimport { isValidPlugin, pathToObj } from './utils/pluginUtils';\nimport { EnableBy, PluginType, ServiceStage } from './enums';\nimport Logger from '../logger';\n\n// TODO\n// 标准化 logger\nexport default class PluginAPI {\n constructor(opts) {\n this.id = opts.id;\n this.key = opts.key;\n this.service = opts.service;\n this.utils = utils;\n this.logger = new Logger(`fes:plugin:${this.id || this.key}`);\n }\n\n // TODO: reversed keys\n describe({\n id,\n key,\n config,\n enableBy\n } = {}) {\n const { plugins } = this.service;\n // this.id and this.key is generated automatically\n // so we need to diff first\n if (id && this.id !== id) {\n if (plugins[id]) {\n const name = plugins[id].isPreset ? 'preset' : 'plugin';\n throw new Error(\n `api.describe() failed, ${name} ${id} is already registered by ${plugins[id].path}.`\n );\n }\n plugins[id] = plugins[this.id];\n plugins[id].id = id;\n delete plugins[this.id];\n this.id = id;\n }\n if (key && this.key !== key) {\n this.key = key;\n plugins[this.id].key = key;\n }\n\n if (config) {\n plugins[this.id].config = config;\n }\n\n plugins[this.id].enableBy = enableBy || EnableBy.register;\n }\n\n register(hook) {\n assert(\n hook.key && typeof hook.key === 'string',\n `api.register() failed, hook.key must supplied and should be string, but got ${hook.key}.`\n );\n assert(\n hook.fn && typeof hook.fn === 'function',\n `api.register() failed, hook.fn must supplied and should be function, but got ${hook.fn}.`\n );\n this.service.hooksByPluginId[this.id] = (\n this.service.hooksByPluginId[this.id] || []\n ).concat(hook);\n }\n\n registerCommand(commandOption) {\n const { command, fn } = commandOption;\n assert(\n !this.service.commands[command],\n `api.registerCommand() failed, the command ${command} is exists.`\n );\n assert(\n typeof command === 'string',\n 'api.registerCommand() failed, the command must be String.'\n );\n assert(\n typeof fn === 'function',\n 'api.registerCommand() failed, the fn must be function.'\n );\n this.service.commands[command] = commandOption;\n }\n\n // 在 preset 初始化阶段放后面,在插件注册阶段放前面\n registerPlugins(plugins) {\n assert(\n this.service.stage === ServiceStage.initPresets\n || this.service.stage === ServiceStage.initPlugins,\n 'api.registerPlugins() failed, it should only be used in registering stage.'\n );\n assert(\n Array.isArray(plugins),\n 'api.registerPlugins() failed, plugins must be Array.'\n );\n const extraPlugins = plugins.map(plugin => (isValidPlugin(plugin)\n ? (plugin)\n : pathToObj({\n type: PluginType.plugin,\n path: plugin,\n cwd: this.service.cwd\n })));\n if (this.service.stage === ServiceStage.initPresets) {\n this.service._extraPlugins.push(...extraPlugins);\n } else {\n this.service._extraPlugins.splice(0, 0, ...extraPlugins);\n }\n }\n\n registerPresets(presets) {\n assert(\n this.service.stage === ServiceStage.initPresets,\n 'api.registerPresets() failed, it should only used in presets.'\n );\n assert(\n Array.isArray(presets),\n 'api.registerPresets() failed, presets must be Array.'\n );\n const extraPresets = presets.map(preset => (isValidPlugin(preset)\n ? (preset)\n : pathToObj({\n type: PluginType.preset,\n path: preset,\n cwd: this.service.cwd\n })));\n // 插到最前面,下个 while 循环优先执行\n this.service._extraPresets.splice(0, 0, ...extraPresets);\n }\n\n registerMethod({\n name,\n fn,\n exitsError = true\n }) {\n if (this.service.pluginMethods[name]) {\n if (exitsError) {\n throw new Error(\n `api.registerMethod() failed, method ${name} is already exist.`\n );\n } else {\n return;\n }\n }\n this.service.pluginMethods[name] = fn\n // 这里不能用 arrow function,this 需指向执行此方法的 PluginAPI\n // 否则 pluginId 会不会,导致不能正确 skip plugin\n || function (hookFn) {\n const hook = {\n key: name,\n ...(utils.lodash.isPlainObject(hookFn) ? hookFn : { fn: hookFn })\n };\n // @ts-ignore\n this.register(hook);\n };\n }\n\n skipPlugins(pluginIds) {\n pluginIds.forEach((pluginId) => {\n this.service.skipPluginIds.add(pluginId);\n });\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/utils/isPromise.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·&&`","line":3,"column":14,"nodeType":null,"messageId":"insert","endLine":3,"endColumn":14,"fix":{"range":[67,67],"text":" &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `&&·(typeof·obj·===·'object'·||·typeof·obj·===·'function')` with `····(typeof·obj·===·'object'·||·typeof·obj·===·'function')·&&`","line":4,"column":5,"nodeType":null,"messageId":"replace","endLine":4,"endColumn":62,"fix":{"range":[72,129],"text":" (typeof obj === 'object' || typeof obj === 'function') &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `&&` with `···`","line":5,"column":5,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":7,"fix":{"range":[134,136],"text":" "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"export default function isPromise(obj) {\n return (\n !!obj\n && (typeof obj === 'object' || typeof obj === 'function')\n && typeof obj.then === 'function'\n );\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/utils/loadDotEnv.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-compiler/src/service/utils/pluginUtils.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····dirname,·join,·basename,·relative,·extname⏎` with `·dirname,·join,·basename,·relative,·extname·`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":3,"endColumn":1,"fix":{"range":[8,56],"text":" dirname, join, basename, relative, extname "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(opts[type·===·PluginType.preset·?·'presets'·:·'plugins'])` with `opts[type·===·PluginType.preset·?·'presets'·:·'plugins']`","line":33,"column":13,"nodeType":null,"messageId":"replace","endLine":33,"endColumn":71,"fix":{"range":[761,819],"text":"opts[type === PluginType.preset ? 'presets' : 'plugins']"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.split(',')` with `⏎············.split(',')⏎············`","line":35,"column":56,"nodeType":null,"messageId":"replace","endLine":35,"endColumn":67,"fix":{"range":[898,909],"text":"\n .split(',')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `(`","line":40,"column":13,"nodeType":null,"messageId":"delete","endLine":40,"endColumn":14,"fix":{"range":[1135,1136],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·'userConfigPresets'` with `⏎················?·'userConfigPresets'⏎···············`","line":41,"column":39,"nodeType":null,"messageId":"replace","endLine":41,"endColumn":61,"fix":{"range":[1180,1202],"text":"\n ? 'userConfigPresets'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `)`","line":42,"column":10,"nodeType":null,"messageId":"delete","endLine":42,"endColumn":11,"fix":{"range":[1234,1235],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(path·=>` with `((path)·=>⏎·······`","line":43,"column":10,"nodeType":null,"messageId":"replace","endLine":43,"endColumn":18,"fix":{"range":[1252,1260],"text":"((path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":44,"column":1,"nodeType":null,"messageId":"replace","endLine":44,"endColumn":9,"fix":{"range":[1282,1290],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":45,"column":1,"nodeType":null,"messageId":"insert","endLine":45,"endColumn":1,"fix":{"range":[1309,1309],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····})` with `········})⏎····`","line":46,"column":1,"nodeType":null,"messageId":"replace","endLine":46,"endColumn":7,"fix":{"range":[1344,1350],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `part` with `(part)`","line":55,"column":14,"nodeType":null,"messageId":"replace","endLine":55,"endColumn":18,"fix":{"range":[1516,1520],"text":"(part)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·winPath(join(dirname(pkgJSONPath),·pkg.main·||·'index.js'))` with `⏎············winPath(join(dirname(pkgJSONPath),·pkg.main·||·'index.js'))·===`","line":73,"column":22,"nodeType":null,"messageId":"replace","endLine":73,"endColumn":82,"fix":{"range":[2049,2109],"text":"\n winPath(join(dirname(pkgJSONPath), pkg.main || 'index.js')) ==="}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·===`","line":74,"column":12,"nodeType":null,"messageId":"delete","endLine":74,"endColumn":16,"fix":{"range":[2121,2125],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path·=>` with `(path)·=>⏎·······`","line":116,"column":24,"nodeType":null,"messageId":"replace","endLine":116,"endColumn":31,"fix":{"range":[3354,3361],"text":"(path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":117,"column":9,"nodeType":null,"messageId":"insert","endLine":117,"endColumn":9,"fix":{"range":[3382,3382],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":118,"column":1,"nodeType":null,"messageId":"replace","endLine":118,"endColumn":9,"fix":{"range":[3388,3396],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":119,"column":1,"nodeType":null,"messageId":"insert","endLine":119,"endColumn":1,"fix":{"range":[3402,3402],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎····`","line":120,"column":5,"nodeType":null,"messageId":"replace","endLine":120,"endColumn":7,"fix":{"range":[3428,3430],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path·=>` with `(path)·=>⏎·······`","line":126,"column":24,"nodeType":null,"messageId":"replace","endLine":126,"endColumn":31,"fix":{"range":[3587,3594],"text":"(path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":127,"column":9,"nodeType":null,"messageId":"insert","endLine":127,"endColumn":9,"fix":{"range":[3615,3615],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":128,"column":1,"nodeType":null,"messageId":"replace","endLine":128,"endColumn":9,"fix":{"range":[3621,3629],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":129,"column":1,"nodeType":null,"messageId":"insert","endLine":129,"endColumn":1,"fix":{"range":[3635,3635],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎····`","line":130,"column":5,"nodeType":null,"messageId":"replace","endLine":130,"endColumn":7,"fix":{"range":[3661,3663],"text":" })\n "}}],"errorCount":23,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":23,"fixableWarningCount":0,"source":"import {\n dirname, join, basename, relative, extname\n} from 'path';\nimport {\n compatESModuleRequire,\n resolve,\n winPath,\n pkgUp,\n lodash\n} from '@fesjs/utils';\n\nimport { PluginType } from '../enums';\n\nconst RE = {\n [PluginType.plugin]: /^(@fesjs\\/|@webank\\/fes-|fes-)plugin-/,\n [PluginType.preset]: /^(@fesjs\\/|@webank\\/fes-|fes-)preset-/\n};\n\nexport function isPluginOrPreset(type, name) {\n const hasScope = name.charAt(0) === '@';\n const re = RE[type];\n if (hasScope) {\n return re.test(name.split('/')[1]) || re.test(name);\n }\n return re.test(name);\n}\n\nexport function getPluginsOrPresets(type, opts) {\n const upperCaseType = type.toUpperCase();\n return [\n // dependencies\n // opts\n ...((opts[type === PluginType.preset ? 'presets' : 'plugins']) || []),\n // env\n ...(process.env[`FES_${upperCaseType}S`] || '').split(',').filter(Boolean),\n ...Object.keys(opts.pkg.devDependencies || {})\n .concat(Object.keys(opts.pkg.dependencies || {}))\n .filter(isPluginOrPreset.bind(null, type)),\n // user config\n ...((opts[\n type === PluginType.preset ? 'userConfigPresets' : 'userConfigPlugins'\n ]) || [])\n ].map(path => resolve.sync(path, {\n basedir: opts.cwd,\n extensions: ['.js', '.ts']\n }));\n}\n\n// e.g.\n// initial-state -> initialState\n// webpack.css-loader -> webpack.cssLoader\nfunction nameToKey(name) {\n return name\n .split('.')\n .map(part => lodash.camelCase(part))\n .join('.');\n}\n\nfunction pkgNameToKey(pkgName, type) {\n if (pkgName.charAt(0) === '@' && !pkgName.startsWith('@fesjs/')) {\n pkgName = pkgName.split('/')[1];\n }\n return nameToKey(pkgName.replace(RE[type], ''));\n}\n\nexport function pathToObj({ path, type, cwd }) {\n let pkg = null;\n let isPkgPlugin = false;\n const pkgJSONPath = pkgUp.sync({ cwd: path });\n if (pkgJSONPath) {\n // eslint-disable-next-line\n pkg = require(pkgJSONPath);\n isPkgPlugin = winPath(join(dirname(pkgJSONPath), pkg.main || 'index.js'))\n === winPath(path);\n }\n\n let id;\n if (isPkgPlugin) {\n id = pkg.name;\n } else if (winPath(path).startsWith(winPath(cwd))) {\n id = `./${winPath(relative(cwd, path))}`;\n } else if (pkgJSONPath) {\n id = winPath(join(pkg.name, relative(dirname(pkgJSONPath), path)));\n } else {\n id = winPath(path);\n }\n id = id.replace('@fesjs/preset-built-in/lib/plugins', '@@');\n id = id.replace(/\\.js$/, '');\n\n const key = isPkgPlugin\n ? pkgNameToKey(pkg.name, type)\n : nameToKey(basename(path, extname(path)));\n\n return {\n id,\n key,\n path: winPath(path),\n apply() {\n // use function to delay require\n try {\n // eslint-disable-next-line\n const ret = require(path);\n // use the default member for es modules\n return compatESModuleRequire(ret);\n } catch (e) {\n throw new Error(`Register ${path} failed, since ${e.message}`);\n }\n },\n defaultConfig: null\n };\n}\n\nexport function resolvePresets(opts) {\n const type = PluginType.preset;\n const presets = [...getPluginsOrPresets(type, opts)];\n return presets.map(path => pathToObj({\n type,\n path,\n cwd: opts.cwd\n }));\n}\n\nexport function resolvePlugins(opts) {\n const type = PluginType.plugin;\n const plugins = getPluginsOrPresets(type, opts);\n return plugins.map(path => pathToObj({\n path,\n type,\n cwd: opts.cwd\n }));\n}\n\nexport function isValidPlugin(plugin) {\n return plugin.id && plugin.key && plugin.apply;\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-access/build.config.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nmodule.exports = {\n copy: ['runtime']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-access/src/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-access/src/runtime/createComponent.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-access/src/runtime/createDirective.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-access/src/runtime/runtime.js","messages":[{"ruleId":"import/extensions","severity":2,"message":"Missing file extension for \"./core\"","line":2,"column":33,"nodeType":"Literal","endLine":2,"endColumn":41},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `runtimeConfig.noFoundHandler·&&·typeof·runtimeConfig.noFoundHandler·===·'function'` with `⏎················runtimeConfig.noFoundHandler·&&⏎················typeof·runtimeConfig.noFoundHandler·===·'function'⏎············`","line":12,"column":17,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":99,"fix":{"range":[421,503],"text":"\n runtimeConfig.noFoundHandler &&\n typeof runtimeConfig.noFoundHandler === 'function'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·to,·from,` with `⏎····················to,⏎····················from,⏎···················`","line":14,"column":28,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":38,"fix":{"range":[588,598],"text":"\n to,\n from,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `runtimeConfig.unAccessHandler·&&·typeof·runtimeConfig.unAccessHandler·===·'function'` with `⏎············runtimeConfig.unAccessHandler·&&⏎············typeof·runtimeConfig.unAccessHandler·===·'function'⏎········`","line":28,"column":13,"nodeType":null,"messageId":"replace","endLine":28,"endColumn":97,"fix":{"range":[927,1011],"text":"\n runtimeConfig.unAccessHandler &&\n typeof runtimeConfig.unAccessHandler === 'function'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·to,·from,` with `⏎················to,⏎················from,⏎···············`","line":30,"column":24,"nodeType":null,"messageId":"replace","endLine":30,"endColumn":34,"fix":{"range":[1089,1099],"text":"\n to,\n from,\n "}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import { plugin, ApplyPluginsType } from '@@/core/coreExports';\nimport { access, install } from './core';\n\nexport function onRouterCreated({ router }) {\n router.beforeEach(async (to, from, next) => {\n const runtimeConfig = plugin.applyPlugins({\n key: 'access',\n type: ApplyPluginsType.modify,\n initialValue: {}\n });\n if (to.matched.length === 0) {\n if (runtimeConfig.noFoundHandler && typeof runtimeConfig.noFoundHandler === 'function') {\n return runtimeConfig.noFoundHandler({\n router, to, from, next\n });\n }\n }\n let path;\n if (to.matched.length === 1) {\n path = to.matched[0].path;\n } else {\n path = to.path;\n }\n const canRoute = await access.hasAccess(path);\n if (canRoute) {\n return next();\n }\n if (runtimeConfig.unAccessHandler && typeof runtimeConfig.unAccessHandler === 'function') {\n return runtimeConfig.unAccessHandler({\n router, to, from, next\n });\n }\n next(false);\n });\n}\n\nexport function onAppCreated({ app }) {\n install(app);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-enums/build.config.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nmodule.exports = {\n copy: ['runtime']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-enums/src/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-icon/build.config.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nmodule.exports = {\n copy: ['runtime']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-icon/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `iconFiles.map(item·=>·join(base,·item))` with `⏎············iconFiles.map((item)·=>·join(base,·item))⏎········`","line":29,"column":44,"nodeType":null,"messageId":"replace","endLine":29,"endColumn":83,"fix":{"range":[844,883],"text":"\n iconFiles.map((item) => join(base, item))\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎····················`","line":36,"column":47,"nodeType":null,"messageId":"delete","endLine":37,"endColumn":21,"fix":{"range":[1247,1268],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `readFileSync(join(__dirname,·'runtime/runtime.tpl'),·'utf-8'),·{` with `⏎················readFileSync(join(__dirname,·'runtime/runtime.tpl'),·'utf-8'),⏎················{}`","line":53,"column":48,"nodeType":null,"messageId":"replace","endLine":53,"endColumn":112,"fix":{"range":[1729,1793],"text":"\n readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'),\n {}"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `}`","line":54,"column":13,"nodeType":null,"messageId":"delete","endLine":54,"endColumn":14,"fix":{"range":[1806,1807],"text":""}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join, basename } from 'path';\nimport optimizeSvg from './optimizeSvg';\n\nexport default (api) => {\n api.addRuntimePluginKey(() => '');\n // 配置\n api.describe({\n key: 'icon',\n config: {\n schema(joi) {\n return joi.object();\n }\n }\n });\n\n const namespace = 'plugin-icon';\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n\n // 监听 icons 文件变更,重新生成文件\n api.addTmpGenerateWatcherPaths(() => join(api.paths.absSrcPath, 'icons'));\n\n let generatedOnce = false;\n api.onGenerateFiles(async () => {\n const base = join(api.paths.absSrcPath, 'icons');\n const iconFiles = api.utils.glob.sync('**/*', {\n cwd: join(api.paths.absSrcPath, 'icons')\n });\n const svgDatas = await optimizeSvg(iconFiles.map(item => join(base, item)));\n const iconNames = [];\n const SVG_COMPONENT_TMPLATE = 'export default () => (SVG)';\n for (const { fileName, data } of svgDatas) {\n iconNames.push(basename(fileName, '.svg'));\n api.writeTmpFile({\n path: `${namespace}/icons/${basename(fileName, '.svg')}.js`,\n content: SVG_COMPONENT_TMPLATE\n .replace('SVG', data)\n });\n }\n\n api.writeTmpFile({\n path: `${namespace}/icons.js`,\n content: api.utils.Mustache.render(\n readFileSync(join(__dirname, 'runtime/icons.tpl'), 'utf-8'),\n {\n ICON_NAMES: iconNames\n }\n )\n });\n\n api.writeTmpFile({\n path: absRuntimeFilePath,\n content: api.utils.Mustache.render(readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'), {\n })\n });\n\n if (!generatedOnce) {\n generatedOnce = true;\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'runtime'),\n ignore: ['.tpl']\n });\n }\n });\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-icon/src/optimizeSvg.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":23,"column":1,"nodeType":null,"messageId":"delete","endLine":24,"endColumn":1,"fix":{"range":[443,444],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·path:·filePath,·plugins:·presetDefault` with `⏎················path:·filePath,⏎················plugins:·presetDefault⏎···········`","line":29,"column":45,"nodeType":null,"messageId":"replace","endLine":29,"endColumn":84,"fix":{"range":[735,774],"text":"\n path: filePath,\n plugins: presetDefault\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { extname, basename } from 'path';\nimport { statSync, readFileSync } from 'fs';\nimport { optimize } from 'svgo';\n\nconst presetDefault = [\n {\n name: 'preset-default',\n params: {\n overrides: {\n sortAttrs: true,\n removeDimensions: true\n }\n }\n },\n {\n name: 'removeAttrs',\n params: {\n attrs: '(fill|stroke|class)'\n }\n }\n];\n\n\nexport default function optimizeSvg(files) {\n const optimizedSvgData = [];\n for (const filePath of files) {\n if (statSync(filePath).isFile() && extname(filePath) === '.svg') {\n const data = readFileSync(filePath, 'utf-8');\n const svgData = optimize(data, { path: filePath, plugins: presetDefault });\n optimizedSvgData.push({\n fileName: basename(filePath),\n ...svgData\n });\n }\n }\n return Promise.all(optimizedSvgData);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-icon/src/runtime/Icon/Icon.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-icon/src/runtime/Icon/index.js","messages":[{"ruleId":"import/no-named-as-default","severity":2,"message":"Parse errors in imported module './Icon': Unexpected token, expected \"}\" (9:8) (9:8)","line":1,"column":18,"nodeType":"Literal","endLine":1,"endColumn":26},{"ruleId":"import/no-named-as-default-member","severity":2,"message":"Parse errors in imported module './Icon': Unexpected token, expected \"}\" (9:8) (9:8)","line":1,"column":18,"nodeType":"Literal","endLine":1,"endColumn":26}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"import Icon from './Icon';\nimport './icon.less';\n\nexport default Icon;\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-jest/helpers/transformers/javascript.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········['@babel/preset-env',·{·targets:·{·node:·'current'·}·}]⏎····` with `['@babel/preset-env',·{·targets:·{·node:·'current'·}·}]`","line":4,"column":15,"nodeType":null,"messageId":"replace","endLine":6,"endColumn":5,"fix":{"range":[111,180],"text":"['@babel/preset-env', { targets: { node: 'current' } }]"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"const babelJest = require('babel-jest').default;\n\nmodule.exports = babelJest.createTransformer({\n presets: [\n ['@babel/preset-env', { targets: { node: 'current' } }]\n ],\n plugins: ['@vue/babel-plugin-jsx'],\n babelrc: false,\n configFile: false\n});\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-jest/src/createDefaultConfig.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················'../helpers/transformers/javascript'⏎············` with `'../helpers/transformers/javascript'`","line":33,"column":44,"nodeType":null,"messageId":"replace","endLine":35,"endColumn":13,"fix":{"range":[1090,1156],"text":"'../helpers/transformers/javascript'"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { existsSync } from 'fs';\nimport { join } from 'path';\n\nexport default (cwd, args) => {\n const testMatchTypes = ['spec', 'test'];\n if (args.e2e) {\n testMatchTypes.push('e2e');\n }\n const hasSrc = existsSync(join(cwd, 'src'));\n return {\n collectCoverageFrom: [\n 'index.{js,jsx,vue}',\n hasSrc && 'src/**/*.{js,jsx,vue}',\n '!**/.fes/**',\n '!**/typings/**',\n '!**/types/**',\n '!**/fixtures/**',\n '!**/examples/**',\n '!**/*.d.ts'\n ].filter(Boolean),\n moduleFileExtensions: [\n 'js',\n 'jsx',\n 'json',\n // tell Jest to handle *.vue files\n 'vue'\n ],\n transform: {\n // process *.vue files with vue-jest\n '^.+\\\\.vue$': require.resolve('vue3-jest'),\n '.+\\\\.(css|styl|less|sass|scss|jpg|jpeg|png|svg|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':\n require.resolve('jest-transform-stub'),\n '^.+\\\\.jsx?$': require.resolve(\n '../helpers/transformers/javascript'\n )\n },\n transformIgnorePatterns: ['/node_modules/'],\n // support the same @ -> src alias mapping in source code\n moduleNameMapper: {\n '^@/(.*)$': '/src/$1'\n },\n testMatch: [\n `**/tests/**/*.(${testMatchTypes.join('|')}).[jt]s?(x)`,\n '**/__tests__/**/*.[jt]s?(x)'\n ],\n // https://github.com/facebook/jest/issues/6766\n testURL: 'http://localhost/',\n watchPlugins: [\n require.resolve('jest-watch-typeahead/filename'),\n require.resolve('jest-watch-typeahead/testname')\n ],\n verbose: true\n };\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-jest/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·utils:·{·mergeConfig·},·cwd` with `⏎········utils:·{·mergeConfig·},⏎········cwd⏎···`","line":31,"column":12,"nodeType":null,"messageId":"replace","endLine":31,"endColumn":40,"fix":{"range":[854,882],"text":"\n utils: { mergeConfig },\n cwd\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":48,"column":35,"nodeType":null,"messageId":"insert","endLine":48,"endColumn":35,"fix":{"range":[1416,1416],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·logger.log(`config·from·jest.config.js:·${JSON.stringify(userJestConfig)}`` with `⏎················logger.log(⏎····················`config·from·jest.config.js:·${JSON.stringify(⏎························userJestConfig⏎····················)}`⏎················`","line":49,"column":26,"nodeType":null,"messageId":"replace","endLine":49,"endColumn":101,"fix":{"range":[1505,1580],"text":"\n logger.log(\n `config from jest.config.js: ${JSON.stringify(\n userJestConfig\n )}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":53,"column":38,"nodeType":null,"messageId":"insert","endLine":53,"endColumn":38,"fix":{"range":[1734,1734],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·logger.log(`jest·config·from·package.json:·${JSON.stringify(packageJestConfig)}`` with `⏎················logger.log(⏎····················`jest·config·from·package.json:·${JSON.stringify(⏎························packageJestConfig⏎····················)}`⏎················`","line":54,"column":26,"nodeType":null,"messageId":"replace","endLine":54,"endColumn":107,"fix":{"range":[1822,1903],"text":"\n logger.log(\n `jest config from package.json: ${JSON.stringify(\n packageJestConfig\n )}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":74,"column":26,"nodeType":null,"messageId":"insert","endLine":74,"endColumn":26,"fix":{"range":[2694,2694],"text":"\n "}}],"errorCount":7,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"\nimport assert from 'assert';\nimport { join } from 'path';\nimport { existsSync } from 'fs';\nimport { Logger } from '@fesjs/compiler';\n// jest-cli 不在暴露 options,维护一份本地的 options\nimport { options as CliOptions } from './jestArgs';\nimport createDefaultConfig from './createDefaultConfig';\n\nconst logger = new Logger('fes:plugin-unit-jest');\n\nfunction getCommandOptiton() {\n const opts = [];\n Object.keys(CliOptions).forEach((key) => {\n const option = CliOptions[key];\n const opt = {};\n if (key !== 'version') {\n if (option.alias) {\n opt.name = `-${option.alias} --${key}`;\n } else {\n opt.name = `--${key}`;\n }\n opt.description = option.description;\n opts.push(opt);\n }\n });\n return opts;\n}\n\nexport default function (api) {\n const { utils: { mergeConfig }, cwd } = api;\n\n api.registerCommand({\n command: 'test',\n description: 'run unit tests with jest',\n options: getCommandOptiton(),\n async fn({ args }) {\n process.env.NODE_ENV = 'test';\n\n if (args._[0] === 'test') {\n args._.shift();\n }\n\n args.debug && logger.log(`args: ${JSON.stringify(args)}`);\n\n // Read config from cwd/jest.config.js\n const userJestConfigFile = join(cwd, 'jest.config.js');\n const userJestConfig = existsSync(userJestConfigFile) && require(userJestConfigFile);\n args.debug && logger.log(`config from jest.config.js: ${JSON.stringify(userJestConfig)}`);\n\n // Read jest config from package.json\n const packageJSONPath = join(cwd, 'package.json');\n const packageJestConfig = existsSync(packageJSONPath) && require(packageJSONPath).jest;\n args.debug && logger.log(`jest config from package.json: ${JSON.stringify(packageJestConfig)}`);\n\n // Merge configs\n // user config and args config could have value function for modification\n const config = mergeConfig(\n createDefaultConfig(cwd, args),\n packageJestConfig,\n userJestConfig\n );\n args.debug && logger.log(`final config: ${JSON.stringify(config)}`);\n\n // Generate jest options\n const argsConfig = Object.keys(CliOptions).reduce((prev, name) => {\n if (args[name]) prev[name] = args[name];\n\n // Convert alias args into real one\n const { alias } = CliOptions[name];\n if (alias && args[alias]) prev[name] = args[alias];\n return prev;\n }, {});\n args.debug && logger.log(`config from args: ${JSON.stringify(argsConfig)}`);\n\n // 比较大的库建议使用require,使用时才加载,提升fes命令的效率\n const { runCLI } = require('jest');\n // Run jest\n const result = await runCLI(\n {\n // @ts-ignore\n _: args._ || [],\n // @ts-ignore\n $0: args.$0 || '',\n // 必须是单独的 config 配置,值为 string,否则不生效\n // @ts-ignore\n config: JSON.stringify(config),\n ...argsConfig\n },\n [cwd]\n );\n args.debug && logger.log(result);\n\n // Throw error when run failed\n assert(result.results.success, 'Test with jest failed');\n }\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-jest/src/jestArgs.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···`","line":8,"column":21,"nodeType":null,"messageId":"insert","endLine":8,"endColumn":21,"fix":{"range":[231,231],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'The·opposite·of·`onlyChanged`.·If·`onlyChanged`·is·set·by·'` with `·····'The·opposite·of·`onlyChanged`.·If·`onlyChanged`·is·set·by·'·+`","line":15,"column":8,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":68,"fix":{"range":[464,524],"text":" 'The opposite of `onlyChanged`. If `onlyChanged` is set by ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'default,·running·jest·with·`--all`·will·force·Jest·to·run·all·tests·'` with `·····'default,·running·jest·with·`--all`·will·force·Jest·to·run·all·tests·'·+`","line":16,"column":8,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":80,"fix":{"range":[532,604],"text":" 'default, running jest with `--all` will force Jest to run all tests ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":17,"column":8,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":9,"fix":{"range":[612,613],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·····`","line":27,"column":8,"nodeType":null,"messageId":"insert","endLine":27,"endColumn":8,"fix":{"range":[866,866],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Respect·the·\"browser\"·field·in·package.json·'` with `·····'Respect·the·\"browser\"·field·in·package.json·'·+`","line":32,"column":8,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":54,"fix":{"range":[1010,1056],"text":" 'Respect the \"browser\" field in package.json ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'when·resolving·modules.·Some·packages·export·different·versions·'` with `············'when·resolving·modules.·Some·packages·export·different·versions·'·+`","line":33,"column":1,"nodeType":null,"messageId":"replace","endLine":33,"endColumn":76,"fix":{"range":[1057,1132],"text":" 'when resolving modules. Some packages export different versions ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":34,"column":8,"nodeType":null,"messageId":"replace","endLine":34,"endColumn":9,"fix":{"range":[1140,1141],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Whether·to·use·the·transform·cache.·Disable·the·cache·'` with `·····'Whether·to·use·the·transform·cache.·Disable·the·cache·'·+`","line":39,"column":8,"nodeType":null,"messageId":"replace","endLine":39,"endColumn":64,"fix":{"range":[1278,1334],"text":" 'Whether to use the transform cache. Disable the cache ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":40,"column":8,"nodeType":null,"messageId":"replace","endLine":40,"endColumn":9,"fix":{"range":[1342,1343],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'The·directory·where·Jest·should·store·its·cached·'` with `·····'The·directory·where·Jest·should·store·its·cached·'·+`","line":45,"column":8,"nodeType":null,"messageId":"replace","endLine":45,"endColumn":59,"fix":{"range":[1446,1497],"text":" 'The directory where Jest should store its cached ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":46,"column":8,"nodeType":null,"messageId":"replace","endLine":46,"endColumn":9,"fix":{"range":[1505,1506],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Runs·tests·related·to·the·current·changes·and·the·changes·made·in·the·'` with `·····'Runs·tests·related·to·the·current·changes·and·the·changes·made·in·the·'·+`","line":51,"column":8,"nodeType":null,"messageId":"replace","endLine":51,"endColumn":80,"fix":{"range":[1625,1697],"text":" 'Runs tests related to the current changes and the changes made in the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":52,"column":8,"nodeType":null,"messageId":"replace","endLine":52,"endColumn":9,"fix":{"range":[1705,1706],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Runs·tests·related·to·the·changes·since·the·provided·branch.·If·the·'` with `·····'Runs·tests·related·to·the·changes·since·the·provided·branch.·If·the·'·+`","line":57,"column":8,"nodeType":null,"messageId":"replace","endLine":57,"endColumn":78,"fix":{"range":[1840,1910],"text":" 'Runs tests related to the changes since the provided branch. If the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'current·branch·has·diverged·from·the·given·branch,·then·only·changes·'` with `·····'current·branch·has·diverged·from·the·given·branch,·then·only·changes·'·+`","line":58,"column":8,"nodeType":null,"messageId":"replace","endLine":58,"endColumn":81,"fix":{"range":[1918,1991],"text":" 'current branch has diverged from the given branch, then only changes ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":59,"column":8,"nodeType":null,"messageId":"replace","endLine":59,"endColumn":9,"fix":{"range":[1999,2000],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Whether·to·run·Jest·in·continuous·integration·(CI)·mode.·'` with `············'Whether·to·run·Jest·in·continuous·integration·(CI)·mode.·'·+`","line":65,"column":1,"nodeType":null,"messageId":"replace","endLine":65,"endColumn":67,"fix":{"range":[2150,2216],"text":" 'Whether to run Jest in continuous integration (CI) mode. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'This·option·is·on·by·default·in·most·popular·CI·environments.·It·will·'` with `·····'This·option·is·on·by·default·in·most·popular·CI·environments.·It·will·'·+`","line":66,"column":8,"nodeType":null,"messageId":"replace","endLine":66,"endColumn":82,"fix":{"range":[2224,2298],"text":" 'This option is on by default in most popular CI environments. It will ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":67,"column":8,"nodeType":null,"messageId":"replace","endLine":67,"endColumn":9,"fix":{"range":[2306,2307],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Clears·the·configured·Jest·cache·directory·and·then·exits.·'` with `············'Clears·the·configured·Jest·cache·directory·and·then·exits.·'·+`","line":72,"column":1,"nodeType":null,"messageId":"replace","endLine":72,"endColumn":69,"fix":{"range":[2447,2515],"text":" 'Clears the configured Jest cache directory and then exits. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":73,"column":8,"nodeType":null,"messageId":"replace","endLine":73,"endColumn":9,"fix":{"range":[2523,2524],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Automatically·clear·mock·calls·and·instances·between·every·'` with `············'Automatically·clear·mock·calls·and·instances·between·every·'·+`","line":78,"column":1,"nodeType":null,"messageId":"replace","endLine":78,"endColumn":69,"fix":{"range":[2658,2726],"text":" 'Automatically clear mock calls and instances between every ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":79,"column":1,"nodeType":null,"messageId":"replace","endLine":79,"endColumn":9,"fix":{"range":[2727,2735],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'A·glob·pattern·relative·to··matching·the·files·that·coverage·'` with `·····'A·glob·pattern·relative·to··matching·the·files·that·coverage·'·+`","line":88,"column":8,"nodeType":null,"messageId":"replace","endLine":88,"endColumn":80,"fix":{"range":[2993,3065],"text":" 'A glob pattern relative to matching the files that coverage ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":89,"column":8,"nodeType":null,"messageId":"replace","endLine":89,"endColumn":9,"fix":{"range":[3073,3074],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Forces·test·results·output·color·highlighting·(even·if·'` with `············'Forces·test·results·output·color·highlighting·(even·if·'·+`","line":99,"column":1,"nodeType":null,"messageId":"replace","endLine":99,"endColumn":65,"fix":{"range":[3336,3400],"text":" 'Forces test results output color highlighting (even if ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":100,"column":8,"nodeType":null,"messageId":"replace","endLine":100,"endColumn":9,"fix":{"range":[3408,3409],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'The·path·to·a·jest·config·file·specifying·how·to·find·'` with `·····'The·path·to·a·jest·config·file·specifying·how·to·find·'·+`","line":110,"column":8,"nodeType":null,"messageId":"replace","endLine":110,"endColumn":64,"fix":{"range":[3668,3724],"text":" 'The path to a jest config file specifying how to find ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'and·execute·tests.·If·no·rootDir·is·set·in·the·config,·the·directory·'` with `············'and·execute·tests.·If·no·rootDir·is·set·in·the·config,·the·directory·'·+`","line":111,"column":1,"nodeType":null,"messageId":"replace","endLine":111,"endColumn":81,"fix":{"range":[3725,3805],"text":" 'and execute tests. If no rootDir is set in the config, the directory ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'containing·the·config·file·is·assumed·to·be·the·rootDir·for·the·project.'` with `·····'containing·the·config·file·is·assumed·to·be·the·rootDir·for·the·project.'·+`","line":112,"column":8,"nodeType":null,"messageId":"replace","endLine":112,"endColumn":84,"fix":{"range":[3813,3889],"text":" 'containing the config file is assumed to be the rootDir for the project.' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":113,"column":8,"nodeType":null,"messageId":"replace","endLine":113,"endColumn":9,"fix":{"range":[3897,3898],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Indicates·that·test·coverage·information·should·be·'` with `············'Indicates·that·test·coverage·information·should·be·'·+`","line":118,"column":1,"nodeType":null,"messageId":"replace","endLine":118,"endColumn":61,"fix":{"range":[4045,4105],"text":" 'Indicates that test coverage information should be ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":119,"column":8,"nodeType":null,"messageId":"replace","endLine":119,"endColumn":9,"fix":{"range":[4113,4114],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":123,"column":21,"nodeType":null,"messageId":"insert","endLine":123,"endColumn":21,"fix":{"range":[4232,4232],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·regexp·pattern·strings·that·are·matched·'` with `·····'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":128,"column":8,"nodeType":null,"messageId":"replace","endLine":128,"endColumn":62,"fix":{"range":[4387,4441],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'against·all·file·paths·before·executing·the·test.·If·the·file·path'` with `·····'against·all·file·paths·before·executing·the·test.·If·the·file·path'·+`","line":129,"column":8,"nodeType":null,"messageId":"replace","endLine":129,"endColumn":78,"fix":{"range":[4449,4519],"text":" 'against all file paths before executing the test. If the file path' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":130,"column":8,"nodeType":null,"messageId":"replace","endLine":130,"endColumn":9,"fix":{"range":[4527,4528],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'A·list·of·reporter·names·that·Jest·uses·when·writing·'` with `·····'A·list·of·reporter·names·that·Jest·uses·when·writing·'·+`","line":140,"column":8,"nodeType":null,"messageId":"replace","endLine":140,"endColumn":63,"fix":{"range":[4839,4894],"text":" 'A list of reporter names that Jest uses when writing ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":141,"column":8,"nodeType":null,"messageId":"replace","endLine":141,"endColumn":9,"fix":{"range":[4902,4903],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'A·JSON·string·with·which·will·be·used·to·configure·'` with `·····'A·JSON·string·with·which·will·be·used·to·configure·'·+`","line":147,"column":8,"nodeType":null,"messageId":"replace","endLine":147,"endColumn":61,"fix":{"range":[5064,5117],"text":" 'A JSON string with which will be used to configure ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":148,"column":8,"nodeType":null,"messageId":"replace","endLine":148,"endColumn":9,"fix":{"range":[5125,5126],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'**EXPERIMENTAL**:·Detect·memory·leaks·in·tests.·After·executing·a·'` with `············'**EXPERIMENTAL**:·Detect·memory·leaks·in·tests.·After·executing·a·'·+`","line":157,"column":1,"nodeType":null,"messageId":"replace","endLine":157,"endColumn":76,"fix":{"range":[5364,5439],"text":" '**EXPERIMENTAL**: Detect memory leaks in tests. After executing a ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'test,·it·will·try·to·garbage·collect·the·global·object·used,·and·fail·'` with `············'test,·it·will·try·to·garbage·collect·the·global·object·used,·and·fail·'·+`","line":158,"column":1,"nodeType":null,"messageId":"replace","endLine":158,"endColumn":82,"fix":{"range":[5440,5521],"text":" 'test, it will try to garbage collect the global object used, and fail ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":159,"column":8,"nodeType":null,"messageId":"replace","endLine":159,"endColumn":9,"fix":{"range":[5529,5530],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Print·out·remaining·open·handles·preventing·Jest·from·exiting·at·the·'` with `············'Print·out·remaining·open·handles·preventing·Jest·from·exiting·at·the·'·+`","line":164,"column":1,"nodeType":null,"messageId":"replace","endLine":164,"endColumn":79,"fix":{"range":[5628,5706],"text":" 'Print out remaining open handles preventing Jest from exiting at the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":165,"column":8,"nodeType":null,"messageId":"replace","endLine":165,"endColumn":9,"fix":{"range":[5714,5715],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'The·test·environment·used·for·all·tests.·This·can·point·to·'` with `·····'The·test·environment·used·for·all·tests.·This·can·point·to·'·+`","line":170,"column":8,"nodeType":null,"messageId":"replace","endLine":170,"endColumn":69,"fix":{"range":[5829,5890],"text":" 'The test environment used for all tests. This can point to ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'any·file·or·node·module.·Examples:·`jsdom`,·`node`·or·'` with `·····'any·file·or·node·module.·Examples:·`jsdom`,·`node`·or·'·+`","line":171,"column":8,"nodeType":null,"messageId":"replace","endLine":171,"endColumn":66,"fix":{"range":[5898,5956],"text":" 'any file or node module. Examples: `jsdom`, `node` or ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":172,"column":8,"nodeType":null,"messageId":"replace","endLine":172,"endColumn":9,"fix":{"range":[5964,5965],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":176,"column":21,"nodeType":null,"messageId":"insert","endLine":176,"endColumn":21,"fix":{"range":[6072,6072],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Path·to·a·module·exporting·a·filtering·function.·This·method·receives·'` with `·····'Path·to·a·module·exporting·a·filtering·function.·This·method·receives·'·+`","line":186,"column":8,"nodeType":null,"messageId":"replace","endLine":186,"endColumn":80,"fix":{"range":[6350,6422],"text":" 'Path to a module exporting a filtering function. This method receives ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'a·list·of·tests·which·can·be·manipulated·to·exclude·tests·from·'` with `·····'a·list·of·tests·which·can·be·manipulated·to·exclude·tests·from·'·+`","line":187,"column":8,"nodeType":null,"messageId":"replace","endLine":187,"endColumn":75,"fix":{"range":[6430,6497],"text":" 'a list of tests which can be manipulated to exclude tests from ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'running.·Especially·useful·when·used·in·conjunction·with·a·testing·'` with `·····'running.·Especially·useful·when·used·in·conjunction·with·a·testing·'·+`","line":188,"column":8,"nodeType":null,"messageId":"replace","endLine":188,"endColumn":79,"fix":{"range":[6505,6576],"text":" 'running. Especially useful when used in conjunction with a testing ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":189,"column":8,"nodeType":null,"messageId":"replace","endLine":189,"endColumn":9,"fix":{"range":[6584,6585],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Find·related·tests·for·a·list·of·source·files·that·were·'` with `············'Find·related·tests·for·a·list·of·source·files·that·were·'·+`","line":194,"column":1,"nodeType":null,"messageId":"replace","endLine":194,"endColumn":66,"fix":{"range":[6709,6774],"text":" 'Find related tests for a list of source files that were ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'passed·in·as·arguments.·Useful·for·pre-commit·hook·integration·to·run·'` with `············'passed·in·as·arguments.·Useful·for·pre-commit·hook·integration·to·run·'·+`","line":195,"column":1,"nodeType":null,"messageId":"replace","endLine":195,"endColumn":82,"fix":{"range":[6775,6856],"text":" 'passed in as arguments. Useful for pre-commit hook integration to run ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":196,"column":8,"nodeType":null,"messageId":"replace","endLine":196,"endColumn":9,"fix":{"range":[6864,6865],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Force·Jest·to·exit·after·all·tests·have·completed·running.·'` with `············'Force·Jest·to·exit·after·all·tests·have·completed·running.·'·+`","line":201,"column":1,"nodeType":null,"messageId":"replace","endLine":201,"endColumn":69,"fix":{"range":[6977,7045],"text":" 'Force Jest to exit after all tests have completed running. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'This·is·useful·when·resources·set·up·by·test·code·cannot·be·'` with `·····'This·is·useful·when·resources·set·up·by·test·code·cannot·be·'·+`","line":202,"column":8,"nodeType":null,"messageId":"replace","endLine":202,"endColumn":72,"fix":{"range":[7053,7117],"text":" 'This is useful when resources set up by test code cannot be ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":203,"column":8,"nodeType":null,"messageId":"replace","endLine":203,"endColumn":9,"fix":{"range":[7125,7126],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·JSON·string·with·map·of·global·variables·that·need·'` with `············'A·JSON·string·with·map·of·global·variables·that·need·'·+`","line":216,"column":1,"nodeType":null,"messageId":"replace","endLine":216,"endColumn":63,"fix":{"range":[7466,7528],"text":" 'A JSON string with map of global variables that need ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":217,"column":8,"nodeType":null,"messageId":"replace","endLine":217,"endColumn":9,"fix":{"range":[7536,7537],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·····`","line":222,"column":1,"nodeType":null,"messageId":"insert","endLine":222,"endColumn":1,"fix":{"range":[7647,7647],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Prints·the·test·results·in·JSON.·This·mode·will·send·all·'` with `············'Prints·the·test·results·in·JSON.·This·mode·will·send·all·'·+`","line":235,"column":1,"nodeType":null,"messageId":"replace","endLine":235,"endColumn":67,"fix":{"range":[8006,8072],"text":" 'Prints the test results in JSON. This mode will send all ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":236,"column":8,"nodeType":null,"messageId":"replace","endLine":236,"endColumn":9,"fix":{"range":[8080,8081],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Run·all·tests·affected·by·file·changes·in·the·last·commit·made.·'` with `·····'Run·all·tests·affected·by·file·changes·in·the·last·commit·made.·'·+`","line":241,"column":8,"nodeType":null,"messageId":"replace","endLine":241,"endColumn":74,"fix":{"range":[8209,8275],"text":" 'Run all tests affected by file changes in the last commit made. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":242,"column":1,"nodeType":null,"messageId":"replace","endLine":242,"endColumn":9,"fix":{"range":[8276,8284],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Lists·all·tests·Jest·will·run·given·the·arguments·and·'` with `············'Lists·all·tests·Jest·will·run·given·the·arguments·and·'·+`","line":247,"column":1,"nodeType":null,"messageId":"replace","endLine":247,"endColumn":64,"fix":{"range":[8395,8458],"text":" 'Lists all tests Jest will run given the arguments and ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'exits.·Most·useful·in·a·CI·system·together·with·`--findRelatedTests`·'` with `·····'exits.·Most·useful·in·a·CI·system·together·with·`--findRelatedTests`·'·+`","line":248,"column":8,"nodeType":null,"messageId":"replace","endLine":248,"endColumn":81,"fix":{"range":[8466,8539],"text":" 'exits. Most useful in a CI system together with `--findRelatedTests` ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":249,"column":8,"nodeType":null,"messageId":"replace","endLine":249,"endColumn":9,"fix":{"range":[8547,8548],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Logs·the·heap·usage·after·every·test.·Useful·to·debug·'` with `············'Logs·the·heap·usage·after·every·test.·Useful·to·debug·'·+`","line":254,"column":1,"nodeType":null,"messageId":"replace","endLine":254,"endColumn":64,"fix":{"range":[8685,8748],"text":" 'Logs the heap usage after every test. Useful to debug ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'memory·leaks.·Use·together·with·`--runInBand`·and·`--expose-gc`·in·'` with `············'memory·leaks.·Use·together·with·`--runInBand`·and·`--expose-gc`·in·'·+`","line":255,"column":1,"nodeType":null,"messageId":"replace","endLine":255,"endColumn":79,"fix":{"range":[8749,8827],"text":" 'memory leaks. Use together with `--runInBand` and `--expose-gc` in ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":256,"column":8,"nodeType":null,"messageId":"replace","endLine":256,"endColumn":9,"fix":{"range":[8835,8836],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Specifies·the·maximum·number·of·tests·that·are·allowed·to·run'` with `············'Specifies·the·maximum·number·of·tests·that·are·allowed·to·run'·+`","line":261,"column":1,"nodeType":null,"messageId":"replace","endLine":261,"endColumn":71,"fix":{"range":[8920,8990],"text":" 'Specifies the maximum number of tests that are allowed to run' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":262,"column":8,"nodeType":null,"messageId":"replace","endLine":262,"endColumn":9,"fix":{"range":[8998,8999],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Specifies·the·maximum·number·of·workers·the·worker-pool·'` with `·····'Specifies·the·maximum·number·of·workers·the·worker-pool·'·+`","line":268,"column":8,"nodeType":null,"messageId":"replace","endLine":268,"endColumn":66,"fix":{"range":[9162,9220],"text":" 'Specifies the maximum number of workers the worker-pool ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'will·spawn·for·running·tests.·This·defaults·to·the·number·of·the·'` with `············'will·spawn·for·running·tests.·This·defaults·to·the·number·of·the·'·+`","line":269,"column":1,"nodeType":null,"messageId":"replace","endLine":269,"endColumn":77,"fix":{"range":[9221,9297],"text":" 'will spawn for running tests. This defaults to the number of the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'cores·available·on·your·machine.·(its·usually·best·not·to·override·'` with `············'cores·available·on·your·machine.·(its·usually·best·not·to·override·'·+`","line":270,"column":1,"nodeType":null,"messageId":"replace","endLine":270,"endColumn":79,"fix":{"range":[9298,9376],"text":" 'cores available on your machine. (its usually best not to override ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":271,"column":8,"nodeType":null,"messageId":"replace","endLine":271,"endColumn":9,"fix":{"range":[9384,9385],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·directory·names·to·be·searched·recursively·'` with `·····'An·array·of·directory·names·to·be·searched·recursively·'·+`","line":276,"column":8,"nodeType":null,"messageId":"replace","endLine":276,"endColumn":65,"fix":{"range":[9486,9543],"text":" 'An array of directory names to be searched recursively ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":277,"column":1,"nodeType":null,"messageId":"replace","endLine":277,"endColumn":9,"fix":{"range":[9544,9552],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·file·extensions·your·modules·use.·If·you·'` with `·····'An·array·of·file·extensions·your·modules·use.·If·you·'·+`","line":283,"column":8,"nodeType":null,"messageId":"replace","endLine":283,"endColumn":63,"fix":{"range":[9704,9759],"text":" 'An array of file extensions your modules use. If you ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'require·modules·without·specifying·a·file·extension,·these·are·the·'` with `·····'require·modules·without·specifying·a·file·extension,·these·are·the·'·+`","line":284,"column":8,"nodeType":null,"messageId":"replace","endLine":284,"endColumn":79,"fix":{"range":[9767,9838],"text":" 'require modules without specifying a file extension, these are the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":285,"column":8,"nodeType":null,"messageId":"replace","endLine":285,"endColumn":9,"fix":{"range":[9846,9847],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·JSON·string·with·a·map·from·regular·expressions·to·'` with `············'A·JSON·string·with·a·map·from·regular·expressions·to·'·+`","line":291,"column":1,"nodeType":null,"messageId":"replace","endLine":291,"endColumn":63,"fix":{"range":[9979,10041],"text":" 'A JSON string with a map from regular expressions to ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'module·names·or·to·arrays·of·module·names·that·allow·to·stub·'` with `············'module·names·or·to·arrays·of·module·names·that·allow·to·stub·'·+`","line":292,"column":1,"nodeType":null,"messageId":"replace","endLine":292,"endColumn":73,"fix":{"range":[10042,10114],"text":" 'module names or to arrays of module names that allow to stub ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":293,"column":8,"nodeType":null,"messageId":"replace","endLine":293,"endColumn":9,"fix":{"range":[10122,10123],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·regexp·pattern·strings·that·are·matched·'` with `·····'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":298,"column":8,"nodeType":null,"messageId":"replace","endLine":298,"endColumn":62,"fix":{"range":[10275,10329],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'against·all·module·paths·before·those·paths·are·to·be·considered·'` with `············'against·all·module·paths·before·those·paths·are·to·be·considered·'·+`","line":299,"column":1,"nodeType":null,"messageId":"replace","endLine":299,"endColumn":77,"fix":{"range":[10330,10406],"text":" 'against all module paths before those paths are to be considered ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":300,"column":8,"nodeType":null,"messageId":"replace","endLine":300,"endColumn":9,"fix":{"range":[10414,10415],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'An·alternative·API·to·setting·the·NODE_PATH·env·variable,·'` with `············'An·alternative·API·to·setting·the·NODE_PATH·env·variable,·'·+`","line":306,"column":1,"nodeType":null,"messageId":"replace","endLine":306,"endColumn":68,"fix":{"range":[10542,10609],"text":" 'An alternative API to setting the NODE_PATH env variable, ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'modulePaths·is·an·array·of·absolute·paths·to·additional·locations·to·'` with `·····'modulePaths·is·an·array·of·absolute·paths·to·additional·locations·to·'·+`","line":307,"column":8,"nodeType":null,"messageId":"replace","endLine":307,"endColumn":81,"fix":{"range":[10617,10690],"text":" 'modulePaths is an array of absolute paths to additional locations to ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":308,"column":8,"nodeType":null,"messageId":"replace","endLine":308,"endColumn":9,"fix":{"range":[10698,10699],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":321,"column":21,"nodeType":null,"messageId":"insert","endLine":321,"endColumn":21,"fix":{"range":[11053,11053],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Attempts·to·identify·which·tests·to·run·based·on·which·'` with `·····'Attempts·to·identify·which·tests·to·run·based·on·which·'·+`","line":327,"column":8,"nodeType":null,"messageId":"replace","endLine":327,"endColumn":65,"fix":{"range":[11213,11270],"text":" 'Attempts to identify which tests to run based on which ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·\"files·have·changed·in·the·current·repository.·Only·works·if·you're·\"` with `············\"files·have·changed·in·the·current·repository.·Only·works·if·you're·\"·+`","line":328,"column":1,"nodeType":null,"messageId":"replace","endLine":328,"endColumn":79,"fix":{"range":[11271,11349],"text":" \"files have changed in the current repository. Only works if you're \" +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":329,"column":1,"nodeType":null,"messageId":"replace","endLine":329,"endColumn":9,"fix":{"range":[11350,11358],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Write·test·results·to·a·file·when·the·--json·option·is·'` with `·····'Write·test·results·to·a·file·when·the·--json·option·is·'·+`","line":339,"column":8,"nodeType":null,"messageId":"replace","endLine":339,"endColumn":65,"fix":{"range":[11638,11695],"text":" 'Write test results to a file when the --json option is ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":340,"column":8,"nodeType":null,"messageId":"replace","endLine":340,"endColumn":9,"fix":{"range":[11703,11704],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······` with `············`","line":345,"column":1,"nodeType":null,"messageId":"replace","endLine":345,"endColumn":8,"fix":{"range":[11798,11805],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":349,"column":21,"nodeType":null,"messageId":"insert","endLine":349,"endColumn":21,"fix":{"range":[11956,11956],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":353,"column":21,"nodeType":null,"messageId":"insert","endLine":353,"endColumn":21,"fix":{"range":[12088,12088],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'A·list·of·projects·that·use·Jest·to·run·all·tests·of·all·'` with `·····'A·list·of·projects·that·use·Jest·to·run·all·tests·of·all·'·+`","line":358,"column":8,"nodeType":null,"messageId":"replace","endLine":358,"endColumn":67,"fix":{"range":[12227,12286],"text":" 'A list of projects that use Jest to run all tests of all ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":359,"column":1,"nodeType":null,"messageId":"replace","endLine":359,"endColumn":9,"fix":{"range":[12287,12295],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Automatically·reset·mock·state·between·every·test.·'` with `·····'Automatically·reset·mock·state·between·every·test.·'·+`","line":370,"column":8,"nodeType":null,"messageId":"replace","endLine":370,"endColumn":61,"fix":{"range":[12574,12627],"text":" 'Automatically reset mock state between every test. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":371,"column":8,"nodeType":null,"messageId":"replace","endLine":371,"endColumn":9,"fix":{"range":[12635,12636],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'If·enabled,·the·module·registry·for·every·test·file·will·'` with `············'If·enabled,·the·module·registry·for·every·test·file·will·'·+`","line":376,"column":1,"nodeType":null,"messageId":"replace","endLine":376,"endColumn":67,"fix":{"range":[12774,12840],"text":" 'If enabled, the module registry for every test file will ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":377,"column":8,"nodeType":null,"messageId":"replace","endLine":377,"endColumn":9,"fix":{"range":[12848,12849],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Automatically·restore·mock·state·and·implementation·between·every·test.·'` with `·····'Automatically·restore·mock·state·and·implementation·between·every·test.·'·+`","line":386,"column":8,"nodeType":null,"messageId":"replace","endLine":386,"endColumn":82,"fix":{"range":[13105,13179],"text":" 'Automatically restore mock state and implementation between every test. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":387,"column":8,"nodeType":null,"messageId":"replace","endLine":387,"endColumn":9,"fix":{"range":[13187,13188],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'The·root·directory·that·Jest·should·scan·for·tests·and·'` with `············'The·root·directory·that·Jest·should·scan·for·tests·and·'·+`","line":392,"column":1,"nodeType":null,"messageId":"replace","endLine":392,"endColumn":65,"fix":{"range":[13323,13387],"text":" 'The root directory that Jest should scan for tests and ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":393,"column":8,"nodeType":null,"messageId":"replace","endLine":393,"endColumn":9,"fix":{"range":[13395,13396],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·list·of·paths·to·directories·that·Jest·should·use·to·'` with `············'A·list·of·paths·to·directories·that·Jest·should·use·to·'·+`","line":398,"column":1,"nodeType":null,"messageId":"replace","endLine":398,"endColumn":65,"fix":{"range":[13480,13544],"text":" 'A list of paths to directories that Jest should use to ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":399,"column":8,"nodeType":null,"messageId":"replace","endLine":399,"endColumn":9,"fix":{"range":[13552,13553],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Run·all·tests·serially·in·the·current·process·(rather·than·'` with `·····'Run·all·tests·serially·in·the·current·process·(rather·than·'·+`","line":406,"column":8,"nodeType":null,"messageId":"replace","endLine":406,"endColumn":69,"fix":{"range":[13694,13755],"text":" 'Run all tests serially in the current process (rather than ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'creating·a·worker·pool·of·child·processes·that·run·tests).·This·'` with `·····'creating·a·worker·pool·of·child·processes·that·run·tests).·This·'·+`","line":407,"column":8,"nodeType":null,"messageId":"replace","endLine":407,"endColumn":76,"fix":{"range":[13763,13831],"text":" 'creating a worker pool of child processes that run tests). This ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'is·sometimes·useful·for·debugging,·but·such·use·cases·are·pretty·'` with `·····'is·sometimes·useful·for·debugging,·but·such·use·cases·are·pretty·'·+`","line":408,"column":8,"nodeType":null,"messageId":"replace","endLine":408,"endColumn":77,"fix":{"range":[13839,13908],"text":" 'is sometimes useful for debugging, but such use cases are pretty ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":409,"column":1,"nodeType":null,"messageId":"replace","endLine":409,"endColumn":9,"fix":{"range":[13909,13917],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Used·when·provided·patterns·are·exact·file·paths.·This·avoids·'` with `·····'Used·when·provided·patterns·are·exact·file·paths.·This·avoids·'·+`","line":414,"column":8,"nodeType":null,"messageId":"replace","endLine":414,"endColumn":72,"fix":{"range":[14008,14072],"text":" 'Used when provided patterns are exact file paths. This avoids ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'converting·them·into·a·regular·expression·and·matching·it·against·'` with `············'converting·them·into·a·regular·expression·and·matching·it·against·'·+`","line":415,"column":1,"nodeType":null,"messageId":"replace","endLine":415,"endColumn":78,"fix":{"range":[14073,14150],"text":" 'converting them into a regular expression and matching it against ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":416,"column":1,"nodeType":null,"messageId":"replace","endLine":416,"endColumn":9,"fix":{"range":[14151,14159],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·····`","line":421,"column":1,"nodeType":null,"messageId":"insert","endLine":421,"endColumn":1,"fix":{"range":[14248,14248],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Run·only·the·tests·of·the·specified·projects.'` with `·····'Run·only·the·tests·of·the·specified·projects.'·+`","line":426,"column":8,"nodeType":null,"messageId":"replace","endLine":426,"endColumn":55,"fix":{"range":[14407,14454],"text":" 'Run only the tests of the specified projects.' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":427,"column":1,"nodeType":null,"messageId":"replace","endLine":427,"endColumn":9,"fix":{"range":[14455,14463],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'A·list·of·paths·to·modules·that·run·some·code·to·configure·or·'` with `·····'A·list·of·paths·to·modules·that·run·some·code·to·configure·or·'·+`","line":433,"column":8,"nodeType":null,"messageId":"replace","endLine":433,"endColumn":72,"fix":{"range":[14649,14713],"text":" 'A list of paths to modules that run some code to configure or ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":434,"column":8,"nodeType":null,"messageId":"replace","endLine":434,"endColumn":9,"fix":{"range":[14721,14722],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·list·of·paths·to·modules·that·run·some·code·to·configure·or·'` with `············'A·list·of·paths·to·modules·that·run·some·code·to·configure·or·'·+`","line":440,"column":1,"nodeType":null,"messageId":"replace","endLine":440,"endColumn":72,"fix":{"range":[14874,14945],"text":" 'A list of paths to modules that run some code to configure or ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":441,"column":8,"nodeType":null,"messageId":"replace","endLine":441,"endColumn":9,"fix":{"range":[14953,14954],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":450,"column":21,"nodeType":null,"messageId":"insert","endLine":450,"endColumn":21,"fix":{"range":[15202,15202],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Disables·the·filter·provided·by·--filter.·Useful·for·CI·jobs,·or·'` with `·····'Disables·the·filter·provided·by·--filter.·Useful·for·CI·jobs,·or·'·+`","line":455,"column":8,"nodeType":null,"messageId":"replace","endLine":455,"endColumn":75,"fix":{"range":[15341,15408],"text":" 'Disables the filter provided by --filter. Useful for CI jobs, or ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":456,"column":8,"nodeType":null,"messageId":"replace","endLine":456,"endColumn":9,"fix":{"range":[15416,15417],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·list·of·paths·to·snapshot·serializer·modules·Jest·should·'` with `············'A·list·of·paths·to·snapshot·serializer·modules·Jest·should·'·+`","line":461,"column":1,"nodeType":null,"messageId":"replace","endLine":461,"endColumn":69,"fix":{"range":[15537,15605],"text":" 'A list of paths to snapshot serializer modules Jest should ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":462,"column":8,"nodeType":null,"messageId":"replace","endLine":462,"endColumn":9,"fix":{"range":[15613,15614],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Test·environment·options·that·will·be·passed·to·the·testEnvironment.·'` with `·····'Test·environment·options·that·will·be·passed·to·the·testEnvironment.·'·+`","line":472,"column":8,"nodeType":null,"messageId":"replace","endLine":472,"endColumn":79,"fix":{"range":[15846,15917],"text":" 'Test environment options that will be passed to the testEnvironment. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":473,"column":8,"nodeType":null,"messageId":"replace","endLine":473,"endColumn":9,"fix":{"range":[15925,15926],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":491,"column":21,"nodeType":null,"messageId":"insert","endLine":491,"endColumn":21,"fix":{"range":[16496,16496],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'An·array·of·regexp·pattern·strings·that·are·matched·'` with `············'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":496,"column":1,"nodeType":null,"messageId":"replace","endLine":496,"endColumn":62,"fix":{"range":[16640,16701],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'against·all·test·paths·before·executing·the·test.·If·the·test·path·'` with `·····'against·all·test·paths·before·executing·the·test.·If·the·test·path·'·+`","line":497,"column":8,"nodeType":null,"messageId":"replace","endLine":497,"endColumn":79,"fix":{"range":[16709,16780],"text":" 'against all test paths before executing the test. If the test path ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":498,"column":8,"nodeType":null,"messageId":"replace","endLine":498,"endColumn":9,"fix":{"range":[16788,16789],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·regexp·pattern·string·that·is·matched·against·all·tests·'` with `············'A·regexp·pattern·string·that·is·matched·against·all·tests·'·+`","line":504,"column":1,"nodeType":null,"messageId":"replace","endLine":504,"endColumn":68,"fix":{"range":[16937,17004],"text":" 'A regexp pattern string that is matched against all tests ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":505,"column":1,"nodeType":null,"messageId":"replace","endLine":505,"endColumn":9,"fix":{"range":[17005,17013],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·····`","line":511,"column":1,"nodeType":null,"messageId":"insert","endLine":511,"endColumn":1,"fix":{"range":[17139,17139],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'Allows·the·use·of·a·custom·results·processor.·'` with `············'Allows·the·use·of·a·custom·results·processor.·'·+`","line":517,"column":1,"nodeType":null,"messageId":"replace","endLine":517,"endColumn":56,"fix":{"range":[17330,17385],"text":" 'Allows the use of a custom results processor. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'This·processor·must·be·a·node·module·that·exports·'` with `·····'This·processor·must·be·a·node·module·that·exports·'·+`","line":518,"column":8,"nodeType":null,"messageId":"replace","endLine":518,"endColumn":62,"fix":{"range":[17393,17447],"text":" 'This processor must be a node module that exports ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":519,"column":8,"nodeType":null,"messageId":"replace","endLine":519,"endColumn":9,"fix":{"range":[17455,17456],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Allows·to·specify·a·custom·test·runner.·The·default·is'` with `·····'Allows·to·specify·a·custom·test·runner.·The·default·is'·+`","line":524,"column":8,"nodeType":null,"messageId":"replace","endLine":524,"endColumn":64,"fix":{"range":[17598,17654],"text":" 'Allows to specify a custom test runner. The default is' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'·`jest-circus/runner`.·A·path·to·a·custom·test·runner·can·be·provided:'` with `············'·`jest-circus/runner`.·A·path·to·a·custom·test·runner·can·be·provided:'·+`","line":525,"column":1,"nodeType":null,"messageId":"replace","endLine":525,"endColumn":82,"fix":{"range":[17655,17736],"text":" ' `jest-circus/runner`. A path to a custom test runner can be provided:' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":526,"column":8,"nodeType":null,"messageId":"replace","endLine":526,"endColumn":9,"fix":{"range":[17744,17745],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Allows·to·specify·a·custom·test·sequencer.·The·default·is·'` with `·····'Allows·to·specify·a·custom·test·sequencer.·The·default·is·'·+`","line":531,"column":8,"nodeType":null,"messageId":"replace","endLine":531,"endColumn":68,"fix":{"range":[17864,17924],"text":" 'Allows to specify a custom test sequencer. The default is ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'`@jest/test-sequencer`.·A·path·to·a·custom·test·sequencer·can·be·'` with `·····'`@jest/test-sequencer`.·A·path·to·a·custom·test·sequencer·can·be·'·+`","line":532,"column":8,"nodeType":null,"messageId":"replace","endLine":532,"endColumn":77,"fix":{"range":[17932,18001],"text":" '`@jest/test-sequencer`. A path to a custom test sequencer can be ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":533,"column":1,"nodeType":null,"messageId":"replace","endLine":533,"endColumn":9,"fix":{"range":[18002,18010],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Setting·this·value·to·fake·allows·the·use·of·fake·timers·'` with `·····'Setting·this·value·to·fake·allows·the·use·of·fake·timers·'·+`","line":546,"column":8,"nodeType":null,"messageId":"replace","endLine":546,"endColumn":67,"fix":{"range":[18380,18439],"text":" 'Setting this value to fake allows the use of fake timers ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":547,"column":8,"nodeType":null,"messageId":"replace","endLine":547,"endColumn":9,"fix":{"range":[18447,18448],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'A·JSON·string·which·maps·from·regular·expressions·to·paths·'` with `············'A·JSON·string·which·maps·from·regular·expressions·to·paths·'·+`","line":552,"column":1,"nodeType":null,"messageId":"replace","endLine":552,"endColumn":69,"fix":{"range":[18554,18622],"text":" 'A JSON string which maps from regular expressions to paths ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":553,"column":8,"nodeType":null,"messageId":"replace","endLine":553,"endColumn":9,"fix":{"range":[18630,18631],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·regexp·pattern·strings·that·are·matched·'` with `·····'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":558,"column":8,"nodeType":null,"messageId":"replace","endLine":558,"endColumn":62,"fix":{"range":[18741,18795],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":559,"column":8,"nodeType":null,"messageId":"replace","endLine":559,"endColumn":9,"fix":{"range":[18803,18804],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'An·array·of·regexp·pattern·strings·that·are·matched·'` with `·····'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":565,"column":8,"nodeType":null,"messageId":"replace","endLine":565,"endColumn":62,"fix":{"range":[18974,19028],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'against·all·modules·before·the·module·loader·will·automatically·'` with `·····'against·all·modules·before·the·module·loader·will·automatically·'·+`","line":566,"column":8,"nodeType":null,"messageId":"replace","endLine":566,"endColumn":76,"fix":{"range":[19036,19104],"text":" 'against all modules before the module loader will automatically ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":567,"column":8,"nodeType":null,"messageId":"replace","endLine":567,"endColumn":9,"fix":{"range":[19112,19113],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Use·this·flag·to·re-record·snapshots.·'` with `·····'Use·this·flag·to·re-record·snapshots.·'·+`","line":574,"column":8,"nodeType":null,"messageId":"replace","endLine":574,"endColumn":48,"fix":{"range":[19262,19302],"text":" 'Use this flag to re-record snapshots. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'Can·be·used·together·with·a·test·suite·pattern·or·with·'` with `·····'Can·be·used·together·with·a·test·suite·pattern·or·with·'·+`","line":575,"column":8,"nodeType":null,"messageId":"replace","endLine":575,"endColumn":67,"fix":{"range":[19310,19369],"text":" 'Can be used together with a test suite pattern or with ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'`--testNamePattern`·to·re-record·snapshot·for·test·matching·'` with `·····'`--testNamePattern`·to·re-record·snapshot·for·test·matching·'·+`","line":576,"column":8,"nodeType":null,"messageId":"replace","endLine":576,"endColumn":72,"fix":{"range":[19377,19441],"text":" '`--testNamePattern` to re-record snapshot for test matching ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":577,"column":8,"nodeType":null,"messageId":"replace","endLine":577,"endColumn":9,"fix":{"range":[19449,19450],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······` with `············`","line":586,"column":1,"nodeType":null,"messageId":"replace","endLine":586,"endColumn":8,"fix":{"range":[19634,19641],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Watch·files·for·changes·and·rerun·tests·related·to·'` with `·····'Watch·files·for·changes·and·rerun·tests·related·to·'·+`","line":596,"column":8,"nodeType":null,"messageId":"replace","endLine":596,"endColumn":61,"fix":{"range":[19896,19949],"text":" 'Watch files for changes and rerun tests related to ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+·'changed·files.·If·you·want·to·re-run·all·tests·when·a·file·has·'` with `············'changed·files.·If·you·want·to·re-run·all·tests·when·a·file·has·'·+`","line":597,"column":1,"nodeType":null,"messageId":"replace","endLine":597,"endColumn":75,"fix":{"range":[19950,20024],"text":" 'changed files. If you want to re-run all tests when a file has ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······+` with `···········`","line":598,"column":1,"nodeType":null,"messageId":"replace","endLine":598,"endColumn":9,"fix":{"range":[20025,20033],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Watch·files·for·changes·and·rerun·all·tests.·If·you·want·'` with `·····'Watch·files·for·changes·and·rerun·all·tests.·If·you·want·'·+`","line":603,"column":8,"nodeType":null,"messageId":"replace","endLine":603,"endColumn":67,"fix":{"range":[20150,20209],"text":" 'Watch files for changes and rerun all tests. If you want ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'to·re-run·only·the·tests·related·to·the·changed·files,·use·the·'` with `·····'to·re-run·only·the·tests·related·to·the·changed·files,·use·the·'·+`","line":604,"column":8,"nodeType":null,"messageId":"replace","endLine":604,"endColumn":75,"fix":{"range":[20217,20284],"text":" 'to re-run only the tests related to the changed files, use the ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":605,"column":8,"nodeType":null,"messageId":"replace","endLine":605,"endColumn":9,"fix":{"range":[20292,20293],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·······'An·array·of·regexp·pattern·strings·that·are·matched·'` with `············'An·array·of·regexp·pattern·strings·that·are·matched·'·+`","line":610,"column":1,"nodeType":null,"messageId":"replace","endLine":610,"endColumn":62,"fix":{"range":[20398,20459],"text":" 'An array of regexp pattern strings that are matched ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+·'against·all·paths·before·trigger·test·re-run·in·watch·mode.·'` with `·····'against·all·paths·before·trigger·test·re-run·in·watch·mode.·'·+`","line":611,"column":8,"nodeType":null,"messageId":"replace","endLine":611,"endColumn":72,"fix":{"range":[20467,20531],"text":" 'against all paths before trigger test re-run in watch mode. ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":612,"column":8,"nodeType":null,"messageId":"replace","endLine":612,"endColumn":9,"fix":{"range":[20539,20540],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'Whether·to·use·watchman·for·file·crawling.·Disable·using·'` with `·····'Whether·to·use·watchman·for·file·crawling.·Disable·using·'·+`","line":618,"column":8,"nodeType":null,"messageId":"replace","endLine":618,"endColumn":67,"fix":{"range":[20705,20764],"text":" 'Whether to use watchman for file crawling. Disable using ' +"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `+` with `····`","line":619,"column":8,"nodeType":null,"messageId":"replace","endLine":619,"endColumn":9,"fix":{"range":[20772,20773],"text":" "}}],"errorCount":177,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":177,"fixableWarningCount":0,"source":"/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nexport const usage = 'Usage: $0 [--config=] [TestPathPattern]';\nexport const docs = 'Documentation: https://jestjs.io/';\n\n// The default values are all set in jest-config\nexport const options = {\n all: {\n description:\n 'The opposite of `onlyChanged`. If `onlyChanged` is set by '\n + 'default, running jest with `--all` will force Jest to run all tests '\n + 'instead of running only tests related to changed files.',\n type: 'boolean'\n },\n automock: {\n description: 'Automock all files by default.',\n type: 'boolean'\n },\n bail: {\n alias: 'b',\n description:\n 'Exit the test suite immediately after `n` number of failing tests.',\n type: 'boolean'\n },\n browser: {\n description:\n 'Respect the \"browser\" field in package.json '\n + 'when resolving modules. Some packages export different versions '\n + 'based on whether they are operating in node.js or a browser.',\n type: 'boolean'\n },\n cache: {\n description:\n 'Whether to use the transform cache. Disable the cache '\n + 'using --no-cache.',\n type: 'boolean'\n },\n cacheDirectory: {\n description:\n 'The directory where Jest should store its cached '\n + ' dependency information.',\n type: 'string'\n },\n changedFilesWithAncestor: {\n description:\n 'Runs tests related to the current changes and the changes made in the '\n + 'last commit. Behaves similarly to `--onlyChanged`.',\n type: 'boolean'\n },\n changedSince: {\n description:\n 'Runs tests related to the changes since the provided branch. If the '\n + 'current branch has diverged from the given branch, then only changes '\n + 'made locally will be tested. Behaves similarly to `--onlyChanged`.',\n nargs: 1,\n type: 'string'\n },\n ci: {\n description:\n 'Whether to run Jest in continuous integration (CI) mode. '\n + 'This option is on by default in most popular CI environments. It will '\n + 'prevent snapshots from being written unless explicitly requested.',\n type: 'boolean'\n },\n clearCache: {\n description:\n 'Clears the configured Jest cache directory and then exits. '\n + 'Default directory can be found by calling jest --showConfig',\n type: 'boolean'\n },\n clearMocks: {\n description:\n 'Automatically clear mock calls and instances between every '\n + 'test. Equivalent to calling jest.clearAllMocks() between each test.',\n type: 'boolean'\n },\n collectCoverage: {\n description: 'Alias for --coverage.',\n type: 'boolean'\n },\n collectCoverageFrom: {\n description:\n 'A glob pattern relative to matching the files that coverage '\n + 'info needs to be collected from.',\n type: 'string'\n },\n collectCoverageOnlyFrom: {\n description: 'Explicit list of paths coverage will be restricted to.',\n string: true,\n type: 'array'\n },\n color: {\n description:\n 'Forces test results output color highlighting (even if '\n + 'stdout is not a TTY). Set to false if you would like to have no colors.',\n type: 'boolean'\n },\n colors: {\n description: 'Alias for `--color`.',\n type: 'boolean'\n },\n config: {\n alias: 'c',\n description:\n 'The path to a jest config file specifying how to find '\n + 'and execute tests. If no rootDir is set in the config, the directory '\n + 'containing the config file is assumed to be the rootDir for the project.'\n + 'This can also be a JSON encoded value which Jest will use as configuration.',\n type: 'string'\n },\n coverage: {\n description:\n 'Indicates that test coverage information should be '\n + 'collected and reported in the output.',\n type: 'boolean'\n },\n coverageDirectory: {\n description: 'The directory where Jest should output its coverage files.',\n type: 'string'\n },\n coveragePathIgnorePatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all file paths before executing the test. If the file path'\n + 'matches any of the patterns, coverage information will be skipped.',\n string: true,\n type: 'array'\n },\n coverageProvider: {\n choices: ['babel', 'v8'],\n description: 'Select between Babel and V8 to collect coverage'\n },\n coverageReporters: {\n description:\n 'A list of reporter names that Jest uses when writing '\n + 'coverage reports. Any istanbul reporter can be used.',\n string: true,\n type: 'array'\n },\n coverageThreshold: {\n description:\n 'A JSON string with which will be used to configure '\n + 'minimum threshold enforcement for coverage results',\n type: 'string'\n },\n debug: {\n description: 'Print debugging info about your jest config.',\n type: 'boolean'\n },\n detectLeaks: {\n description:\n '**EXPERIMENTAL**: Detect memory leaks in tests. After executing a '\n + 'test, it will try to garbage collect the global object used, and fail '\n + 'if it was leaked',\n type: 'boolean'\n },\n detectOpenHandles: {\n description:\n 'Print out remaining open handles preventing Jest from exiting at the '\n + 'end of a test run. Implies `runInBand`.',\n type: 'boolean'\n },\n env: {\n description:\n 'The test environment used for all tests. This can point to '\n + 'any file or node module. Examples: `jsdom`, `node` or '\n + '`path/to/my-environment.js`',\n type: 'string'\n },\n errorOnDeprecated: {\n description: 'Make calling deprecated APIs throw helpful error messages.',\n type: 'boolean'\n },\n expand: {\n alias: 'e',\n description: 'Use this flag to show full diffs instead of a patch.',\n type: 'boolean'\n },\n filter: {\n description:\n 'Path to a module exporting a filtering function. This method receives '\n + 'a list of tests which can be manipulated to exclude tests from '\n + 'running. Especially useful when used in conjunction with a testing '\n + 'infrastructure to filter known broken tests.',\n type: 'string'\n },\n findRelatedTests: {\n description:\n 'Find related tests for a list of source files that were '\n + 'passed in as arguments. Useful for pre-commit hook integration to run '\n + 'the minimal amount of tests necessary.',\n type: 'boolean'\n },\n forceExit: {\n description:\n 'Force Jest to exit after all tests have completed running. '\n + 'This is useful when resources set up by test code cannot be '\n + 'adequately cleaned up.',\n type: 'boolean'\n },\n globalSetup: {\n description: 'The path to a module that runs before All Tests.',\n type: 'string'\n },\n globalTeardown: {\n description: 'The path to a module that runs after All Tests.',\n type: 'string'\n },\n globals: {\n description:\n 'A JSON string with map of global variables that need '\n + 'to be available in all test environments.',\n type: 'string'\n },\n haste: {\n description:\n 'A JSON string with map of variables for the haste module system',\n type: 'string'\n },\n init: {\n description: 'Generate a basic configuration file',\n type: 'boolean'\n },\n injectGlobals: {\n description: 'Should Jest inject global variables or not',\n type: 'boolean'\n },\n json: {\n description:\n 'Prints the test results in JSON. This mode will send all '\n + 'other test output and user messages to stderr.',\n type: 'boolean'\n },\n lastCommit: {\n description:\n 'Run all tests affected by file changes in the last commit made. '\n + 'Behaves similarly to `--onlyChanged`.',\n type: 'boolean'\n },\n listTests: {\n description:\n 'Lists all tests Jest will run given the arguments and '\n + 'exits. Most useful in a CI system together with `--findRelatedTests` '\n + 'to determine the tests Jest will run based on specific files',\n type: 'boolean'\n },\n logHeapUsage: {\n description:\n 'Logs the heap usage after every test. Useful to debug '\n + 'memory leaks. Use together with `--runInBand` and `--expose-gc` in '\n + 'node.',\n type: 'boolean'\n },\n maxConcurrency: {\n description:\n 'Specifies the maximum number of tests that are allowed to run'\n + 'concurrently. This only affects tests using `test.concurrent`.',\n type: 'number'\n },\n maxWorkers: {\n alias: 'w',\n description:\n 'Specifies the maximum number of workers the worker-pool '\n + 'will spawn for running tests. This defaults to the number of the '\n + 'cores available on your machine. (its usually best not to override '\n + 'this default)',\n type: 'string'\n },\n moduleDirectories: {\n description:\n 'An array of directory names to be searched recursively '\n + \"up from the requiring module's location.\",\n string: true,\n type: 'array'\n },\n moduleFileExtensions: {\n description:\n 'An array of file extensions your modules use. If you '\n + 'require modules without specifying a file extension, these are the '\n + 'extensions Jest will look for. ',\n string: true,\n type: 'array'\n },\n moduleNameMapper: {\n description:\n 'A JSON string with a map from regular expressions to '\n + 'module names or to arrays of module names that allow to stub '\n + 'out resources, like images or styles with a single module',\n type: 'string'\n },\n modulePathIgnorePatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all module paths before those paths are to be considered '\n + '\"visible\" to the module loader.',\n string: true,\n type: 'array'\n },\n modulePaths: {\n description:\n 'An alternative API to setting the NODE_PATH env variable, '\n + 'modulePaths is an array of absolute paths to additional locations to '\n + 'search when resolving modules.',\n string: true,\n type: 'array'\n },\n noStackTrace: {\n description: 'Disables stack trace in test results output',\n type: 'boolean'\n },\n notify: {\n description: 'Activates notifications for test results.',\n type: 'boolean'\n },\n notifyMode: {\n description: 'Specifies when notifications will appear for test results.',\n type: 'string'\n },\n onlyChanged: {\n alias: 'o',\n description:\n 'Attempts to identify which tests to run based on which '\n + \"files have changed in the current repository. Only works if you're \"\n + 'running tests in a git or hg repository at the moment.',\n type: 'boolean'\n },\n onlyFailures: {\n alias: 'f',\n description: 'Run tests that failed in the previous execution.',\n type: 'boolean'\n },\n outputFile: {\n description:\n 'Write test results to a file when the --json option is '\n + 'also specified.',\n type: 'string'\n },\n passWithNoTests: {\n description:\n 'Will not fail if no tests are found (for example while using `--testPathPattern`.)',\n type: 'boolean'\n },\n preset: {\n description: \"A preset that is used as a base for Jest's configuration.\",\n type: 'string'\n },\n prettierPath: {\n description: 'The path to the \"prettier\" module used for inline snapshots.',\n type: 'string'\n },\n projects: {\n description:\n 'A list of projects that use Jest to run all tests of all '\n + 'projects in a single instance of Jest.',\n string: true,\n type: 'array'\n },\n reporters: {\n description: 'A list of custom reporters for the test suite.',\n string: true,\n type: 'array'\n },\n resetMocks: {\n description:\n 'Automatically reset mock state between every test. '\n + 'Equivalent to calling jest.resetAllMocks() between each test.',\n type: 'boolean'\n },\n resetModules: {\n description:\n 'If enabled, the module registry for every test file will '\n + 'be reset before running each individual test.',\n type: 'boolean'\n },\n resolver: {\n description: 'A JSON string which allows the use of a custom resolver.',\n type: 'string'\n },\n restoreMocks: {\n description:\n 'Automatically restore mock state and implementation between every test. '\n + 'Equivalent to calling jest.restoreAllMocks() between each test.',\n type: 'boolean'\n },\n rootDir: {\n description:\n 'The root directory that Jest should scan for tests and '\n + 'modules within.',\n type: 'string'\n },\n roots: {\n description:\n 'A list of paths to directories that Jest should use to '\n + 'search for files in.',\n string: true,\n type: 'array'\n },\n runInBand: {\n alias: 'i',\n description:\n 'Run all tests serially in the current process (rather than '\n + 'creating a worker pool of child processes that run tests). This '\n + 'is sometimes useful for debugging, but such use cases are pretty '\n + 'rare.',\n type: 'boolean'\n },\n runTestsByPath: {\n description:\n 'Used when provided patterns are exact file paths. This avoids '\n + 'converting them into a regular expression and matching it against '\n + 'every single file.',\n type: 'boolean'\n },\n runner: {\n description:\n \"Allows to use a custom runner instead of Jest's default test runner.\",\n type: 'string'\n },\n selectProjects: {\n description:\n 'Run only the tests of the specified projects.'\n + 'Jest uses the attribute `displayName` in the configuration to identify each project.',\n string: true,\n type: 'array'\n },\n setupFiles: {\n description:\n 'A list of paths to modules that run some code to configure or '\n + 'set up the testing environment before each test. ',\n string: true,\n type: 'array'\n },\n setupFilesAfterEnv: {\n description:\n 'A list of paths to modules that run some code to configure or '\n + 'set up the testing framework before each test ',\n string: true,\n type: 'array'\n },\n showConfig: {\n description: 'Print your jest config and then exits.',\n type: 'boolean'\n },\n silent: {\n description: 'Prevent tests from printing messages through the console.',\n type: 'boolean'\n },\n skipFilter: {\n description:\n 'Disables the filter provided by --filter. Useful for CI jobs, or '\n + 'local enforcement when fixing tests.',\n type: 'boolean'\n },\n snapshotSerializers: {\n description:\n 'A list of paths to snapshot serializer modules Jest should '\n + 'use for snapshot testing.',\n string: true,\n type: 'array'\n },\n testEnvironment: {\n description: 'Alias for --env',\n type: 'string'\n },\n testEnvironmentOptions: {\n description:\n 'Test environment options that will be passed to the testEnvironment. '\n + 'The relevant options depend on the environment.',\n type: 'string' // Object\n },\n testFailureExitCode: {\n description: 'Exit code of `jest` command if the test run failed',\n type: 'string' // number\n },\n testLocationInResults: {\n description: 'Add `location` information to the test results',\n type: 'boolean'\n },\n testMatch: {\n description: 'The glob patterns Jest uses to detect test files.',\n string: true,\n type: 'array'\n },\n testNamePattern: {\n alias: 't',\n description: 'Run only tests with a name that matches the regex pattern.',\n type: 'string'\n },\n testPathIgnorePatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all test paths before executing the test. If the test path '\n + 'matches any of the patterns, it will be skipped.',\n string: true,\n type: 'array'\n },\n testPathPattern: {\n description:\n 'A regexp pattern string that is matched against all tests '\n + 'paths before executing the test.',\n string: true,\n type: 'array'\n },\n testRegex: {\n description:\n 'A string or array of string regexp patterns that Jest uses to detect test files.',\n string: true,\n type: 'array'\n },\n testResultsProcessor: {\n description:\n 'Allows the use of a custom results processor. '\n + 'This processor must be a node module that exports '\n + 'a function expecting as the first argument the result object.',\n type: 'string'\n },\n testRunner: {\n description:\n 'Allows to specify a custom test runner. The default is'\n + ' `jest-circus/runner`. A path to a custom test runner can be provided:'\n + ' `/path/to/testRunner.js`.',\n type: 'string'\n },\n testSequencer: {\n description:\n 'Allows to specify a custom test sequencer. The default is '\n + '`@jest/test-sequencer`. A path to a custom test sequencer can be '\n + 'provided: `/path/to/testSequencer.js`',\n type: 'string'\n },\n testTimeout: {\n description: 'This option sets the default timeouts of test cases.',\n type: 'number'\n },\n testURL: {\n description: 'This option sets the URL for the jsdom environment.',\n type: 'string'\n },\n timers: {\n description:\n 'Setting this value to fake allows the use of fake timers '\n + 'for functions such as setTimeout.',\n type: 'string'\n },\n transform: {\n description:\n 'A JSON string which maps from regular expressions to paths '\n + 'to transformers.',\n type: 'string'\n },\n transformIgnorePatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all source file paths before transformation.',\n string: true,\n type: 'array'\n },\n unmockedModulePathPatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all modules before the module loader will automatically '\n + 'return a mock for them.',\n string: true,\n type: 'array'\n },\n updateSnapshot: {\n alias: 'u',\n description:\n 'Use this flag to re-record snapshots. '\n + 'Can be used together with a test suite pattern or with '\n + '`--testNamePattern` to re-record snapshot for test matching '\n + 'the pattern',\n type: 'boolean'\n },\n useStderr: {\n description: 'Divert all output to stderr.',\n type: 'boolean'\n },\n verbose: {\n description:\n 'Display individual test results with the test suite hierarchy.',\n type: 'boolean'\n },\n version: {\n alias: 'v',\n description: 'Print the version and exit',\n type: 'boolean'\n },\n watch: {\n description:\n 'Watch files for changes and rerun tests related to '\n + 'changed files. If you want to re-run all tests when a file has '\n + 'changed, use the `--watchAll` option.',\n type: 'boolean'\n },\n watchAll: {\n description:\n 'Watch files for changes and rerun all tests. If you want '\n + 'to re-run only the tests related to the changed files, use the '\n + '`--watch` option.',\n type: 'boolean'\n },\n watchPathIgnorePatterns: {\n description:\n 'An array of regexp pattern strings that are matched '\n + 'against all paths before trigger test re-run in watch mode. '\n + 'If the test path matches any of the patterns, it will be skipped.',\n string: true,\n type: 'array'\n },\n watchman: {\n description:\n 'Whether to use watchman for file crawling. Disable using '\n + '--no-watchman.',\n type: 'boolean'\n }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/build.config.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\nmodule.exports = {\n copy: ['runtime']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `iconName·=>` with `(iconName)·=>⏎···············`","line":50,"column":13,"nodeType":null,"messageId":"replace","endLine":50,"endColumn":24,"fix":{"range":[1245,1256],"text":"(iconName) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `routes` with `(routes)`","line":82,"column":22,"nodeType":null,"messageId":"replace","endLine":82,"endColumn":28,"fix":{"range":[2150,2156],"text":"(routes)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················join(api.paths.absTmpPath·||·'',·absFilePath)⏎············` with `join(api.paths.absTmpPath·||·'',·absFilePath)`","line":85,"column":32,"nodeType":null,"messageId":"replace","endLine":87,"endColumn":13,"fix":{"range":[2226,2301],"text":"join(api.paths.absTmpPath || '', absFilePath)"}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { winPath } from '@fesjs/utils';\n\nconst namespace = 'plugin-layout';\n\nexport default (api) => {\n const {\n utils: { Mustache }\n } = api;\n\n const helper = require('./node/helper');\n\n api.describe({\n key: 'layout',\n config: {\n schema(joi) {\n return joi.object();\n },\n onChange: api.ConfigChangeType.regenerateTmpFiles\n }\n });\n\n api.addRuntimePluginKey(() => 'layout');\n\n const absFilePath = join(namespace, 'index.js');\n\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n\n api.onGenerateFiles(async () => {\n const { name } = api.pkg;\n\n const HAS_LOCALE = api.hasPlugins(['@fesjs/plugin-locale']);\n\n // .fes配置\n const userConfig = {\n title: name,\n footer: 'Created by Fes.js',\n ...(api.config.layout || {})\n };\n\n // 路由信息\n const routes = await api.getRoutes();\n // 把路由的meta合并到menu配置中\n userConfig.menus = helper.fillMenuByRoute(userConfig.menus, routes);\n\n const icons = helper.getIconsFromMenu(userConfig.menus);\n\n const iconsString = icons.map(\n iconName => `import ${iconName} from '@ant-design/icons-vue/es/icons/${iconName}'`\n );\n api.writeTmpFile({\n path: join(namespace, 'icons.js'),\n content: `\n ${iconsString.join(';\\n')}\n export default {\n ${icons.join(',\\n')}\n }`\n });\n\n api.writeTmpFile({\n path: absFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/index.tpl'), 'utf-8'),\n {\n REPLACE_USER_CONFIG: JSON.stringify(userConfig),\n HAS_LOCALE\n }\n )\n });\n\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'runtime'),\n ignore: ['.tpl']\n });\n });\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n\n // 把BaseLayout插入到路由配置中,作为根路由\n api.modifyRoutes(routes => [\n {\n path: '/',\n component: winPath(\n join(api.paths.absTmpPath || '', absFilePath)\n ),\n children: routes\n }\n ]);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/helpers/pluginAccess.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":16,"column":29,"nodeType":null,"messageId":"insert","endLine":16,"endColumn":29,"fix":{"range":[528,528],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":17,"column":1,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":1,"fix":{"range":[561,561],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":18,"column":1,"nodeType":null,"messageId":"replace","endLine":18,"endColumn":13,"fix":{"range":[613,625],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎········`","line":19,"column":9,"nodeType":null,"messageId":"replace","endLine":19,"endColumn":11,"fix":{"range":[658,660],"text":" })\n "}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import { unref, computed } from 'vue';\n// eslint-disable-next-line\nimport { useAccess } from '../../plugin-access/core';\n\nif (!useAccess) {\n throw new Error(\n '[plugin-layout]: pLugin-layout depends on plugin-access,please install plugin-access first!'\n );\n}\n\nexport const hasAccessByMenuItem = (item) => {\n let res;\n if (item.path && (!item.children || item.children.length === 0)) {\n res = useAccess(item.path);\n } else if (item.children && item.children.length > 0) {\n res = computed(() => item.children.some((child) => {\n const rst = hasAccessByMenuItem(child);\n return rst && rst.value;\n }));\n }\n return res;\n};\n\nconst _addAccessTag = (arr) => {\n if (Array.isArray(arr)) {\n arr.forEach((item) => {\n item.access = hasAccessByMenuItem(item);\n if (item.children && item.children.length > 0) {\n _addAccessTag(item.children);\n }\n });\n }\n};\n\nexport const transform = (menus) => {\n const originData = unref(menus);\n _addAccessTag(originData);\n\n return originData;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/helpers/pluginLocale.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":4,"column":1,"nodeType":null,"messageId":"delete","endLine":5,"endColumn":1,"fix":{"range":[86,87],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":12,"column":3,"nodeType":null,"messageId":"delete","endLine":13,"endColumn":1,"fix":{"range":[297,298],"text":""}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { unref, computed } from 'vue';\nimport { plugin } from '@@/core/coreExports';\n\n\nexport const transTitle = (name) => {\n const sharedLocale = plugin.getShared('locale');\n if (sharedLocale) {\n const { t } = sharedLocale.useI18n();\n return t(name);\n }\n return name;\n};\n\n\nconst _transform = (arr) => {\n if (Array.isArray(arr)) {\n arr.forEach((item) => {\n if (item.title) {\n item._title = item.title;\n item.title = computed(() => transTitle(item._title));\n }\n if (item.children && item.children.length > 0) {\n _transform(item.children);\n }\n });\n }\n};\n\nexport const transform = (menus) => {\n const originData = unref(menus);\n _transform(originData);\n return originData;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/helpers/svg.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/runtime.js","messages":[{"ruleId":"import/no-named-as-default","severity":2,"message":"Parse errors in imported module './views/404': Unexpected token (3:18) (3:18)","line":4,"column":26,"nodeType":"Literal","endLine":4,"endColumn":39},{"ruleId":"import/no-named-as-default-member","severity":2,"message":"Parse errors in imported module './views/404': Unexpected token (3:18) (3:18)","line":4,"column":26,"nodeType":"Literal","endLine":4,"endColumn":39},{"ruleId":"import/no-named-as-default","severity":2,"message":"Parse errors in imported module './views/403': Unexpected token (3:18) (3:18)","line":5,"column":26,"nodeType":"Literal","endLine":5,"endColumn":39},{"ruleId":"import/no-named-as-default-member","severity":2,"message":"Parse errors in imported module './views/403': Unexpected token (3:18) (3:18)","line":5,"column":26,"nodeType":"Literal","endLine":5,"endColumn":39},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `memo` with `(memo)`","line":29,"column":23,"nodeType":null,"messageId":"replace","endLine":29,"endColumn":27,"fix":{"range":[871,875],"text":"(memo)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········router,·to,·from,·next⏎···` with `·router,·to,·from,·next`","line":30,"column":22,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":4,"fix":{"range":[903,938],"text":" router, to, from, next"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `runtimeConfig.unAccessHandler·&&·typeof·runtimeConfig.unAccessHandler·===·'function'` with `⏎············runtimeConfig.unAccessHandler·&&⏎············typeof·runtimeConfig.unAccessHandler·===·'function'⏎········`","line":38,"column":13,"nodeType":null,"messageId":"replace","endLine":38,"endColumn":97,"fix":{"range":[1119,1203],"text":"\n runtimeConfig.unAccessHandler &&\n typeof runtimeConfig.unAccessHandler === 'function'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·to,·from,` with `⏎················to,⏎················from,⏎···············`","line":40,"column":24,"nodeType":null,"messageId":"replace","endLine":40,"endColumn":34,"fix":{"range":[1281,1291],"text":"\n to,\n from,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········router,·to,·from,·next⏎···` with `·router,·to,·from,·next`","line":50,"column":21,"nodeType":null,"messageId":"replace","endLine":52,"endColumn":4,"fix":{"range":[1511,1546],"text":" router, to, from, next"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `runtimeConfig.noFoundHandler·&&·typeof·runtimeConfig.noFoundHandler·===·'function'` with `⏎············runtimeConfig.noFoundHandler·&&⏎············typeof·runtimeConfig.noFoundHandler·===·'function'⏎········`","line":58,"column":13,"nodeType":null,"messageId":"replace","endLine":58,"endColumn":95,"fix":{"range":[1727,1809],"text":"\n runtimeConfig.noFoundHandler &&\n typeof runtimeConfig.noFoundHandler === 'function'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·to,·from,` with `⏎················to,⏎················from,⏎···············`","line":60,"column":24,"nodeType":null,"messageId":"replace","endLine":60,"endColumn":34,"fix":{"range":[1886,1896],"text":"\n to,\n from,\n "}}],"errorCount":11,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"import { plugin, ApplyPluginsType } from '@@/core/coreExports';\n// eslint-disable-next-line import/extensions\nimport { access as accessApi } from '../plugin-access/core';\nimport Exception404 from './views/404';\nimport Exception403 from './views/403';\n\nif (!accessApi) {\n throw new Error(\n '[plugin-layout]: pLugin-layout depends on plugin-access,please install plugin-access first!'\n );\n}\n\nconst handle = (type, router) => {\n const accesssIds = accessApi.getAccess();\n const path = `/${type}`;\n const name = `Exception${type}`;\n const components = {\n 404: Exception404,\n 403: Exception403\n };\n if (!accesssIds.includes(path)) {\n accessApi.setAccess(accesssIds.concat([path]));\n }\n if (!router.hasRoute(name)) {\n router.addRoute({ path, name, component: components[type] });\n }\n};\n\nexport const access = memo => ({\n unAccessHandler({\n router, to, from, next\n }) {\n const runtimeConfig = plugin.applyPlugins({\n key: 'layout',\n type: ApplyPluginsType.modify,\n initialValue: {}\n });\n if (runtimeConfig.unAccessHandler && typeof runtimeConfig.unAccessHandler === 'function') {\n return runtimeConfig.unAccessHandler({\n router, to, from, next\n });\n }\n if (to.path === '/404') {\n handle(404, router);\n return next('/404');\n }\n handle(403, router);\n next('/403');\n },\n noFoundHandler({\n router, to, from, next\n }) {\n const runtimeConfig = plugin.applyPlugins({\n key: 'layout',\n type: ApplyPluginsType.modify,\n initialValue: {}\n });\n if (runtimeConfig.noFoundHandler && typeof runtimeConfig.noFoundHandler === 'function') {\n return runtimeConfig.noFoundHandler({\n router, to, from, next\n });\n }\n if (to.path === '/403') {\n handle(403, router);\n return next('/403');\n }\n handle(404, router);\n next('/404');\n },\n ...memo\n});\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/403.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n \n \n 上一页\n \n \n\n\n{\n \"layout\": false\n}\n\n\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/404.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n \n \n 上一页\n \n \n\n\n{\n \"layout\": false\n}\n\n\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/BaseLayout.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n \n \n \n \n
\n\n\n{\n \"name\": \"test\",\n \"title\": \"侧事故\"\n}\n\n\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/stores/counter.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/stores/foo/bar.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/stores/plugin-loger.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/stores/user.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/utils/sum.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/.fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/.fes.prod.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/coreExports.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/plugin.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/pluginExports.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/pluginRegister.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/routes/routes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/core/routes/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/Icon/Icon.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/Icon/index.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/icons/hello.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/icons/smile.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/icons.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-icon/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/cacheControl.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/genRequestKey.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/helpers.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/paramsProcess.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/preventRepeatReq.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/request.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/resDataAdaptor.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/resErrorProcess.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/scheduler.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/setDataField.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/.fes/plugin-request/throttle.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/app.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/common/service.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":1,"column":1,"nodeType":null,"messageId":"delete","endLine":2,"endColumn":1,"fix":{"range":[0,1],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/common/utils.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":7,"column":1,"nodeType":null,"messageId":"delete","endLine":8,"endColumn":1,"fix":{"range":[56,57],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎·······`","line":9,"column":27,"nodeType":null,"messageId":"insert","endLine":9,"endColumn":27,"fix":{"range":[127,127],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":12,"column":29,"nodeType":null,"messageId":"insert","endLine":12,"endColumn":29,"fix":{"range":[262,262],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":21,"column":1,"nodeType":null,"messageId":"delete","endLine":22,"endColumn":1,"fix":{"range":[533,534],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `/MicroMessenger\\/([\\d.]+)/i` with `⏎········/MicroMessenger\\/([\\d.]+)/i⏎····`","line":23,"column":55,"nodeType":null,"messageId":"replace","endLine":23,"endColumn":82,"fix":{"range":[623,650],"text":"\n /MicroMessenger\\/([\\d.]+)/i\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(navigator.appVersion)` with `navigator.appVersion`","line":26,"column":21,"nodeType":null,"messageId":"replace","endLine":26,"endColumn":43,"fix":{"range":[739,761],"text":"navigator.appVersion"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `0,·Math.max(document.body.clientHeight,·document.documentElement.clientHeight)` with `⏎············0,⏎············Math.max(⏎················document.body.clientHeight,⏎················document.documentElement.clientHeight⏎············)⏎········`","line":30,"column":25,"nodeType":null,"messageId":"replace","endLine":30,"endColumn":103,"fix":{"range":[939,1017],"text":"\n 0,\n Math.max(\n document.body.clientHeight,\n document.documentElement.clientHeight\n )\n "}}],"errorCount":7,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"// TODO\n// 时间格式化\n// js 数字精度计算\n// 手机号、身份证号 等的校验\n// 数字分割\n\n\nexport function resetContainerHeight(dom) {\n const originalHeight = document.body.clientHeight || document.documentElement.clientHeight;\n\n window.onresize = function () {\n const resizeHeight = document.documentElement.clientHeight || document.body.clientHeight;\n if (resizeHeight < originalHeight) {\n // 恢复内容区域高度\n const container = document.querySelector(dom);\n container.style.height = originalHeight;\n }\n };\n}\n\n\nexport function resetInputBlur() {\n const isWechat = window.navigator.userAgent.match(/MicroMessenger\\/([\\d.]+)/i);\n if (!isWechat) return;\n const wechatVersion = isWechat[1];\n const version = (navigator.appVersion).match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\n\n // 如果设备类型为iOS 12+ 和wechat 6.7.4+,恢复成原来的视口\n if (+wechatVersion.replace(/\\./g, '') >= 674 && +version[1] >= 12) {\n window.scrollTo(0, Math.max(document.body.clientHeight, document.documentElement.clientHeight));\n }\n}\n\nexport function getQueryString(name) {\n const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i');\n const r = window.location.search.substr(1).match(reg);\n if (r != null) {\n return decodeURIComponent(r[2]);\n }\n return null;\n}\n\nexport function simpleRequest(options) {\n const xhr = new XMLHttpRequest();\n xhr.timeout = 3000;\n if (options.type === 'GET') {\n xhr.open(options.type, options.url, options.async || true);\n xhr.send(null);\n } else if (options.type === 'POST') {\n xhr.open(options.type, options.url, options.async || true);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(options.data || {}));\n }\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n options.successed(xhr.responseText);\n } else {\n options.failed && options.failed(xhr);\n }\n }\n };\n xhr.ontimeout = function () {\n options.failed && options.failed(xhr);\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/components/helloTS.ts","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/components/helloTSX.tsx","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `defineComponent` with `·defineComponent·`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":1,"endColumn":24,"fix":{"range":[8,23],"text":" defineComponent "}},{"ruleId":"arrow-body-style","severity":2,"message":"Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.","line":5,"column":22,"nodeType":"ArrowFunctionExpression","messageId":"unexpectedSingleBlock","endLine":7,"endColumn":10,"fix":{"range":[106,148],"text":"'hello tsx'"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `;`","line":6,"column":31,"nodeType":null,"messageId":"insert","endLine":6,"endColumn":31,"fix":{"range":[138,138],"text":";"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `;`","line":7,"column":10,"nodeType":null,"messageId":"insert","endLine":7,"endColumn":10,"fix":{"range":[148,148],"text":";"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `;⏎`","line":9,"column":3,"nodeType":null,"messageId":"insert","endLine":9,"endColumn":3,"fix":{"range":[157,157],"text":";\n"}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":5,"fixableWarningCount":0,"source":"import {defineComponent} from 'vue';\n\nexport default defineComponent({\n setup() {\n return () => {\n return 'hello tsx'\n }\n }\n})","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/components/helloWorld.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"\n