mirror of
https://gitee.com/WeBank/fes.js.git
synced 2024-11-29 18:28:09 +08:00
1 line
662 KiB
JSON
1 line
662 KiB
JSON
{"score":0,"report":[{"filePath":"/Users/qlin/code/fes.js/.eslintrc.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 `⏎········'@webank/eslint-config-webank/vue.js'⏎····` with `'@webank/eslint-config-webank/vue.js'`","line":3,"column":15,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":5,"fix":{"range":[34,85],"text":"'@webank/eslint-config-webank/vue.js'"}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nmodule.exports = {\n extends: [\n '@webank/eslint-config-webank/vue.js'\n ],\n globals: {\n // 这里填入你的项目需要的全局变量\n // 这里值为 false 表示这个全局变量不允许被重新赋值,比如:\n //\n // Vue: false\n __DEV__: false\n },\n rules: {\n 'vue/comment-directive': 'off',\n 'global-require': 'off',\n 'import/no-unresolved': 'off',\n 'no-restricted-syntax': 'off',\n 'no-undefined': 'off',\n 'vue/valid-template-root': 'off'\n },\n env: {\n jest: true\n }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/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 // 需要编译的包\n pkgs: [\n 'create-fes-app',\n 'fes',\n 'fes-compiler',\n 'fes-plugin-access',\n 'fes-plugin-enums',\n 'fes-plugin-icon',\n 'fes-plugin-jest',\n 'fes-plugin-layout',\n 'fes-plugin-locale',\n 'fes-plugin-model',\n 'fes-plugin-monaco-editor',\n 'fes-plugin-qiankun',\n 'fes-plugin-request',\n 'fes-plugin-sass',\n 'fes-plugin-vuex',\n 'fes-preset-built-in',\n 'fes-plugin-windicss',\n 'fes-runtime',\n 'fes-utils'\n ],\n copy: []\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/commitlint.config.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/config.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/index.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/navbar/en.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/navbar/index.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/navbar/zh.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/sidebar/en.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/sidebar/index.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/docs/.vuepress/configs/sidebar/zh.ts","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/jest.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 testPathIgnorePatterns: [\n '/node_modules/',\n 'fes-template',\n 'fes-template-h5'\n ]\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/bin/create-fes-app.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/src/cli.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":5,"column":1,"nodeType":null,"messageId":"delete","endLine":6,"endColumn":1,"fix":{"range":[110,111],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `chalk.yellow('\\n·Warning:·You·provided·more·than·one·argument.·The·first·one·will·be·used·as·the·app\\'s·name,·the·rest·are·ignored.')` with `⏎········chalk.yellow(⏎············\"\\n·Warning:·You·provided·more·than·one·argument.·The·first·one·will·be·used·as·the·app's·name,·the·rest·are·ignored.\"⏎········)⏎····`","line":18,"column":17,"nodeType":null,"messageId":"replace","endLine":18,"endColumn":150,"fix":{"range":[384,517],"text":"\n chalk.yellow(\n \"\\n Warning: You provided more than one argument. The first one will be used as the app's name, the rest are ignored.\"\n )\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { chalk, yParser } from '@fesjs/utils';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n\n\nconst args = yParser(process.argv.slice(2), {\n alias: {\n version: ['v'],\n help: ['h'],\n force: ['f'],\n merge: ['m'],\n proxy: ['x']\n },\n boolean: ['version', 'help', 'merge', 'force']\n});\n\nif (args._.length > 1) {\n console.log(chalk.yellow('\\n Warning: You provided more than one argument. The first one will be used as the app\\'s name, the rest are ignored.'));\n}\n\nif (args.version && !args._[0]) {\n args._[0] = 'version';\n const local = existsSync(join(__dirname, '../.local'))\n ? chalk.cyan('@local')\n : '';\n const { name, version } = require('../package.json');\n console.log(`${name}@${version}${local}`);\n} else if (args.help && !args._[0]) {\n console.log(`\nUsage: create-fes-app <name>\n\nOptions:\n -v, --version Output the current version\n -h, --help Display help for command \n -f, --force Overwrite target directory if it exists\n -m, --merge Merge target directory if it exists\n -x, --proxy <proxyUrl> Use specified proxy when creating project\n `);\n} else {\n require('.')\n .default({\n cwd: process.cwd(),\n args\n })\n .catch((err) => {\n console.error(`Create failed, ${err.message}`);\n console.error(err);\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/src/generator/App.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········cwd,·args,·path,·targetDir⏎···` with `·cwd,·args,·path,·targetDir`","line":4,"column":18,"nodeType":null,"messageId":"replace","endLine":6,"endColumn":4,"fix":{"range":[114,153],"text":" cwd, args, path, targetDir"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { Generator } from '@fesjs/utils';\n\nexport default class AppGenerator extends Generator {\n constructor({\n cwd, args, path, targetDir\n }) {\n super({\n cwd,\n args\n });\n this.path = path;\n this.targetDir = targetDir;\n }\n\n async writing() {\n this.copyDirectory({\n context: {\n version: require('../../package.json').version\n },\n path: this.path,\n target: this.targetDir\n });\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":22,"column":25,"nodeType":null,"messageId":"insert","endLine":22,"endColumn":25,"fix":{"range":[773,773],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":23,"column":1,"nodeType":null,"messageId":"insert","endLine":23,"endColumn":1,"fix":{"range":[807,807],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":24,"column":1,"nodeType":null,"messageId":"insert","endLine":24,"endColumn":1,"fix":{"range":[866,866],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":25,"column":27,"nodeType":null,"messageId":"insert","endLine":25,"endColumn":27,"fix":{"range":[904,904],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":26,"column":1,"nodeType":null,"messageId":"insert","endLine":26,"endColumn":1,"fix":{"range":[941,941],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":27,"column":1,"nodeType":null,"messageId":"insert","endLine":27,"endColumn":1,"fix":{"range":[1003,1003],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `targetDir` with `⏎························targetDir⏎····················`","line":51,"column":61,"nodeType":null,"messageId":"replace","endLine":51,"endColumn":70,"fix":{"range":[1801,1810],"text":"\n targetDir\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·name:·'PC,·suitable·for·management·desk·front-end·applications',·value:·'pc'` with `⏎····················name:·'PC,·suitable·for·management·desk·front-end·applications',⏎····················value:·'pc'⏎···············`","line":76,"column":18,"nodeType":null,"messageId":"replace","endLine":76,"endColumn":95,"fix":{"range":[2592,2669],"text":"\n name: 'PC, suitable for management desk front-end applications',\n value: 'pc'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `chalk.green(`project·${projectName}·created·successfully,·please·execute·the·following·command·to·use:`)` with `⏎············chalk.green(⏎················`project·${projectName}·created·successfully,·please·execute·the·following·command·to·use:`⏎············)⏎········`","line":92,"column":21,"nodeType":null,"messageId":"replace","endLine":92,"endColumn":125,"fix":{"range":[3114,3218],"text":"\n chalk.green(\n `project ${projectName} created successfully, please execute the following command to use:`\n )\n "}}],"errorCount":9,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":9,"fixableWarningCount":0,"source":"import path from 'path';\nimport { chalk } from '@fesjs/utils';\nimport validateProjectName from 'validate-npm-package-name';\nimport fs from 'fs-extra';\nimport inquirer from 'inquirer';\n\nimport { clearConsole } from './utils';\nimport AppGenerator from './generator/App';\n\nexport default async ({ cwd, args }) => {\n if (args.proxy) {\n process.env.HTTP_PROXY = args.proxy;\n }\n const projectName = args._[0];\n const inCurrent = projectName === '.';\n const name = inCurrent ? path.relative('../', cwd) : projectName;\n const targetDir = path.resolve(cwd, projectName || '.');\n\n const result = validateProjectName(name);\n if (!result.validForNewPackages) {\n console.error(chalk.red(`Invalid project name: \"${name}\"`));\n result.errors && result.errors.forEach((err) => {\n console.error(chalk.red.dim(`Error: ${err}`));\n });\n result.warnings && result.warnings.forEach((warn) => {\n console.error(chalk.red.dim(`Warning: ${warn}`));\n });\n throw new Error('Process exited');\n }\n if (fs.pathExistsSync(targetDir) && !args.merge) {\n if (args.force) {\n await fs.remove(targetDir);\n } else if (inCurrent) {\n clearConsole();\n const { ok } = await inquirer.prompt([\n {\n name: 'ok',\n type: 'confirm',\n message: 'Generate project in current directory?'\n }\n ]);\n if (!ok) {\n return null;\n }\n } else {\n clearConsole();\n const { action } = await inquirer.prompt([\n {\n name: 'action',\n type: 'list',\n message: `Target directory ${chalk.cyan(targetDir)} already exists. Pick an action:`,\n choices: [\n { name: 'Overwrite', value: 'overwrite' },\n { name: 'Merge', value: 'merge' },\n { name: 'Cancel', value: false }\n ]\n }\n ]);\n if (!action) {\n return null;\n }\n if (action === 'overwrite') {\n console.log(`\\nRemoving ${chalk.cyan(targetDir)}...`);\n await fs.remove(targetDir);\n }\n }\n }\n\n clearConsole();\n const { template } = await inquirer.prompt([\n {\n name: 'template',\n type: 'list',\n message: 'Pick an template:',\n choices: [\n { name: 'PC, suitable for management desk front-end applications', value: 'pc' },\n { name: 'H5, suitable for mobile applications', value: 'h5' },\n { name: 'Cancel', value: false }\n ]\n }\n ]);\n\n if (template) {\n const generator = new AppGenerator({\n cwd,\n args,\n targetDir,\n path: path.join(__dirname, `../templates/app/${template}`)\n });\n await generator.run();\n console.log();\n console.log(chalk.green(`project ${projectName} created successfully, please execute the following command to use:`));\n console.log(`$ cd ${projectName}`);\n console.log('$ yarn');\n console.log('$ yarn dev');\n console.log();\n }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/src/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/h5/.eslintrc.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 `⏎········'@webank/eslint-config-webank/vue.js'⏎····` with `'@webank/eslint-config-webank/vue.js'`","line":3,"column":15,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":5,"fix":{"range":[34,85],"text":"'@webank/eslint-config-webank/vue.js'"}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nmodule.exports = {\n extends: [\n '@webank/eslint-config-webank/vue.js'\n ],\n globals: {\n // 这里填入你的项目需要的全局变量\n // 这里值为 false 表示这个全局变量不允许被重新赋值,比如:\n //\n // Vue: false\n __DEV__: false\n },\n rules: {\n 'vue/comment-directive': 'off',\n 'global-require': 'off',\n 'import/no-unresolved': 'off',\n 'no-restricted-syntax': 'off'\n }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/h5/.fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/h5/src/app.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/h5/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/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/create-fes-app/templates/app/h5/src/models/user.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/h5/src/pages/index.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div class=\"onepiece\">\n fes & 拉夫德鲁 <br />\n <fes-icon :spin=\"true\" class=\"one-icon\" type=\"smile\" @click=\"clickIcon\" />\n <div v-if=\"loading\" class=\"loading\">loading</div>\n <div v-else class=\"data\">{{data}}</div>\n </div>\n</template>\n<config>\n{\n \"title\": \"首页\",\n \"layout\": \"false\"\n}\n</config>\n<script>\nimport { ref, onMounted } from 'vue';\nimport { useRouter, useRequest } from '@fesjs/fes';\n\nexport default {\n setup() {\n const fes = ref('fes upgrade to vue3');\n const rotate = ref(90);\n const router = useRouter();\n onMounted(() => {\n console.log(router);\n console.log('mounted1!!');\n });\n const clickIcon = () => {\n console.log('click Icon');\n };\n const { loading, data } = useRequest('api');\n return {\n loading,\n data,\n fes,\n rotate,\n clickIcon\n };\n }\n};\n</script>\n\n<style lang=\"less\" scoped>\n@import \"~@/styles/mixins/hairline\";\n@import \"~@/styles/mixins/hover\";\n\ndiv {\n padding: 20px;\n p {\n margin: 20px;\n }\n}\n.one-icon {\n color: yellow;\n font-size: 24px;\n .hover();\n}\n.onepiece {\n .hairline(\"top\");\n background: url('../images/male.png');\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/h5/src/pages/onepiece.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div>{{fes}}</div>\n</template>\n<config>\n{\n \"title\": \"onepiece\",\n \"layout\": \"true\"\n}\n</config>\n<script>\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const fes = ref('fes upgrade to vue3');\n return {\n fes\n };\n }\n};\n</script>\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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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: <PageLoading />,\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: <UserCenter />\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":"<template>\n <div class=\"page-loading\">\n <Spin size=\"large\" />\n </div>\n</template>\n<script>\nimport Spin from 'ant-design-vue/lib/spin';\nimport 'ant-design-vue/lib/spin/style/css';\n\nexport default {\n components: {\n Spin\n }\n};\n</script>\n<style>\n.page-loading{\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/components/UserCenter.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div class=\"right\">{{initialState.userName}}</div>\n</template>\n<script>\nimport { useModel } from '@fesjs/fes';\n\nexport default {\n setup() {\n const initialState = useModel('@@initialState');\n return {\n initialState\n };\n }\n};\n</script>\n<style scope>\n.right {\n text-align: right;\n padding: 0 20px;\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/create-fes-app/templates/app/pc/src/models/user.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/pages/index.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div style=\"padding: 32px;\">\n <h3>fes & 拉夫德鲁 </h3>\n <h4>数据字典</h4>\n <div v-for=\"item in enumsGet('status')\" :key=\"item.key\">{{item.value}}:{{item.key}}</div>\n\n <section>\n 计数器\n <button @click=\"increment\">click me:{{count}}</button>\n </section>\n </div>\n</template>\n\n<script>\nimport { ref } from 'vue';\nimport {\n enums\n} from '@fesjs/fes';\n\nexport default {\n setup() {\n const fes = ref('fes upgrade to vue3');\n const count = ref(0);\n const increment = () => {\n count.value++;\n };\n\n return {\n fes,\n increment,\n count,\n enumsGet: enums.get\n };\n }\n};\n</script>\n\n<config>\n{\n \"name\": \"index\",\n \"title\": \"首页\"\n}\n</config>\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('<command> [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 <command> --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":"<script>\nimport { computed } from 'vue';\n// eslint-disable-next-line\nimport icons from '../icons';\n\nconst noop = () => { };\n\nexport default {\n name: 'FesIcon',\n props: ['type', 'spin', 'rotate', 'tabIndex'],\n setup(props, { attrs }) {\n const CurrentIcon = computed(() => icons[props.type]);\n const iconTabIndex = computed(() => {\n let tabIndex = props.tabIndex;\n if (tabIndex == null && attrs.onClick) {\n tabIndex = -1;\n }\n return tabIndex;\n });\n const svgStyle = computed(() => (props.rotate\n ? {\n msTransform: `rotate(${props.rotate}deg)`,\n transform: `rotate(${props.rotate}deg)`\n }\n : null));\n const svgCls = computed(() => ({\n 'inner-icon--spin': !!props.spin || props.type === 'loading'\n }));\n return () => (\n <span\n tabIndex={iconTabIndex.value}\n role=\"img\"\n class=\"inner-icon\"\n onClick={attrs.onClick || noop}\n >\n <CurrentIcon.value class={svgCls.value} style={svgStyle.value} />\n </span>\n );\n }\n};\n</script>\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 '^@/(.*)$': '<rootDir>/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·<rootDir>·matching·the·files·that·coverage·'` with `·····'A·glob·pattern·relative·to·<rootDir>·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 <rootDir> 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=<pathToConfigFile>] [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 <rootDir> 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 + ' `<rootDir>/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: `<rootDir>/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":"<template>\n <a-result status=\"403\" title=\"403\" sub-title=\"对不起,您没有权限访问此页面。\">\n <template #extra>\n <a-button type=\"primary\" @click=\"click\">上一页</a-button>\n </template>\n </a-result>\n</template>\n<config>\n{\n \"layout\": false\n}\n</config>\n<script>\nimport { useRouter } from '@@/core/coreExports';\nimport Result from 'ant-design-vue/lib/result';\nimport 'ant-design-vue/lib/result/style/css';\nimport Button from 'ant-design-vue/lib/button';\nimport 'ant-design-vue/lib/button/style/css';\n\nexport default {\n components: {\n [Result.name]: Result,\n [Button.name]: Button\n },\n setup() {\n const router = useRouter();\n const click = () => {\n router.back();\n };\n return {\n click\n };\n }\n};\n</script>\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":"<template>\n <a-result status=\"404\" title=\"404\" sub-title=\"对不起,您访问的页面不存在。\">\n <template #extra>\n <a-button type=\"primary\" @click=\"click\">上一页</a-button>\n </template>\n </a-result>\n</template>\n<config>\n{\n \"layout\": false\n}\n</config>\n<script>\nimport { useRouter } from '@@/core/coreExports';\nimport Result from 'ant-design-vue/lib/result';\nimport 'ant-design-vue/lib/result/style/css';\nimport Button from 'ant-design-vue/lib/button';\nimport 'ant-design-vue/lib/button/style/css';\n\nexport default {\n components: {\n [Result.name]: Result,\n [Button.name]: Button\n },\n setup() {\n const router = useRouter();\n const click = () => {\n router.back();\n };\n return {\n click\n };\n }\n};\n</script>\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":"<template>\n <a-layout\n v-if=\"routeLayout\"\n :class=\"[\n collapsed ? 'main-layout-collapsed' : '',\n `main-layout-navigation-${navigation}`,\n `main-layout-theme-${siderTheme}`\n ]\"\n class=\"main-layout\"\n >\n <template v-if=\"navigation !== 'top' && routeLayout.side\">\n <div v-if=\"fixedSideBar\" :style=\"siderFixedStuffStyle\" class=\"layout-sider-fixed-stuff\"></div>\n <a-layout-sider\n v-model:collapsed=\"collapsed\"\n :width=\"sideWidth\"\n :class=\"[\n 'layout-sider',\n fixedSideBar ? 'layout-sider-fixed' : ''\n ]\"\n :theme=\"siderTheme\"\n collapsible\n >\n <div v-if=\"navigation !== 'mixin' && routeLayout.logo\" class=\"layout-logo\">\n <img :src=\"logo\" class=\"logo-img\" />\n <h1 class=\"logo-name\">{{title}}</h1>\n </div>\n <Menu :menus=\"menus\" :theme=\"siderTheme\" />\n </a-layout-sider>\n </template>\n <a-layout class=\"child-layout\">\n <a-layout-header v-if=\"currentFixedHeader && routeLayout.top\" class=\"layout-header\">\n </a-layout-header>\n <a-layout-header\n v-if=\"routeLayout.top\"\n :style=\"headerFixedStyle\"\n :class=\"[currentFixedHeader ? 'layout-header-fixed' : '']\"\n class=\"layout-header\"\n >\n <div v-if=\"navigation === 'mixin' && routeLayout.logo\" class=\"layout-logo\">\n <img :src=\"logo\" class=\"logo-img\" />\n <h1 class=\"logo-name\">{{title}}</h1>\n </div>\n <template v-if=\"navigation === 'top'\">\n <div v-if=\"routeLayout.logo\" class=\"layout-logo\">\n <img :src=\"logo\" class=\"logo-img\" />\n <h1 class=\"logo-name\">{{title}}</h1>\n </div>\n <Menu :menus=\"menus\" :theme=\"theme\" class=\"layout-menu\" mode=\"horizontal\" />\n </template>\n <div class=\"layout-header-custom\">\n <slot name=\"customHeader\"></slot>\n </div>\n <template v-if=\"locale\">\n <slot name=\"locale\"></slot>\n </template>\n </a-layout-header>\n <a-layout-content class=\"layout-content\">\n <MultiTabProvider v-if=\"multiTabs\" />\n <router-view v-else></router-view>\n </a-layout-content>\n <a-layout-footer v-if=\"footer\" class=\"layout-footer\">\n {{footer}}\n </a-layout-footer>\n </a-layout>\n </a-layout>\n <div v-else class=\"content-wrapper\">\n <router-view></router-view>\n </div>\n</template>\n\n<script>\nimport { ref, computed } from 'vue';\nimport { useRoute } from '@@/core/coreExports';\nimport Layout from 'ant-design-vue/lib/layout';\nimport 'ant-design-vue/lib/layout/style/css';\nimport Menu from './Menu';\nimport MultiTabProvider from './MultiTabProvider';\nimport defaultLogo from '../assets/logo.png';\n\nexport default {\n components: {\n [Layout.name]: Layout,\n [Layout.Sider.name]: Layout.Sider,\n [Layout.Content.name]: Layout.Content,\n [Layout.Header.name]: Layout.Header,\n [Layout.Footer.name]: Layout.Footer,\n Menu,\n MultiTabProvider\n },\n props: {\n menus: {\n type: Array,\n default() {\n return [];\n }\n },\n title: {\n type: String,\n default: ''\n },\n locale: {\n type: Boolean,\n default: false\n },\n logo: {\n type: String,\n default: defaultLogo\n },\n theme: {\n type: String,\n default: 'dark' // light、dark\n },\n navigation: {\n type: String,\n default: 'side' // side 左右(上/下)、 top 上/下、 mixin 上/下(左/右)\n },\n fixedHeader: {\n type: Boolean,\n default: false\n },\n fixedSideBar: {\n type: Boolean,\n default: true\n },\n multiTabs: {\n type: Boolean,\n default: false\n },\n sideWidth: {\n type: Number,\n default: 200\n },\n footer: String\n },\n setup(props) {\n const collapsed = ref(false);\n const route = useRoute();\n const routeLayoutDefault = {\n side: true,\n top: true,\n logo: true\n };\n const routeLayout = computed(() => {\n let config;\n // meta 中 layout 默认为 true\n const metaLayoutConfig = route.meta.layout === undefined ? true : route.meta.layout;\n if (typeof metaLayoutConfig === 'boolean') {\n config = metaLayoutConfig ? routeLayoutDefault : false;\n } else if (typeof metaLayoutConfig === 'object') {\n config = { ...routeLayoutDefault, ...metaLayoutConfig };\n } else {\n console.error('[plugin-layout]: meta layout must be object or boolean!');\n }\n // query 中 layout 默认为 false\n const routeQueryLayoutConfig = route.query.layout && JSON.parse(route.query.layout);\n if (typeof routeQueryLayoutConfig === 'boolean') {\n config = routeQueryLayoutConfig ? routeLayoutDefault : false;\n } else if (typeof routeQueryLayoutConfig === 'object') {\n config = { ...config, ...routeQueryLayoutConfig };\n } else if (routeQueryLayoutConfig !== undefined) {\n console.error('[plugin-layout]: query layout must be object or boolean!');\n }\n return config;\n });\n const siderTheme = computed(() => {\n if (props.navigation === 'mixin') {\n return 'light';\n }\n return props.theme;\n });\n const currentFixedHeader = computed(() => props.fixedHeader || props.navigation === 'mixin');\n const siderFixedStuffStyle = computed(() => {\n if (collapsed.value) {\n return {\n width: '80px'\n };\n }\n return {\n width: `${props.sideWidth}px`\n };\n });\n const headerFixedStyle = computed(() => {\n if (!currentFixedHeader.value) {\n return {};\n }\n if (props.navigation === 'side') {\n return {\n left: `${props.sideWidth}px`,\n width: `calc(100% - ${props.sideWidth}px)`\n };\n }\n return {\n left: 0,\n width: '100%'\n };\n });\n return {\n siderTheme,\n currentFixedHeader,\n route,\n routeLayout,\n collapsed,\n siderFixedStuffStyle,\n headerFixedStyle\n };\n }\n};\n</script>\n\n<style lang=\"less\">\n.main-layout.main-layout-navigation-mixin{\n .layout-sider{\n .ant-layout-sider-trigger {\n border-top: 1px solid #f0f0f0;\n }\n }\n}\n</style>\n<style lang=\"less\" scoped>\n.main-layout {\n min-height: 100vh;\n &.main-layout-collapsed {\n .layout-sider {\n .layout-logo {\n justify-content: center;\n .logo-name {\n display: none;\n }\n }\n }\n }\n &.main-layout-navigation-top {\n .layout-header {\n padding-left: 24px;\n color: hsla(0,0%,100%,.65);\n background: #001529;\n .layout-menu {\n line-height: 48px;\n }\n .layout-logo {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n min-width: 165px;\n height: 100%;\n overflow: hidden;\n transition: all .3s;\n .logo-img {\n height: 32px;\n width: auto;\n }\n .logo-name {\n overflow: hidden;\n margin: 0 0 0 12px;\n color: #fff;\n font-weight: 600;\n font-size: 18px;\n line-height: 32px;\n }\n }\n }\n }\n &.main-layout-navigation-mixin {\n .layout-sider {\n padding: 48px 0 0;\n box-shadow: 2px 0 8px 0 rgba(29,35,41,.05);\n }\n .layout-header {\n padding-left: 24px;\n color: hsla(0,0%,100%,.65);\n background: #001529;\n .layout-menu {\n line-height: 48px;\n }\n .layout-logo {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n min-width: 165px;\n height: 100%;\n overflow: hidden;\n transition: all .3s;\n .logo-img {\n height: 32px;\n width: auto;\n }\n .logo-name {\n overflow: hidden;\n margin: 0 0 0 12px;\n color: #fff;\n font-weight: 600;\n font-size: 18px;\n line-height: 32px;\n }\n }\n }\n }\n .layout-sider-fixed-stuff {\n overflow: hidden;\n transition: width 0.2s;\n flex-shrink: 0;\n }\n .child-layout {\n position: relative;\n }\n .layout-sider {\n &.layout-sider-fixed {\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n width: 200px;\n }\n .layout-logo {\n height: 32px;\n margin: 16px;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n .logo-img {\n height: 32px;\n width: auto;\n }\n .logo-name {\n overflow: hidden;\n margin: 0 0 0 12px;\n color: #fff;\n font-weight: 600;\n font-size: 18px;\n line-height: 32px;\n }\n }\n }\n .layout-header {\n position: relative;\n z-index: 1;\n display: flex;\n align-items: center;\n height: 48px;\n line-height: 48px;\n background: #fff;\n box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);\n padding: 0;\n .layout-header-custom {\n flex: 1;\n }\n &.layout-header-fixed {\n position: fixed;\n top: 0;\n right: 0;\n z-index: 10;\n }\n }\n .layout-content,\n .content-wrapper {\n position: relative;\n }\n .layout-footer {\n text-align: center;\n }\n &.main-layout-theme-light{\n .logo-name{\n color: rgba(0, 0, 0, 0.65) !important;\n }\n &.main-layout-navigation-mixin{\n .logo-name{\n color: #fff !important;\n }\n }\n &.main-layout-navigation-top{\n .layout-header {\n background: #fff;\n color: rgba(0, 0, 0, 0.85);\n }\n }\n }\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/Menu.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <a-menu\n :selectedKeys=\"selectedKeys\"\n :theme=\"theme\"\n mode=\"inline\"\n @click=\"onMenuClick\"\n >\n <template v-for=\"(item, index) in fixedMenus\" :key=\"index\">\n <template v-if=\"item.access\">\n <a-sub-menu v-if=\"item.children\" :key=\"index\" :title=\"item.title\">\n <template v-if=\"item.icon\" #icon>\n <MenuIcon :icon=\"item.icon\" />\n </template>\n <template\n v-for=\"(item1, index1) in item.children\"\n >\n <template v-if=\"item1.access\">\n <a-sub-menu\n v-if=\"item1.children\"\n :key=\"`${index}-${index1}`\"\n :title=\"item1.title\"\n >\n <template\n v-for=\"(item2) in item1.children\"\n >\n <a-menu-item\n v-if=\"item2.access\"\n :key=\"item2.path\"\n :title=\"item2.title\"\n >\n {{item2.title}}\n </a-menu-item>\n </template>\n </a-sub-menu>\n <a-menu-item v-else :key=\"item1.path\" :title=\"item1.title\">\n {{item1.title}}\n </a-menu-item>\n </template>\n </template>\n </a-sub-menu>\n <a-menu-item v-else :key=\"item.path\" :title=\"item.title\">\n <MenuIcon v-if=\"item.icon\" :icon=\"item.icon\" />\n <span>{{item.title}}</span>\n </a-menu-item>\n </template>\n </template>\n </a-menu>\n</template>\n\n<script>\nimport { toRefs, computed } from 'vue';\nimport { useRoute, useRouter } from '@@/core/coreExports';\nimport Menu from 'ant-design-vue/lib/menu';\nimport 'ant-design-vue/lib/menu/style/css';\nimport MenuIcon from './MenuIcon';\nimport { transform as transformByAccess } from '../helpers/pluginAccess';\nimport { transform as transformByLocale } from '../helpers/pluginLocale';\n\nexport default {\n components: {\n [Menu.name]: Menu,\n [Menu.SubMenu.name]: Menu.SubMenu,\n [Menu.Item.name]: Menu.Item,\n MenuIcon\n },\n props: {\n menus: {\n type: Array,\n default() {\n return [];\n }\n },\n theme: {\n type: String,\n default: 'dark'\n }\n },\n setup(props) {\n const { menus } = toRefs(props);\n const route = useRoute();\n const router = useRouter();\n const fixedMenus = transformByLocale(transformByAccess(menus));\n const onMenuClick = (e) => {\n const path = e.key;\n if (/^https?:\\/\\//.test(path)) {\n window.open(path, '_blank');\n } else if (/^\\//.test(path)) {\n router.push(path);\n } else {\n console.warn(\n '[plugin-layout]: 菜单的path只能使以http(s)开头的网址或者路由地址'\n );\n }\n };\n const selectedKeys = computed(() => [route.path]);\n return {\n selectedKeys,\n fixedMenus,\n onMenuClick\n };\n }\n};\n</script>\n\n<style lang=\"less\">\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/MenuIcon.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<script>\n\nimport { ref, onBeforeMount } from 'vue';\n// eslint-disable-next-line import/extensions\nimport Icons from '../icons';\nimport { validateContent } from '../helpers/svg';\n\nexport default {\n props: {\n icon: [String, Object]\n },\n setup(props) {\n const AIcon = ref(null);\n const AText = ref(null);\n\n onBeforeMount(() => {\n if (props.icon && props.icon.type === 'icon') {\n AIcon.value = Icons[props.icon.name];\n } else {\n fetch(props.icon).then((rsp) => {\n if (rsp.ok) {\n return rsp.text().then((svgContent) => {\n AText.value = validateContent(svgContent);\n });\n }\n });\n }\n });\n\n return () => {\n if (AIcon.value) {\n return <AIcon.value />;\n }\n if (AText.value) {\n return (\n <span className={'fes-layout-icon anticon'} innerHTML={AText.value}>\n </span>\n );\n }\n return null;\n };\n }\n};\n</script>\n<style>\n.fes-layout-icon{\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n min-width: 14px;\n margin-right: 10px;\n font-size: 14px;\n transition: font-size 0.15s cubic-bezier(0.215, 0.61, 0.355, 1), margin 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-layout/src/runtime/views/MultiTabProvider.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <a-tabs\n :activeKey=\"route.path\"\n class=\"layout-content-tabs\"\n hide-add\n type=\"editable-card\"\n @tabClick=\"switchPage\"\n @edit=\"onEdit\"\n >\n <a-tab-pane\n v-for=\"page in pageList\"\n :key=\"page.path\"\n :closable=\"route.path !== page.path\"\n >\n <template #tab>\n {{page.title}}\n <ReloadOutlined\n v-show=\"route.path === page.path\"\n class=\"layout-tabs-close-icon\"\n @click=\"reloadPage(page.path)\"\n />\n </template>\n </a-tab-pane>\n <template #tabBarExtraContent>\n <a-dropdown>\n <div class=\"layout-tabs-more-icon\">\n <MoreOutlined />\n </div>\n <template #overlay>\n <a-menu @click=\"handlerMore\">\n <a-menu-item key=\"closeOtherPage\">\n <a href=\"javascript:;\">关闭其他</a>\n </a-menu-item>\n <a-menu-item key=\"reloadPage\">\n <a href=\"javascript:;\">刷新当前页</a>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n </template>\n </a-tabs>\n <router-view v-slot=\"{ Component, route }\">\n <keep-alive>\n <component :is=\"Component\" :key=\"getPageKey(route)\" />\n </keep-alive>\n </router-view>\n</template>\n<script>\nimport {\n computed, onMounted, reactive, unref, ref\n} from 'vue';\nimport Tabs from 'ant-design-vue/lib/tabs';\nimport Dropdown from 'ant-design-vue/lib/dropdown';\nimport Menu from 'ant-design-vue/lib/menu';\nimport 'ant-design-vue/lib/menu/style/css';\nimport 'ant-design-vue/lib/dropdown/style/css';\nimport 'ant-design-vue/lib/tabs/style/css';\nimport { ReloadOutlined, MoreOutlined } from '@ant-design/icons-vue';\nimport { useRouter, useRoute } from '@@/core/coreExports';\nimport { transTitle } from '../helpers/pluginLocale';\n\nlet i = 0;\nconst getKey = () => ++i;\nexport default {\n components: {\n [Dropdown.name]: Dropdown,\n [Menu.name]: Menu,\n [Menu.Item.name]: Menu.Item,\n [Tabs.name]: Tabs,\n [Tabs.TabPane.name]: Tabs.TabPane,\n ReloadOutlined,\n MoreOutlined\n },\n setup() {\n const route = useRoute();\n const router = useRouter();\n const pageList = ref([]);\n\n const createPage = (route) => {\n const title = route.meta.title;\n return {\n path: route.path,\n route,\n name: route.meta.name,\n title: computed(() => transTitle(title)),\n key: getKey()\n };\n };\n\n const findPage = path => pageList.value.find(item => unref(item.path) === unref(path));\n\n onMounted(() => {\n pageList.value = [createPage(route)];\n });\n\n router.beforeEach((to) => {\n if (!findPage(to.path)) {\n pageList.value = [...pageList.value, createPage(to)];\n }\n return true;\n });\n // 还需要考虑参数\n const switchPage = (path) => {\n const selectedPage = findPage(path);\n if (selectedPage) {\n router.push({\n path,\n query: selectedPage.route.query,\n params: selectedPage.route.params\n });\n }\n };\n const onEdit = (targetKey, action) => {\n if (action === 'remove') {\n const selectedPage = findPage(targetKey);\n const list = [...pageList.value];\n const index = list.indexOf(selectedPage);\n list.splice(index, 1);\n pageList.value = list;\n }\n };\n const reloadPage = (path) => {\n const selectedPage = findPage(path || unref(route.path));\n if (selectedPage) {\n selectedPage.key = getKey();\n }\n };\n const closeOtherPage = (path) => {\n const selectedPage = findPage(path || unref(route.path));\n pageList.value = [selectedPage];\n };\n const getPageKey = (_route) => {\n const selectedPage = findPage(_route.path);\n if (selectedPage) {\n return selectedPage.key;\n }\n return '';\n };\n const handlerMore = ({ key }) => {\n switch (key) {\n case 'closeOtherPage':\n closeOtherPage();\n break;\n case 'reloadPage':\n reloadPage();\n break;\n default:\n }\n };\n return {\n route,\n pageList,\n getPageKey,\n reloadPage,\n switchPage,\n handlerMore,\n onEdit\n };\n }\n};\n</script>\n<style lang=\"less\">\n.layout-content-tabs {\n background: rgb(255, 255, 255);\n margin: 0px;\n padding-top: 6px;\n width: 100%;\n .ant-tabs-nav-container {\n padding-left: 16px;\n }\n .layout-tabs-close-icon {\n vertical-align: middle;\n color: rgba(0, 0, 0, 0.45);\n font-size: 12px;\n margin-left: 6px;\n margin-top: -2px;\n &:hover {\n color: rgba(0, 0, 0, 0.8);\n }\n }\n .layout-tabs-more-icon {\n margin-right: 8px;\n padding: 0 4px;\n color: rgba(0, 0, 0, 0.45);\n &:hover {\n color: rgba(0, 0, 0, 0.8);\n }\n }\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-locale/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-locale/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `api.paths.absSrcPath,·api.config.singular·?·'locale'·:·'locales'` with `⏎············api.paths.absSrcPath,⏎············api.config.singular·?·'locale'·:·'locales'⏎········`","line":31,"column":21,"nodeType":null,"messageId":"replace","endLine":31,"endColumn":85,"fix":{"range":[736,800],"text":"\n api.paths.absSrcPath,\n api.config.singular ? 'locale' : 'locales'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎························`","line":58,"column":61,"nodeType":null,"messageId":"insert","endLine":58,"endColumn":61,"fix":{"range":[1678,1678],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `························` with `····························`","line":59,"column":1,"nodeType":null,"messageId":"replace","endLine":59,"endColumn":25,"fix":{"range":[1680,1704],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":60,"column":1,"nodeType":null,"messageId":"insert","endLine":60,"endColumn":1,"fix":{"range":[1731,1731],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":61,"column":25,"nodeType":null,"messageId":"insert","endLine":61,"endColumn":25,"fix":{"range":[1822,1822],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},·null,·2` with `····},⏎························null,⏎························2⏎····················`","line":62,"column":21,"nodeType":null,"messageId":"replace","endLine":62,"endColumn":31,"fix":{"range":[1868,1878],"text":" },\n null,\n 2\n "}}],"errorCount":6,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":6,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { resolvePkg } from '@fesjs/utils';\nimport { getLocalesJSON } from './utils';\n\nconst namespace = 'plugin-locale';\n\nexport default (api) => {\n const {\n utils: { Mustache }\n } = api;\n\n api.describe({\n key: 'locale',\n config: {\n schema(joi) {\n return joi.object();\n },\n default: {},\n onChange: api.ConfigChangeType.regenerateTmpFiles\n }\n });\n\n api.addRuntimePluginKey(() => 'locale');\n\n const absoluteFilePath = join(namespace, 'core.js');\n\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n\n function getLocaleFileBasePath() {\n return join(api.paths.absSrcPath, api.config.singular ? 'locale' : 'locales');\n }\n\n // 监听 locale 文件改变,重新生成文件\n api.addTmpGenerateWatcherPaths(getLocaleFileBasePath);\n\n api.onGenerateFiles(() => {\n // .fes配置\n const userConfig = {\n locale: 'zh-CN', // default locale\n fallbackLocale: 'zh-CN', // set fallback locale\n legacy: true,\n baseNavigator: true, // 开启浏览器语言检测\n share: true, // 用户是否需要手动改变语言\n ...api.config.locale\n };\n\n const localeConfigFileBasePath = getLocaleFileBasePath();\n\n const locales = getLocalesJSON(localeConfigFileBasePath);\n\n api.writeTmpFile({\n path: absoluteFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n {\n REPLACE_LOCALES: locales,\n REPLACE_DEFAULT_OPTIONS: JSON.stringify({\n locale: userConfig.locale,\n fallbackLocale: userConfig.fallbackLocale,\n legacy: userConfig.legacy\n }, null, 2),\n BASE_NAVIGATOR: userConfig.baseNavigator,\n SHARE: userConfig.share,\n VUE_I18N_PATH: resolvePkg('vue-i18n')\n }\n )\n });\n\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'runtime'),\n ignore: ['.tpl']\n });\n });\n\n api.addPluginExports(() => [\n {\n specifiers: ['useI18n', 'locale'],\n source: absoluteFilePath\n }\n ]);\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-locale/src/runtime/langUConfigMap.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-locale/src/runtime/runtime.js","messages":[{"ruleId":"import/extensions","severity":2,"message":"Missing file extension for \"./core\"","line":1,"column":25,"nodeType":"Literal","endLine":1,"endColumn":33}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"import { install } from './core';\n\nexport function onAppCreated({ app }) {\n install(app);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-locale/src/runtime/views/SelectLang.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <a-dropdown>\n <div class=\"lang-icon\"><GlobalOutlined /></div>\n <template #overlay>\n <a-menu :selectedKeys=\"selectedKeys\" @click=\"handleClick\">\n <a-menu-item\n v-for=\"item in configs\"\n :key=\"item.lang\"\n class=\"lang-item\"\n >\n <span class=\"lang-item-icon\">{{item.icon}}</span>\n <span class=\"lang-item-label\">{{item.label}}</span>\n </a-menu-item>\n </a-menu>\n </template>\n </a-dropdown>\n</template>\n\n<script>\nimport Dropdown from 'ant-design-vue/lib/dropdown';\nimport Menu from 'ant-design-vue/lib/menu';\nimport 'ant-design-vue/lib/dropdown/style/css';\nimport 'ant-design-vue/lib/menu/style/css';\nimport { GlobalOutlined } from '@ant-design/icons-vue';\nimport { useI18n } from 'vue-i18n';\nimport { computed } from 'vue';\nimport langUConfigMap from '../langUConfigMap';\n\nexport default {\n components: {\n [Dropdown.name]: Dropdown,\n [Menu.name]: Menu,\n [Menu.Item.name]: Menu.Item,\n GlobalOutlined\n },\n setup() {\n const { messages, locale } = useI18n();\n const selectedKeys = computed(() => [locale.value]);\n const configs = computed(() => {\n const arr = [];\n Object.keys(messages.value)\n .sort()\n .forEach((item) => {\n arr.push(langUConfigMap[item] || {});\n });\n return arr;\n });\n const handleClick = ({ key }) => {\n locale.value = key;\n window.localStorage.setItem('fes_locale', key);\n };\n return {\n handleClick,\n selectedKeys,\n configs\n };\n }\n};\n</script>\n\n<style lang=\"less\">\n.lang-icon {\n margin: 0 8px;\n padding: 0 4px;\n cursor: pointer;\n}\n.lang-item {\n display: flex;\n align-items: center;\n .lang-item-label {\n margin-left: 8px;\n }\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-locale/src/utils/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `file·=>·!file.endsWith('.d.ts')` with `(file)·=>⏎················!file.endsWith('.d.ts')·&&`","line":10,"column":13,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":44,"fix":{"range":[214,245],"text":"(file) =>\n !file.endsWith('.d.ts') &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·&&·!file.endsWith('.test.js')⏎················&&` with `·!file.endsWith('.test.js')·&&⏎···············`","line":11,"column":16,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":19,"fix":{"range":[261,310],"text":" !file.endsWith('.test.js') &&\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":13,"column":10,"nodeType":null,"messageId":"insert","endLine":13,"endColumn":10,"fix":{"range":[348,348],"text":"\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { glob } from '@fesjs/utils';\nimport { join, basename } from 'path';\n\nexport function getLocales(cwd) {\n const files = glob\n .sync('*.js', {\n cwd\n })\n .filter(\n file => !file.endsWith('.d.ts')\n && !file.endsWith('.test.js')\n && !file.endsWith('.test.jsx')\n ).map((fileName) => {\n const locale = basename(fileName, '.js');\n return {\n locale,\n message: `require('${join(cwd, fileName)}').default`\n };\n });\n\n return files;\n}\n\nexport function getLocalesJSON(cwd) {\n const locales = getLocales(cwd);\n return JSON.stringify(locales, null, 2)\n .replace(\n /\"message\": (\"(.+?)\")/g,\n (global, m1, m2) => `\"message\": ${m2.replace(/\\^/g, '\"')}`\n )\n .replace(/\\\\r\\\\n/g, '\\r\\n')\n .replace(/\\\\n/g, '\\r\\n');\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-model/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-model/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":"Insert `⏎············`","line":42,"column":20,"nodeType":null,"messageId":"insert","endLine":42,"endColumn":20,"fix":{"range":[1168,1168],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············absPath:·winPath(join(paths.absTmpPath,·absInitlaStateFilePath)` with `················absPath:·winPath(⏎····················join(paths.absTmpPath,·absInitlaStateFilePath)⏎················`","line":43,"column":1,"nodeType":null,"messageId":"replace","endLine":43,"endColumn":76,"fix":{"range":[1170,1245],"text":" absPath: winPath(\n join(paths.absTmpPath, absInitlaStateFilePath)\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":44,"column":1,"nodeType":null,"messageId":"insert","endLine":44,"endColumn":1,"fix":{"range":[1248,1248],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎········`","line":45,"column":9,"nodeType":null,"messageId":"replace","endLine":45,"endColumn":10,"fix":{"range":[1296,1297],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `readFileSync(join(__dirname,·'runtime/core.tpl'),·'utf-8'),` with `⏎················readFileSync(join(__dirname,·'runtime/core.tpl'),·'utf-8'),⏎···············`","line":61,"column":38,"nodeType":null,"messageId":"replace","endLine":61,"endColumn":97,"fix":{"range":[1744,1803],"text":"\n readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":62,"column":1,"nodeType":null,"messageId":"insert","endLine":62,"endColumn":1,"fix":{"range":[1806,1806],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":63,"column":13,"nodeType":null,"messageId":"replace","endLine":63,"endColumn":14,"fix":{"range":[1846,1847],"text":" }\n "}},{"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":68,"column":38,"nodeType":null,"messageId":"replace","endLine":68,"endColumn":102,"fix":{"range":[1964,2028],"text":"\n readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'),\n {}"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `}`","line":69,"column":13,"nodeType":null,"messageId":"delete","endLine":69,"endColumn":14,"fix":{"range":[2041,2042],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `readFileSync(join(__dirname,·'runtime/models/initialState.tpl'),·'utf-8'),·{` with `⏎················readFileSync(⏎····················join(__dirname,·'runtime/models/initialState.tpl'),⏎····················'utf-8'⏎················),⏎················{}`","line":74,"column":38,"nodeType":null,"messageId":"replace","endLine":74,"endColumn":114,"fix":{"range":[2163,2239],"text":"\n readFileSync(\n join(__dirname, 'runtime/models/initialState.tpl'),\n 'utf-8'\n ),\n {}"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `}`","line":75,"column":13,"nodeType":null,"messageId":"delete","endLine":75,"endColumn":14,"fix":{"range":[2252,2253],"text":""}}],"errorCount":12,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":12,"fixableWarningCount":0,"source":"\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { lodash, winPath } from '@fesjs/utils';\nimport { getModels } from './utils/getModels';\nimport { getTmpFile } from './utils/getTmpFile';\n\nconst namespace = 'plugin-model';\n\nexport default (api) => {\n const {\n paths,\n utils: { Mustache }\n } = api;\n\n function getModelDir() {\n return api.config.singular ? 'model' : 'models';\n }\n\n function getModelsPath() {\n return join(paths.absSrcPath, getModelDir());\n }\n\n function getAllModels() {\n const srcModelsPath = getModelsPath();\n return lodash.uniq([\n ...getModels(srcModelsPath)\n // ...getModels(\n // paths.absPagesPath,\n // `**/${getModelDir()}/**/*.{js,jsx}`\n // ),\n // ...getModels(paths.absPagesPath, '**/*.model.{js,jsx}')\n ]);\n }\n\n const absCoreFilePath = join(namespace, 'core.js');\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n const absInitlaStateFilePath = join(namespace, 'models/initialState.js');\n\n api.register({\n key: 'addExtraModels',\n fn: () => [{\n absPath: winPath(join(paths.absTmpPath, absInitlaStateFilePath)),\n namespace: '@@initialState'\n }]\n });\n\n api.onGenerateFiles(async () => {\n const files = getAllModels();\n\n const additionalModels = await api.applyPlugins({\n key: 'addExtraModels',\n type: api.ApplyPluginsType.add,\n initialValue: []\n });\n\n const tmpFiles = getTmpFile(files, additionalModels, paths.absSrcPath);\n\n api.writeTmpFile({\n path: absCoreFilePath,\n content: Mustache.render(readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'), {\n ...tmpFiles\n })\n });\n\n api.writeTmpFile({\n path: absRuntimeFilePath,\n content: Mustache.render(readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8'), {\n })\n });\n\n api.writeTmpFile({\n path: absInitlaStateFilePath,\n content: Mustache.render(readFileSync(join(__dirname, 'runtime/models/initialState.tpl'), 'utf-8'), {\n })\n });\n });\n\n api.addPluginExports(() => [\n {\n specifiers: ['useModel'],\n source: absCoreFilePath\n }\n ]);\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-model/src/utils/getModels.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `file·=>·!file.endsWith('.d.ts')` with `(file)·=>⏎················!file.endsWith('.d.ts')·&&`","line":10,"column":13,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":44,"fix":{"range":[238,269],"text":"(file) =>\n !file.endsWith('.d.ts') &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `&&·!file.endsWith('.test.js')` with `········!file.endsWith('.test.js')·&&`","line":11,"column":9,"nodeType":null,"messageId":"replace","endLine":11,"endColumn":38,"fix":{"range":[278,307],"text":" !file.endsWith('.test.js') &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `&&` with `·······`","line":12,"column":9,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":11,"fix":{"range":[316,318],"text":" "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { glob } from '@fesjs/utils';\nimport { getValidFiles } from '.';\n\nexport function getModels(cwd, pattern) {\n const files = glob\n .sync(pattern || '**/*.{js,jsx}', {\n cwd\n })\n .filter(\n file => !file.endsWith('.d.ts')\n && !file.endsWith('.test.js')\n && !file.endsWith('.test.jsx')\n );\n\n return getValidFiles(files, cwd);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-model/src/utils/getTmpFile.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····genImports,·genModels,·genExtraModels⏎` with `·genImports,·genModels,·genExtraModels·`","line":3,"column":9,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":1,"fix":{"range":[74,117],"text":" genImports, genModels, genExtraModels "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ele·=>·`'${ele.namespace.replace(/'/g,·\"\\\\'\")}':·${ele.importName}`` with `⏎············(ele)·=>⏎················`'${ele.namespace.replace(/'/g,·\"\\\\'\")}':·${ele.importName}`⏎········`","line":10,"column":14,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":81,"fix":{"range":[268,335],"text":"\n (ele) =>\n `'${ele.namespace.replace(/'/g, \"\\\\'\")}': ${ele.importName}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ele` with `(ele)`","line":17,"column":14,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":17,"fix":{"range":[508,511],"text":"(ele)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····files,⏎····extra·=·[],⏎····absSrcPath⏎` with `files,·extra·=·[],·absSrcPath`","line":37,"column":28,"nodeType":null,"messageId":"replace","endLine":41,"endColumn":1,"fix":{"range":[1148,1191],"text":"files, extra = [], absSrcPath"}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import { EOL } from 'os';\nimport { winPath } from '@fesjs/utils';\nimport {\n genImports, genModels, genExtraModels\n} from './index';\n\nfunction getModels(files, absSrcPath) {\n const sortedModels = genModels(files, absSrcPath);\n return sortedModels\n .map(ele => `'${ele.namespace.replace(/'/g, \"\\\\'\")}': ${ele.importName}`)\n .join(', ');\n}\n\nfunction getExtraModels(models = [], absSrcPath) {\n const extraModels = genExtraModels(models, absSrcPath);\n return extraModels\n .map(ele => `'${ele.namespace}': ${ele.exportName || ele.importName}`)\n .join(', ');\n}\n\nfunction getExtraImports(models = [], absSrcPath) {\n const extraModels = genExtraModels(models, absSrcPath);\n return extraModels\n .map((ele) => {\n if (ele.exportName) {\n return `import { ${ele.exportName} } from '${winPath(\n ele.importPath.replace(/'/g, \"\\\\'\")\n )}';`;\n }\n return `import ${ele.importName} from '${winPath(\n ele.importPath.replace(/'/g, \"\\\\'\")\n )}';`;\n })\n .join(EOL);\n}\n\nexport const getTmpFile = (\n files,\n extra = [],\n absSrcPath\n) => {\n const userImports = genImports(files);\n const userModels = getModels(files, absSrcPath);\n const extraImports = getExtraImports(extra, absSrcPath);\n const extraModels = getExtraModels(extra, absSrcPath);\n\n return {\n userImports,\n userModels,\n extraImports,\n extraModels\n };\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-model/src/utils/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ele` with `(ele)`","line":20,"column":13,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":16,"fix":{"range":[673,676],"text":"(ele)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `imports·=>` with `(imports)·=>⏎···`","line":36,"column":27,"nodeType":null,"messageId":"replace","endLine":36,"endColumn":37,"fix":{"range":[1167,1177],"text":"(imports) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":37,"column":5,"nodeType":null,"messageId":"insert","endLine":37,"endColumn":5,"fix":{"range":[1190,1190],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········(ele,·index)·=>` with `············(ele,·index)·=>⏎···············`","line":38,"column":1,"nodeType":null,"messageId":"replace","endLine":38,"endColumn":24,"fix":{"range":[1196,1219],"text":" (ele, index) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····` with `········`","line":39,"column":1,"nodeType":null,"messageId":"replace","endLine":39,"endColumn":5,"fix":{"range":[1276,1280],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":40,"column":1,"nodeType":null,"messageId":"insert","endLine":40,"endColumn":1,"fix":{"range":[1282,1282],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···`","line":42,"column":59,"nodeType":null,"messageId":"insert","endLine":42,"endColumn":59,"fix":{"range":[1357,1357],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":43,"column":5,"nodeType":null,"messageId":"insert","endLine":43,"endColumn":5,"fix":{"range":[1384,1384],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":44,"column":9,"nodeType":null,"messageId":"insert","endLine":44,"endColumn":9,"fix":{"range":[1423,1423],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":45,"column":1,"nodeType":null,"messageId":"replace","endLine":45,"endColumn":13,"fix":{"range":[1432,1444],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":46,"column":1,"nodeType":null,"messageId":"insert","endLine":46,"endColumn":1,"fix":{"range":[1470,1470],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":47,"column":1,"nodeType":null,"messageId":"replace","endLine":47,"endColumn":13,"fix":{"range":[1528,1540],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":48,"column":1,"nodeType":null,"messageId":"replace","endLine":48,"endColumn":9,"fix":{"range":[1576,1584],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":49,"column":1,"nodeType":null,"messageId":"insert","endLine":49,"endColumn":1,"fix":{"range":[1587,1587],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":50,"column":5,"nodeType":null,"messageId":"insert","endLine":50,"endColumn":5,"fix":{"range":[1597,1597],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":51,"column":1,"nodeType":null,"messageId":"replace","endLine":51,"endColumn":9,"fix":{"range":[1606,1614],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":52,"column":1,"nodeType":null,"messageId":"insert","endLine":52,"endColumn":1,"fix":{"range":[1648,1648],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":53,"column":1,"nodeType":null,"messageId":"insert","endLine":53,"endColumn":1,"fix":{"range":[1710,1710],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":54,"column":9,"nodeType":null,"messageId":"insert","endLine":54,"endColumn":9,"fix":{"range":[1752,1752],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":55,"column":5,"nodeType":null,"messageId":"insert","endLine":55,"endColumn":5,"fix":{"range":[1783,1783],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":56,"column":1,"nodeType":null,"messageId":"insert","endLine":56,"endColumn":1,"fix":{"range":[1786,1786],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `v` with `(v)`","line":66,"column":38,"nodeType":null,"messageId":"replace","endLine":66,"endColumn":39,"fix":{"range":[2115,2116],"text":"(v)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `v` with `(v)`","line":74,"column":47,"nodeType":null,"messageId":"replace","endLine":74,"endColumn":48,"fix":{"range":[2407,2408],"text":"(v)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(v` with `((v)`","line":83,"column":46,"nodeType":null,"messageId":"replace","endLine":83,"endColumn":48,"fix":{"range":[2723,2725],"text":"((v)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `absPath` with `(absPath)`","line":106,"column":34,"nodeType":null,"messageId":"replace","endLine":106,"endColumn":41,"fix":{"range":[3471,3478],"text":"(absPath)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `absPath` with `(absPath)`","line":110,"column":38,"nodeType":null,"messageId":"replace","endLine":110,"endColumn":45,"fix":{"range":[3630,3637],"text":"(absPath)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `list` with `(list)`","line":112,"column":29,"nodeType":null,"messageId":"replace","endLine":112,"endColumn":33,"fix":{"range":[3701,3705],"text":"(list)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ele` with `(ele)`","line":143,"column":38,"nodeType":null,"messageId":"replace","endLine":143,"endColumn":41,"fix":{"range":[4646,4649],"text":"(ele)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":176,"column":59,"nodeType":null,"messageId":"insert","endLine":176,"endColumn":59,"fix":{"range":[5686,5686],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":177,"column":24,"nodeType":null,"messageId":"delete","endLine":177,"endColumn":27,"fix":{"range":[5710,5713],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎························&&·ele.declarations[0].init.type` with `·&&⏎························ele.declarations[0].init.type·===`","line":200,"column":71,"nodeType":null,"messageId":"replace","endLine":201,"endColumn":57,"fix":{"range":[6506,6563],"text":" &&\n ele.declarations[0].init.type ==="}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `===·`","line":202,"column":29,"nodeType":null,"messageId":"delete","endLine":202,"endColumn":33,"fix":{"range":[6592,6596],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···`","line":216,"column":51,"nodeType":null,"messageId":"insert","endLine":216,"endColumn":51,"fix":{"range":[6870,6870],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":217,"column":1,"nodeType":null,"messageId":"insert","endLine":217,"endColumn":1,"fix":{"range":[6877,6877],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":218,"column":1,"nodeType":null,"messageId":"replace","endLine":218,"endColumn":9,"fix":{"range":[6898,6906],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":219,"column":1,"nodeType":null,"messageId":"insert","endLine":219,"endColumn":1,"fix":{"range":[6951,6951],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":220,"column":9,"nodeType":null,"messageId":"insert","endLine":220,"endColumn":9,"fix":{"range":[7004,7004],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":221,"column":1,"nodeType":null,"messageId":"replace","endLine":221,"endColumn":13,"fix":{"range":[7017,7029],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":222,"column":9,"nodeType":null,"messageId":"insert","endLine":222,"endColumn":9,"fix":{"range":[7054,7054],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":223,"column":1,"nodeType":null,"messageId":"insert","endLine":223,"endColumn":1,"fix":{"range":[7056,7056],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":224,"column":5,"nodeType":null,"messageId":"insert","endLine":224,"endColumn":5,"fix":{"range":[7079,7079],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····.filter(ele` with `········.filter((ele)`","line":225,"column":1,"nodeType":null,"messageId":"replace","endLine":225,"endColumn":16,"fix":{"range":[7082,7097],"text":" .filter((ele)"}}],"errorCount":42,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":42,"fixableWarningCount":0,"source":"import path from 'path';\nimport { EOL } from 'os';\nimport { readFileSync } from 'fs';\nimport { parser, traverse, winPath } from '@fesjs/utils';\n\nconst getFileName = (name) => {\n const fileName = path.basename(name, path.extname(name));\n if (fileName.endsWith('.model') || fileName.endsWith('.models')) {\n return fileName.split('.').slice(0, -1).join('.');\n }\n return fileName;\n};\n\nexport const getName = (absPath, absSrcPath) => {\n const relativePath = path.relative(absSrcPath, absPath);\n // model files with namespace\n const dirList = path.dirname(relativePath).split(path.sep);\n try {\n const validDirs = dirList.filter(\n ele => !['src', 'page', 'pages', 'model', 'models'].includes(ele)\n );\n if (validDirs && validDirs.length) {\n return `${validDirs.join('.')}.${getFileName(relativePath)}`;\n }\n return getFileName(relativePath);\n } catch (e) {\n return getFileName(relativePath);\n }\n};\n\nexport const getPath = (absPath) => {\n const info = path.parse(absPath);\n return winPath(path.join(info.dir, info.name).replace(/'/, \"'\"));\n};\n\nexport const genImports = imports => imports\n .map(\n (ele, index) => `import model${index} from \"${winPath(getPath(ele))}\";`\n )\n .join(EOL);\n\nexport const genExtraModels = (models = [], absSrcPath) => models.map((ele) => {\n if (typeof ele === 'string') {\n return {\n importPath: getPath(ele),\n importName: path.basename(ele).split('.')[0],\n namespace: getName(ele, absSrcPath)\n };\n }\n return {\n importPath: getPath(ele.absPath),\n importName: path.basename(ele.absPath).split('.')[0],\n namespace: ele.namespace,\n exportName: ele.exportName\n };\n});\n\nexport const sort = (ns) => {\n let final = [];\n ns.forEach((item, index) => {\n if (item.use && item.use.length) {\n const itemGroup = [...item.use, item.namespace];\n\n const cannotUse = [item.namespace];\n for (let i = 0; i <= index; i += 1) {\n if (ns[i].use.filter(v => cannotUse.includes(v)).length) {\n if (!cannotUse.includes(ns[i].namespace)) {\n cannotUse.push(ns[i].namespace);\n i = -1;\n }\n }\n }\n\n const errorList = item.use.filter(v => cannotUse.includes(v));\n if (errorList.length) {\n throw Error(\n `Circular dependencies: ${\n item.namespace\n } can't use ${errorList.join(', ')}`\n );\n }\n\n const intersection = final.filter(v => itemGroup.includes(v));\n if (intersection.length) {\n // first intersection\n const finalIndex = final.indexOf(intersection[0]);\n // replace with groupItem\n final = final\n .slice(0, finalIndex)\n .concat(itemGroup)\n .concat(final.slice(finalIndex + 1));\n } else {\n final.push(...itemGroup);\n }\n }\n if (!final.includes(item.namespace)) {\n // first occurance append to the end\n final.push(item.namespace);\n }\n });\n\n return [...new Set(final)];\n};\n\nexport const genModels = (imports, absSrcPath) => {\n const contents = imports.map(absPath => ({\n namespace: getName(absPath, absSrcPath),\n content: readFileSync(absPath).toString()\n }));\n const allUserModel = imports.map(absPath => getName(absPath, absSrcPath));\n\n const checkDuplicates = list => new Set(list).size !== list.length;\n\n const raw = contents.map((ele, index) => {\n const ast = parser.parse(ele.content, {\n sourceType: 'module',\n plugins: ['jsx', 'typescript']\n });\n\n const use = [];\n\n traverse(ast, {\n enter(astPath) {\n if (astPath.isIdentifier({ name: 'useModel' })) {\n try {\n // string literal\n const ns = astPath.parentPath.node.arguments[0].value;\n if (allUserModel.includes(ns)) {\n use.push(ns);\n }\n } catch (e) {\n // console.log(e)\n }\n }\n }\n });\n\n return { namespace: ele.namespace, use, importName: `model${index}` };\n });\n\n const models = sort(raw);\n\n if (checkDuplicates(contents.map(ele => ele.namespace))) {\n throw Error('plugin-model: models 中包含重复的 namespace!');\n }\n return raw.sort(\n (a, b) => models.indexOf(a.namespace) - models.indexOf(b.namespace)\n );\n};\n\nexport const isValidHook = (filePath) => {\n const content = readFileSync(filePath, { encoding: 'utf-8' }).toString();\n\n const ast = parser.parse(content, {\n sourceType: 'module',\n plugins: [\n 'classProperties',\n 'dynamicImport',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'functionBind',\n 'nullishCoalescingOperator',\n 'objectRestSpread',\n 'optionalChaining',\n 'decorators-legacy'\n ].filter(Boolean)\n });\n let valid = false;\n let identifierName = '';\n traverse(ast, {\n enter(p) {\n if (p.isExportDefaultDeclaration()) {\n const { type } = p.node.declaration;\n try {\n if (\n type === 'ArrowFunctionExpression'\n || type === 'FunctionDeclaration'\n ) {\n valid = true;\n } else if (type === 'Identifier') {\n identifierName = p.node.declaration.name;\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n });\n\n try {\n if (identifierName) {\n ast.program.body.forEach((ele) => {\n if (ele.type === 'FunctionDeclaration') {\n if (ele.id?.name === identifierName) {\n valid = true;\n }\n }\n if (ele.type === 'VariableDeclaration') {\n if (\n ele.declarations[0].id.name === identifierName\n && ele.declarations[0].init.type\n === 'ArrowFunctionExpression'\n ) {\n valid = true;\n }\n }\n });\n }\n } catch (e) {\n valid = false;\n }\n\n return valid;\n};\n\nexport const getValidFiles = (files, modelsDir) => files\n .map((file) => {\n const filePath = path.join(modelsDir, file);\n const valid = isValidHook(filePath);\n if (valid) {\n return filePath;\n }\n return '';\n })\n .filter(ele => !!ele);\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-monaco-editor/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-monaco-editor/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎········`","line":25,"column":19,"nodeType":null,"messageId":"delete","endLine":26,"endColumn":9,"fix":{"range":[651,660],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎················`","line":42,"column":18,"nodeType":null,"messageId":"delete","endLine":43,"endColumn":17,"fix":{"range":[1156,1173],"text":""}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { resolvePkg } from '@fesjs/utils';\n\nconst namespace = 'plugin-monaco-editor';\n\nexport default (api) => {\n const {\n utils: { Mustache }\n } = api;\n\n api.describe({\n key: 'monacoEditor',\n config: {\n schema(joi) {\n return joi.object().keys({\n filename: joi.string(),\n publicPath: joi.string(),\n languages: joi.array(),\n features: joi.array(),\n globalAPI: joi.boolean()\n });\n }\n },\n default: {\n }\n });\n\n const absoluteFilePath = join(namespace, 'core.js');\n\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n\n const absLoaderFilePath = join(namespace, 'loader.js');\n const absEditorFilePath = join(namespace, 'editor.vue');\n\n api.onGenerateFiles(() => {\n // 文件写出\n api.writeTmpFile({\n path: absoluteFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n {\n }\n )\n });\n\n api.writeTmpFile({\n path: absRuntimeFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/runtime.tpl'), 'utf-8')\n )\n });\n\n api.writeTmpFile({\n path: absLoaderFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/loader.tpl'), 'utf-8'),\n {\n MONACO_EDITOR: resolvePkg('monaco-editor')\n }\n )\n });\n\n api.writeTmpFile({\n path: absEditorFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/editor.tpl'), 'utf-8'),\n {\n LODASH_ES: resolvePkg('lodash-es')\n }\n )\n });\n\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'runtime'),\n ignore: ['.tpl']\n });\n });\n\n api.addPluginExports(() => [\n {\n specifiers: ['monaco', 'MonacoEditor'],\n source: absoluteFilePath\n }\n ]);\n\n api.addRuntimePluginKey(() => 'monacoEditor');\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n\n api.chainWebpack((webpackConfig) => {\n webpackConfig\n .plugin('monaco-editor')\n .use(require('monaco-editor-webpack-plugin'), [\n api.config?.monacoEditor || {}\n ]);\n return webpackConfig;\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-monaco-editor/src/runtime/theme/default.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-qiankun/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-qiankun/src/constants.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-qiankun/src/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-qiankun/src/main/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":15,"column":40,"nodeType":null,"messageId":"insert","endLine":15,"endColumn":40,"fix":{"range":[413,413],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":16,"column":8,"nodeType":null,"messageId":"delete","endLine":16,"endColumn":11,"fix":{"range":[421,424],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `config` with `(config)`","line":29,"column":29,"nodeType":null,"messageId":"replace","endLine":29,"endColumn":35,"fix":{"range":[673,679],"text":"(config)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `namespace,·'MicroAppWithMemoHistory.js'` with `⏎········namespace,⏎········'MicroAppWithMemoHistory.js'⏎····`","line":37,"column":49,"nodeType":null,"messageId":"replace","endLine":37,"endColumn":88,"fix":{"range":[904,943],"text":"\n namespace,\n 'MicroAppWithMemoHistory.js'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎························&&` with `·&&⏎·······················`","line":54,"column":41,"nodeType":null,"messageId":"replace","endLine":55,"endColumn":27,"fix":{"range":[1624,1651],"text":" &&\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(__dirname,·'runtime/MicroAppWithMemoHistory.tpl'),·'utf-8'),` with `⏎····················join(__dirname,·'runtime/MicroAppWithMemoHistory.tpl'),⏎····················'utf-8'`","line":72,"column":30,"nodeType":null,"messageId":"replace","endLine":72,"endColumn":95,"fix":{"range":[2253,2318],"text":"\n join(__dirname, 'runtime/MicroAppWithMemoHistory.tpl'),\n 'utf-8'"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `{` with `),`","line":73,"column":17,"nodeType":null,"messageId":"replace","endLine":73,"endColumn":18,"fix":{"range":[2335,2336],"text":"),"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `{`","line":74,"column":17,"nodeType":null,"messageId":"insert","endLine":74,"endColumn":17,"fix":{"range":[2353,2353],"text":"{"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":95,"column":34,"nodeType":null,"messageId":"insert","endLine":95,"endColumn":34,"fix":{"range":[2913,2913],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":101,"column":9,"nodeType":null,"messageId":"insert","endLine":101,"endColumn":9,"fix":{"range":[3143,3143],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":102,"column":1,"nodeType":null,"messageId":"insert","endLine":102,"endColumn":1,"fix":{"range":[3162,3162],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":103,"column":9,"nodeType":null,"messageId":"insert","endLine":103,"endColumn":9,"fix":{"range":[3184,3184],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":104,"column":1,"nodeType":null,"messageId":"insert","endLine":104,"endColumn":1,"fix":{"range":[3195,3195],"text":" "}}],"errorCount":13,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":13,"fixableWarningCount":0,"source":"import { readFileSync, existsSync } from 'fs';\nimport { join } from 'path';\nimport { resolvePkg } from '@fesjs/utils';\nimport {\n defaultMainRootId,\n defaultHistoryType,\n qiankunStateForMicroModelNamespace\n} from '../constants';\nimport modifyRoutes from './modifyRoutes';\n\nconst namespace = 'plugin-qiankun/main';\n\nexport function isMasterEnable(api) {\n return (\n !!api.userConfig?.qiankun?.main\n || !!process.env.INITIAL_QIANKUN_MAIN_OPTIONS\n );\n}\n\nexport default function (api) {\n const {\n utils: { Mustache, winPath }\n } = api;\n\n api.describe({\n enableBy: () => isMasterEnable(api)\n });\n\n api.modifyDefaultConfig(config => ({\n ...config,\n mountElementId: defaultMainRootId\n }));\n\n modifyRoutes({ api, namespace });\n\n const absMicroAppPath = join(namespace, 'MicroApp.js');\n const absMicroAppWithMemoHistoryPath = join(namespace, 'MicroAppWithMemoHistory.js');\n const absRuntimePath = join(namespace, 'runtime.js');\n const absMasterOptionsPath = join(namespace, 'masterOptions.js');\n const absGetMicroAppRouteCompPath = join(\n namespace,\n 'getMicroAppRouteComponent.js'\n );\n\n api.onGenerateFiles(() => {\n const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']);\n api.writeTmpFile({\n path: absMicroAppPath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/MicroApp.tpl'), 'utf-8'),\n {\n qiankunStateForMicroModelNamespace,\n HAS_PLUGIN_MODEL:\n HAS_PLUGIN_MODEL\n && existsSync(\n winPath(\n join(\n api.paths.absSrcPath,\n 'models/qiankunStateForMicro.js'\n )\n )\n ),\n QIANKUN: resolvePkg('qiankun'),\n LODASH_ES: resolvePkg('lodash-es')\n }\n )\n });\n\n api.writeTmpFile({\n path: absMicroAppWithMemoHistoryPath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/MicroAppWithMemoHistory.tpl'), 'utf-8'),\n {\n }\n )\n });\n\n api.writeTmpFile({\n path: absRuntimePath,\n content: readFileSync(\n join(__dirname, 'runtime/runtime.tpl'),\n 'utf-8'\n )\n });\n\n api.writeTmpFile({\n path: absGetMicroAppRouteCompPath,\n content: readFileSync(\n join(__dirname, 'runtime/getMicroAppRouteComponent.tpl'),\n 'utf-8'\n )\n });\n\n const { main: options } = api.config?.qiankun || {};\n const masterHistoryType = api.config?.router?.mode || defaultHistoryType;\n const base = api.config.base;\n api.writeTmpFile({\n path: absMasterOptionsPath,\n content: `\n let options = ${JSON.stringify({\n masterHistoryType,\n base,\n ...options\n })};\n export const getMasterOptions = () => options;\n export const setMasterOptions = (newOpts) => options = ({ ...options, ...newOpts });\n `\n });\n });\n\n api.addPluginExports(() => [\n {\n specifiers: ['MicroApp'],\n source: absMicroAppPath\n }\n ]);\n\n api.addPluginExports(() => [\n {\n specifiers: ['MicroAppWithMemoHistory'],\n source: absMicroAppWithMemoHistoryPath\n }\n ]);\n\n api.addPluginExports(() => [\n {\n specifiers: ['getMicroAppRouteComponent'],\n source: absGetMicroAppRouteCompPath\n }\n ]);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-qiankun/src/main/modifyRoutes.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·microAppName,·masterHistoryType,·base,·namespace,` with `⏎········microAppName,⏎········masterHistoryType,⏎········base,⏎········namespace,⏎·······`","line":5,"column":13,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":63,"fix":{"range":[108,158],"text":"\n microAppName,\n masterHistoryType,\n base,\n namespace,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `normalizedRouteProps` with `⏎········normalizedRouteProps⏎····`","line":9,"column":167,"nodeType":null,"messageId":"replace","endLine":9,"endColumn":187,"fix":{"range":[479,499],"text":"\n normalizedRouteProps\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·masterHistoryType,·base,` with `⏎····masterHistoryType,⏎····base,⏎···`","line":14,"column":12,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":37,"fix":{"range":[564,589],"text":"\n masterHistoryType,\n base,\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { defaultHistoryType } from '../constants';\n\nfunction getMicroApp(options) {\n const {\n key, microAppName, masterHistoryType, base, namespace, ...normalizedRouteProps\n } = options;\n return `(() => {\nconst { getMicroAppRouteComponent } = require('@@/${namespace}/getMicroAppRouteComponent');\nreturn getMicroAppRouteComponent({key: '${key}', appName: '${microAppName}', base: '${base}', masterHistoryType: '${masterHistoryType}', routeProps: ${JSON.stringify(normalizedRouteProps)} })\n})()`;\n}\n\nfunction modifyRoutesWithAttachMode({\n routes, masterHistoryType, base, namespace\n}) {\n const patchRoutes = (_routes) => {\n if (_routes.length) {\n _routes.forEach((route) => {\n if (route.meta && route.meta.microApp) {\n route.component = getMicroApp({\n key: route.path,\n microAppName: route.meta.microApp,\n masterHistoryType,\n base,\n namespace\n });\n }\n if (route.children?.length) {\n modifyRoutesWithAttachMode({\n routes: route.children,\n masterHistoryType,\n base,\n namespace\n });\n }\n });\n }\n };\n\n patchRoutes(routes);\n\n return routes;\n}\n\nexport default function modifyRoutes({ api, namespace }) {\n api.modifyRoutes((routes) => {\n const { router, base } = api.config;\n const masterHistoryType = (router && router.mode) || defaultHistoryType;\n\n modifyRoutesWithAttachMode({\n routes,\n masterHistoryType,\n base: base || '/',\n namespace\n });\n\n return routes;\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-qiankun/src/micro/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":12,"column":41,"nodeType":null,"messageId":"insert","endLine":12,"endColumn":41,"fix":{"range":[364,364],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·||·lodash.isEqual(api.userConfig?.qiankun,·{})` with `·lodash.isEqual(api.userConfig?.qiankun,·{})·||`","line":13,"column":8,"nodeType":null,"messageId":"replace","endLine":13,"endColumn":55,"fix":{"range":[372,419],"text":" lodash.isEqual(api.userConfig?.qiankun, {}) ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":14,"column":8,"nodeType":null,"messageId":"delete","endLine":14,"endColumn":11,"fix":{"range":[427,430],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·api.userConfig.qiankun?.slave?.shouldNotModifyDefaultBase` with `⏎············api.userConfig.qiankun?.slave?.shouldNotModifyDefaultBase·??`","line":42,"column":43,"nodeType":null,"messageId":"replace","endLine":42,"endColumn":101,"fix":{"range":[1148,1206],"text":"\n api.userConfig.qiankun?.slave?.shouldNotModifyDefaultBase ??"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·??`","line":43,"column":12,"nodeType":null,"messageId":"delete","endLine":43,"endColumn":15,"fix":{"range":[1218,1221],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·&&`","line":69,"column":35,"nodeType":null,"messageId":"insert","endLine":69,"endColumn":35,"fix":{"range":[2158,2158],"text":" &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·&&·api.config.qiankun.micro` with `·api.config.qiankun.micro·&&`","line":70,"column":16,"nodeType":null,"messageId":"replace","endLine":70,"endColumn":44,"fix":{"range":[2174,2202],"text":" api.config.qiankun.micro &&"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·&&`","line":71,"column":16,"nodeType":null,"messageId":"delete","endLine":71,"endColumn":19,"fix":{"range":[2218,2221],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·[` with `⏎················?·[⏎······················`","line":101,"column":36,"nodeType":null,"messageId":"replace","endLine":101,"endColumn":40,"fix":{"range":[3406,3410],"text":"\n ? [\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `··························`","line":102,"column":1,"nodeType":null,"messageId":"replace","endLine":102,"endColumn":17,"fix":{"range":[3412,3428],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··········`","line":103,"column":1,"nodeType":null,"messageId":"insert","endLine":103,"endColumn":1,"fix":{"range":[3459,3459],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············}]` with `······················}⏎··················]⏎···············`","line":104,"column":1,"nodeType":null,"messageId":"replace","endLine":104,"endColumn":15,"fix":{"range":[3521,3535],"text":" }\n ]\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎················`","line":121,"column":38,"nodeType":null,"messageId":"insert","endLine":121,"endColumn":38,"fix":{"range":[3970,3970],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":122,"column":1,"nodeType":null,"messageId":"insert","endLine":122,"endColumn":1,"fix":{"range":[3984,3984],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":123,"column":17,"nodeType":null,"messageId":"insert","endLine":123,"endColumn":17,"fix":{"range":[4059,4059],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `),` with `····),⏎···············`","line":124,"column":13,"nodeType":null,"messageId":"replace","endLine":124,"endColumn":15,"fix":{"range":[4079,4081],"text":" ),\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":125,"column":1,"nodeType":null,"messageId":"insert","endLine":125,"endColumn":1,"fix":{"range":[4084,4084],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":126,"column":13,"nodeType":null,"messageId":"replace","endLine":126,"endColumn":14,"fix":{"range":[4129,4130],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `················`","line":143,"column":1,"nodeType":null,"messageId":"replace","endLine":143,"endColumn":9,"fix":{"range":[4618,4626],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":144,"column":1,"nodeType":null,"messageId":"insert","endLine":144,"endColumn":1,"fix":{"range":[4665,4665],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(__dirname,·'runtime/qiankunModel.tpl'),·'utf-8'` with `⏎····················join(__dirname,·'runtime/qiankunModel.tpl'),⏎····················'utf-8'⏎················`","line":153,"column":39,"nodeType":null,"messageId":"replace","endLine":153,"endColumn":91,"fix":{"range":[4991,5043],"text":"\n join(__dirname, 'runtime/qiankunModel.tpl'),\n 'utf-8'\n "}}],"errorCount":21,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":21,"fixableWarningCount":0,"source":"import assert from 'assert';\nimport address from 'address';\nimport { lodash } from '@fesjs/utils';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { qiankunStateFromMainModelNamespace } from '../constants';\n\nconst namespace = 'plugin-qiankun/micro';\n\nexport function isSlaveEnable(api) {\n return (\n !!api.userConfig?.qiankun?.micro\n || lodash.isEqual(api.userConfig?.qiankun, {})\n || !!process.env.INITIAL_QIANKUN_MIRCO_OPTIONS\n );\n}\n\nexport default function (api) {\n const {\n utils: { Mustache }\n } = api;\n\n api.describe({\n enableBy: () => isSlaveEnable(api)\n });\n\n api.modifyDefaultConfig((memo) => {\n const initialMicroOptions = {\n devSourceMap: true,\n ...JSON.parse(process.env.INITIAL_QIANKUN_MIRCO_OPTIONS || '{}'),\n ...(memo.qiankun || {}).micro\n };\n const modifiedDefaultConfig = {\n ...memo,\n runtimePublicPath: true,\n qiankun: {\n ...memo.qiankun,\n slave: initialMicroOptions\n }\n };\n\n const shouldNotModifyDefaultBase = api.userConfig.qiankun?.slave?.shouldNotModifyDefaultBase\n ?? initialMicroOptions.shouldNotModifyDefaultBase;\n if (!shouldNotModifyDefaultBase) {\n modifiedDefaultConfig.base = `/${api.pkg.name}`;\n }\n\n return modifiedDefaultConfig;\n });\n\n api.chainWebpack((config) => {\n assert(api.pkg.name, 'You should have name in package.json');\n config.output.libraryTarget('umd').library(`${api.pkg.name}-[name]`);\n return config;\n });\n\n const port = process.env.PORT;\n // source-map 跨域设置\n if (process.env.NODE_ENV === 'development' && port) {\n const localHostname = process.env.USE_REMOTE_IP\n ? address.ip()\n : process.env.HOST || 'localhost';\n\n const protocol = process.env.HTTPS ? 'https' : 'http';\n // TODO: 变更 webpack-dev-server websocket 默认监听地址\n api.chainWebpack((memo, { webpack }) => {\n // 开启了 devSourceMap 配置,默认为 true\n if (\n api.config.qiankun\n && api.config.qiankun.micro\n && api.config.qiankun.micro.devSourceMap !== false\n ) {\n // 禁用 devtool,启用 SourceMapDevToolPlugin\n memo.devtool(false);\n memo.plugin('source-map').use(webpack.SourceMapDevToolPlugin, [\n {\n // @ts-ignore\n namespace: api.pkg.name,\n append: `\\n//# sourceMappingURL=${protocol}://${localHostname}:${port}/[url]`,\n filename: '[file].map'\n }\n ]);\n }\n return memo;\n });\n }\n\n const absRuntimePath = join(namespace, 'runtime.js');\n const absLifeclesPath = join(namespace, 'lifecycles.js');\n const absMicroOptionsPath = join(namespace, 'slaveOptions.js');\n const absPublicPath = join(namespace, 'publicPath.js');\n const absModelPath = join(namespace, 'qiankunModel.js');\n\n // 更改public path\n api.addEntryImportsAhead(() => [{ source: `@@/${absPublicPath}` }]);\n\n api.register({\n key: 'addExtraModels',\n fn: () => {\n const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']);\n return HAS_PLUGIN_MODEL ? [{\n absPath: `@@/${absModelPath}`,\n namespace: qiankunStateFromMainModelNamespace\n }] : [];\n }\n });\n\n api.onGenerateFiles(() => {\n const HAS_PLUGIN_MODEL = api.hasPlugins(['@fesjs/plugin-model']);\n\n api.writeTmpFile({\n path: absRuntimePath,\n content: readFileSync(\n join(__dirname, 'runtime/runtime.tpl'),\n 'utf-8'\n )\n });\n\n api.writeTmpFile({\n path: absLifeclesPath,\n content: Mustache.render(readFileSync(\n join(__dirname, 'runtime/lifecycles.tpl'),\n 'utf-8'\n ), {\n HAS_PLUGIN_MODEL\n })\n });\n\n api.writeTmpFile({\n path: absPublicPath,\n content: `\n if (window.__POWERED_BY_QIANKUN__) {\n __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;\n window.public_path = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;\n }\n `\n });\n\n api.writeTmpFile({\n path: absMicroOptionsPath,\n content: `\n let options = ${JSON.stringify(\n (api.config.qiankun || {}).micro || {}\n )};\n export const getSlaveOptions = () => options;\n export const setSlaveOptions = (newOpts) => options = ({ ...options, ...newOpts });\n `\n });\n\n if (HAS_PLUGIN_MODEL) {\n api.writeTmpFile({\n path: absModelPath,\n content: readFileSync(join(__dirname, 'runtime/qiankunModel.tpl'), 'utf-8')\n });\n }\n });\n\n api.addRuntimePlugin(() => `@@/${absRuntimePath}`);\n\n api.addEntryImports(() => ({\n source: `@@/${absLifeclesPath}`,\n specifier:\n '{ genMount as qiankun_genMount, genBootstrap as qiankun_genBootstrap, genUnmount as qiankun_genUnmount, genUpdate as qiankun_genUpdate }'\n }));\n\n api.addEntryCode(\n () => `\nexport const bootstrap = qiankun_genBootstrap(clientRender, app);\nexport const mount = qiankun_genMount('#${api.config.mountElementId}');\nexport const unmount = qiankun_genUnmount();\nexport const update = qiankun_genUpdate();\n\nif (!window.__POWERED_BY_QIANKUN__) {\n bootstrap().then(mount);\n}\n`\n );\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/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: ['template']\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎························.string()⏎························` with `.string()`","line":20,"column":30,"nodeType":null,"messageId":"replace","endLine":22,"endColumn":25,"fix":{"range":[587,646],"text":".string()"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(__dirname,·'template',·'request.js'),·'utf-8'` with `⏎········join(__dirname,·'template',·'request.js'),⏎········'utf-8'⏎····`","line":34,"column":42,"nodeType":null,"messageId":"replace","endLine":34,"endColumn":92,"fix":{"range":[941,991],"text":"\n join(__dirname, 'template', 'request.js'),\n 'utf-8'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'[DEPRECATED]:·reqeust·base·即将废弃,建议使用·axios·baseURL代替:https://github.com/axios/axios'` with `⏎················'[DEPRECATED]:·reqeust·base·即将废弃,建议使用·axios·baseURL代替:https://github.com/axios/axios'⏎············`","line":41,"column":25,"nodeType":null,"messageId":"replace","endLine":41,"endColumn":110,"fix":{"range":[1179,1264],"text":"\n '[DEPRECATED]: reqeust base 即将废弃,建议使用 axios baseURL代替:https://github.com/axios/axios'\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { Logger } from '@fesjs/compiler';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { resolvePkg } from '@fesjs/utils';\n\nconst logger = new Logger('fes:plugin-request');\n\nexport default (api) => {\n api.addRuntimePluginKey(() => 'request');\n // 配置\n api.describe({\n key: 'request',\n config: {\n schema(joi) {\n return joi.object({\n dataField: joi\n .string()\n .pattern(/^[a-zA-Z]*$/)\n .allow(''),\n base: joi\n .string()\n .allow('')\n });\n },\n default: {\n base: '',\n dataField: ''\n }\n }\n });\n\n const namespace = 'plugin-request';\n const absoluteFilePath = `${namespace}/request.js`;\n const requestTemplate = readFileSync(join(__dirname, 'template', 'request.js'), 'utf-8');\n api.onGenerateFiles(() => {\n // 文件写出\n const { dataField = '', base = '' } = api.config.request;\n\n if (base) {\n // DEPRECATED\n logger.warn('[DEPRECATED]: reqeust base 即将废弃,建议使用 axios baseURL代替:https://github.com/axios/axios');\n }\n api.writeTmpFile({\n path: absoluteFilePath,\n content: requestTemplate\n .replace('REPLACE_DATA_FIELD', JSON.stringify(dataField))\n .replace('REPLACE_BASE', base || '')\n .replace('AXIOS_PATH', resolvePkg('axios'))\n });\n });\n\n let generatedOnce = false;\n api.onGenerateFiles(() => {\n if (generatedOnce) return;\n generatedOnce = true;\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'template'),\n ignore: ['request.js']\n });\n });\n\n api.addPluginExports(() => [\n {\n exportAll: true,\n source: absoluteFilePath\n }\n ]);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/cacheControl.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·isString,·isURLSearchParams,` with `⏎····isString,⏎····isURLSearchParams,⏎···`","line":2,"column":14,"nodeType":null,"messageId":"replace","endLine":2,"endColumn":43,"fix":{"range":[22,51],"text":"\n isString,\n isURLSearchParams,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":21,"column":4,"nodeType":null,"messageId":"delete","endLine":22,"endColumn":1,"fix":{"range":[468,469],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!data·||·isObject(data)·||·isString(data)·||·Array.isArray(data)·||·isURLSearchParams(data)` with `(⏎········!data·||⏎········isObject(data)·||⏎········isString(data)·||⏎········Array.isArray(data)·||⏎········isURLSearchParams(data)⏎····)`","line":57,"column":12,"nodeType":null,"messageId":"replace","endLine":57,"endColumn":103,"fix":{"range":[1161,1252],"text":"(\n !data ||\n isObject(data) ||\n isString(data) ||\n Array.isArray(data) ||\n isURLSearchParams(data)\n )"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `item.startsWith(CACHE_KEY_PREFIX)·&&·Object.prototype.hasOwnProperty.call(cacheInstance,·item)` with `⏎····················item.startsWith(CACHE_KEY_PREFIX)·&&⏎····················Object.prototype.hasOwnProperty.call(cacheInstance,·item)⏎················`","line":81,"column":21,"nodeType":null,"messageId":"replace","endLine":81,"endColumn":115,"fix":{"range":[1847,1941],"text":"\n item.startsWith(CACHE_KEY_PREFIX) &&\n Object.prototype.hasOwnProperty.call(cacheInstance, item)\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·key:·ctx.key,·cacheType:·config.cache.cacheType` with `⏎············key:·ctx.key,⏎············cacheType:·config.cache.cacheType⏎·······`","line":178,"column":41,"nodeType":null,"messageId":"replace","endLine":178,"endColumn":89,"fix":{"range":[4612,4660],"text":"\n key: ctx.key,\n cacheType: config.cache.cacheType\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·config.data` with `⏎············?·config.data⏎···········`","line":196,"column":67,"nodeType":null,"messageId":"replace","endLine":196,"endColumn":81,"fix":{"range":[5132,5146],"text":"\n ? config.data\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!ctx.error·&&·ctx.response·&&·canCache(requestdata)·&&·canCache(ctx.response.data)` with `⏎············!ctx.error·&&⏎············ctx.response·&&⏎············canCache(requestdata)·&&⏎············canCache(ctx.response.data)⏎········`","line":197,"column":13,"nodeType":null,"messageId":"replace","endLine":197,"endColumn":95,"fix":{"range":[5176,5258],"text":"\n !ctx.error &&\n ctx.response &&\n canCache(requestdata) &&\n canCache(ctx.response.data)\n "}}],"errorCount":7,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"import {\n isObject, isString, isURLSearchParams, checkHttpRequestHasBody\n} from './helpers';\n/**\n * 缓存实现的功能\n * 1. 唯一定位一个请求(url, data | params, method)\n * 其中请求参数根据请求方法使用其中一个就够了\n * 一个请求同时包含 data | params 参数的设计本身不合理\n * 不对这种情况进行兼容\n * 2. 控制缓存内容的大小,localStorage 只有5M\n * 3. 控制缓存时间\n * session(存在内存中)\n * expireTime 存在localStoreage 中\n * 4. 成功的、且响应内容为json的请求进行缓存\n */\n\n/**\n * 配置数据\n * type: 'ram' | 'sessionStorage' | 'localStorage'\n * cacheTime: ''\n */\n\n\n/**\n * 缓存数据结构\n * cache: {\n * url: 'url', // 缓存 url\n * data: data, // 数据\n * expire: '' // 缓存时间\n * }\n */\n\n/**\n * 请求参数可以为如下类型\n * - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams\n * - Browser only: FormData, File, Blob\n * 只缓存参数类型为: string、plain object、URLSearchParams 或者无参数的 请求\n */\n\nconst CACHE_KEY_PREFIX = '__FES_REQUEST_CACHE:';\nconst CACHE_TYPE = {\n ram: 'ram',\n session: 'sessionStorage',\n local: 'localStorage'\n};\n\nconst CACHE_DATA_MAP = new Map();\n\nfunction genInnerKey(key, cacheType = 'ram') {\n if (cacheType !== CACHE_TYPE.ram) {\n return `${CACHE_KEY_PREFIX}${key}`;\n }\n return key;\n}\n\nfunction canCache(data) {\n return !data || isObject(data) || isString(data) || Array.isArray(data) || isURLSearchParams(data);\n}\n\nfunction setCacheData({\n key,\n cacheType = 'ram',\n data,\n cacheTime = 1000 * 60 * 3\n}) {\n const _key = genInnerKey(key, cacheType);\n\n const currentCacheData = {\n cacheType,\n data,\n cacheTime,\n expire: Date.now() + cacheTime\n };\n if (cacheType !== CACHE_TYPE.ram) {\n const cacheInstance = window[CACHE_TYPE[cacheType]];\n try {\n cacheInstance.setItem(_key, JSON.stringify(currentCacheData));\n } catch (e) {\n // setItem 出现异常,清理缓存\n for (const item in cacheInstance) {\n if (item.startsWith(CACHE_KEY_PREFIX) && Object.prototype.hasOwnProperty.call(cacheInstance, item)) {\n cacheInstance.removeItem(item);\n }\n }\n }\n } else {\n CACHE_DATA_MAP.set(_key, currentCacheData);\n }\n}\n\nfunction isExpire({ expire, cacheTime }) {\n if (!cacheTime || expire >= Date.now()) {\n return false;\n }\n return true;\n}\n\nfunction getCacheData({ key, cacheType = 'ram' }) {\n const _key = genInnerKey(key, cacheType);\n if (cacheType !== CACHE_TYPE.ram) {\n const cacheInstance = window[CACHE_TYPE[cacheType]];\n const text = cacheInstance.getItem(_key) || null;\n try {\n const currentCacheData = JSON.parse(text);\n if (currentCacheData && !isExpire(currentCacheData)) {\n return currentCacheData.data;\n }\n cacheInstance.removeItem(_key);\n return null;\n } catch (e) {\n cacheInstance.removeItem(_key);\n return null;\n }\n } else {\n const currentCacheData = CACHE_DATA_MAP.get(_key);\n if (currentCacheData && !isExpire(currentCacheData)) {\n return currentCacheData.data;\n }\n CACHE_DATA_MAP.delete(_key);\n return null;\n }\n}\n\n// 存储缓存队列\nconst cacheStartFlag = new Map();\nconst cachingQueue = new Map();\n\n/**\n * 等上一次请求结果\n * 1. 如果上一次请求成功,直接使用上一次的请求结果\n * 2. 如果上一次请求失败,重启本次请求\n */\nfunction handleCachingStart(ctx, config) {\n const _key = genInnerKey(ctx.key, config.cache.cacheType);\n const caching = cacheStartFlag.get(_key);\n if (caching) {\n return new Promise((resolve) => {\n const queue = cachingQueue.get(_key) || [];\n cachingQueue.set(_key, queue.concat(resolve));\n });\n }\n cacheStartFlag.set(_key, true);\n}\n\n// 有请求成功的\nfunction handleCachingQueueSuccess(ctx, config) {\n // 移除首次缓存 flag\n const _key = genInnerKey(ctx.key, config.cache.cacheType);\n const queue = cachingQueue.get(_key);\n if (queue && queue.length > 0) {\n queue.forEach((resolve) => {\n resolve({\n response: ctx.response\n });\n });\n }\n cachingQueue.delete(_key);\n cacheStartFlag.delete(_key);\n}\n\n// 处理请求失败\nfunction handleCachingQueueError(ctx, config) {\n const _key = genInnerKey(ctx.key, config.cache.cacheType);\n const queue = cachingQueue.get(_key);\n if (queue && queue.length > 0) {\n const firstResolve = queue.shift();\n firstResolve();\n cachingQueue.set(_key, queue);\n } else {\n cachingQueue.delete(_key);\n cacheStartFlag.delete(_key);\n }\n}\n\nexport default async (ctx, next) => {\n const { config } = ctx;\n if (config.cache) {\n const cacheData = getCacheData({ key: ctx.key, cacheType: config.cache.cacheType });\n if (cacheData) {\n ctx.response = {\n data: cacheData\n };\n return;\n }\n const result = await handleCachingStart(ctx, config);\n if (result) {\n Object.keys(result).forEach((key) => {\n ctx[key] = result[key];\n });\n return;\n }\n }\n await next();\n\n if (config.cache) {\n const requestdata = checkHttpRequestHasBody(config.method) ? config.data : config.params;\n if (!ctx.error && ctx.response && canCache(requestdata) && canCache(ctx.response.data)) {\n handleCachingQueueSuccess(ctx, config);\n\n setCacheData({\n key: ctx.key,\n data: ctx.response.data,\n ...config.cache\n });\n } else {\n handleCachingQueueError(ctx, config);\n }\n }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/genRequestKey.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········url,·data,·params,·method⏎···` with `·url,·data,·params,·method`","line":17,"column":12,"nodeType":null,"messageId":"replace","endLine":19,"endColumn":4,"fix":{"range":[425,463],"text":" url, data, params, method"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { isURLSearchParams } from './helpers';\n/**\n * 唯一定位一个请求(url, data | params, method)\n * 其中请求参数(data, params)根据请求方法,只使用其中一个\n * 一个请求同时包含 data | params 参数的设计本身不合理\n * 不对这种情况进行兼容\n */\n\nconst getQueryString = (data) => {\n if (isURLSearchParams(data)) {\n return data.toString();\n }\n return data ? JSON.stringify(data) : '';\n};\n\nexport default async function genRequestKey(ctx, next) {\n const {\n url, data, params, method\n } = ctx.config;\n\n ctx.key = `${url}${getQueryString(data)}${getQueryString(params)}${method}`;\n\n await next();\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/helpers.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `val·=>·val·!=·null;⏎` with `(val)·=>·val·!=·null;`","line":49,"column":26,"nodeType":null,"messageId":"replace","endLine":50,"endColumn":1,"fix":{"range":[1133,1153],"text":"(val) => val != null;"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"/**\n *判断类型\n * @param {*} obj 需要判断的对象\n */\nexport function typeOf(obj) {\n const map = {\n '[object Boolean]': 'boolean',\n '[object Number]': 'number',\n '[object String]': 'string',\n '[object Function]': 'function',\n '[object Array]': 'array',\n '[object Date]': 'date',\n '[object RegExp]': 'regExp',\n '[object Undefined]': 'undefined',\n '[object Null]': 'null',\n '[object Object]': 'object',\n '[object URLSearchParams]': 'URLSearchParams'\n };\n return map[Object.prototype.toString.call(obj)];\n}\n\nexport function isFunction(obj) {\n return typeOf(obj) === 'function';\n}\n\nexport function isDate(obj) {\n return typeOf(obj) === 'date';\n}\n\nexport function isString(obj) {\n return typeOf(obj) === 'string';\n}\n\nexport function isArray(obj) {\n return typeOf(obj) === 'array';\n}\n\nexport function isObject(obj) {\n return typeOf(obj) === 'object';\n}\n\nexport function isURLSearchParams(obj) {\n return typeOf(obj) === 'URLSearchParams';\n}\n\n// eslint-disable-next-line\nexport const isUndefined = val => val === undefined;\n\nexport const isDefined = val => val != null;\n\n\nexport function checkHttpRequestHasBody(method) {\n method = method.toUpperCase();\n const HTTP_METHOD = {\n GET: {\n request_body: false\n },\n POST: {\n request_body: true\n },\n PUT: {\n request_body: true\n },\n DELETE: {\n request_body: true\n },\n HEAD: {\n request_body: false\n },\n OPTIONS: {\n request_body: false\n },\n PATCH: {\n request_body: true\n }\n };\n return HTTP_METHOD[method].request_body;\n}\n\nexport function trimObj(obj) {\n if (isObject(obj)) {\n Object.entries(obj).forEach(([key, value]) => {\n if (isString(value)) {\n obj[key] = value.trim();\n } else if (isObject(value)) {\n trimObj(value);\n }\n });\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/paramsProcess.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/preventRepeatReq.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/request.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····checkHttpRequestHasBody,⏎····isFunction⏎` with `·checkHttpRequestHasBody,·isFunction·`","line":5,"column":9,"nodeType":null,"messageId":"replace","endLine":8,"endColumn":1,"fix":{"range":[159,204],"text":" checkHttpRequestHasBody, isFunction "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":59,"column":41,"nodeType":null,"messageId":"insert","endLine":59,"endColumn":41,"fix":{"range":[1684,1684],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":60,"column":1,"nodeType":null,"messageId":"insert","endLine":60,"endColumn":1,"fix":{"range":[1686,1686],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":61,"column":1,"nodeType":null,"messageId":"replace","endLine":61,"endColumn":9,"fix":{"range":[1710,1718],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},·otherConfigs` with `····},⏎········otherConfigs⏎····`","line":62,"column":5,"nodeType":null,"messageId":"replace","endLine":62,"endColumn":20,"fix":{"range":[1744,1759],"text":" },\n otherConfigs\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":125,"column":1,"nodeType":null,"messageId":"delete","endLine":126,"endColumn":1,"fix":{"range":[3307,3308],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····errorHandler·=·{},⏎····error,⏎····response,⏎····config⏎` with `·errorHandler·=·{},·error,·response,·config·`","line":145,"column":30,"nodeType":null,"messageId":"replace","endLine":150,"endColumn":1,"fix":{"range":[3801,3861],"text":" errorHandler = {}, error, response, config "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·context.response` with `⏎················?·context.response⏎···············`","line":185,"column":45,"nodeType":null,"messageId":"replace","endLine":185,"endColumn":64,"fix":{"range":[4981,5000],"text":"\n ? context.response\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":206,"column":12,"nodeType":null,"messageId":"insert","endLine":206,"endColumn":12,"fix":{"range":[5550,5550],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":207,"column":1,"nodeType":null,"messageId":"insert","endLine":207,"endColumn":1,"fix":{"range":[5567,5567],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎········`","line":208,"column":5,"nodeType":null,"messageId":"replace","endLine":208,"endColumn":7,"fix":{"range":[5600,5602],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":209,"column":9,"nodeType":null,"messageId":"insert","endLine":209,"endColumn":9,"fix":{"range":[5630,5630],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎········`","line":210,"column":5,"nodeType":null,"messageId":"replace","endLine":210,"endColumn":7,"fix":{"range":[5658,5660],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":211,"column":1,"nodeType":null,"messageId":"insert","endLine":211,"endColumn":1,"fix":{"range":[5677,5677],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":212,"column":1,"nodeType":null,"messageId":"insert","endLine":212,"endColumn":1,"fix":{"range":[5711,5711],"text":" "}}],"errorCount":15,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":15,"fixableWarningCount":0,"source":"import axios from 'AXIOS_PATH';\nimport { ApplyPluginsType, plugin } from '@fesjs/fes';\nimport { ref } from 'vue';\nimport scheduler from './scheduler';\nimport {\n checkHttpRequestHasBody,\n isFunction\n} from './helpers';\n\nimport setDataField from './setDataField';\nimport paramsProcess from './paramsProcess';\nimport genRequestKey from './genRequestKey';\nimport preventRepeatReq from './preventRepeatReq';\nimport throttle from './throttle';\nimport cacheControl from './cacheControl';\nimport resDataAdaptor from './resDataAdaptor';\nimport resErrorProcess from './resErrorProcess';\n\nfunction addInterceptors(instance, interceptors, type = 'request') {\n interceptors.forEach((fn) => {\n if (Array.isArray(fn)) {\n instance.interceptors[type].use(...fn);\n } else if (isFunction(fn)) {\n instance.interceptors[type].use(fn);\n }\n });\n}\n\nfunction addRequestInterceptors(instance, interceptors) {\n addInterceptors(instance, interceptors, 'request');\n}\n\nfunction addResponseInterceptors(instance, interceptors) {\n addInterceptors(instance, interceptors, 'response');\n}\n\nasync function axiosMiddleware(context, next) {\n try {\n context.response = await context.instance.request(context.config);\n } catch (error) {\n context.error = error;\n }\n await next();\n}\n\nfunction getRequestInstance() {\n const {\n responseDataAdaptor,\n requestInterceptors = [],\n responseInterceptors = [],\n errorHandler,\n ...otherConfigs\n } = plugin.applyPlugins({\n key: 'request',\n type: ApplyPluginsType.modify,\n initialValue: {}\n });\n\n const defaultConfig = Object.assign({\n timeout: 10000,\n withCredentials: true\n }, otherConfigs);\n const instance = axios.create(defaultConfig);\n\n addRequestInterceptors(instance, requestInterceptors);\n addResponseInterceptors(instance, responseInterceptors);\n\n // 洋葱模型内部应该这是对数据的处理,避免有副作用调用\n scheduler\n .use(paramsProcess)\n .use(genRequestKey)\n .use(cacheControl)\n .use(preventRepeatReq)\n .use(throttle)\n .use(axiosMiddleware)\n .use(resDataAdaptor)\n .use(resErrorProcess)\n .use(setDataField);\n\n return {\n context: {\n instance,\n defaultConfig,\n dataField: REPLACE_DATA_FIELD, // eslint-disable-line\n responseDataAdaptor,\n errorHandler\n },\n request: scheduler.compose()\n };\n}\n\n// DEPRECATED 废弃,使用 axios baseURL\nfunction handleApiPathBase(url, options = {}) {\n if (url.startsWith('http')) return url;\n\n if (options.base) {\n return `${options.base}${url}`;\n }\n return `REPLACE_BASE${url}`;\n}\n\nfunction userConfigHandler(url, data, options = {}) {\n options.url = handleApiPathBase(url, options);\n options.method = (options.method || 'post').toUpperCase();\n if (checkHttpRequestHasBody(options.method)) {\n options.data = data;\n } else {\n options.params = data;\n }\n return options;\n}\n\nlet currentRequestInstance = null;\n\nfunction createContext(userConfig) {\n return {\n ...currentRequestInstance.context,\n config: {\n ...currentRequestInstance.context.defaultConfig,\n ...userConfig\n }\n };\n}\n\n\nfunction getResponseCode(response) {\n if (response) {\n if (response._rawData) return response._rawData.code;\n if (response.data) return response.data.code;\n }\n return null;\n}\n\nfunction skipErrorHandlerToObj(skipErrorHandler = []) {\n if (!Array.isArray(skipErrorHandler)) {\n skipErrorHandler = [skipErrorHandler];\n }\n\n return skipErrorHandler.reduce((acc, cur) => {\n acc[cur] = true;\n return acc;\n }, {});\n}\n\nfunction handleRequestError({\n errorHandler = {},\n error,\n response,\n config\n}) {\n // 跳过所有错误类型处理\n if (config.skipErrorHandler === true) return;\n\n const skipObj = skipErrorHandlerToObj(config.skipErrorHandler);\n const resCode = getResponseCode(response);\n\n let errorKey = 'default';\n if (resCode && errorHandler[resCode]) {\n errorKey = resCode;\n } else if (error.type && errorHandler[error.type]) {\n errorKey = error.type;\n } else if (error.response && errorHandler[error.response.status]) {\n errorKey = error.response.status;\n }\n\n if (!skipObj[errorKey] && errorHandler[errorKey]) {\n return errorHandler[errorKey](error);\n }\n}\n\nexport const request = (url, data, options = {}) => {\n if (typeof options === 'string') {\n options = {\n method: options\n };\n }\n if (!currentRequestInstance) {\n currentRequestInstance = getRequestInstance();\n }\n const userConfig = userConfigHandler(url, data, options);\n const context = createContext(userConfig);\n\n return currentRequestInstance.request(context).then(async () => {\n if (!context.error) {\n return context.config.useResonse ? context.response : context.response.data;\n }\n await handleRequestError(context);\n return Promise.reject(context.error);\n });\n};\n\nfunction isPromiseLike(obj) {\n return !!obj && typeof obj === 'object' && typeof obj.then === 'function';\n}\n\nexport const useRequest = (url, data, options = {}) => {\n const loadingRef = ref(true);\n const errorRef = ref(null);\n const dataRef = ref(null);\n let promise;\n if (isPromiseLike(url)) {\n promise = url;\n } else {\n promise = request(url, data, options);\n }\n promise.then((res) => {\n dataRef.value = res;\n }).catch((error) => {\n errorRef.value = error;\n }).finally(() => {\n loadingRef.value = false;\n });\n return {\n loading: loadingRef,\n error: errorRef,\n data: dataRef\n };\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/resDataAdaptor.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `isFunction(responseDataAdaptor)·&&·response·&&·(isObject(response.data)·||·isString(response.data))` with `⏎········isFunction(responseDataAdaptor)·&&⏎········response·&&⏎········(isObject(response.data)·||·isString(response.data))⏎····`","line":4,"column":9,"nodeType":null,"messageId":"replace","endLine":4,"endColumn":108,"fix":{"range":[137,236],"text":"\n isFunction(responseDataAdaptor) &&\n response &&\n (isObject(response.data) || isString(response.data))\n "}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { isFunction, isObject, isString } from './helpers';\n\nexport default async ({ response, responseDataAdaptor }, next) => {\n if (isFunction(responseDataAdaptor) && response && (isObject(response.data) || isString(response.data))) {\n response.data = responseDataAdaptor(response.data);\n }\n await next();\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/resErrorProcess.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········response,⏎········config⏎···` with `·response,·config`","line":5,"column":12,"nodeType":null,"messageId":"replace","endLine":8,"endColumn":4,"fix":{"range":[103,140],"text":" response, config"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { isObject } from './helpers';\n\n// 错误处理等副作用网上提\nexport default async (ctx, next) => {\n const {\n response,\n config\n } = ctx;\n if (!config.closeResDataCheck && response && isObject(response.data)) {\n const code = response.data.code;\n if (code !== '0') {\n ctx.error = response; // code 不为零进入 reject\n }\n }\n\n await next();\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/scheduler.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":"Insert `⏎···········`","line":8,"column":38,"nodeType":null,"messageId":"insert","endLine":8,"endColumn":38,"fix":{"range":[128,128],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·return·Promise.reject(new·Error('next()·called·multiple·times')` with `⏎····················return·Promise.reject(⏎························new·Error('next()·called·multiple·times')⏎····················`","line":17,"column":32,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":96,"fix":{"range":[396,460],"text":"\n return Promise.reject(\n new Error('next() called multiple times')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `fn(context,·dispatch.bind(null,·i·+·1))` with `⏎························fn(context,·dispatch.bind(null,·i·+·1))⏎····················`","line":23,"column":44,"nodeType":null,"messageId":"replace","endLine":23,"endColumn":83,"fix":{"range":[718,757],"text":"\n fn(context, dispatch.bind(null, i + 1))\n "}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"\nclass Scheduler {\n constructor() {\n this.middlewares = [];\n }\n\n use(fn) {\n if (typeof fn !== 'function') throw new TypeError('middleware must be a function!');\n this.middlewares.push(fn);\n return this;\n }\n\n compose() {\n return (context, next) => {\n let index = -1;\n const dispatch = (i) => {\n if (i <= index) return Promise.reject(new Error('next() called multiple times'));\n index = i;\n let fn = this.middlewares[i];\n if (index === this.middlewares.length) fn = next;\n if (!fn) return Promise.resolve();\n try {\n return Promise.resolve(fn(context, dispatch.bind(null, i + 1)));\n } catch (e) {\n return Promise.reject(e);\n }\n };\n return dispatch(0);\n };\n }\n}\n\nexport default new Scheduler();\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/setDataField.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!ctx.error·&&·ctx.response·&&·isObject(ctx.response.data)·&&·dataField` with `⏎········!ctx.error·&&⏎········ctx.response·&&⏎········isObject(ctx.response.data)·&&⏎········dataField⏎····`","line":6,"column":9,"nodeType":null,"messageId":"replace","endLine":6,"endColumn":79,"fix":{"range":[169,239],"text":"\n !ctx.error &&\n ctx.response &&\n isObject(ctx.response.data) &&\n dataField\n "}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { isObject } from './helpers';\n\n// FEATURE: 后续支持 a.b.c\nexport default async (ctx, next) => {\n const dataField = ctx.config.dataField ?? ctx.dataField;\n if (!ctx.error && ctx.response && isObject(ctx.response.data) && dataField) {\n ctx.response._rawData = ctx.response.data;\n ctx.response.data = ctx.response.data[dataField];\n }\n await next();\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-request/src/template/throttle.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":"\nconst throttleMap = new Map();\n\nexport default async (ctx, next) => {\n if (ctx.config.throttle) {\n if (throttleMap.get(ctx.key) >= Date.now()) {\n ctx.error = {\n type: 'FREQUENTLY',\n msg: '请求过于频繁'\n };\n return;\n }\n }\n await next();\n throttleMap.set(ctx.key, Date.now() + ctx.config.throttle);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-sass/.fatherrc.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-sass/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⏎···` with `·utils`","line":3,"column":12,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":4,"fix":{"range":[38,56],"text":" utils"}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default (api) => {\n const {\n utils\n } = api;\n\n api.describe({\n key: 'sass',\n config: {\n schema(joi) {\n return joi.object({\n implementation: joi.any(),\n sassOptions: joi.object(),\n prependData: joi.alternatives(joi.string(), joi.func()),\n sourceMap: joi.boolean(),\n webpackImporter: joi.boolean()\n });\n },\n default: {}\n }\n });\n\n api.chainWebpack((memo, { createCSSRule }) => {\n createCSSRule({\n lang: 'sass',\n test: /\\.(sass|scss)(\\?.*)?$/,\n loader: require.resolve('sass-loader'),\n options: utils.deepmerge(\n {\n implementation: require('sass')\n },\n api.config.sass || {}\n )\n });\n return memo;\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-vuex/.fatherrc.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-vuex/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-vuex/src/helper.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":29,"column":16,"nodeType":null,"messageId":"insert","endLine":29,"endColumn":16,"fix":{"range":[687,687],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `text` with `(text)`","line":31,"column":49,"nodeType":null,"messageId":"replace","endLine":31,"endColumn":53,"fix":{"range":[782,786],"text":"(text)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `text` with `(text)`","line":32,"column":24,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":28,"fix":{"range":[836,840],"text":"(text)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `namespaced·?·`${name}/`·:·''` with `⏎························namespaced·?·`${name}/`·:·''⏎····················`","line":65,"column":48,"nodeType":null,"messageId":"replace","endLine":65,"endColumn":76,"fix":{"range":[1897,1925],"text":"\n namespaced ? `${name}/` : ''\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `prop.value,·prop.key.name,·`${namespace}${namespaced·?·`${name}/`·:·''}`` with `⏎····················prop.value,⏎····················prop.key.name,⏎····················`${namespace}${namespaced·?·`${name}/`·:·''}`⏎················`","line":72,"column":48,"nodeType":null,"messageId":"replace","endLine":72,"endColumn":120,"fix":{"range":[2143,2215],"text":"\n prop.value,\n prop.key.name,\n `${namespace}${namespaced ? `${name}/` : ''}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `body·=>·body.type·===·'ExportDefaultDeclaration'` with `⏎············(body)·=>·body.type·===·'ExportDefaultDeclaration'⏎········`","line":112,"column":39,"nodeType":null,"messageId":"replace","endLine":112,"endColumn":87,"fix":{"range":[3401,3449],"text":"\n (body) => body.type === 'ExportDefaultDeclaration'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ast.declaration,·moduleName` with `⏎················ast.declaration,⏎················moduleName⏎············`","line":114,"column":67,"nodeType":null,"messageId":"replace","endLine":114,"endColumn":94,"fix":{"range":[3540,3567],"text":"\n ast.declaration,\n moduleName\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·importModules,·MUTATION_TYPES,·ACTION_TYPES,` with `⏎········importModules,⏎········MUTATION_TYPES,⏎········ACTION_TYPES,⏎·······`","line":130,"column":17,"nodeType":null,"messageId":"replace","endLine":130,"endColumn":62,"fix":{"range":[3935,3980],"text":"\n importModules,\n MUTATION_TYPES,\n ACTION_TYPES,\n "}}],"errorCount":8,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":8,"fixableWarningCount":0,"source":"import { parser, winPath } from '@fesjs/utils';\nimport { readdirSync, readFileSync, statSync } from 'fs';\nimport { join } from 'path';\n\n/**\n * 获取文件夹所有JS文件路径\n * @param {string} dir\n */\nfunction getDirFilePaths(dir) {\n const dirs = readdirSync(dir);\n let pathList = [];\n for (const name of dirs) {\n const path = winPath(join(dir, name));\n const info = statSync(path);\n if (info.isDirectory()) {\n pathList = pathList.concat(getDirFilePaths(path));\n } else if (path.endsWith('.js')) {\n pathList.push(path);\n }\n }\n return pathList;\n}\n\n/**\n * 路径转驼峰\n * @param {*} path\n */\nfunction pathToHump(path, root) {\n return path.replace(root, '')\n .replace('.js', '')\n .replace(RegExp('(/|\\\\.|-|_)\\\\S', 'g'), text => text[1].toUpperCase())\n .replace(/\\S/, text => text.toLowerCase());\n}\n\n/**\n * 获取vuex模块的mutations、actions、getters类型\n * @param {*} ast\n * @param {*} name\n */\nfunction getModelTypes(ast, name, namespace = '') {\n const types = {\n mutations: {},\n actions: {},\n getters: {}\n };\n let namespaced = false;\n if (ast.type !== 'ObjectExpression') return types;\n ast.properties.forEach((node) => {\n if (node.key.name === 'namespaced' && node.value.value) {\n namespaced = true;\n return;\n }\n if (Object.keys(types).includes(node.key.name)) {\n let type = types[node.key.name];\n if (namespaced) {\n type = types[node.key.name][name];\n if (!type) {\n // eslint-disable-next-line no-multi-assign\n type = types[node.key.name][name] = {};\n }\n }\n node.value.properties.forEach((prop) => {\n const key = prop.key && prop.key.name;\n if (key) {\n type[key] = `${namespace}${namespaced ? `${name}/` : ''}${key}`;\n }\n });\n return;\n }\n if (node.key.name === 'modules') {\n node.value.properties.forEach((prop) => {\n const subTypes = getModelTypes(prop.value, prop.key.name, `${namespace}${namespaced ? `${name}/` : ''}`);\n Object.keys(types).forEach((key) => {\n if (namespaced) {\n types[key][name] = {\n ...subTypes[key],\n ...types[key][name]\n };\n } else {\n types[key] = {\n ...subTypes[key],\n ...types[key]\n };\n }\n });\n });\n }\n });\n return types;\n}\n\n/**\n * 解析模块\n * @param {*} paths\n * @param {*} root\n */\nfunction parseModel(paths = [], root) {\n const modules = [];\n const importModules = [];\n let MUTATION_TYPES = {};\n let ACTION_TYPES = {};\n let GETTER_TYPES = {};\n paths.forEach((path) => {\n const moduleName = pathToHump(path, root);\n importModules.push(`import ${moduleName} from '${path}'`);\n modules.push(moduleName);\n const content = readFileSync(path).toString('utf-8');\n let ast = parser.parse(content, {\n sourceType: 'module',\n plugins: ['jsx', 'typescript']\n });\n ast = ast.program.body.filter(body => body.type === 'ExportDefaultDeclaration')[0];\n if (ast) {\n const { mutations, actions, getters } = getModelTypes(ast.declaration, moduleName);\n MUTATION_TYPES = {\n ...mutations,\n ...MUTATION_TYPES\n };\n ACTION_TYPES = {\n ...actions,\n ...ACTION_TYPES\n };\n GETTER_TYPES = {\n ...getters,\n ...GETTER_TYPES\n };\n }\n });\n return {\n modules, importModules, MUTATION_TYPES, ACTION_TYPES, GETTER_TYPES\n };\n}\n\nfunction parsePlugin(paths = [], root) {\n const plugins = [];\n const importPlugins = [];\n paths.forEach((path) => {\n const moduleName = pathToHump(path, root);\n importPlugins.push(`import ${moduleName} from '${path}'`);\n plugins.push(moduleName);\n });\n return { plugins, importPlugins };\n}\n\nexport function parseStore(root) {\n const paths = getDirFilePaths(root);\n const modelPaths = [];\n const pluginPaths = [];\n paths.forEach((path) => {\n if (path.indexOf('plugin') > -1) {\n pluginPaths.push(path);\n } else {\n modelPaths.push(path);\n }\n });\n return {\n ...parsePlugin(pluginPaths, root),\n ...parseModel(modelPaths, root)\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-vuex/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(paths.absSrcPath,·api.config.singular·?·'store'·:·'stores')` with `⏎············join(paths.absSrcPath,·api.config.singular·?·'store'·:·'stores')⏎········`","line":27,"column":30,"nodeType":null,"messageId":"replace","endLine":27,"endColumn":94,"fix":{"range":[669,733],"text":"\n join(paths.absSrcPath, api.config.singular ? 'store' : 'stores')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'MUTATION_TYPES',·'ACTION_TYPES',·'GETTER_TYPES',·'store'` with `⏎················'MUTATION_TYPES',⏎················'ACTION_TYPES',⏎················'GETTER_TYPES',⏎················'store'⏎············`","line":57,"column":26,"nodeType":null,"messageId":"replace","endLine":57,"endColumn":83,"fix":{"range":[1831,1888],"text":"\n 'MUTATION_TYPES',\n 'ACTION_TYPES',\n 'GETTER_TYPES',\n 'store'\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { winPath } from '@fesjs/utils';\nimport { parseStore } from './helper';\n\nconst namespace = 'plugin-vuex';\n\nexport default (api) => {\n const {\n paths,\n utils: { Mustache }\n } = api;\n\n api.describe({\n key: 'vuex',\n config: {\n schema(joi) {\n return joi.object();\n },\n onChange: api.ConfigChangeType.regenerateTmpFiles\n }\n });\n\n const absCoreFilePath = join(namespace, 'core.js');\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n api.onGenerateFiles(() => {\n const root = winPath(join(paths.absSrcPath, api.config.singular ? 'store' : 'stores'));\n const store = parseStore(root);\n const vuexConfig = api.config.vuex || {};\n // 文件写出\n api.writeTmpFile({\n path: absCoreFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'runtime/core.tpl'), 'utf-8'),\n {\n IMPORT_MODULES: store.importModules.join('\\n'),\n IMPORT_PLUGINS: store.importPlugins.join('\\n'),\n MODULES: `{ ${store.modules.join(', ')} }`,\n PLUGINS: `[${store.plugins.join(', ')}]`,\n MUTATION_TYPES: JSON.stringify(store.MUTATION_TYPES),\n ACTION_TYPES: JSON.stringify(store.ACTION_TYPES),\n GETTER_TYPES: JSON.stringify(store.GETTER_TYPES),\n VUEX_CONFIG: JSON.stringify(vuexConfig)\n }\n )\n });\n\n api.copyTmpFiles({\n namespace,\n path: join(__dirname, 'runtime'),\n ignore: ['.tpl']\n });\n });\n\n api.addPluginExports(() => [\n {\n specifiers: ['MUTATION_TYPES', 'ACTION_TYPES', 'GETTER_TYPES', 'store'],\n source: absCoreFilePath\n }\n ]);\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-vuex/src/runtime/runtime.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-windicss/.fatherrc.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-windicss/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":"Delete `⏎`","line":3,"column":32,"nodeType":null,"messageId":"delete","endLine":4,"endColumn":1,"fix":{"range":[93,94],"text":""}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nimport WindiCSSWebpackPlugin from 'windicss-webpack-plugin';\nimport { resolve } from 'path';\n\n\nexport default (api) => {\n api.describe({\n key: 'windicss',\n config: {\n schema(joi) {\n return joi.object();\n },\n default: {}\n }\n });\n\n api.addEntryImportsAhead(() => [{ source: 'windi.css' }]);\n\n api.chainWebpack((memo) => {\n memo.plugin('windicss').use(WindiCSSWebpackPlugin, [\n {\n config: resolve(__dirname, '../windi.config.js'),\n ...api.config.windicss\n }\n ]);\n return memo;\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-plugin-windicss/windi.config.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'./plugins/generateFiles/core/exports/pluginExports'` with `⏎················'./plugins/generateFiles/core/exports/pluginExports'⏎············`","line":10,"column":29,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":81,"fix":{"range":[359,411],"text":"\n './plugins/generateFiles/core/exports/pluginExports'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":49,"column":67,"nodeType":null,"messageId":"delete","endLine":50,"endColumn":1,"fix":{"range":[2751,2752],"text":""}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"export default function () {\n return {\n plugins: [\n // register methods\n require.resolve('./plugins/registerMethods'),\n\n // generate files\n require.resolve('./plugins/generateFiles/core/plugin'),\n require.resolve('./plugins/generateFiles/core/exports/coreExports'),\n require.resolve('./plugins/generateFiles/core/exports/pluginExports'),\n require.resolve('./plugins/generateFiles/fes'),\n\n // bundle configs\n require.resolve('./plugins/features/alias'),\n require.resolve('./plugins/features/analyze'),\n require.resolve('./plugins/features/autoprefixer'),\n require.resolve('./plugins/features/base'),\n require.resolve('./plugins/features/babelPluginImport'),\n require.resolve('./plugins/features/chainWebpack'),\n require.resolve('./plugins/features/cssLoader'),\n require.resolve('./plugins/features/copy'),\n require.resolve('./plugins/features/define'),\n require.resolve('./plugins/features/devScripts'),\n require.resolve('./plugins/features/devServer'),\n require.resolve('./plugins/features/devtool'),\n require.resolve('./plugins/features/externals'),\n require.resolve('./plugins/features/extraBabelPlugins'),\n require.resolve('./plugins/features/extraBabelPresets'),\n require.resolve('./plugins/features/extraPostCSSPlugins'),\n require.resolve('./plugins/features/html'),\n require.resolve('./plugins/features/globalCSS'),\n require.resolve('./plugins/features/inlineLimit'),\n require.resolve('./plugins/features/lessLoader'),\n require.resolve('./plugins/features/mountElementId'),\n require.resolve('./plugins/features/outputPath'),\n require.resolve('./plugins/features/plugins'),\n require.resolve('./plugins/features/postcssLoader'),\n require.resolve('./plugins/features/proxy'),\n require.resolve('./plugins/features/publicPath'),\n require.resolve('./plugins/features/singular'),\n require.resolve('./plugins/features/targets'),\n require.resolve('./plugins/features/terserOptions'),\n require.resolve('./plugins/features/nodeModulesTransform'),\n require.resolve('./plugins/features/vueLoader'),\n require.resolve('./plugins/features/mock'),\n require.resolve('./plugins/features/dynamicImport'),\n require.resolve('./plugins/features/runtimePublicPath'),\n require.resolve('./plugins/features/exportStatic'),\n require.resolve('./plugins/features/checkVuePackage'),\n\n\n // misc\n require.resolve('./plugins/misc/route'),\n\n // commands\n require.resolve('./plugins/commands/build'),\n require.resolve('./plugins/commands/dev'),\n require.resolve('./plugins/commands/help'),\n require.resolve('./plugins/commands/info'),\n require.resolve('./plugins/commands/webpack')\n ]\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/buildDevUtils.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····api⏎` with `·api·`","line":12,"column":44,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":1,"fix":{"range":[402,411],"text":" api "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":67,"column":1,"nodeType":null,"messageId":"delete","endLine":68,"endColumn":1,"fix":{"range":[2299,2300],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎········`","line":69,"column":16,"nodeType":null,"messageId":"delete","endLine":70,"endColumn":9,"fix":{"range":[2326,2335],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎········`","line":77,"column":16,"nodeType":null,"messageId":"delete","endLine":78,"endColumn":9,"fix":{"range":[2555,2564],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····absTmpPath⏎` with `·absTmpPath·`","line":84,"column":42,"nodeType":null,"messageId":"replace","endLine":86,"endColumn":1,"fix":{"range":[2648,2664],"text":" absTmpPath "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `val` with `(val)`","line":125,"column":18,"nodeType":null,"messageId":"replace","endLine":125,"endColumn":21,"fix":{"range":[3785,3788],"text":"(val)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `val` with `(val)`","line":126,"column":19,"nodeType":null,"messageId":"replace","endLine":126,"endColumn":22,"fix":{"range":[3829,3832],"text":"(val)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":128,"column":33,"nodeType":null,"messageId":"insert","endLine":128,"endColumn":33,"fix":{"range":[3889,3889],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":129,"column":9,"nodeType":null,"messageId":"insert","endLine":129,"endColumn":9,"fix":{"range":[3911,3911],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":130,"column":1,"nodeType":null,"messageId":"replace","endLine":130,"endColumn":9,"fix":{"range":[3942,3950],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":131,"column":1,"nodeType":null,"messageId":"insert","endLine":131,"endColumn":1,"fix":{"range":[3982,3982],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":132,"column":9,"nodeType":null,"messageId":"insert","endLine":132,"endColumn":9,"fix":{"range":[4049,4049],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":133,"column":13,"nodeType":null,"messageId":"insert","endLine":133,"endColumn":13,"fix":{"range":[4101,4101],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":134,"column":1,"nodeType":null,"messageId":"replace","endLine":134,"endColumn":13,"fix":{"range":[4131,4143],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":135,"column":1,"nodeType":null,"messageId":"insert","endLine":135,"endColumn":1,"fix":{"range":[4173,4173],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":136,"column":1,"nodeType":null,"messageId":"replace","endLine":136,"endColumn":9,"fix":{"range":[4248,4256],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":137,"column":13,"nodeType":null,"messageId":"insert","endLine":137,"endColumn":13,"fix":{"range":[4277,4277],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":138,"column":1,"nodeType":null,"messageId":"insert","endLine":138,"endColumn":1,"fix":{"range":[4283,4283],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":139,"column":9,"nodeType":null,"messageId":"insert","endLine":139,"endColumn":9,"fix":{"range":[4338,4338],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":140,"column":1,"nodeType":null,"messageId":"insert","endLine":140,"endColumn":1,"fix":{"range":[4341,4341],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎········`","line":172,"column":10,"nodeType":null,"messageId":"delete","endLine":173,"endColumn":9,"fix":{"range":[5271,5280],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `························`","line":176,"column":1,"nodeType":null,"messageId":"replace","endLine":176,"endColumn":17,"fix":{"range":[5530,5546],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `getGzippedSize(asset))` with `········getGzippedSize(asset)⏎····················)⏎················`","line":177,"column":17,"nodeType":null,"messageId":"replace","endLine":177,"endColumn":39,"fix":{"range":[5584,5606],"text":" getGzippedSize(asset)\n )\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":178,"column":28,"nodeType":null,"messageId":"insert","endLine":178,"endColumn":28,"fix":{"range":[5635,5635],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":179,"column":7,"nodeType":null,"messageId":"delete","endLine":180,"endColumn":1,"fix":{"range":[5644,5645],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `asset` with `(asset)`","line":188,"column":29,"nodeType":null,"messageId":"replace","endLine":188,"endColumn":34,"fix":{"range":[5815,5820],"text":"(asset)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":189,"column":1,"nodeType":null,"messageId":"insert","endLine":189,"endColumn":1,"fix":{"range":[5844,5844],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":190,"column":1,"nodeType":null,"messageId":"insert","endLine":190,"endColumn":1,"fix":{"range":[5890,5890],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'The·bundle·size·is·significantly·larger·than·recommended.'` with `⏎················'The·bundle·size·is·significantly·larger·than·recommended.'⏎············`","line":193,"column":26,"nodeType":null,"messageId":"replace","endLine":193,"endColumn":85,"fix":{"range":[5985,6044],"text":"\n 'The bundle size is significantly larger than recommended.'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············chalk.yellow(⏎················'Consider·reducing·it·with·code·splitting'⏎············)⏎········` with `chalk.yellow('Consider·reducing·it·with·code·splitting')`","line":195,"column":21,"nodeType":null,"messageId":"replace","endLine":199,"endColumn":9,"fix":{"range":[6077,6185],"text":"chalk.yellow('Consider reducing it with code splitting')"}}],"errorCount":30,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":30,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/buildDevUtils.ts\n */\n\nimport { join, resolve } from 'path';\nimport { existsSync, readdirSync, readFileSync } from 'fs';\nimport { rimraf, chalk } from '@fesjs/utils';\nimport zlib from 'zlib';\nimport getConfig from './webpackConfig';\n\nexport async function getBundleAndConfigs({\n api\n}) {\n // get config\n const env = api.env === 'production' ? 'production' : 'development';\n const getConfigOpts = await api.applyPlugins({\n type: api.ApplyPluginsType.modify,\n key: 'modifyBundleConfigOpts',\n initialValue: {\n cwd: api.paths.cwd,\n config: api.config,\n env,\n entry: {\n index: join(api.paths.absTmpPath, 'fes.js')\n },\n // @ts-ignore\n async modifyBabelOpts(opts) {\n return api.applyPlugins({\n type: api.ApplyPluginsType.modify,\n key: 'modifyBabelOpts',\n initialValue: opts\n });\n },\n async modifyBabelPresetOpts(opts) {\n return api.applyPlugins({\n type: api.ApplyPluginsType.modify,\n key: 'modifyBabelPresetOpts',\n initialValue: opts\n });\n },\n async chainWebpack(webpackConfig, opts) {\n return api.applyPlugins({\n type: api.ApplyPluginsType.modify,\n key: 'chainWebpack',\n initialValue: webpackConfig,\n args: {\n ...opts\n }\n });\n },\n async headScripts() {\n return api.applyPlugins({\n key: 'addHTMLHeadScripts',\n type: api.ApplyPluginsType.add,\n initialState: []\n });\n },\n publicPath: await api.applyPlugins({\n key: 'modifyPublicPathStr',\n type: api.ApplyPluginsType.modify,\n initialValue: api.config.publicPath || '',\n args: {\n // route: args.route\n }\n })\n\n },\n args: {\n }\n });\n\n const bundleConfig = await api.applyPlugins({\n type: api.ApplyPluginsType.modify,\n key: 'modifyBundleConfig',\n initialValue: await getConfig({ api, ...getConfigOpts }),\n args: {\n }\n });\n\n return { bundleConfig };\n}\n\nexport function cleanTmpPathExceptCache({\n absTmpPath\n}) {\n if (!existsSync(absTmpPath)) return;\n readdirSync(absTmpPath).forEach((file) => {\n if (file === '.cache') return;\n rimraf.sync(join(absTmpPath, file));\n });\n}\n\n// These sizes are pretty large. We'll warn for bundles exceeding them.\nconst WARN_AFTER_BUNDLE_GZIP_SIZE = 1.8 * 1024 * 1024;\nconst WARN_AFTER_CHUNK_GZIP_SIZE = 1 * 1024 * 1024;\n\nexport function printFileSizes(stats, dir) {\n const ui = require('cliui')({ width: 80 });\n const json = stats.toJson({\n hash: false,\n modules: false,\n chunks: false\n });\n\n const filesize = (bytes) => {\n bytes = Math.abs(bytes);\n const radix = 1024;\n const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n let loop = 0;\n\n // calculate\n while (bytes >= radix) {\n bytes /= radix;\n ++loop;\n }\n return `${bytes.toFixed(1)} ${unit[loop]}`;\n };\n\n const assets = json.assets\n ? json.assets\n : json?.children?.reduce((acc, child) => acc.concat(child?.assets), []);\n\n const seenNames = new Map();\n const isJS = val => /\\.js$/.test(val);\n const isCSS = val => /\\.css$/.test(val);\n\n const orderedAssets = assets.map((a) => {\n a.name = a.name.split('?')[0];\n // These sizes are pretty large\n const isMainBundle = a.name.indexOf('fes.') === 0;\n const maxRecommendedSize = isMainBundle\n ? WARN_AFTER_BUNDLE_GZIP_SIZE\n : WARN_AFTER_CHUNK_GZIP_SIZE;\n const isLarge = maxRecommendedSize && a.size > maxRecommendedSize;\n return {\n ...a,\n suggested: isLarge && isJS(a.name)\n };\n })\n .filter((a) => {\n if (seenNames.has(a.name)) {\n return false;\n }\n seenNames.set(a.name, true);\n return isJS(a.name) || isCSS(a.name);\n })\n .sort((a, b) => {\n if (isJS(a.name) && isCSS(b.name)) return -1;\n if (isCSS(a.name) && isJS(b.name)) return 1;\n return b.size - a.size;\n });\n\n function getGzippedSize(asset) {\n const filepath = resolve(join(dir, asset.name));\n if (existsSync(filepath)) {\n const buffer = readFileSync(filepath);\n return filesize(zlib.gzipSync(buffer).length);\n }\n return filesize(0);\n }\n\n function makeRow(a, b, c) {\n return ` ${a}\\t ${b}\\t ${c}`;\n }\n\n ui.div(\n `${makeRow(\n chalk.cyan.bold('File'),\n chalk.cyan.bold('Size'),\n chalk.cyan.bold('Gzipped')\n )\n }\\n\\n${\n // eslint-disable-next-line\n orderedAssets.map(asset => makeRow(/js$/.test(asset.name) ? (asset.suggested ? chalk.yellow(join(dir, asset.name)) : chalk.green(join(dir, asset.name))) : chalk.blue(join(dir, asset.name)),\n filesize(asset.size),\n getGzippedSize(asset)))\n .join('\\n')}`\n );\n\n\n console.log(\n `${ui.toString()}\\n\\n ${chalk.gray(\n 'Images and other types of assets omitted.'\n )}\\n`\n );\n\n if (orderedAssets?.some(asset => asset.suggested)) {\n // We'll warn for bundles exceeding them.\n // TODO: use umi docs\n console.log();\n console.log(\n chalk.yellow('The bundle size is significantly larger than recommended.')\n );\n console.log(\n chalk.yellow(\n 'Consider reducing it with code splitting'\n )\n );\n console.log(\n chalk.yellow(\n 'You can also analyze the project dependencies using ANALYZE=1'\n )\n );\n console.log();\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/dev/createRouteMiddleware.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 `api` with `(api)`","line":7,"column":16,"nodeType":null,"messageId":"replace","endLine":7,"endColumn":19,"fix":{"range":[190,193],"text":"(api)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `proxyConfig·&&·Object.keys(proxyConfig).some(path·=>·req.path.startsWith(path))` with `⏎········proxyConfig·&&⏎········Object.keys(proxyConfig).some((path)·=>·req.path.startsWith(path))⏎····`","line":9,"column":9,"nodeType":null,"messageId":"replace","endLine":9,"endColumn":88,"fix":{"range":[269,348],"text":"\n proxyConfig &&\n Object.keys(proxyConfig).some((path) => req.path.startsWith(path))\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"\nimport { extname, join } from 'path';\nimport historyFallback from 'connect-history-api-fallback';\n\nconst ASSET_EXTNAMES = ['.ico', '.png', '.jpg', '.jpeg', '.gif', '.svg'];\n\nexport default api => (req, res, next) => {\n const proxyConfig = api.config.proxy;\n if (proxyConfig && Object.keys(proxyConfig).some(path => req.path.startsWith(path))) {\n return next();\n }\n if (req.path === '/favicon.ico') {\n return res.sendFile(join(__dirname, 'fes.png'));\n }\n if (ASSET_EXTNAMES.includes(extname(req.path))) {\n return next();\n }\n const history = historyFallback();\n history(req, res, next);\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/dev/devServer.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":6,"column":1,"nodeType":null,"messageId":"delete","endLine":7,"endColumn":1,"fix":{"range":[129,130],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path.resolve(__dirname,·'./cert/key.pem')` with `⏎············path.resolve(__dirname,·'./cert/key.pem')⏎········`","line":46,"column":39,"nodeType":null,"messageId":"replace","endLine":46,"endColumn":80,"fix":{"range":[1114,1155],"text":"\n path.resolve(__dirname, './cert/key.pem')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path.resolve(__dirname,·'./cert/cert.pem')` with `⏎············path.resolve(__dirname,·'./cert/cert.pem')⏎········`","line":47,"column":40,"nodeType":null,"messageId":"replace","endLine":47,"endColumn":82,"fix":{"range":[1197,1239],"text":"\n path.resolve(__dirname, './cert/cert.pem')\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import WebpackDevServer from 'webpack-dev-server';\nimport webpack from 'webpack';\nimport fs from 'fs';\nimport path from 'path';\n\n\nexport function startDevServer({\n webpackConfig,\n host,\n port,\n proxy,\n https,\n beforeMiddlewares,\n afterMiddlewares,\n customerDevServerConfig\n}) {\n const options = {\n contentBase: webpackConfig.output.path,\n hot: true,\n host,\n sockHost: host,\n sockPort: port,\n proxy,\n compress: true,\n noInfo: true,\n disableHostCheck: true,\n clientLogLevel: 'silent',\n stats: 'errors-only',\n before: (app) => {\n beforeMiddlewares.forEach((middleware) => {\n app.use(middleware);\n });\n },\n after: (app) => {\n afterMiddlewares.forEach((middleware) => {\n app.use(middleware);\n });\n },\n headers: {\n 'access-control-allow-origin': '*'\n },\n ...(customerDevServerConfig || {})\n };\n if (https) {\n options.https = true;\n options.key = fs.readFileSync(path.resolve(__dirname, './cert/key.pem'));\n options.cert = fs.readFileSync(path.resolve(__dirname, './cert/cert.pem'));\n }\n WebpackDevServer.addDevServerEntrypoints(webpackConfig, options);\n const compiler = webpack(webpackConfig);\n const server = new WebpackDevServer(compiler, options);\n\n server.listen(port, host, (err) => {\n if (err) {\n console.error(err);\n }\n });\n return server;\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/dev/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":30,"column":19,"nodeType":null,"messageId":"insert","endLine":30,"endColumn":19,"fix":{"range":[635,635],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":31,"column":1,"nodeType":null,"messageId":"insert","endLine":31,"endColumn":1,"fix":{"range":[637,637],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":32,"column":1,"nodeType":null,"messageId":"insert","endLine":32,"endColumn":1,"fix":{"range":[665,665],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········},` with `············},⏎···········`","line":33,"column":1,"nodeType":null,"messageId":"replace","endLine":33,"endColumn":11,"fix":{"range":[721,731],"text":" },\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":34,"column":1,"nodeType":null,"messageId":"insert","endLine":34,"endColumn":1,"fix":{"range":[734,734],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":35,"column":1,"nodeType":null,"messageId":"insert","endLine":35,"endColumn":1,"fix":{"range":[763,763],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········}` with `············}⏎········`","line":36,"column":1,"nodeType":null,"messageId":"replace","endLine":36,"endColumn":10,"fix":{"range":[827,836],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":43,"column":42,"nodeType":null,"messageId":"insert","endLine":43,"endColumn":42,"fix":{"range":[1111,1111],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":44,"column":34,"nodeType":null,"messageId":"insert","endLine":44,"endColumn":34,"fix":{"range":[1189,1189],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":47,"column":32,"nodeType":null,"messageId":"insert","endLine":47,"endColumn":32,"fix":{"range":[1327,1327],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···············`","line":51,"column":23,"nodeType":null,"messageId":"insert","endLine":51,"endColumn":23,"fix":{"range":[1557,1557],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `chalk.cyan(`Starting·the·development·server·${isHTTPS·?·'https'·:·'http'}://${hostname}:${port}·...`)` with `⏎················chalk.cyan(⏎····················`Starting·the·development·server·${⏎························isHTTPS·?·'https'·:·'http'⏎····················}://${hostname}:${port}·...`⏎················)⏎············`","line":61,"column":25,"nodeType":null,"messageId":"replace","endLine":61,"endColumn":126,"fix":{"range":[1838,1939],"text":"\n chalk.cyan(\n `Starting the development server ${\n isHTTPS ? 'https' : 'http'\n }://${hostname}:${port} ...`\n )\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `p` with `(p)`","line":95,"column":42,"nodeType":null,"messageId":"replace","endLine":95,"endColumn":43,"fix":{"range":[3233,3234],"text":"(p)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···································`","line":106,"column":53,"nodeType":null,"messageId":"insert","endLine":106,"endColumn":53,"fix":{"range":[3793,3793],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·===`","line":108,"column":45,"nodeType":null,"messageId":"insert","endLine":108,"endColumn":45,"fix":{"range":[3919,3919],"text":" ==="}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·===`","line":109,"column":36,"nodeType":null,"messageId":"delete","endLine":109,"endColumn":40,"fix":{"range":[3955,3959],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":114,"column":46,"nodeType":null,"messageId":"insert","endLine":114,"endColumn":46,"fix":{"range":[4215,4215],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":115,"column":36,"nodeType":null,"messageId":"delete","endLine":115,"endColumn":39,"fix":{"range":[4251,4254],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···································`","line":134,"column":57,"nodeType":null,"messageId":"insert","endLine":134,"endColumn":57,"fix":{"range":[5150,5150],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `fn` with `(fn)`","line":143,"column":49,"nodeType":null,"messageId":"replace","endLine":143,"endColumn":51,"fix":{"range":[5541,5543],"text":"(fn)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `...beforeMiddlewares,·createRouteMiddleware(api)` with `⏎····················...beforeMiddlewares,⏎····················createRouteMiddleware(api)⏎················`","line":179,"column":37,"nodeType":null,"messageId":"replace","endLine":179,"endColumn":85,"fix":{"range":[6802,6850],"text":"\n ...beforeMiddlewares,\n createRouteMiddleware(api)\n "}}],"errorCount":21,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":21,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/dev/dev.ts\n */\n\nconst assert = require('assert');\n\nexport default (api) => {\n const {\n env,\n paths,\n utils: { chalk, portfinder }\n } = api;\n\n const unwatchs = [];\n let port;\n let hostname;\n let server;\n\n function destroy() {\n for (const unwatch of unwatchs) {\n unwatch();\n }\n server?.close();\n }\n\n api.registerCommand({\n command: 'dev',\n description: 'start a local http service for development',\n options: [{\n name: '--port',\n description: 'http service port, like 8080'\n }, {\n name: '--https',\n description: 'whether to turn on the https service'\n }],\n async fn({ args = {} }) {\n const {\n cleanTmpPathExceptCache,\n getBundleAndConfigs\n } = require('../buildDevUtils');\n const { delay } = require('@fesjs/utils');\n const createRouteMiddleware = require('./createRouteMiddleware').default;\n const generateFiles = require('../../../utils/generateFiles').default;\n const { watchPkg } = require('./watchPkg');\n\n const defaultPort = process.env.PORT || args.port || api.config.devServer?.port;\n port = await portfinder.getPortPromise({\n port: defaultPort ? parseInt(String(defaultPort), 10) : 8000\n });\n hostname = process.env.HOST || api.config.devServer?.host || 'localhost';\n\n process.send({\n type: 'UPDATE_PORT',\n port\n });\n\n // enable https\n const isHTTPS = process.env.HTTPS || args.https;\n\n console.log(chalk.cyan(`Starting the development server ${isHTTPS ? 'https' : 'http'}://${hostname}:${port} ...`));\n\n cleanTmpPathExceptCache({\n absTmpPath: paths.absTmpPath\n });\n const watch = process.env.WATCH !== 'none';\n\n // generate files\n const unwatchGenerateFiles = await generateFiles({\n api,\n watch\n });\n if (unwatchGenerateFiles) unwatchs.push(unwatchGenerateFiles);\n\n if (watch) {\n // watch pkg changes\n const unwatchPkg = watchPkg({\n cwd: api.cwd,\n onChange() {\n console.log();\n api.logger.info('Plugins in package.json changed.');\n api.restartServer();\n }\n });\n unwatchs.push(unwatchPkg);\n\n // watch config change\n const unwatchConfig = api.service.configInstance.watch({\n userConfig: api.service.userConfig,\n onChange: async ({ pluginChanged, valueChanged }) => {\n if (pluginChanged.length) {\n console.log();\n api.logger.info(\n `Plugins of ${pluginChanged\n .map(p => p.key)\n .join(', ')} changed.`\n );\n api.restartServer();\n }\n if (valueChanged.length) {\n let reload = false;\n let regenerateTmpFiles = false;\n const fns = [];\n const reloadConfigs = [];\n valueChanged.forEach(({ key, pluginId }) => {\n const { onChange } = api.service.plugins[pluginId].config || {};\n if (\n onChange\n === api.ConfigChangeType.regenerateTmpFiles\n ) {\n regenerateTmpFiles = true;\n }\n if (\n !onChange\n || onChange === api.ConfigChangeType.reload\n ) {\n reload = true;\n reloadConfigs.push(key);\n }\n if (typeof onChange === 'function') {\n fns.push(onChange);\n }\n });\n\n if (reload) {\n console.log();\n api.logger.info(\n `Config ${reloadConfigs.join(\n ', '\n )} changed.`\n );\n api.restartServer();\n } else {\n api.service.userConfig = api.service.configInstance.getUserConfig();\n\n await api.setConfig();\n\n if (regenerateTmpFiles) {\n await generateFiles({\n api\n });\n } else {\n fns.forEach(fn => fn());\n }\n }\n }\n }\n });\n unwatchs.push(unwatchConfig);\n }\n\n // delay dev server 启动,避免重复 compile\n // https://github.com/webpack/watchpack/issues/25\n // https://github.com/yessky/webpack-mild-compile\n await delay(500);\n\n // dev\n const { bundleConfig } = await getBundleAndConfigs({ api });\n\n const beforeMiddlewares = await api.applyPlugins({\n key: 'addBeforeMiddlewares',\n type: api.ApplyPluginsType.add,\n initialValue: [],\n args: {}\n });\n const middlewares = await api.applyPlugins({\n key: 'addMiddlewares',\n type: api.ApplyPluginsType.add,\n initialValue: [],\n args: {}\n });\n const { startDevServer } = require('./devServer');\n server = startDevServer({\n webpackConfig: bundleConfig,\n host: hostname,\n port,\n proxy: api.config.proxy,\n https: isHTTPS,\n beforeMiddlewares: [...beforeMiddlewares, createRouteMiddleware(api)],\n afterMiddlewares: [...middlewares],\n customerDevServerConfig: api.config.devServer\n });\n return {\n destroy\n };\n }\n });\n\n api.registerMethod({\n name: 'getPort',\n fn() {\n assert(\n env === 'development',\n 'api.getPort() is only valid in development.'\n );\n return port;\n }\n });\n\n api.registerMethod({\n name: 'getHostname',\n fn() {\n assert(\n env === 'development',\n 'api.getHostname() is only valid in development.'\n );\n return hostname;\n }\n });\n\n api.registerMethod({\n name: 'getServer',\n fn() {\n assert(\n env === 'development',\n 'api.getServer() is only valid in development.'\n );\n return server;\n }\n });\n\n api.registerMethod({\n name: 'restartServer',\n fn() {\n console.log(chalk.gray('Try to restart dev server...'));\n destroy();\n process.send({\n type: 'RESTART'\n });\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/dev/watchPkg.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `name·=>·(` with `⏎········(name)·=>`","line":15,"column":15,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":24,"fix":{"range":[483,492],"text":"\n (name) =>"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `isPluginOrPreset(PluginType.plugin,·name)` with `····isPluginOrPreset(PluginType.plugin,·name)·||`","line":16,"column":9,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":50,"fix":{"range":[501,542],"text":" isPluginOrPreset(PluginType.plugin, name) ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `||` with `···`","line":17,"column":9,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":11,"fix":{"range":[551,553],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `)`","line":18,"column":5,"nodeType":null,"messageId":"delete","endLine":18,"endColumn":6,"fix":{"range":[600,601],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `watchPkg({·cwd:·process.cwd(),·onChange:·opts.onChange·})` with `⏎············watchPkg({·cwd:·process.cwd(),·onChange:·opts.onChange·})⏎········`","line":54,"column":23,"nodeType":null,"messageId":"replace","endLine":54,"endColumn":80,"fix":{"range":[1564,1621],"text":"\n watchPkg({ cwd: process.cwd(), onChange: opts.onChange })\n "}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":5,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/preset-built-in/src/plugins/commands/dev/watchPkg.ts\n */\n\nimport { join } from 'path';\nimport { chokidar, winPath, lodash } from '@fesjs/utils';\nimport { existsSync, readFileSync } from 'fs';\nimport { isPluginOrPreset, PluginType } from '@fesjs/compiler';\n\nfunction getPlugins(opts) {\n return Object.keys({\n ...opts.pkg.dependencies,\n ...opts.pkg.devDependencies\n }).filter(name => (\n isPluginOrPreset(PluginType.plugin, name)\n || isPluginOrPreset(PluginType.preset, name)\n ));\n}\n\nfunction getPluginsFromPkgPath(opts) {\n let pkg = {};\n if (existsSync(opts.pkgPath)) {\n try {\n pkg = JSON.parse(readFileSync(opts.pkgPath, 'utf-8'));\n } catch (e) {\n // ignore\n }\n }\n return getPlugins({ pkg });\n}\n\nexport function watchPkg(opts) {\n const pkgPath = join(opts.cwd, 'package.json');\n const plugins = getPluginsFromPkgPath({ pkgPath });\n const watcher = chokidar.watch(pkgPath, {\n ignoreInitial: true\n });\n watcher.on('all', () => {\n const newPlugins = getPluginsFromPkgPath({ pkgPath });\n if (!lodash.isEqual(plugins, newPlugins)) {\n // 已经重启了,只处理一次就够了\n opts.onChange();\n }\n });\n return () => {\n watcher.close();\n };\n}\n\nexport function watchPkgs(opts) {\n const unwatchs = [watchPkg({ cwd: opts.cwd, onChange: opts.onChange })];\n if (winPath(opts.cwd) !== winPath(process.cwd())) {\n unwatchs.push(watchPkg({ cwd: process.cwd(), onChange: opts.onChange }));\n }\n return () => {\n unwatchs.forEach((unwatch) => {\n unwatch();\n });\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/help/index.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":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\n\nexport default function (api) {\n api.registerCommand({\n command: 'help',\n description: 'show command helps',\n async fn({ program }) {\n program.outputHelp();\n }\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/info/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":"Insert `⏎················`","line":7,"column":38,"nodeType":null,"messageId":"insert","endLine":7,"endColumn":38,"fix":{"range":[217,217],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":8,"column":17,"nodeType":null,"messageId":"insert","endLine":8,"endColumn":17,"fix":{"range":[239,239],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":9,"column":1,"nodeType":null,"messageId":"insert","endLine":9,"endColumn":1,"fix":{"range":[241,241],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `························`","line":10,"column":1,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":21,"fix":{"range":[284,304],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":11,"column":1,"nodeType":null,"messageId":"insert","endLine":11,"endColumn":1,"fix":{"range":[339,339],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `························`","line":12,"column":1,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":21,"fix":{"range":[410,430],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":13,"column":21,"nodeType":null,"messageId":"insert","endLine":13,"endColumn":21,"fix":{"range":[500,500],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":14,"column":1,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":17,"fix":{"range":[534,550],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":15,"column":17,"nodeType":null,"messageId":"insert","endLine":15,"endColumn":17,"fix":{"range":[569,569],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `························`","line":16,"column":1,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":21,"fix":{"range":[571,591],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":17,"column":21,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":21,"fix":{"range":[631,631],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":18,"column":1,"nodeType":null,"messageId":"insert","endLine":18,"endColumn":1,"fix":{"range":[649,649],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":19,"column":17,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":17,"fix":{"range":[700,700],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":20,"column":1,"nodeType":null,"messageId":"insert","endLine":20,"endColumn":1,"fix":{"range":[702,702],"text":" "}}],"errorCount":15,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":15,"fixableWarningCount":0,"source":"\nexport default function (api) {\n api.registerCommand({\n command: 'info',\n description: 'print debugging information about your environment',\n async fn() {\n return require('envinfo').run(\n {\n System: ['OS', 'CPU'],\n Binaries: ['Node', 'Yarn', 'npm'],\n Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],\n npmPackages: ['@fesjs/fes', 'vue', 'vue-router'],\n npmGlobalPackages: ['@fesjs/fes']\n },\n {\n showNotFound: true,\n duplicates: true,\n fullTree: true\n }\n )\n .then(console.log);\n }\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpack/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":5,"column":19,"nodeType":null,"messageId":"insert","endLine":5,"endColumn":19,"fix":{"range":[159,159],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":6,"column":13,"nodeType":null,"messageId":"insert","endLine":6,"endColumn":13,"fix":{"range":[173,173],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":7,"column":1,"nodeType":null,"messageId":"insert","endLine":7,"endColumn":1,"fix":{"range":[200,200],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},` with `····},⏎···········`","line":8,"column":9,"nodeType":null,"messageId":"replace","endLine":8,"endColumn":11,"fix":{"range":[266,268],"text":" },\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":9,"column":1,"nodeType":null,"messageId":"replace","endLine":9,"endColumn":13,"fix":{"range":[271,283],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":10,"column":1,"nodeType":null,"messageId":"insert","endLine":10,"endColumn":1,"fix":{"range":[314,314],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},` with `····},⏎···········`","line":11,"column":9,"nodeType":null,"messageId":"replace","endLine":11,"endColumn":11,"fix":{"range":[375,377],"text":" },\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":12,"column":1,"nodeType":null,"messageId":"insert","endLine":12,"endColumn":1,"fix":{"range":[380,380],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":13,"column":1,"nodeType":null,"messageId":"insert","endLine":13,"endColumn":1,"fix":{"range":[409,409],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},` with `····},⏎···········`","line":14,"column":9,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":11,"fix":{"range":[471,473],"text":" },\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":15,"column":1,"nodeType":null,"messageId":"insert","endLine":15,"endColumn":1,"fix":{"range":[476,476],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":16,"column":1,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":13,"fix":{"range":[507,519],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},` with `····},⏎···········`","line":17,"column":9,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":11,"fix":{"range":[564,566],"text":" },\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":18,"column":1,"nodeType":null,"messageId":"insert","endLine":18,"endColumn":1,"fix":{"range":[569,569],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":19,"column":1,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":1,"fix":{"range":[600,600],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎········`","line":20,"column":9,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":10,"fix":{"range":[676,677],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `r` with `(r)`","line":33,"column":21,"nodeType":null,"messageId":"replace","endLine":33,"endColumn":22,"fix":{"range":[1236,1237],"text":"(r)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `p` with `(p)`","line":37,"column":21,"nodeType":null,"messageId":"replace","endLine":37,"endColumn":22,"fix":{"range":[1401,1402],"text":"(p)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `r` with `(r)`","line":40,"column":50,"nodeType":null,"messageId":"replace","endLine":40,"endColumn":51,"fix":{"range":[1548,1549],"text":"(r)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `p` with `(p)`","line":43,"column":21,"nodeType":null,"messageId":"replace","endLine":43,"endColumn":22,"fix":{"range":[1679,1680],"text":"(p)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `highlight(toString(config,·{·verbose:·options.verbose·}),·{·language:·'js'·})` with `⏎················highlight(toString(config,·{·verbose:·options.verbose·}),·{⏎····················language:·'js'⏎················})⏎············`","line":47,"column":25,"nodeType":null,"messageId":"replace","endLine":47,"endColumn":102,"fix":{"range":[1779,1856],"text":"\n highlight(toString(config, { verbose: options.verbose }), {\n language: 'js'\n })\n "}}],"errorCount":21,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":21,"fixableWarningCount":0,"source":"export default function (api) {\n api.registerCommand({\n command: 'webpack',\n description: 'inspect webpack configurations',\n options: [{\n name: '--rule <ruleName>',\n description: 'inspect a specific module rule'\n }, {\n name: '--plugin <pluginName>',\n description: 'inspect a specific plugin'\n }, {\n name: '--rules',\n description: 'list all module rule names'\n }, {\n name: '--plugins',\n description: 'list all plugin names'\n }, {\n name: '--verbose',\n description: 'show full function definitions in output'\n }],\n async fn({ options }) {\n const assert = require('assert');\n const { getBundleAndConfigs } = require('../buildDevUtils');\n const { toString } = require('webpack-chain');\n const { highlight } = require('cli-highlight');\n const { bundleConfig } = await getBundleAndConfigs({ api });\n\n let config = bundleConfig;\n assert(config, 'No valid config found with fes entry.');\n\n if (options.rule) {\n config = config.module.rules.find(\n r => r.__ruleNames[0] === options.rule\n );\n } else if (options.plugin) {\n config = config.plugins.find(\n p => p.__pluginName === options.plugin\n );\n } else if (options.rules) {\n config = config.module.rules.map(r => r.__ruleNames[0]);\n } else if (options.plugins) {\n config = config.plugins.map(\n p => p.__pluginName || p.constructor.name\n );\n }\n\n console.log(highlight(toString(config, { verbose: options.verbose }), { language: 'js' }));\n }\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/css.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎················`","line":28,"column":27,"nodeType":null,"messageId":"delete","endLine":29,"endColumn":17,"fix":{"range":[611,628],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎················`","line":33,"column":27,"nodeType":null,"messageId":"delete","endLine":34,"endColumn":17,"fix":{"range":[783,800],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":46,"column":33,"nodeType":null,"messageId":"insert","endLine":46,"endColumn":33,"fix":{"range":[1196,1196],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····································localIdentName:` with `······································localIdentName:⏎·········································`","line":47,"column":1,"nodeType":null,"messageId":"replace","endLine":47,"endColumn":52,"fix":{"range":[1207,1258],"text":" localIdentName:\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":48,"column":33,"nodeType":null,"messageId":"insert","endLine":48,"endColumn":33,"fix":{"range":[1319,1319],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":49,"column":1,"nodeType":null,"messageId":"insert","endLine":49,"endColumn":1,"fix":{"range":[1321,1321],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `deepmerge(` with `⏎················deepmerge(⏎····················`","line":58,"column":22,"nodeType":null,"messageId":"replace","endLine":58,"endColumn":32,"fix":{"range":[1596,1606],"text":"\n deepmerge(\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":59,"column":1,"nodeType":null,"messageId":"insert","endLine":59,"endColumn":1,"fix":{"range":[1608,1608],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····················` with `····························`","line":60,"column":1,"nodeType":null,"messageId":"replace","endLine":60,"endColumn":21,"fix":{"range":[1649,1669],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":61,"column":1,"nodeType":null,"messageId":"insert","endLine":61,"endColumn":1,"fix":{"range":[1680,1680],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":62,"column":25,"nodeType":null,"messageId":"insert","endLine":62,"endColumn":25,"fix":{"range":[1783,1783],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `························` with `································`","line":63,"column":1,"nodeType":null,"messageId":"replace","endLine":63,"endColumn":25,"fix":{"range":[1818,1842],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `[require('autoprefixer'),·{·...config.autoprefixer,·overrideBrowserslist:·browserslist·}` with `········[⏎····································require('autoprefixer'),⏎····································{⏎········································...config.autoprefixer,⏎········································overrideBrowserslist:·browserslist⏎····································}⏎································`","line":64,"column":25,"nodeType":null,"messageId":"replace","endLine":64,"endColumn":113,"fix":{"range":[1898,1986],"text":" [\n require('autoprefixer'),\n {\n ...config.autoprefixer,\n overrideBrowserslist: browserslist\n }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `························...(config.extraPostCSSPlugins·?·config.extraPostCSSPlugins` with `································...(config.extraPostCSSPlugins⏎····································?·config.extraPostCSSPlugins⏎···································`","line":65,"column":1,"nodeType":null,"messageId":"replace","endLine":65,"endColumn":84,"fix":{"range":[1989,2072],"text":" ...(config.extraPostCSSPlugins\n ? config.extraPostCSSPlugins\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":66,"column":1,"nodeType":null,"messageId":"insert","endLine":66,"endColumn":1,"fix":{"range":[2079,2079],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `········`","line":67,"column":17,"nodeType":null,"messageId":"insert","endLine":67,"endColumn":17,"fix":{"range":[2117,2117],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············},·config.postcssLoader·||·{})` with `····················},⏎····················config.postcssLoader·||·{}⏎················)⏎············`","line":68,"column":1,"nodeType":null,"messageId":"replace","endLine":68,"endColumn":43,"fix":{"range":[2120,2162],"text":" },\n config.postcssLoader || {}\n )\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················.loader(require.resolve(loader))⏎················` with `.loader(require.resolve(loader))`","line":71,"column":29,"nodeType":null,"messageId":"replace","endLine":73,"endColumn":17,"fix":{"range":[2216,2282],"text":".loader(require.resolve(loader))"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":113,"column":18,"nodeType":null,"messageId":"insert","endLine":113,"endColumn":18,"fix":{"range":[3107,3107],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":114,"column":59,"nodeType":null,"messageId":"insert","endLine":114,"endColumn":59,"fix":{"range":[3186,3186],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":115,"column":13,"nodeType":null,"messageId":"insert","endLine":115,"endColumn":13,"fix":{"range":[3200,3200],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":116,"column":1,"nodeType":null,"messageId":"insert","endLine":116,"endColumn":1,"fix":{"range":[3263,3263],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········}` with `············}⏎········`","line":117,"column":1,"nodeType":null,"messageId":"replace","endLine":117,"endColumn":10,"fix":{"range":[3338,3347],"text":" }\n "}}],"errorCount":23,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":23,"fixableWarningCount":0,"source":"// css less post-css mini-css css 压缩\n// extraPostCSSPlugins\n// postcssLoader\n// lessLoader\n// css-loader\n// 支持 热加载\n// 性能优化\n// css 压缩 https://github.com/webpack-contrib/css-minimizer-webpack-plugin\n// 根据 entry 进行代码块拆分\n// 根据 entry 将文件输出到不同的文件夹\n\nimport { deepmerge } from '@fesjs/utils';\n\nfunction createRules({\n isDev,\n webpackConfig,\n config,\n lang,\n test,\n loader,\n options,\n browserslist\n}) {\n function applyLoaders(rule, isCSSModules) {\n if (isDev) {\n rule.use('extra-css-loader')\n .loader(require.resolve('style-loader'))\n .options({\n });\n } else {\n rule.use('extra-css-loader')\n .loader(require('mini-css-extract-plugin').loader)\n .options({\n });\n }\n\n rule.use('css-loader')\n .loader(require.resolve('css-loader'))\n .options(\n deepmerge(\n {\n importLoaders: 1,\n // https://webpack.js.org/loaders/css-loader/#onlylocals\n ...(isCSSModules\n ? {\n modules: {\n localIdentName: '[local]___[hash:base64:5]'\n }\n }\n : {})\n },\n config.cssLoader || {}\n )\n );\n\n rule.use('postcss-loader')\n .loader(require.resolve('postcss-loader'))\n .options(deepmerge({\n postcssOptions: () => ({\n plugins: [\n // https://github.com/luisrudge/postcss-flexbugs-fixes\n require('postcss-flexbugs-fixes'),\n require('postcss-safe-parser'),\n [require('autoprefixer'), { ...config.autoprefixer, overrideBrowserslist: browserslist }],\n ...(config.extraPostCSSPlugins ? config.extraPostCSSPlugins : [])\n ]\n })\n }, config.postcssLoader || {}));\n\n if (loader) {\n rule.use(loader)\n .loader(require.resolve(loader))\n .options(options);\n }\n }\n\n const rule = webpackConfig.module.rule(lang).test(test);\n applyLoaders(rule.oneOf('css-modules').resourceQuery(/module/), true);\n applyLoaders(rule.oneOf('css'), false);\n}\n\nexport default function createCssWebpackConfig({\n isDev,\n config,\n webpackConfig,\n browserslist\n}) {\n createRules({\n isDev,\n webpackConfig,\n config,\n lang: 'css',\n test: /\\.css$/,\n browserslist\n });\n\n createRules({\n isDev,\n webpackConfig,\n config,\n lang: 'less',\n test: /\\.less$/,\n loader: 'less-loader',\n options: {\n lessOptions: {\n javascriptEnabled: true,\n ...config.lessLoader\n }\n },\n browserslist\n });\n\n webpackConfig.plugin('extra-css')\n .use(require.resolve('mini-css-extract-plugin'), [{\n filename: isDev ? '[name].css' : '[name].[contenthash:8].css',\n chunkFilename: isDev ? '[id].css' : '[id].[contenthash:8].css'\n }]);\n\n if (!isDev) {\n webpackConfig.optimization\n .minimizer('css')\n .use(require.resolve('css-minimizer-webpack-plugin'), [{}]);\n }\n\n return (options) => {\n createRules({\n isDev,\n config,\n webpackConfig,\n browserslist,\n ...options\n });\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/define.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····config,⏎····webpackConfig⏎` with `·config,·webpackConfig·`","line":4,"column":52,"nodeType":null,"messageId":"replace","endLine":7,"endColumn":1,"fix":{"range":[128,159],"text":" config, webpackConfig "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":8,"column":18,"nodeType":null,"messageId":"insert","endLine":8,"endColumn":18,"fix":{"range":[181,181],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············resolveDefine(config)⏎········` with `resolveDefine(config)`","line":9,"column":37,"nodeType":null,"messageId":"replace","endLine":11,"endColumn":9,"fix":{"range":[235,278],"text":"resolveDefine(config)"}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import webpack from 'webpack';\nimport resolveDefine from './resolveDefine';\n\nexport default function createDefineWebpackConfig({\n config,\n webpackConfig\n}) {\n webpackConfig.plugin('define')\n .use(webpack.DefinePlugin, [\n resolveDefine(config)\n ]);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/getBabelOpts.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····winPath⏎` with `·winPath·`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":3,"endColumn":1,"fix":{"range":[8,21],"text":" winPath "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····cwd,⏎····targets,⏎····config,⏎····presetOpts⏎` with `·cwd,·targets,·config,·presetOpts·`","line":5,"column":24,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":1,"fix":{"range":[68,118],"text":" cwd, targets, config, presetOpts "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `importOpts` with `(importOpts)`","line":54,"column":37,"nodeType":null,"messageId":"replace","endLine":54,"endColumn":47,"fix":{"range":[1496,1506],"text":"(importOpts)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":55,"column":1,"nodeType":null,"messageId":"insert","endLine":55,"endColumn":1,"fix":{"range":[1512,1512],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `··················`","line":56,"column":1,"nodeType":null,"messageId":"replace","endLine":56,"endColumn":17,"fix":{"range":[1568,1584],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":57,"column":1,"nodeType":null,"messageId":"insert","endLine":57,"endColumn":1,"fix":{"range":[1596,1596],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":58,"column":1,"nodeType":null,"messageId":"insert","endLine":58,"endColumn":1,"fix":{"range":[1635,1635],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·process.env.BABEL_CACHE·!==·'none'·?·winPath(`${cwd}/.cache/babel-loader`)` with `⏎············process.env.BABEL_CACHE·!==·'none'⏎················?·winPath(`${cwd}/.cache/babel-loader`)⏎···············`","line":66,"column":24,"nodeType":null,"messageId":"replace","endLine":66,"endColumn":99,"fix":{"range":[1857,1932],"text":"\n process.env.BABEL_CACHE !== 'none'\n ? winPath(`${cwd}/.cache/babel-loader`)\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":69,"column":21,"nodeType":null,"messageId":"insert","endLine":69,"endColumn":21,"fix":{"range":[1996,1996],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":70,"column":13,"nodeType":null,"messageId":"insert","endLine":70,"endColumn":13,"fix":{"range":[2010,2010],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":71,"column":13,"nodeType":null,"messageId":"insert","endLine":71,"endColumn":13,"fix":{"range":[2065,2065],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········}` with `············}⏎········`","line":72,"column":1,"nodeType":null,"messageId":"replace","endLine":72,"endColumn":10,"fix":{"range":[2091,2100],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":74,"column":2,"nodeType":null,"messageId":"delete","endLine":75,"endColumn":1,"fix":{"range":[2110,2111],"text":""}}],"errorCount":13,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":13,"fixableWarningCount":0,"source":"import {\n winPath\n} from '@fesjs/utils';\n\nfunction getBabelOpts({\n cwd,\n targets,\n config,\n presetOpts\n}) {\n const presets = [\n [\n require.resolve('@babel/preset-env'),\n {\n targets,\n useBuiltIns: 'usage',\n corejs: {\n version: 3,\n proposals: true\n },\n modules: false\n }\n ],\n [\n // FEATURE 实现类型安全检查\n require('@babel/preset-typescript').default,\n {\n // https://babeljs.io/docs/en/babel-plugin-transform-typescript#impartial-namespace-support\n allowNamespaces: true,\n isTSX: true,\n allExtensions: true\n }\n ],\n ...(config.extraBabelPresets || [])\n ];\n const plugins = [\n require('@babel/plugin-proposal-export-default-from').default,\n [\n require('@babel/plugin-proposal-pipeline-operator').default,\n {\n proposal: 'minimal'\n }\n ],\n require('@babel/plugin-proposal-do-expressions').default,\n require('@babel/plugin-proposal-function-bind').default,\n [\n require.resolve('@babel/plugin-transform-runtime'),\n {\n useESModules: true,\n ...presetOpts.transformRuntime\n }\n ],\n ...(presetOpts.import\n ? presetOpts.import.map(importOpts => [\n require.resolve('babel-plugin-import'),\n importOpts,\n importOpts.libraryName\n ])\n : []),\n require.resolve('@vue/babel-plugin-jsx'),\n ...(config.extraBabelPlugins || [])\n ];\n return {\n babelrc: false,\n configFile: false,\n cacheDirectory: process.env.BABEL_CACHE !== 'none' ? winPath(`${cwd}/.cache/babel-loader`) : false,\n presets,\n plugins,\n overrides: [{\n test: [/[\\\\/]node_modules[\\\\/]/, /\\.fes/],\n sourceType: 'unambiguous'\n }]\n };\n}\n\n\nexport default async ({\n cwd,\n config,\n modifyBabelOpts,\n modifyBabelPresetOpts,\n targets\n}) => {\n let presetOpts = {\n transformRuntime: {}\n };\n if (modifyBabelPresetOpts) {\n presetOpts = await modifyBabelPresetOpts(presetOpts);\n }\n let babelOpts = getBabelOpts({\n cwd,\n config,\n presetOpts,\n targets\n });\n if (modifyBabelOpts) {\n babelOpts = await modifyBabelOpts(babelOpts);\n }\n return babelOpts;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/html.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····winPath⏎` with `·winPath·`","line":3,"column":9,"nodeType":null,"messageId":"replace","endLine":5,"endColumn":1,"fix":{"range":[79,92],"text":" winPath "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········?·htmlPath⏎·······` with `·?·htmlPath`","line":43,"column":48,"nodeType":null,"messageId":"replace","endLine":45,"endColumn":8,"fix":{"range":[1208,1235],"text":" ? htmlPath"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·route?.meta?.title·||·config.html.title·||` with `⏎································route?.meta?.title·||⏎································config.html.title·||⏎·······························`","line":67,"column":35,"nodeType":null,"messageId":"replace","endLine":67,"endColumn":78,"fix":{"range":[2004,2047],"text":"\n route?.meta?.title ||\n config.html.title ||\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `_htmlOptions` with `⏎································_htmlOptions⏎····························`","line":74,"column":75,"nodeType":null,"messageId":"replace","endLine":74,"endColumn":87,"fix":{"range":[2436,2448],"text":"\n _htmlOptions\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎················`","line":89,"column":64,"nodeType":null,"messageId":"insert","endLine":89,"endColumn":64,"fix":{"range":[2882,2882],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":90,"column":1,"nodeType":null,"messageId":"insert","endLine":90,"endColumn":1,"fix":{"range":[2884,2884],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `scripts:·headScriptsMap.map(script` with `····scripts:·headScriptsMap.map((script)`","line":91,"column":17,"nodeType":null,"messageId":"replace","endLine":91,"endColumn":51,"fix":{"range":[2931,2965],"text":" scripts: headScriptsMap.map((script)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":92,"column":1,"nodeType":null,"messageId":"insert","endLine":92,"endColumn":1,"fix":{"range":[2972,2972],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":93,"column":17,"nodeType":null,"messageId":"insert","endLine":93,"endColumn":17,"fix":{"range":[3025,3025],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":94,"column":13,"nodeType":null,"messageId":"replace","endLine":94,"endColumn":14,"fix":{"range":[3041,3042],"text":" }\n "}}],"errorCount":10,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":10,"fixableWarningCount":0,"source":"import { join, resolve } from 'path';\nimport { existsSync } from 'fs';\nimport {\n winPath\n} from '@fesjs/utils';\nimport resolveDefine from './resolveDefine';\n\nexport default async function createHtmlWebpackConfig({\n api,\n cwd,\n config,\n webpackConfig,\n headScripts,\n isProd\n}) {\n const htmlOptions = {\n title: 'fes.js',\n filename: '[name].html',\n ...config.html,\n templateParameters: resolveDefine(config, true),\n mountElementId: config.mountElementId\n };\n\n if (isProd) {\n Object.assign(htmlOptions, {\n minify: {\n removeComments: true,\n collapseWhitespace: true,\n collapseBooleanAttributes: true,\n removeScriptTypeAttributes: true\n // more options:\n // https://github.com/kangax/html-minifier#options-quick-reference\n }\n });\n }\n\n const multiPageConfig = config.html.pages;\n const htmlPath = join(cwd, 'public/index.html');\n const defaultHtmlPath = resolve(__dirname, 'index-default.html');\n const publicCopyIgnore = [];\n\n // default, single page setup.\n htmlOptions.template = existsSync(htmlPath)\n ? htmlPath\n : defaultHtmlPath;\n\n publicCopyIgnore.push(winPath(htmlOptions.template));\n\n if (!multiPageConfig) {\n webpackConfig\n .plugin('html')\n .use(require.resolve('html-webpack-plugin'), [htmlOptions]);\n } else {\n // TODO 支持多页\n }\n\n // 如果需要导出html,则根据路由生成对应的html文件\n if (config.exportStatic) {\n const routes = await api.getRoutes();\n const addHtml = (_routes) => {\n if (Array.isArray(_routes)) {\n _routes.forEach((route) => {\n const _fileName = `${route.path.slice(1) || 'index'}.html`;\n if (_fileName !== 'index.html') {\n const _htmlOptions = {\n ...config.html,\n title: route?.meta?.title || config.html.title || 'fes.js',\n filename: _fileName,\n templateParameters: resolveDefine(config, true),\n mountElementId: config.mountElementId\n };\n webpackConfig\n .plugin(_fileName)\n .use(require.resolve('html-webpack-plugin'), [_htmlOptions]);\n }\n if (route.children && route.children.length) {\n addHtml(route.children);\n }\n });\n }\n };\n addHtml(routes);\n }\n\n if (headScripts) {\n const headScriptsMap = await headScripts();\n webpackConfig\n .plugin('html-tags')\n .use(require.resolve('html-webpack-tags-plugin'), [{\n append: false,\n scripts: headScriptsMap.map(script => ({\n path: script.src\n }))\n }]);\n }\n return {\n publicCopyIgnore\n };\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `key` with `(key)`","line":16,"column":17,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":20,"fix":{"range":[554,557],"text":"(key)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·targets.browsers` with `⏎········targets.browsers·||`","line":22,"column":25,"nodeType":null,"messageId":"replace","endLine":22,"endColumn":42,"fix":{"range":[722,739],"text":"\n targets.browsers ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `||·Object.keys(targets).map(key·=>·`${key}·>=·${targets[key]·===·true·?·'0'·:·targets[key]}`` with `··Object.keys(targets).map(⏎············(key)·=>·`${key}·>=·${targets[key]·===·true·?·'0'·:·targets[key]}`⏎········`","line":23,"column":7,"nodeType":null,"messageId":"replace","endLine":23,"endColumn":99,"fix":{"range":[746,838],"text":" Object.keys(targets).map(\n (key) => `${key} >= ${targets[key] === true ? '0' : targets[key]}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·depPath.replace(/\\\\/g,·'\\\\\\\\')` with `⏎················?·depPath.replace(/\\\\/g,·'\\\\\\\\')⏎···············`","line":50,"column":57,"nodeType":null,"messageId":"replace","endLine":50,"endColumn":90,"fix":{"range":[1437,1470],"text":"\n ? depPath.replace(/\\\\/g, '\\\\\\\\')\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎·······`","line":51,"column":10,"nodeType":null,"messageId":"insert","endLine":51,"endColumn":10,"fix":{"range":[1491,1491],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'exclude·only·accepts·an·array·of·string·or·regular·expressions'` with `⏎············'exclude·only·accepts·an·array·of·string·or·regular·expressions'⏎········`","line":55,"column":25,"nodeType":null,"messageId":"replace","endLine":55,"endColumn":89,"fix":{"range":[1587,1651],"text":"\n 'exclude only accepts an array of string or regular expressions'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":58,"column":2,"nodeType":null,"messageId":"delete","endLine":59,"endColumn":1,"fix":{"range":[1723,1724],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `isDev·?·(config.devtool·||·'cheap-module-source-map')·:·config.devtool` with `⏎········isDev·?·config.devtool·||·'cheap-module-source-map'·:·config.devtool⏎····`","line":81,"column":27,"nodeType":null,"messageId":"replace","endLine":81,"endColumn":97,"fix":{"range":[2260,2330],"text":"\n isDev ? config.devtool || 'cheap-module-source-map' : config.devtool\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'.mjs',·'.js',·'.jsx',·'.vue',·'.ts',·'.tsx',·'.json',·'.wasm'` with `⏎········'.mjs',⏎········'.js',⏎········'.jsx',⏎········'.vue',⏎········'.ts',⏎········'.tsx',⏎········'.json',⏎········'.wasm'⏎····`","line":103,"column":45,"nodeType":null,"messageId":"replace","endLine":103,"endColumn":107,"fix":{"range":[3010,3072],"text":"\n '.mjs',\n '.js',\n '.jsx',\n '.vue',\n '.ts',\n '.tsx',\n '.json',\n '.wasm'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎················`","line":107,"column":40,"nodeType":null,"messageId":"delete","endLine":108,"endColumn":17,"fix":{"range":[3193,3210],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":185,"column":11,"nodeType":null,"messageId":"insert","endLine":185,"endColumn":11,"fix":{"range":[5416,5416],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `config.nodeModulesTransform.exclude` with `⏎············config.nodeModulesTransform.exclude⏎········`","line":192,"column":56,"nodeType":null,"messageId":"replace","endLine":192,"endColumn":91,"fix":{"range":[5669,5704],"text":"\n config.nodeModulesTransform.exclude\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":196,"column":41,"nodeType":null,"messageId":"insert","endLine":196,"endColumn":41,"fix":{"range":[5849,5849],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":203,"column":15,"nodeType":null,"messageId":"insert","endLine":203,"endColumn":15,"fix":{"range":[6070,6070],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":234,"column":27,"nodeType":null,"messageId":"insert","endLine":234,"endColumn":27,"fix":{"range":[6773,6773],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":235,"column":1,"nodeType":null,"messageId":"replace","endLine":235,"endColumn":9,"fix":{"range":[6810,6818],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":236,"column":1,"nodeType":null,"messageId":"insert","endLine":236,"endColumn":1,"fix":{"range":[6845,6845],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":237,"column":13,"nodeType":null,"messageId":"insert","endLine":237,"endColumn":13,"fix":{"range":[6893,6893],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":238,"column":1,"nodeType":null,"messageId":"replace","endLine":238,"endColumn":17,"fix":{"range":[6941,6957],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":239,"column":13,"nodeType":null,"messageId":"insert","endLine":239,"endColumn":13,"fix":{"range":[6983,6983],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":240,"column":1,"nodeType":null,"messageId":"insert","endLine":240,"endColumn":1,"fix":{"range":[6985,6985],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":241,"column":1,"nodeType":null,"messageId":"insert","endLine":241,"endColumn":1,"fix":{"range":[7044,7044],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":242,"column":13,"nodeType":null,"messageId":"insert","endLine":242,"endColumn":13,"fix":{"range":[7086,7086],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":243,"column":1,"nodeType":null,"messageId":"insert","endLine":243,"endColumn":1,"fix":{"range":[7088,7088],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":244,"column":9,"nodeType":null,"messageId":"insert","endLine":244,"endColumn":9,"fix":{"range":[7121,7121],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":245,"column":1,"nodeType":null,"messageId":"replace","endLine":245,"endColumn":9,"fix":{"range":[7124,7132],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `},·...(` with `····},⏎········...`","line":246,"column":5,"nodeType":null,"messageId":"replace","endLine":246,"endColumn":12,"fix":{"range":[7155,7162],"text":" },\n ..."}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":247,"column":1,"nodeType":null,"messageId":"insert","endLine":247,"endColumn":1,"fix":{"range":[7198,7198],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":248,"column":13,"nodeType":null,"messageId":"insert","endLine":248,"endColumn":13,"fix":{"range":[7250,7250],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":249,"column":1,"nodeType":null,"messageId":"replace","endLine":249,"endColumn":17,"fix":{"range":[7259,7275],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":250,"column":1,"nodeType":null,"messageId":"insert","endLine":250,"endColumn":1,"fix":{"range":[7303,7303],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":251,"column":13,"nodeType":null,"messageId":"insert","endLine":251,"endColumn":13,"fix":{"range":[7350,7350],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":252,"column":1,"nodeType":null,"messageId":"replace","endLine":252,"endColumn":9,"fix":{"range":[7353,7361],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":253,"column":1,"nodeType":null,"messageId":"insert","endLine":253,"endColumn":1,"fix":{"range":[7363,7363],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":254,"column":1,"nodeType":null,"messageId":"insert","endLine":254,"endColumn":1,"fix":{"range":[7380,7380],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":255,"column":13,"nodeType":null,"messageId":"insert","endLine":255,"endColumn":13,"fix":{"range":[7432,7432],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":256,"column":9,"nodeType":null,"messageId":"insert","endLine":256,"endColumn":9,"fix":{"range":[7474,7474],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····}))` with `········})⏎····`","line":257,"column":1,"nodeType":null,"messageId":"replace","endLine":257,"endColumn":8,"fix":{"range":[7477,7484],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎················`","line":262,"column":59,"nodeType":null,"messageId":"insert","endLine":262,"endColumn":59,"fix":{"range":[7689,7689],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":263,"column":1,"nodeType":null,"messageId":"insert","endLine":263,"endColumn":1,"fix":{"range":[7691,7691],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":264,"column":13,"nodeType":null,"messageId":"replace","endLine":264,"endColumn":14,"fix":{"range":[7742,7743],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········.plugin('progress')⏎········` with `.plugin('progress')`","line":302,"column":18,"nodeType":null,"messageId":"replace","endLine":304,"endColumn":9,"fix":{"range":[8692,8729],"text":".plugin('progress')"}}],"errorCount":42,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":42,"fixableWarningCount":0,"source":"import { join } from 'path';\nimport { existsSync } from 'fs';\nimport Config from 'webpack-chain';\nimport webpack from 'webpack';\nimport createCssWebpackConfig from './css';\nimport getBabelOpts from './getBabelOpts';\nimport createVueWebpackConfig from './vue';\nimport createDefineWebpackConfig from './define';\nimport createMinimizerWebpackConfig from './minimizer';\nimport createHtmlWebpackConfig from './html';\n\nfunction getTargetsAndBrowsersList({ config }) {\n let targets = config.targets || {};\n\n targets = Object.keys(targets)\n .filter(key => targets[key] !== false)\n .reduce((memo, key) => {\n memo[key] = targets[key];\n return memo;\n }, {});\n\n const browserslist = targets.browsers\n || Object.keys(targets).map(key => `${key} >= ${targets[key] === true ? '0' : targets[key]}`);\n\n return {\n targets,\n browserslist\n };\n}\n\nconst DEFAULT_EXCLUDE_NODE_MODULES = [\n 'vue',\n 'vuex',\n 'vue-router',\n 'ant-design-vue',\n 'core-js',\n 'echarts',\n '@babel/runtime',\n 'lodash-es',\n 'webpack-dev-server',\n 'ansi-html',\n 'html-entities'\n];\n\nfunction genTranspileDepRegex(exclude) {\n exclude = exclude.concat(DEFAULT_EXCLUDE_NODE_MODULES);\n const deps = exclude.map((dep) => {\n if (typeof dep === 'string') {\n const depPath = join('node_modules', dep, '/');\n return /^win/.test(require('os').platform()) ? depPath.replace(/\\\\/g, '\\\\\\\\') : depPath;\n } if (dep instanceof RegExp) {\n return dep.source;\n }\n\n throw new Error('exclude only accepts an array of string or regular expressions');\n });\n return deps.length ? new RegExp(deps.join('|')) : null;\n}\n\n\nexport default async function getConfig({\n api,\n cwd,\n config,\n env,\n entry = {},\n modifyBabelOpts,\n modifyBabelPresetOpts,\n chainWebpack,\n headScripts,\n publicPath\n}) {\n const isDev = env === 'development';\n const isProd = env === 'production';\n const webpackConfig = new Config();\n const absoluteOutput = join(cwd, config.outputPath || 'dist');\n\n webpackConfig.mode(env);\n webpackConfig.stats('verbose');\n webpackConfig.externals(config.externals || {});\n webpackConfig.devtool(isDev ? (config.devtool || 'cheap-module-source-map') : config.devtool);\n\n // --------------- cache -----------\n webpackConfig.cache({\n type: 'filesystem',\n cacheDirectory: join(cwd, '.cache/webpack')\n });\n\n // --------------- entry -----------\n // Feature 公共模块 vue vue-router 处理 dependOn ?\n Object.keys(entry).forEach((key) => {\n webpackConfig.entry(key).add(entry[key]).end();\n });\n\n // --------------- output -----------\n webpackConfig.output\n .path(absoluteOutput)\n .publicPath(publicPath)\n .filename('[name].[contenthash:8].js')\n .chunkFilename('[name].[contenthash:8].chunk.js');\n\n // --------------- resolve -----------\n webpackConfig.resolve.extensions.merge(['.mjs', '.js', '.jsx', '.vue', '.ts', '.tsx', '.json', '.wasm']);\n\n if (config.alias) {\n Object.keys(config.alias).forEach((key) => {\n webpackConfig.resolve.alias\n .set(key, config.alias[key]);\n });\n }\n\n // --------------- module -----------\n webpackConfig.module\n .rule('image')\n .test(/\\.(png|jpe?g|gif|webp|ico)(\\?.*)?$/)\n .use('url-loader')\n .loader(require.resolve('url-loader'))\n .options({\n limit: config.inlineLimit || 8192,\n esModule: false,\n fallback: {\n loader: require.resolve('file-loader'),\n options: {\n name: 'static/[name].[hash:8].[ext]',\n esModule: false\n }\n }\n });\n\n webpackConfig.module\n .rule('svg')\n .test(/\\.(svg)(\\?.*)?$/)\n .use('file-loader')\n .loader(require.resolve('file-loader'))\n .options({\n name: 'static/[name].[hash:8].[ext]',\n esModule: false\n });\n\n webpackConfig.module\n .rule('fonts')\n .test(/\\.(eot|woff|woff2|ttf)(\\?.*)?$/)\n .use('file-loader')\n .loader(require.resolve('file-loader'))\n .options({\n name: 'static/[name].[hash:8].[ext]',\n esModule: false\n });\n\n webpackConfig.module\n .rule('raw')\n .test(/\\.(txt|text|md)$/)\n .use('raw-loader')\n .loader(require.resolve('raw-loader'))\n .options({\n esModule: false\n });\n\n const { targets, browserslist } = getTargetsAndBrowsersList({ config });\n const babelOpts = await getBabelOpts({\n cwd,\n config,\n modifyBabelOpts,\n modifyBabelPresetOpts,\n targets\n });\n\n // --------------- js -----------\n // https://webpack.docschina.org/configuration/module/#resolve-fully-specified\n webpackConfig.module\n .rule('esm')\n .test(/\\.m?jsx?$/)\n .resolve.set('fullySpecified', false);\n\n webpackConfig.module\n .rule('js')\n .test(/\\.(js|mjs|jsx|ts|tsx)$/)\n .exclude.add((filepath) => {\n // always transpile js in vue files\n if (/\\.vue\\.jsx?$/.test(filepath)) {\n return false;\n }\n // Don't transpile node_modules\n return /node_modules/.test(filepath);\n }).end()\n .use('babel-loader')\n .loader(require.resolve('babel-loader'))\n .options(babelOpts);\n\n // 为了避免第三方依赖包编译不充分导致线上问题,默认对 node_modules 也进行全编译,只在生产构建的时候进行\n if (isProd) {\n const transpileDepRegex = genTranspileDepRegex(config.nodeModulesTransform.exclude);\n webpackConfig.module\n .rule('js-in-node_modules')\n .test(/\\.(js|mjs)$/)\n .include.add(/node_modules/).end()\n .exclude.add((filepath) => {\n if (transpileDepRegex && transpileDepRegex.test(filepath)) {\n return true;\n }\n\n return false;\n }).end()\n .use('babel-loader')\n .loader(require.resolve('babel-loader'))\n .options(babelOpts);\n }\n\n // --------------- css -----------\n const createCSSRule = createCssWebpackConfig({\n isDev,\n config,\n webpackConfig,\n browserslist\n });\n\n // --------------- vue -----------\n createVueWebpackConfig({\n config,\n webpackConfig\n });\n\n // --------------- html -----------\n const { publicCopyIgnore } = await createHtmlWebpackConfig({\n api,\n cwd,\n config,\n webpackConfig,\n headScripts,\n isProd\n });\n\n // --------------- copy -----------\n const copyPatterns = [existsSync(join(cwd, 'public')) && {\n from: join(cwd, 'public'),\n filter: (resourcePath) => {\n if (resourcePath.indexOf('.DS_Store') !== -1) {\n return false;\n }\n if (publicCopyIgnore.includes(resourcePath)) {\n return false;\n }\n return true;\n },\n to: absoluteOutput\n }, ...((config.copy || []).map((item) => {\n if (typeof item === 'string') {\n return {\n from: join(cwd, item.from),\n to: absoluteOutput\n };\n }\n return {\n from: join(cwd, item.from),\n to: join(absoluteOutput, item.to)\n };\n }))].filter(Boolean);\n // const publicCopyIgnore = ['.DS_Store'];\n if (copyPatterns.length) {\n webpackConfig\n .plugin('copy')\n .use(require.resolve('copy-webpack-plugin'), [{\n patterns: copyPatterns\n }]);\n }\n\n // --------------- define -----------\n createDefineWebpackConfig({\n config,\n webpackConfig\n });\n\n // --------------- 分包 -----------\n if (isProd) {\n webpackConfig.optimization.splitChunks({\n cacheGroups: {\n defaultVendors: {\n name: 'chunk-vendors',\n test: /[\\\\/]node_modules[\\\\/]/,\n priority: -10,\n chunks: 'initial'\n },\n common: {\n name: 'chunk-common',\n minChunks: 2,\n priority: -20,\n chunks: 'initial',\n reuseExistingChunk: true\n }\n }\n });\n }\n\n // --------------- 压缩 -----------\n createMinimizerWebpackConfig({\n isProd,\n config,\n webpackConfig\n });\n\n // --------------- 构建输出 ----------\n webpackConfig\n .plugin('progress')\n .use(require.resolve('webpackbar'));\n\n webpackConfig\n .plugin('friendly-errors')\n .use(require('@soda/friendly-errors-webpack-plugin'));\n\n // --------------- chainwebpack -----------\n if (chainWebpack) {\n await chainWebpack(webpackConfig, {\n createCSSRule,\n webpack\n });\n }\n // 用户配置的 chainWebpack 优先级最高\n if (config.chainWebpack) {\n await config.chainWebpack(webpackConfig, {\n createCSSRule,\n env,\n webpack\n });\n }\n\n return webpackConfig.toConfig();\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/minimizer.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":5,"column":5,"nodeType":null,"messageId":"insert","endLine":5,"endColumn":5,"fix":{"range":[94,94],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `config` with `(config)`","line":40,"column":23,"nodeType":null,"messageId":"replace","endLine":40,"endColumn":29,"fix":{"range":[1046,1052],"text":"(config)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········defaultTerserOptions,⏎········config.terserOptions·||·{}⏎····` with `defaultTerserOptions,·config.terserOptions·||·{}`","line":41,"column":30,"nodeType":null,"messageId":"replace","endLine":44,"endColumn":5,"fix":{"range":[1088,1158],"text":"defaultTerserOptions, config.terserOptions || {}"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":46,"column":4,"nodeType":null,"messageId":"delete","endLine":47,"endColumn":1,"fix":{"range":[1191,1192],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `terserOptions(config)` with `⏎················terserOptions(config)⏎············`","line":57,"column":61,"nodeType":null,"messageId":"replace","endLine":57,"endColumn":82,"fix":{"range":[1442,1463],"text":"\n terserOptions(config)\n "}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":5,"fixableWarningCount":0,"source":"import { deepmerge } from '@fesjs/utils';\n\nconst defaultTerserOptions = {\n compress: {\n // turn off flags with small gains to speed up minification\n arrows: false,\n collapse_vars: false, // 0.3kb\n comparisons: false,\n computed_props: false,\n hoist_funs: false,\n hoist_props: false,\n hoist_vars: false,\n inline: false,\n loops: false,\n negate_iife: false,\n properties: false,\n reduce_funcs: false,\n reduce_vars: false,\n switches: false,\n toplevel: false,\n typeofs: false,\n\n // a few flags with noticeable gains/speed ratio\n // numbers based on out of the box vendor bundle\n booleans: true, // 0.7kb\n if_return: true, // 0.4kb\n sequences: true, // 0.7kb\n unused: true, // 2.3kb\n\n // required features to drop conditional branches\n conditionals: true,\n dead_code: true,\n evaluate: true\n },\n mangle: {\n safari10: true\n }\n};\n\nconst terserOptions = config => ({\n terserOptions: deepmerge(\n defaultTerserOptions,\n config.terserOptions || {}\n ),\n extractComments: false\n});\n\n\nexport default function createMinimizerWebpackConfig({\n isProd,\n config,\n webpackConfig\n}) {\n if (isProd) {\n webpackConfig.optimization\n .minimizer('terser')\n .use(require.resolve('terser-webpack-plugin'), [terserOptions(config)]);\n }\n if (process.env.FES_ENV === 'test') {\n webpackConfig.optimization.minimize(false);\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/resolveDefine.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/commands/webpackConfig/vue.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····config,⏎····webpackConfig⏎` with `·config,·webpackConfig·`","line":3,"column":49,"nodeType":null,"messageId":"replace","endLine":6,"endColumn":1,"fix":{"range":[83,114],"text":" config, webpackConfig "}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"// import webpack from 'webpack';\n\nexport default function createVueWebpackConfig({\n config,\n webpackConfig\n}) {\n webpackConfig.module\n .rule('vue')\n .test(/\\.vue$/)\n .use('vue-loader')\n .loader(require.resolve('vue-loader'))\n .options({\n babelParserPlugins: ['jsx', 'classProperties', 'decorators-legacy'],\n ...(config.vueLoader || {})\n })\n .end();\n\n webpackConfig\n .plugin('vue-loader-plugin')\n .use(require('vue-loader').VueLoaderPlugin);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/alias.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎············`","line":10,"column":23,"nodeType":null,"messageId":"delete","endLine":11,"endColumn":13,"fix":{"range":[213,226],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"export default (api) => {\n const { paths } = api;\n\n api.describe({\n key: 'alias',\n config: {\n schema(joi) {\n return joi.object();\n },\n default: {\n }\n }\n });\n\n api.chainWebpack(async (memo) => {\n // 选择在 chainWebpack 中进行以上 alias 的初始化,是为了支持用户使用 modifyPaths API 对 paths 进行改写\n memo.resolve.alias.set('@', paths.absSrcPath);\n memo.resolve.alias.set('@@', paths.absTmpPath);\n\n return memo;\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/analyze.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 `.string()` with `⏎····························.string()⏎····························`","line":9,"column":42,"nodeType":null,"messageId":"replace","endLine":9,"endColumn":51,"fix":{"range":[212,221],"text":"\n .string()\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.string()` with `⏎····························.string()⏎····························`","line":15,"column":38,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":47,"fix":{"range":[592,601],"text":"\n .string()\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.string()` with `⏎····························.string()⏎····························`","line":16,"column":42,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":51,"fix":{"range":[685,694],"text":"\n .string()\n "}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"\nexport default (api) => {\n api.describe({\n key: 'analyze',\n config: {\n schema(joi) {\n return joi\n .object({\n analyzerMode: joi.string().valid('server', 'static', 'disabled'),\n analyzerHost: joi.string(),\n analyzerPort: joi.alternatives(joi.number(), 'auto'),\n openAnalyzer: joi.boolean(),\n generateStatsFile: joi.boolean(),\n statsFilename: joi.string(),\n logLevel: joi.string().valid('info', 'warn', 'error', 'silent'),\n defaultSizes: joi.string().valid('stat', 'parsed', 'gzip')\n })\n .unknown(true);\n },\n default: {\n analyzerMode: process.env.ANALYZE_MODE || 'server',\n analyzerPort: process.env.ANALYZE_PORT || 8888,\n openAnalyzer: process.env.ANALYZE_OPEN !== 'none',\n // generate stats file while ANALYZE_DUMP exist\n generateStatsFile: !!process.env.ANALYZE_DUMP,\n statsFilename: process.env.ANALYZE_DUMP || 'stats.json',\n logLevel: process.env.ANALYZE_LOG_LEVEL || 'info',\n defaultSizes: 'parsed' // stat // gzip\n }\n },\n enableBy: () => !!process.env.ANALYZE\n });\n api.chainWebpack((webpackConfig) => {\n webpackConfig\n .plugin('bundle-analyzer')\n .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [\n api.config?.analyze || {}\n ]);\n return webpackConfig;\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/autoprefixer.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 `'postcss·autoprefixer,·default·flexbox:·no-2009'` with `⏎························'postcss·autoprefixer,·default·flexbox:·no-2009'⏎····················`","line":12,"column":34,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":82,"fix":{"range":[282,330],"text":"\n 'postcss autoprefixer, default flexbox: no-2009'\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default (api) => {\n api.describe({\n key: 'autoprefixer',\n config: {\n default: {\n flexbox: 'no-2009'\n },\n schema(joi) {\n return joi\n .object()\n .description('postcss autoprefixer, default flexbox: no-2009');\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/babelPluginImport.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/base.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 default (api) => {\n api.describe({\n key: 'base',\n config: {\n default: '',\n schema(joi) {\n return joi.string().allow('');\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/chainWebpack.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/checkVuePackage.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎············`","line":10,"column":23,"nodeType":null,"messageId":"delete","endLine":11,"endColumn":13,"fix":{"range":[242,255],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `vuePkg.version,·`~${vueCompilerPkg.version.replace(/\\d+$/,·'0')}`,·{·includePrerelease:·true·}` with `⏎················vuePkg.version,⏎················`~${vueCompilerPkg.version.replace(/\\d+$/,·'0')}`,⏎················{·includePrerelease:·true·}⏎············`","line":20,"column":31,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":125,"fix":{"range":[539,633],"text":"\n vuePkg.version,\n `~${vueCompilerPkg.version.replace(/\\d+$/, '0')}`,\n { includePrerelease: true }\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"import { chalk, semver } from '@fesjs/utils';\n\nexport default (api) => {\n api.describe({\n key: 'checkVuePackage',\n config: {\n schema(joi) {\n return joi.object();\n },\n default: {\n }\n }\n });\n\n api.onStart(() => {\n // eslint-disable-next-line import/no-extraneous-dependencies\n const vuePkg = require('vue/package.json');\n const vueCompilerPkg = require('@vue/compiler-sfc/package.json');\n if (\n !semver.satisfies(vuePkg.version, `~${vueCompilerPkg.version.replace(/\\d+$/, '0')}`, { includePrerelease: true })\n ) {\n console.log(\n chalk.red(\n `You are using vue@${vuePkg.version}, requires @vue/compiler-sfc@${vuePkg.version}.\\nPlease upgrade your @vue/compiler-sfc@${vueCompilerPkg.version} version.`\n )\n );\n process.exit(1);\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/copy.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 default (api) => {\n api.describe({\n key: 'copy',\n config: {\n schema(joi) {\n return joi.array().items(\n joi.alternatives(\n joi.object({\n from: joi.string(),\n to: joi.string()\n }),\n joi.string()\n )\n );\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/cssLoader.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 default (api) => {\n api.describe({\n key: 'cssLoader',\n config: {\n default: {},\n schema(joi) {\n return joi\n .object({\n url: joi.alternatives(joi.boolean(), joi.function()),\n import: joi.alternatives(joi.boolean(), joi.function()),\n modules: joi.alternatives(\n joi.boolean(),\n joi.string(),\n joi.object()\n ),\n sourceMap: joi.boolean(),\n importLoaders: joi.number(),\n onlyLocals: joi.boolean(),\n esModule: joi.boolean(),\n localsConvention: joi\n .string()\n .valid(\n 'asIs',\n 'camelCase',\n 'camelCaseOnly',\n 'dashes',\n 'dashesOnly'\n )\n })\n .description(\n 'more css-loader options see https://webpack.js.org/loaders/css-loader/#options'\n );\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/define.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":"Delete `⏎············`","line":9,"column":23,"nodeType":null,"messageId":"delete","endLine":10,"endColumn":13,"fix":{"range":[187,200],"text":""}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default (api) => {\n api.describe({\n key: 'define',\n config: {\n schema(joi) {\n return joi.object();\n },\n default: {\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/devScripts.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 default (api) => {\n api.describe({\n key: 'devScripts',\n config: {\n schema(joi) {\n return joi.object();\n }\n },\n enableBy() {\n return api.env === 'development';\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/devServer.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 `.number()` with `⏎····························.number()⏎····························`","line":10,"column":34,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":43,"fix":{"range":[231,240],"text":"\n .number()\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `joi.boolean(),·joi.function()` with `⏎····························joi.boolean(),⏎····························joi.function()⏎························`","line":22,"column":55,"nodeType":null,"messageId":"replace","endLine":22,"endColumn":84,"fix":{"range":[812,841],"text":"\n joi.boolean(),\n joi.function()\n "}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"\nexport default (api) => {\n api.describe({\n key: 'devServer',\n config: {\n default: {},\n schema(joi) {\n return joi\n .object({\n port: joi.number().description('devServer port, default 8000'),\n host: joi.string(),\n https: joi.alternatives(\n joi\n .object({\n key: joi.string(),\n cert: joi.string()\n })\n .unknown(),\n joi.boolean()\n ),\n headers: joi.object(),\n writeToDisk: joi.alternatives(joi.boolean(), joi.function())\n })\n .description('devServer configs')\n .unknown(true);\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/devtool.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 default (api) => {\n api.describe({\n key: 'devtool',\n config: {\n schema(joi) {\n return joi.string();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/dynamicImport.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 default (api) => {\n api.describe({\n key: 'dynamicImport',\n config: {\n schema(joi) {\n return joi.boolean();\n }\n },\n default: false\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/exportStatic.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·(` with `⏎············`","line":13,"column":24,"nodeType":null,"messageId":"replace","endLine":13,"endColumn":26,"fix":{"range":[405,407],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":14,"column":1,"nodeType":null,"messageId":"insert","endLine":14,"endColumn":1,"fix":{"range":[440,440],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `:·api.config?.exportStatic)` with `····:·api.config?.exportStatic`","line":15,"column":13,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":40,"fix":{"range":[494,521],"text":" : api.config?.exportStatic"}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"export default (api) => {\n api.describe({\n key: 'exportStatic',\n config: {\n schema(joi) {\n return joi.object({\n htmlSuffix: joi.boolean(),\n dynamicRoot: joi.boolean()\n });\n }\n },\n // TODO: api.EnableBy.config 读取的 userConfig,modifyDefaultConfig hook 修改后对这个判断不起效\n enableBy: () => ('exportStatic' in api.userConfig\n ? api.userConfig.exportStatic\n : api.config?.exportStatic)\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/externals.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 `joi.object(),·joi.string(),·joi.function()` with `⏎····················joi.object(),⏎····················joi.string(),⏎····················joi.function()⏎················`","line":8,"column":41,"nodeType":null,"messageId":"replace","endLine":8,"endColumn":83,"fix":{"range":[233,275],"text":"\n joi.object(),\n joi.string(),\n joi.function()\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default (api) => {\n api.describe({\n key: 'externals',\n config: {\n schema(joi) {\n // https://webpack.js.org/configuration/externals/#externals\n return joi.alternatives(joi.object(), joi.string(), joi.function());\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/extraBabelPlugins.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 default (api) => {\n api.describe({\n key: 'extraBabelPlugins',\n config: {\n schema(joi) {\n return joi.array();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/extraBabelPresets.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 default (api) => {\n api.describe({\n key: 'extraBabelPresets',\n config: {\n schema(joi) {\n return joi.array();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/extraPostCSSPlugins.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 default (api) => {\n api.describe({\n key: 'extraPostCSSPlugins',\n config: {\n schema(joi) {\n return joi.array();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/globalCSS.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `file` with `(file)`","line":19,"column":14,"nodeType":null,"messageId":"replace","endLine":19,"endColumn":18,"fix":{"range":[432,436],"text":"(file)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `file` with `(file)`","line":20,"column":17,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":21,"fix":{"range":[486,490],"text":"(file)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":24,"column":14,"nodeType":null,"messageId":"insert","endLine":24,"endColumn":14,"fix":{"range":[575,575],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.map(file·=>·`require('${winPath(relative(absTmpPath,·file))}');`` with `····.map(⏎····················(file)·=>⏎························`require('${winPath(relative(absTmpPath,·file))}');`⏎················`","line":25,"column":13,"nodeType":null,"messageId":"replace","endLine":25,"endColumn":78,"fix":{"range":[605,670],"text":" .map(\n (file) =>\n `require('${winPath(relative(absTmpPath, file))}');`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":26,"column":1,"nodeType":null,"messageId":"insert","endLine":26,"endColumn":1,"fix":{"range":[672,672],"text":" "}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":5,"fixableWarningCount":0,"source":"import { relative, join } from 'path';\nimport { existsSync } from 'fs';\n\nexport default (api) => {\n const {\n paths,\n utils: { winPath }\n } = api;\n const { absSrcPath = '', absTmpPath = '' } = paths;\n const files = [\n 'global.css',\n 'global.less',\n 'global.scss',\n 'global.sass',\n 'global.styl',\n 'global.stylus'\n ];\n const globalCSSFile = files\n .map(file => join(absSrcPath || '', file))\n .filter(file => existsSync(file))\n .slice(0, 1);\n\n api.addEntryCodeAhead(\n () => `${globalCSSFile\n .map(file => `require('${winPath(relative(absTmpPath, file))}');`)\n .join('')}`\n );\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/html.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎············`","line":12,"column":23,"nodeType":null,"messageId":"delete","endLine":13,"endColumn":13,"fix":{"range":[386,399],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"export default (api) => {\n api.describe({\n key: 'html',\n config: {\n schema(joi) {\n return joi\n .object()\n .description(\n 'more html-webpack-plugin options see https://github.com/jantimon/html-webpack-plugin#configuration'\n );\n },\n default: {\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/inlineLimit.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 default (api) => {\n api.describe({\n key: 'inlineLimit',\n config: {\n schema(joi) {\n return joi.number();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/lessLoader.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 default (api) => {\n api.describe({\n key: 'lessLoader',\n config: {\n default: {},\n schema(joi) {\n return joi.object();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/mock.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···································`","line":75,"column":60,"nodeType":null,"messageId":"insert","endLine":75,"endColumn":60,"fix":{"range":[2293,2293],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":110,"column":21,"nodeType":null,"messageId":"insert","endLine":110,"endColumn":21,"fix":{"range":[3254,3254],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":111,"column":13,"nodeType":null,"messageId":"insert","endLine":111,"endColumn":13,"fix":{"range":[3297,3297],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":112,"column":1,"nodeType":null,"messageId":"insert","endLine":112,"endColumn":1,"fix":{"range":[3314,3314],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `item` with `(item)`","line":145,"column":17,"nodeType":null,"messageId":"replace","endLine":145,"endColumn":21,"fix":{"range":[4528,4532],"text":"(item)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":171,"column":55,"nodeType":null,"messageId":"insert","endLine":171,"endColumn":55,"fix":{"range":[5519,5519],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":172,"column":20,"nodeType":null,"messageId":"delete","endLine":172,"endColumn":23,"fix":{"range":[5539,5542],"text":""}}],"errorCount":7,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"import { existsSync, readFileSync } from 'fs';\nimport { resolve } from 'path';\nimport { chokidar, lodash, parseRequireDeps } from '@fesjs/utils';\nimport bodyParser from 'body-parser';\nimport cookieParser from 'cookie-parser';\nimport mockjs from 'mockjs';\n\nexport default (api) => {\n let mockFlag = false; // mock 开关flag\n let mockPrefix = '/'; // mock 过滤前缀\n let mockFile = ''; // mock 文件\n let loadMock = ''; // mock 对象\n\n const registerBabel = (paths) => {\n // support\n // clear require cache and set babel register\n const requireDeps = paths.reduce((memo, file) => {\n memo = memo.concat(parseRequireDeps(file));\n return memo;\n }, []);\n requireDeps.forEach((f) => {\n if (require.cache[f]) {\n delete require.cache[f];\n }\n });\n api.babelRegister.setOnlyMap({\n key: 'mock',\n value: [...paths, ...requireDeps]\n });\n };\n\n api.describe({\n key: 'mock',\n config: {\n schema(joi) {\n return joi.alternatives(joi.boolean(), joi.object());\n }\n },\n enableBy: () => process.env.NODE_ENV === 'development'\n });\n\n // 对 array、object 遍历处理\n function traversalHandler(val, callback) {\n if (lodash.isArray(val)) {\n val.forEach(callback);\n }\n if (lodash.isPlainObject(val)) {\n Object.keys(val).forEach((key) => {\n callback(val[key], key);\n });\n }\n }\n\n // 根据参数个数获取配置\n function getOption(arg) {\n const len = arg.length;\n // 默认配置\n const option = {\n headers: {\n 'Cache-Control': 'no-cache'\n },\n statusCode: 200,\n cookies: [],\n timeout: 0\n };\n if (len === 0) return option;\n if (len === 1) {\n const newOption = arg[0];\n if (lodash.isPlainObject(newOption)) {\n traversalHandler(newOption, (value, key) => {\n if (key === 'headers') {\n traversalHandler(\n newOption.headers,\n (headervalue, headerkey) => {\n option.headers[headerkey] = newOption.headers[headerkey];\n }\n );\n } else {\n option[key] = newOption[key];\n }\n });\n }\n } else {\n option.url = arg[0];\n option.result = arg[1];\n }\n return option;\n }\n\n // 把基于 cgiMockfile 的相对绝对转成绝对路径\n function parsePath(value) {\n return resolve(api.cwd, value);\n }\n\n const createMock = () => {\n const requestList = [];\n const cgiMock = (...arg) => {\n const option = getOption(arg);\n if (!option.url || !option.result) return;\n requestList.push(option);\n };\n\n const utils = {};\n utils.file = function (file) {\n return readFileSync(parsePath(file));\n };\n\n // mock打开情况下,配置的过滤前缀\n const mockPrefixTemp = api.config.mock.prefix || mockPrefix;\n mockPrefix = mockPrefixTemp === mockPrefix\n ? mockPrefixTemp\n : `${mockPrefixTemp}/`;\n // mock文件处理\n mockFile = parsePath('./mock.js');\n if (!existsSync(mockFile)) {\n api.logger.info('mock.js File does not exist, please check');\n return;\n }\n // 清除require的缓存,保证 mock 文件修改后拿到最新的 mock.js\n if (require.cache[mockFile]) {\n delete require.cache[mockFile];\n }\n // require最新的 mock.js 文件\n try {\n // register babel\n registerBabel([mockFile]);\n const _initFunction = require(mockFile);\n const initFunction = _initFunction.default || _initFunction;\n if (!lodash.isFunction(initFunction)) {\n api.logger.info('mock.js should export Function');\n return;\n }\n initFunction({ cgiMock, mockjs, utils });\n } catch (err) {\n api.logger.error('mock.js run fail!');\n }\n\n return (req, res, next) => {\n // 如果请求不是以 cgiMock.prefix 开头,直接 next\n if (!req.path.startsWith(mockPrefix)) {\n return next();\n }\n // 请求以 cgiMock.prefix 开头,匹配处理\n const matchRequet = requestList.find(\n item => req.path.search(item.url) !== -1\n );\n if (!matchRequet) {\n return next();\n }\n\n const sendData = () => {\n // set header\n res.set(matchRequet.headers);\n // set Content-Type\n matchRequet.type && res.type(matchRequet.type);\n // set status code\n res.status(matchRequet.statusCode);\n // set cookie\n traversalHandler(matchRequet.cookies, (item) => {\n const name = item.name;\n const value = item.value;\n delete item.name;\n delete item.value;\n res.cookie(name, value, item);\n });\n\n // do result\n if (lodash.isFunction(matchRequet.result)) {\n matchRequet.result(req, res);\n } else if (\n lodash.isArray(matchRequet.result)\n || lodash.isPlainObject(matchRequet.result)\n ) {\n !matchRequet.type && res.type('json');\n res.json(matchRequet.result);\n } else {\n !matchRequet.type && res.type('text');\n res.send(matchRequet.result.toString());\n }\n };\n\n bodyParser.json({ strict: false })(req, res, () => {\n bodyParser.urlencoded({ extended: true })(req, res, () => {\n cookieParser()(req, res, () => {\n sendData();\n });\n });\n });\n };\n };\n\n api.onStart(() => {\n // 获取mock配置: 是否打开\n mockFlag = lodash.isPlainObject(api.config.mock)\n ? true\n : api.config.mock;\n if (!mockFlag) return;\n\n loadMock = createMock();\n return chokidar\n .watch(mockFile, {\n ignoreInitial: true\n })\n .on('change', () => {\n api.logger.info('mock.js changed,reload');\n loadMock = createMock();\n });\n });\n\n api.addBeforeMiddlewares(() => (req, res, next) => {\n if (!mockFlag) return next();\n loadMock(req, res, next);\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/mountElementId.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 default (api) => {\n api.describe({\n key: 'mountElementId',\n config: {\n default: 'app',\n schema(joi) {\n return joi.string().allow('');\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/nodeModulesTransform.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 default (api) => {\n api.describe({\n key: 'nodeModulesTransform',\n config: {\n default: {\n exclude: []\n },\n schema(joi) {\n return joi.object({\n exclude: joi.array().items(joi.string())\n });\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/outputPath.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/plugins.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 default (api) => {\n api.describe({\n key: 'plugins',\n config: {\n schema(joi) {\n return joi.array().items(joi.string());\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/postcssLoader.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 default (api) => {\n api.describe({\n key: 'postcssLoader',\n config: {\n schema(joi) {\n return joi.object();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/proxy.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 default (api) => {\n api.describe({\n key: 'proxy',\n config: {\n onChange: () => {\n // todo 重新执行proxy的逻辑\n },\n schema(joi) {\n return joi.object();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/publicPath.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/runtimePublicPath.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 default (api) => {\n api.describe({\n key: 'runtimePublicPath',\n config: {\n schema(joi) {\n return joi.boolean();\n }\n },\n default: false\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/singular.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎····················`","line":7,"column":27,"nodeType":null,"messageId":"delete","endLine":8,"endColumn":21,"fix":{"range":[168,189],"text":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"export default (api) => {\n api.describe({\n key: 'singular',\n config: {\n default: false,\n schema(joi) {\n return joi\n .boolean();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/targets.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 default (api) => {\n api.describe({\n key: 'targets',\n config: {\n default: {\n chrome: 49,\n firefox: 64,\n safari: 10,\n edge: 13,\n ios: 10\n },\n schema(joi) {\n return joi.object();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/terserOptions.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 default (api) => {\n api.describe({\n key: 'terserOptions',\n config: {\n schema(joi) {\n return joi.object();\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/features/vueLoader.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":""}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"\n\nexport default (api) => {\n api.describe({\n key: 'vueLoader',\n config: {\n schema(joi) {\n return joi\n .object({})\n .description(\n 'more vue-loader options see https://vue-loader.vuejs.org/'\n );\n }\n }\n });\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/generateFiles/core/exports/coreExports.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `item·=>` with `(item)·=>⏎···············`","line":17,"column":18,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":25,"fix":{"range":[603,610],"text":"(item) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":18,"column":1,"nodeType":null,"messageId":"replace","endLine":18,"endColumn":17,"fix":{"range":[647,663],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":19,"column":1,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":1,"fix":{"range":[669,669],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎············`","line":20,"column":13,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":15,"fix":{"range":[712,714],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `.replace('CORE_EXPORTS',·content)` with `⏎················.replace('CORE_EXPORTS',·content)⏎················`","line":25,"column":25,"nodeType":null,"messageId":"replace","endLine":25,"endColumn":58,"fix":{"range":[913,946],"text":"\n .replace('CORE_EXPORTS', content)\n "}}],"errorCount":5,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":5,"fixableWarningCount":0,"source":"import { readFileSync } from 'fs';\nimport { join } from 'path';\nimport generateExports from '../../../../utils/generateExports';\nimport { runtimePath } from '../../../../utils/constants';\n\nexport default function (api) {\n api.onGenerateFiles(async () => {\n const coreExports = await api.applyPlugins({\n key: 'addCoreExports',\n type: api.ApplyPluginsType.add,\n initialValue: []\n });\n\n const fesExportsHook = {}; // repeated definition\n const absoluteFilePath = 'core/coreExports.js';\n const content = `${coreExports\n .map(item => generateExports(absoluteFilePath, {\n item,\n fesExportsHook\n }))\n .join('\\n')}\\n`;\n const tpl = readFileSync(join(__dirname, './coreExports.tpl'), 'utf-8');\n api.writeTmpFile({\n path: absoluteFilePath,\n content: tpl.replace('CORE_EXPORTS', content).replace('RUNTIME_PATH', runtimePath)\n });\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/generateFiles/core/exports/pluginExports.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `item·=>` with `(item)·=>⏎···················`","line":16,"column":22,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":29,"fix":{"range":[546,553],"text":"(item) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":17,"column":1,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":1,"fix":{"range":[590,590],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":18,"column":21,"nodeType":null,"messageId":"insert","endLine":18,"endColumn":21,"fix":{"range":[636,636],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎················`","line":19,"column":17,"nodeType":null,"messageId":"replace","endLine":19,"endColumn":19,"fix":{"range":[667,669],"text":" })\n "}}],"errorCount":4,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":4,"fixableWarningCount":0,"source":"import generateExports from '../../../../utils/generateExports';\n\nexport default function (api) {\n api.onGenerateFiles(async () => {\n const fesExports = await api.applyPlugins({\n key: 'addPluginExports',\n type: api.ApplyPluginsType.add,\n initialValue: []\n });\n\n const fesExportsHook = {}; // repeated definition\n const absoluteFilePath = 'core/pluginExports.js';\n api.writeTmpFile({\n path: absoluteFilePath,\n content: `${fesExports\n .map(item => generateExports(absoluteFilePath, {\n item,\n fesExportsHook\n }))\n .join('\\n')}\\n`\n });\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/generateFiles/core/plugin/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················existsSync(appPath)·&&·appPath⏎············` with `existsSync(appPath)·&&·appPath`","line":40,"column":28,"nodeType":null,"messageId":"replace","endLine":42,"endColumn":13,"fix":{"range":[1234,1294],"text":"existsSync(appPath) && appPath"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { readFileSync, existsSync } from 'fs';\nimport { join } from 'path';\nimport { winPath } from '@fesjs/utils';\nimport { runtimePath } from '../../../../utils/constants';\n\nexport default function (api) {\n const {\n paths,\n utils: { Mustache }\n } = api;\n\n const absoluteFilePath = 'core/plugin.js';\n\n api.onGenerateFiles(async () => {\n const validKeys = await api.applyPlugins({\n key: 'addRuntimePluginKey',\n type: api.ApplyPluginsType.add,\n initialValue: [\n // 初始化数据\n 'beforeRender',\n // modify渲染工具\n 'modifyClientRenderOpts',\n 'rootContainer',\n // app生成时触发\n 'onAppCreated',\n // 渲染\n 'render',\n // 修改路由\n 'patchRoutes',\n // 修改histror\n 'modifyCreateHistroy',\n // 生成router时触发\n 'onRouterCreated'\n ]\n });\n const appPath = winPath(join(paths.absSrcPath, 'app.js'));\n const plugins = await api.applyPlugins({\n key: 'addRuntimePlugin',\n type: api.ApplyPluginsType.add,\n initialValue: [\n existsSync(appPath) && appPath\n ].filter(Boolean)\n });\n api.writeTmpFile({\n path: absoluteFilePath,\n content: Mustache.render(\n readFileSync(join(__dirname, 'plugin.tpl'), 'utf-8'),\n {\n validKeys,\n runtimePath\n }\n )\n });\n api.writeTmpFile({\n path: 'core/pluginRegister.js',\n content: Mustache.render(\n readFileSync(join(__dirname, 'pluginRegister.tpl'), 'utf-8'),\n {\n plugins: plugins.map((plugin, index) => ({\n index,\n path: winPath(plugin)\n }))\n }\n )\n });\n });\n\n api.addCoreExports(() => ({\n specifiers: ['plugin'],\n source: absoluteFilePath\n }));\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/generateFiles/fes/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/misc/route/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····join,·extname,·posix,·basename⏎` with `·join,·extname,·posix,·basename·`","line":2,"column":9,"nodeType":null,"messageId":"replace","endLine":4,"endColumn":1,"fix":{"range":[66,102],"text":" join, extname, posix, basename "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `b` with `(b)`","line":88,"column":17,"nodeType":null,"messageId":"replace","endLine":88,"endColumn":18,"fix":{"range":[2740,2741],"text":"(b)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `parentRoutePath,·fileName,·config` with `⏎················parentRoutePath,⏎················fileName,⏎················config⏎············`","line":96,"column":52,"nodeType":null,"messageId":"replace","endLine":96,"endColumn":85,"fix":{"range":[3105,3138],"text":"\n parentRoutePath,\n fileName,\n config\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·?·JSON.parse(routeMetaBlock.content)` with `⏎················?·JSON.parse(routeMetaBlock.content)⏎···············`","line":97,"column":54,"nodeType":null,"messageId":"replace","endLine":97,"endColumn":91,"fix":{"range":[3194,3231],"text":"\n ? JSON.parse(routeMetaBlock.content)\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `layoutRoute.children,·component,·nextParentRouteUrl,·config` with `⏎····················layoutRoute.children,⏎····················component,⏎····················nextParentRouteUrl,⏎····················config⏎················`","line":122,"column":27,"nodeType":null,"messageId":"replace","endLine":122,"endColumn":86,"fix":{"range":[4065,4124],"text":"\n layoutRoute.children,\n component,\n nextParentRouteUrl,\n config\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `sonPath.indexOf(':')·!==·-1·&&·sonPath.indexOf(':pathMatch(.*)')·===·-1` with `⏎················sonPath.indexOf(':')·!==·-1·&&⏎················sonPath.indexOf(':pathMatch(.*)')·===·-1⏎············`","line":151,"column":17,"nodeType":null,"messageId":"replace","endLine":151,"endColumn":88,"fix":{"range":[4808,4879],"text":"\n sonPath.indexOf(':') !== -1 &&\n sonPath.indexOf(':pathMatch(.*)') === -1\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `·||`","line":187,"column":49,"nodeType":null,"messageId":"insert","endLine":187,"endColumn":49,"fix":{"range":[5951,5951],"text":" ||"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `·||`","line":188,"column":12,"nodeType":null,"messageId":"delete","endLine":188,"endColumn":15,"fix":{"range":[5963,5966],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎····················`","line":220,"column":27,"nodeType":null,"messageId":"delete","endLine":221,"endColumn":21,"fix":{"range":[6952,6973],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `····`","line":222,"column":21,"nodeType":null,"messageId":"delete","endLine":222,"endColumn":25,"fix":{"range":[7003,7007],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `····`","line":223,"column":21,"nodeType":null,"messageId":"delete","endLine":223,"endColumn":25,"fix":{"range":[7048,7052],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `····`","line":224,"column":1,"nodeType":null,"messageId":"delete","endLine":224,"endColumn":5,"fix":{"range":[7071,7075],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(__dirname,·'template/routes.tpl'),·'utf-8'` with `⏎············join(__dirname,·'template/routes.tpl'),⏎············'utf-8'⏎········`","line":271,"column":40,"nodeType":null,"messageId":"replace","endLine":271,"endColumn":87,"fix":{"range":[8237,8284],"text":"\n join(__dirname, 'template/routes.tpl'),\n 'utf-8'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·historyType[api.config.router.mode]·||` with `⏎····················historyType[api.config.router.mode]·||⏎···················`","line":281,"column":32,"nodeType":null,"messageId":"replace","endLine":281,"endColumn":71,"fix":{"range":[8615,8654],"text":"\n historyType[api.config.router.mode] ||\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `join(__dirname,·'template/runtime.tpl'),·'utf-8'` with `⏎················join(__dirname,·'template/runtime.tpl'),⏎················'utf-8'⏎············`","line":287,"column":35,"nodeType":null,"messageId":"replace","endLine":287,"endColumn":83,"fix":{"range":[8805,8853],"text":"\n join(__dirname, 'template/runtime.tpl'),\n 'utf-8'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'getRoutes',·'getRouter',·'getHistory',·'destroyRouter'` with `⏎················'getRoutes',⏎················'getRouter',⏎················'getHistory',⏎················'destroyRouter'⏎············`","line":293,"column":26,"nodeType":null,"messageId":"replace","endLine":293,"endColumn":81,"fix":{"range":[8942,8997],"text":"\n 'getRoutes',\n 'getRouter',\n 'getHistory',\n 'destroyRouter'\n "}}],"errorCount":16,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":16,"fixableWarningCount":0,"source":"import { readdirSync, statSync, readFileSync } from 'fs';\nimport {\n join, extname, posix, basename\n} from 'path';\nimport { lodash } from '@fesjs/utils';\nimport { parse } from '@vue/compiler-sfc';\nimport { runtimePath } from '../../../utils/constants';\n\n// pages\n// ├── index.vue # 根路由页面 路径 /\n// ├── *.vue # 模糊匹配 路径 *\n// ├── a.vue # 路径 /a\n// ├── b\n// │ ├── index.vue # 路径 /b\n// │ ├── @id.vue # 动态路由 /b/:id\n// │ └── c.vue # 路径 /b/c\n// └── layout.vue # 根路由下所有page共用的外层\n\nconst isProcessFile = function (path) {\n const ext = extname(path);\n return statSync(path).isFile() && ['.vue'].includes(ext);\n};\n\nconst isProcessDirectory = function (path, item) {\n const component = join(path, item);\n return statSync(component).isDirectory() && !['components'].includes(item);\n};\n\nconst checkHasLayout = function (path) {\n const dirList = readdirSync(path);\n return dirList.some((item) => {\n if (!isProcessFile(join(path, item))) {\n return false;\n }\n const ext = extname(item);\n const fileName = basename(item, ext);\n return fileName === 'layout';\n });\n};\n\nconst getRouteName = function (parentRoutePath, fileName) {\n const routeName = posix.join(parentRoutePath, fileName);\n return routeName\n .slice(1)\n .replace(/\\//g, '_')\n .replace(/@/g, '_')\n .replace(/\\*/g, 'FUZZYMATCH');\n};\n\nconst getComponentPath = function (parentRoutePath, fileName, config) {\n const pagesName = config.singular ? 'page' : 'pages';\n return posix.join(`@/${pagesName}/`, parentRoutePath, fileName);\n};\n\nconst getRoutePath = function (parentRoutePath, fileName) {\n // /index.vue -> /\n if (fileName === 'index') {\n fileName = '';\n }\n // /@id.vue -> /:id\n if (fileName.startsWith('@')) {\n fileName = fileName.replace(/@/, ':');\n }\n // /*.vue -> :pathMatch(.*)\n if (fileName.includes('*')) {\n fileName = fileName.replace('*', ':pathMatch(.*)');\n }\n return posix.join(parentRoutePath, fileName);\n};\n\n// TODO 约定 layout 目录作为布局文件夹,\nconst genRoutes = function (parentRoutes, path, parentRoutePath, config) {\n const dirList = readdirSync(path);\n const hasLayout = checkHasLayout(path);\n const layoutRoute = {\n children: []\n };\n if (hasLayout) {\n layoutRoute.path = parentRoutePath;\n parentRoutes.push(layoutRoute);\n }\n dirList.forEach((item) => {\n // 文件或者目录的绝对路径\n const component = join(path, item);\n if (isProcessFile(component)) {\n const { descriptor } = parse(readFileSync(component, 'utf-8'));\n const routeMetaBlock = descriptor.customBlocks.find(\n b => b.type === 'config'\n );\n const ext = extname(item);\n const fileName = basename(item, ext);\n // 路由的path\n const routePath = getRoutePath(parentRoutePath, fileName);\n // 路由名称\n const routeName = getRouteName(parentRoutePath, fileName);\n const componentPath = getComponentPath(parentRoutePath, fileName, config);\n const routeMeta = routeMetaBlock?.content ? JSON.parse(routeMetaBlock.content) : {};\n const routeConfig = {\n path: routePath,\n component: componentPath,\n name: routeMeta.name || routeName,\n meta: routeMeta\n };\n if (hasLayout) {\n if (fileName === 'layout') {\n layoutRoute.component = componentPath;\n } else {\n layoutRoute.children.push(routeConfig);\n }\n } else {\n parentRoutes.push(routeConfig);\n }\n }\n });\n\n dirList.forEach((item) => {\n if (isProcessDirectory(path, item)) {\n // 文件或者目录的绝对路径\n const component = join(path, item);\n const nextParentRouteUrl = posix.join(parentRoutePath, item);\n if (hasLayout) {\n genRoutes(layoutRoute.children, component, nextParentRouteUrl, config);\n } else {\n genRoutes(parentRoutes, component, nextParentRouteUrl, config);\n }\n }\n });\n};\n\n/**\n * 智能路由\n * 1、路由的路径是多个“/”组成的字符串,使用“/”分割后得到不同的子项\n * 2、计算子项个数,用个数乘以4,计入得分\n * 3、判断子项是否是静态的,即不包含“:”、“*”等特殊字符串,若是计入3分。\n * 4、判断子项是否是动态的,即包含“:”特殊字符,若是计入2分。\n * 5、判断子项是否是模糊匹配,即包含“*”特殊字符,若是扣除1分。\n * 6、判断子项是否是根端,即只是“/”,若是计入1分。\n\n * @param {*} routes\n */\nconst rank = function (routes) {\n routes.forEach((item) => {\n const path = item.path;\n let arr = path.split('/');\n if (arr[0] === '') {\n arr = arr.slice(1);\n }\n let count = 0;\n arr.forEach((sonPath) => {\n count += 4;\n if (sonPath.indexOf(':') !== -1 && sonPath.indexOf(':pathMatch(.*)') === -1) {\n count += 2;\n } else if (sonPath.indexOf(':pathMatch(.*)') !== -1) {\n count -= 1;\n } else if (sonPath === '') {\n count += 1;\n } else {\n count += 3;\n }\n });\n item.count = count;\n if (item.children && item.children.length) {\n rank(item.children);\n }\n });\n routes.sort((a, b) => b.count - a.count);\n};\n\nconst getRoutes = function ({ config, absPagesPath }) {\n // 用户配置了routes则使用用户配置的\n const configRoutes = config.router.routes;\n if (configRoutes && configRoutes.length > 0) return configRoutes;\n\n const routes = [];\n genRoutes(routes, absPagesPath, '/', config);\n rank(routes);\n return routes;\n};\n\nconst getRoutesJSON = function ({ routes, config }) {\n // 因为要往 routes 里加无用的信息,所以必须 deep clone 一下,避免污染\n const clonedRoutes = lodash.cloneDeep(routes);\n\n function isFunctionComponent(component) {\n // eslint-disable-next-line\n return (\n /^\\((.+)?\\)(\\s+)?=>/.test(component)\n || /^function([^(]+)?\\(([^)]+)?\\)([^{]+)?{/.test(component)\n );\n }\n\n function replacer(key, value) {\n switch (key) {\n case 'component':\n if (isFunctionComponent(value)) return value;\n if (config.dynamicImport) {\n // TODO 针对目录进行 chunk 划分,import(/* webpackChunkName: \"group-user\" */ './UserDetails.vue')\n return `() => import('${value}')`;\n }\n return `require('${value}').default`;\n default:\n return value;\n }\n }\n\n return JSON.stringify(clonedRoutes, replacer, 2)\n .replace(\n /\"component\": (\"(.+?)\")/g,\n (global, m1, m2) => `\"component\": ${m2.replace(/\\^/g, '\"')}`\n )\n .replace(/\\\\r\\\\n/g, '\\r\\n')\n .replace(/\\\\n/g, '\\r\\n');\n};\n\nexport default function (api) {\n api.describe({\n key: 'router',\n config: {\n schema(joi) {\n return joi\n .object({\n routes: joi.array(),\n mode: joi.string()\n });\n },\n default: {\n mode: 'hash'\n }\n }\n });\n\n api.registerMethod({\n name: 'getRoutes',\n async fn() {\n return api.applyPlugins({\n key: 'modifyRoutes',\n type: api.ApplyPluginsType.modify,\n initialValue: getRoutes({\n config: api.config,\n absPagesPath: api.paths.absPagesPath\n })\n });\n }\n });\n\n api.registerMethod({\n name: 'getRoutesJSON',\n async fn() {\n const routes = await api.getRoutes();\n return getRoutesJSON({ routes, config: api.config });\n }\n });\n\n const {\n utils: { Mustache }\n } = api;\n\n const namespace = 'core/routes';\n\n const absCoreFilePath = join(namespace, 'routes.js');\n\n const absRuntimeFilePath = join(namespace, 'runtime.js');\n\n const historyType = {\n history: 'createWebHistory',\n hash: 'createWebHashHistory',\n memory: 'createMemoryHistory'\n };\n\n api.onGenerateFiles(async () => {\n const routesTpl = readFileSync(join(__dirname, 'template/routes.tpl'), 'utf-8');\n const routes = await api.getRoutesJSON();\n\n api.writeTmpFile({\n path: absCoreFilePath,\n content: Mustache.render(routesTpl, {\n runtimePath,\n routes,\n config: api.config,\n routerBase: api.config.base,\n CREATE_HISTORY: historyType[api.config.router.mode] || 'createWebHashHistory'\n })\n });\n\n api.writeTmpFile({\n path: absRuntimeFilePath,\n content: readFileSync(join(__dirname, 'template/runtime.tpl'), 'utf-8')\n });\n });\n\n api.addCoreExports(() => [\n {\n specifiers: ['getRoutes', 'getRouter', 'getHistory', 'destroyRouter'],\n source: absCoreFilePath\n }\n ]);\n\n api.addRuntimePlugin(() => `@@/${absRuntimeFilePath}`);\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/plugins/registerMethods.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·statSync,·readFileSync,·writeFileSync,` with `⏎····statSync,⏎····readFileSync,⏎····writeFileSync,⏎···`","line":4,"column":16,"nodeType":null,"messageId":"replace","endLine":4,"endColumn":55,"fix":{"range":[91,130],"text":"\n statSync,\n readFileSync,\n writeFileSync,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············path,⏎············content⏎·······` with `·path,·content`","line":39,"column":13,"nodeType":null,"messageId":"replace","endLine":42,"endColumn":8,"fix":{"range":[1019,1065],"text":" path, content"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!existsSync(absPath)·||·readFileSync(absPath,·'utf-8')·!==·content` with `⏎················!existsSync(absPath)·||⏎················readFileSync(absPath,·'utf-8')·!==·content⏎············`","line":49,"column":17,"nodeType":null,"messageId":"replace","endLine":49,"endColumn":83,"fix":{"range":[1371,1437],"text":"\n !existsSync(absPath) ||\n readFileSync(absPath, 'utf-8') !== content\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············namespace,·path,·ignore⏎·······` with `·namespace,·path,·ignore`","line":57,"column":13,"nodeType":null,"messageId":"replace","endLine":59,"endColumn":8,"fix":{"range":[1599,1643],"text":" namespace, path, ignore"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················path,⏎················'api.copyTmpFiles()·should·has·param·path'⏎············` with `path,·'api.copyTmpFiles()·should·has·param·path'`","line":64,"column":20,"nodeType":null,"messageId":"replace","endLine":67,"endColumn":13,"fix":{"range":[1837,1931],"text":"path, 'api.copyTmpFiles() should has param path'"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎················namespace,⏎················'api.copyTmpFiles()·should·has·param·namespace'⏎············` with `namespace,·'api.copyTmpFiles()·should·has·param·namespace'`","line":68,"column":20,"nodeType":null,"messageId":"replace","endLine":71,"endColumn":13,"fix":{"range":[1953,2057],"text":"namespace, 'api.copyTmpFiles() should has param namespace'"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!ignore.some(pattern·=>·new·RegExp(pattern).test(file))` with `⏎························!ignore.some((pattern)·=>⏎····························new·RegExp(pattern).test(file)⏎························)⏎····················`","line":85,"column":25,"nodeType":null,"messageId":"replace","endLine":85,"endColumn":80,"fix":{"range":[2669,2724],"text":"\n !ignore.some((pattern) =>\n new RegExp(pattern).test(file)\n )\n "}}],"errorCount":7,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":7,"fixableWarningCount":0,"source":"import assert from 'assert';\nimport { dirname, join } from 'path';\nimport {\n existsSync, statSync, readFileSync, writeFileSync, copyFileSync\n} from 'fs';\n\nexport default function (api) {\n [\n 'onExit',\n 'onGenerateFiles',\n 'addPluginExports',\n 'addCoreExports',\n 'addRuntimePluginKey',\n 'addRuntimePlugin',\n 'addDevScripts',\n 'addEntryImportsAhead',\n 'addEntryImports',\n 'addEntryCodeAhead',\n 'addEntryCode',\n 'addBeforeMiddlewares',\n 'addHTMLHeadScripts',\n 'addMiddlewares',\n 'modifyRoutes',\n 'modifyBundler',\n 'modifyBundleImplementor',\n 'modifyBundleConfigOpts',\n 'modifyBundleConfig',\n 'modifyBabelOpts',\n 'modifyBabelPresetOpts',\n 'chainWebpack',\n 'addTmpGenerateWatcherPaths',\n 'modifyPublicPathStr'\n ].forEach((name) => {\n api.registerMethod({ name });\n });\n\n api.registerMethod({\n name: 'writeTmpFile',\n fn({\n path,\n content\n }) {\n assert(\n api.stage >= api.ServiceStage.pluginReady,\n 'api.writeTmpFile() should not execute in register stage.'\n );\n const absPath = join(api.paths.absTmpPath, path);\n api.utils.mkdirp.sync(dirname(absPath));\n if (!existsSync(absPath) || readFileSync(absPath, 'utf-8') !== content) {\n writeFileSync(absPath, content, 'utf-8');\n }\n }\n });\n\n api.registerMethod({\n name: 'copyTmpFiles',\n fn({\n namespace, path, ignore\n }) {\n assert(\n api.stage >= api.ServiceStage.pluginReady,\n 'api.copyTmpFiles() should not execute in register stage.'\n );\n assert(\n path,\n 'api.copyTmpFiles() should has param path'\n );\n assert(\n namespace,\n 'api.copyTmpFiles() should has param namespace'\n );\n const files = api.utils.glob.sync('**/*', {\n cwd: path\n });\n const base = join(api.paths.absTmpPath, namespace);\n files.forEach((file) => {\n const source = join(path, file);\n const target = join(base, file);\n if (!existsSync(dirname(target))) {\n api.utils.mkdirp.sync(dirname(target));\n }\n if (statSync(source).isDirectory()) {\n api.utils.mkdirp.sync(target);\n } else if (Array.isArray(ignore)) {\n if (!ignore.some(pattern => new RegExp(pattern).test(file))) {\n copyFileSync(source, target);\n }\n } else {\n copyFileSync(source, target);\n }\n });\n }\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/utils/constants.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/utils/generateExports.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-preset-built-in/src/utils/generateFiles.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············.uniq(watcherPaths.map(p·=>·winPath(p)))⏎············` with `.uniq(watcherPaths.map((p)·=>·winPath(p)))`","line":52,"column":15,"nodeType":null,"messageId":"replace","endLine":54,"endColumn":13,"fix":{"range":[1384,1450],"text":".uniq(watcherPaths.map((p) => winPath(p)))"}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `····`","line":55,"column":1,"nodeType":null,"messageId":"delete","endLine":55,"endColumn":5,"fix":{"range":[1468,1472],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `····`","line":56,"column":1,"nodeType":null,"messageId":"delete","endLine":56,"endColumn":5,"fix":{"range":[1502,1506],"text":""}}],"errorCount":3,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":3,"fixableWarningCount":0,"source":"import { chokidar, lodash, winPath } from '@fesjs/utils';\nimport { join } from 'path';\n\nexport default async ({ api, watch }) => {\n const { paths } = api;\n\n async function generate() {\n api.logger.debug('generate files');\n await api.applyPlugins({\n key: 'onGenerateFiles',\n type: api.ApplyPluginsType.event\n });\n }\n\n let watchers = [];\n\n await generate();\n\n function unwatch() {\n watchers.forEach((watcher) => {\n watcher.close();\n });\n watchers = [];\n }\n\n function createWatcher(path) {\n const watcher = chokidar.watch(path, {\n // ignore .dotfiles and _mock.js\n ignored: /(^|[/\\\\])(_mock.js$|\\..)/,\n ignoreInitial: true\n });\n watcher.on(\n 'all',\n lodash.throttle(async () => {\n await generate();\n }, 100)\n );\n watchers.push(watcher);\n }\n\n if (watch) {\n const watcherPaths = await api.applyPlugins({\n key: 'addTmpGenerateWatcherPaths',\n type: api.ApplyPluginsType.add,\n initialValue: [\n paths.absPagesPath,\n // 貌似没用到\n // join(paths.absSrcPath, api.config?.singular ? 'layout' : 'layouts'),\n join(paths.absSrcPath, 'app.js')\n ]\n });\n lodash\n .uniq(watcherPaths.map(p => winPath(p)))\n .forEach((p) => {\n createWatcher(p);\n });\n }\n\n return unwatch;\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-runtime/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 target: 'browser'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-runtime/src/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-runtime/src/plugin/index.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `!Object.keys(this.shared).includes(key),·'share·failed,·key·repeat'` with `⏎············!Object.keys(this.shared).includes(key),⏎············'share·failed,·key·repeat'⏎········`","line":35,"column":16,"nodeType":null,"messageId":"replace","endLine":35,"endColumn":83,"fix":{"range":[765,832],"text":"\n !Object.keys(this.shared).includes(key),\n 'share failed, key repeat'\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎········key,⏎········type,⏎········initialValue,⏎········args,⏎········async⏎···` with `·key,·type,·initialValue,·args,·async`","line":77,"column":19,"nodeType":null,"messageId":"replace","endLine":83,"endColumn":4,"fix":{"range":[2147,2228],"text":" key, type, initialValue, args, async"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `typeof·hook·===·'function'·||·typeof·hook·===·'object'·||` with `⏎································typeof·hook·===·'function'·||⏎····································typeof·hook·===·'object'·||⏎···································`","line":98,"column":36,"nodeType":null,"messageId":"replace","endLine":98,"endColumn":93,"fix":{"range":[2676,2733],"text":"\n typeof hook === 'function' ||\n typeof hook === 'object' ||\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎····························`","line":99,"column":123,"nodeType":null,"messageId":"insert","endLine":99,"endColumn":123,"fix":{"range":[2877,2877],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":131,"column":1,"nodeType":null,"messageId":"delete","endLine":132,"endColumn":1,"fix":{"range":[4270,4271],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···················`","line":142,"column":29,"nodeType":null,"messageId":"insert","endLine":142,"endColumn":29,"fix":{"range":[4678,4678],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":143,"column":1,"nodeType":null,"messageId":"insert","endLine":143,"endColumn":1,"fix":{"range":[4690,4690],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":144,"column":21,"nodeType":null,"messageId":"insert","endLine":144,"endColumn":21,"fix":{"range":[4763,4763],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":145,"column":1,"nodeType":null,"messageId":"insert","endLine":145,"endColumn":1,"fix":{"range":[4768,4768],"text":" "}}],"errorCount":9,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":9,"fixableWarningCount":0,"source":"/**\n * @copy 该文件代码大部分出自 umi,有需要请参考:\n * https://github.com/umijs/umi/blob/master/packages/runtime/src/Plugin/Plugin.ts\n */\n\nimport { assert } from '../utils';\n\nfunction _compose({ fns, args }) {\n if (fns.length === 1) {\n return fns[0];\n }\n const last = fns.pop();\n return fns.reduce((a, b) => () => b(a, args), last);\n}\n\nfunction isPromiseLike(obj) {\n return !!obj && typeof obj === 'object' && typeof obj.then === 'function';\n}\n\nexport const ApplyPluginsType = {\n compose: 'compose',\n event: 'event',\n modify: 'modify'\n};\n\nexport default class Plugin {\n constructor(opts) {\n this.validKeys = opts?.validKeys || [];\n this.hooks = {};\n // 共享\n this.shared = {};\n }\n\n share(key, obj) {\n assert(!Object.keys(this.shared).includes(key), 'share failed, key repeat');\n this.shared[key] = obj;\n }\n\n getShared(key) {\n return this.shared[key];\n }\n\n register(plugin) {\n assert(!!plugin.apply, 'register failed, plugin.apply must supplied');\n assert(!!plugin.path, 'register failed, plugin.path must supplied');\n Object.keys(plugin.apply).forEach((key) => {\n assert(\n this.validKeys.indexOf(key) > -1,\n `register failed, invalid key ${key} from plugin ${plugin.path}.`\n );\n if (!this.hooks[key]) this.hooks[key] = [];\n this.hooks[key] = this.hooks[key].concat(plugin.apply[key]);\n });\n }\n\n getHooks(keyWithDot) {\n const [key, ...memberKeys] = keyWithDot.split('.');\n let hooks = this.hooks[key] || [];\n if (memberKeys.length) {\n hooks = hooks\n .map((hook) => {\n try {\n let ret = hook;\n for (const memberKey of memberKeys) {\n ret = ret[memberKey];\n }\n return ret;\n } catch (e) {\n return null;\n }\n })\n .filter(Boolean);\n }\n return hooks;\n }\n\n applyPlugins({\n key,\n type,\n initialValue,\n args,\n async\n }) {\n const hooks = this.getHooks(key) || [];\n\n if (args) {\n assert(\n typeof args === 'object',\n 'applyPlugins failed, args must be plain object.'\n );\n }\n\n switch (type) {\n case ApplyPluginsType.modify:\n if (async) {\n return hooks.reduce(\n async (memo, hook) => {\n assert(typeof hook === 'function' || typeof hook === 'object' || isPromiseLike(hook),\n `applyPlugins failed, all hooks for key ${key} must be function, plain object or Promise.`);\n if (isPromiseLike(memo)) {\n memo = await memo;\n }\n if (typeof hook === 'function') {\n const ret = hook(memo, args);\n if (isPromiseLike(ret)) {\n return ret;\n }\n return ret;\n }\n if (isPromiseLike(hook)) {\n hook = await hook;\n }\n return { ...memo, ...hook };\n },\n isPromiseLike(initialValue)\n ? initialValue\n : Promise.resolve(initialValue)\n );\n }\n return hooks.reduce((memo, hook) => {\n assert(\n typeof hook === 'function' || typeof hook === 'object',\n `applyPlugins failed, all hooks for key ${key} must be function or plain object.`\n );\n if (typeof hook === 'function') {\n return hook(memo, args);\n }\n return { ...memo, ...hook };\n }, initialValue);\n\n\n case ApplyPluginsType.event:\n return hooks.forEach((hook) => {\n assert(\n typeof hook === 'function',\n `applyPlugins failed, all hooks for key ${key} must be function.`\n );\n hook(args);\n });\n\n case ApplyPluginsType.compose:\n return () => _compose({\n fns: hooks.concat(initialValue),\n args\n })();\n default:\n return null;\n }\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-runtime/src/utils/assert.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-runtime/src/utils/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/.eslintrc.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/.fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/.fes.local.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/.fes.prod.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/mock.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":6,"column":18,"nodeType":null,"messageId":"insert","endLine":6,"endColumn":18,"fix":{"range":[187,187],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":7,"column":1,"nodeType":null,"messageId":"insert","endLine":7,"endColumn":1,"fix":{"range":[204,204],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":8,"column":13,"nodeType":null,"messageId":"insert","endLine":8,"endColumn":13,"fix":{"range":[239,239],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":9,"column":1,"nodeType":null,"messageId":"insert","endLine":9,"endColumn":1,"fix":{"range":[248,248],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":10,"column":1,"nodeType":null,"messageId":"insert","endLine":10,"endColumn":1,"fix":{"range":[270,270],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":11,"column":13,"nodeType":null,"messageId":"insert","endLine":11,"endColumn":13,"fix":{"range":[343,343],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········})` with `············})⏎········`","line":12,"column":1,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":11,"fix":{"range":[345,355],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":15,"column":18,"nodeType":null,"messageId":"insert","endLine":15,"endColumn":18,"fix":{"range":[431,431],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":16,"column":1,"nodeType":null,"messageId":"replace","endLine":16,"endColumn":13,"fix":{"range":[448,460],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":17,"column":13,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":13,"fix":{"range":[483,483],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":18,"column":1,"nodeType":null,"messageId":"replace","endLine":18,"endColumn":13,"fix":{"range":[492,504],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":19,"column":1,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":1,"fix":{"range":[514,514],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":20,"column":13,"nodeType":null,"messageId":"insert","endLine":20,"endColumn":13,"fix":{"range":[573,573],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········})` with `············})⏎········`","line":21,"column":1,"nodeType":null,"messageId":"replace","endLine":21,"endColumn":11,"fix":{"range":[575,585],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎············`","line":26,"column":18,"nodeType":null,"messageId":"insert","endLine":26,"endColumn":18,"fix":{"range":[699,699],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":27,"column":13,"nodeType":null,"messageId":"insert","endLine":27,"endColumn":13,"fix":{"range":[728,728],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":28,"column":1,"nodeType":null,"messageId":"replace","endLine":28,"endColumn":13,"fix":{"range":[739,751],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":29,"column":1,"nodeType":null,"messageId":"insert","endLine":29,"endColumn":1,"fix":{"range":[760,760],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":30,"column":1,"nodeType":null,"messageId":"replace","endLine":30,"endColumn":17,"fix":{"range":[782,798],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":31,"column":13,"nodeType":null,"messageId":"insert","endLine":31,"endColumn":13,"fix":{"range":[850,850],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········})` with `············})⏎········`","line":32,"column":1,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":11,"fix":{"range":[852,862],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·msg:·\"不合法的请求:Missing·cookie·'wb_app_id'·for·method·parameter·of·type·String\",·transactionTime:·'20170309171146',` with `⏎············msg:·\"不合法的请求:Missing·cookie·'wb_app_id'·for·method·parameter·of·type·String\",⏎············transactionTime:·'20170309171146',⏎···········`","line":43,"column":28,"nodeType":null,"messageId":"replace","endLine":43,"endColumn":141,"fix":{"range":[1047,1160],"text":"\n msg: \"不合法的请求:Missing cookie 'wb_app_id' for method parameter of type String\",\n transactionTime: '20170309171146',\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'/random',` with `⏎········'/random',⏎·······`","line":51,"column":13,"nodeType":null,"messageId":"replace","endLine":51,"endColumn":23,"fix":{"range":[1309,1319],"text":"\n '/random',\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":52,"column":1,"nodeType":null,"messageId":"insert","endLine":52,"endColumn":1,"fix":{"range":[1334,1334],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `})` with `····})⏎····`","line":53,"column":5,"nodeType":null,"messageId":"replace","endLine":53,"endColumn":7,"fix":{"range":[1365,1367],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·value:·'kwan',·maxAge:·900000,` with `⏎················value:·'kwan',⏎················maxAge:·900000,⏎···············`","line":84,"column":32,"nodeType":null,"messageId":"replace","endLine":84,"endColumn":63,"fix":{"range":[2164,2195],"text":"\n value: 'kwan',\n maxAge: 900000,\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎············currentPage,·pageSize,·isAudited⏎·······` with `·currentPage,·pageSize,·isAudited`","line":91,"column":16,"nodeType":null,"messageId":"replace","endLine":93,"endColumn":8,"fix":{"range":[2320,2373],"text":" currentPage, pageSize, isAudited"}}],"errorCount":27,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":27,"fixableWarningCount":0,"source":"export default function ({ cgiMock, mockjs, utils }) {\n const { Random } = mockjs;\n\n // 测试 proxy 与 mock 用例集合\n cgiMock('/movie/in_theaters_mock', (req, res) => {\n res.send(JSON.stringify({\n code: '0',\n msg: '',\n result: {\n text: 'movie: movie/in_theaters_mock ~~~~~'\n }\n }));\n });\n cgiMock('/movie/test_mock', (req, res) => {\n res.send(JSON.stringify({\n code: '0',\n msg: '',\n result: {\n text: 'mock: movie/test_mock'\n }\n }));\n });\n\n // 测试用例: mock.js change,重现请求,需要能拉最新的数据\n cgiMock('/watchtest', (req, res) => {\n res.send(JSON.stringify({\n code: '0',\n msg: '',\n result: {\n text: '通过 register 测试 mock watch: 初始状态'\n }\n }));\n });\n\n // 返回一个数字\n // cgiMock('/number', 666);\n cgiMock('/number', 999);\n\n // 返回一个json\n cgiMock({\n url: '/json',\n result: {\n code: '400101', msg: \"不合法的请求:Missing cookie 'wb_app_id' for method parameter of type String\", transactionTime: '20170309171146', success: false\n }\n });\n\n // 利用 mock.js 产生随机文本\n cgiMock('/text', Random.cparagraph());\n\n // 返回一个字符串 利用 mock.js 产生随机字符\n cgiMock('/random', mockjs.mock({\n 'string|1-10': '★'\n }));\n\n // 正则匹配url, 返回一个字符串\n cgiMock(/\\/abc|\\/xyz/, 'regexp test!');\n\n // option.result 参数如果是一个函数, 可以实现自定义返回内容, 接收的参数是是经过 express 封装的 req 和 res 对象.\n cgiMock(/\\/function$/, (req, res) => {\n res.send('function test');\n });\n\n // 返回文本 readFileSync\n cgiMock('/file', utils.file('./package.json'));\n\n // 更复杂的规则配置\n cgiMock({\n url: /\\/who/,\n method: 'GET',\n result(req, res) {\n if (req.query.name === 'kwan') {\n res.json({ kwan: '孤独患者' });\n } else {\n res.send('Nooooooooooo');\n }\n },\n headers: {\n 'Content-Type': 'text/plain',\n 'Content-Length': '123',\n ETag: '12345'\n },\n cookies: [\n {\n name: 'myname', value: 'kwan', maxAge: 900000, httpOnly: true\n }\n ]\n });\n\n // 携带参数的请求\n cgiMock('/v2/audit/list', (req, res) => {\n const {\n currentPage, pageSize, isAudited\n } = req.body;\n res.send({\n code: '0',\n msg: '',\n data: {\n currentPage,\n pageSize,\n totalPage: 2,\n totalCount: 12,\n pageData: Array.from({ length: pageSize }, () => ({\n title: Random.title(),\n authorName: Random.cname(),\n authorId: Random.name(),\n createTime: Date.now(),\n updateTime: Date.now(),\n readCount: Random.integer(60, 1000),\n favoriteCount: Random.integer(1, 50),\n postId: '12323',\n serviceTag: '业务类型',\n productTag: '产品类型',\n requestTag: '需求类型',\n handleTag: '已采纳',\n postType: 'voice',\n postStatus: isAudited ? 'pass' : 'auditing',\n auditStatus: 'audit1'\n }))\n }\n });\n });\n\n // multipart/form-data 类型\n cgiMock('/v2/upload', (req, res) => {\n res.send({\n code: '0',\n msg: '文件上传成功'\n });\n });\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/coreExports.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/plugin.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/pluginExports.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/pluginRegister.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/routes/routes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/core/routes/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/fes.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-access/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-access/createComponent.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-access/createDirective.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-access/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-enums/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/helpers/pluginAccess.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/helpers/pluginLocale.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/helpers/svg.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/icons.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/index.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/403.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/404.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/BaseLayout.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/Menu.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/MenuIcon.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-layout/views/MultiTabProvider.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-locale/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-locale/langUConfigMap.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-locale/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-locale/views/SelectLang.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-model/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-model/models/initialState.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-model/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-monaco-editor/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-monaco-editor/editor.vue","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-monaco-editor/loader.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-monaco-editor/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-monaco-editor/theme/default.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/cacheControl.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/genRequestKey.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/helpers.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/paramsProcess.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/preventRepeatReq.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/request.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/resDataAdaptor.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/resErrorProcess.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/scheduler.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/setDataField.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-request/throttle.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-vuex/core.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/.fes/plugin-vuex/runtime.js","messages":[{"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}],"errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/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 as accessApi, store, GETTER_TYPES } from '@fesjs/fes';\nimport PageLoading from '@/components/PageLoading';\nimport UserCenter from '@/components/UserCenter';\n\nconsole.log(store.getters[GETTER_TYPES.user.address]);\nconsole.log(process.env.FES_APP_PUBLISH_ERROR_PAGE);\n\nexport const beforeRender = {\n loading: <PageLoading />,\n action() {\n const { setRole } = accessApi;\n return new Promise((resolve) => {\n setTimeout(() => {\n setRole('menuTest');\n resolve({\n userName: 'harrywan'\n });\n }, 1000);\n });\n }\n};\n\nexport const layout = {\n customHeader: <UserCenter />\n // unAccessHandler({ next }) {\n // next(false);\n // },\n // noFoundHandler({ next }) {\n // next(false);\n // }\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/common/service.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/components/PageLoading.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div class=\"page-loading\">\n <Spin size=\"large\" />\n </div>\n</template>\n<script>\nimport Spin from 'ant-design-vue/lib/spin';\nimport 'ant-design-vue/lib/spin/style/css';\n\nexport default {\n components: {\n Spin\n },\n setup() {\n return {\n };\n }\n};\n</script>\n<style>\n.page-loading{\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/components/UserCenter.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div>{{initialState.userName}}</div>\n</template>\n<script>\nimport { useModel } from '@fesjs/fes';\n\nexport default {\n setup() {\n const initialState = useModel('@@initialState');\n return {\n initialState\n };\n }\n};\n</script>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/locales/en-US.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":"Insert `⏎·······`","line":11,"column":35,"nodeType":null,"messageId":"insert","endLine":11,"endColumn":35,"fix":{"range":[367,367],"text":"\n "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default {\n test: 'test',\n home: 'home',\n 'navBar.lang': 'Languages',\n 'layout.user.link.help': 'Help',\n 'layout.user.link.privacy': 'Privacy',\n 'layout.user.link.terms': 'Terms',\n 'app.preview.down.block': 'Download this page to your local project',\n 'app.welcome.link.fetch-blocks': 'Get all block',\n 'app.welcome.link.block-list': 'Quickly build standard, pages based on `block` development'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/locales/id-ID.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":"Insert `····`","line":10,"column":1,"nodeType":null,"messageId":"insert","endLine":10,"endColumn":1,"fix":{"range":[343,343],"text":" "}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"\nexport default {\n 'navbar.lang': 'Bahasa',\n 'layout.user.link.help': 'Bantuan',\n 'layout.user.link.privacy': 'Privasi',\n 'layout.user.link.terms': 'Ketentuan',\n 'app.preview.down.block': 'Unduh halaman ini dalam projek lokal anda',\n 'app.welcome.link.fetch-blocks': 'Dapatkan semua blok',\n 'app.welcome.link.block-list':\n 'Buat standar dengan cepat, halaman-halaman berdasarkan pengembangan `block`'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/locales/pt-BR.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 default {\n 'navBar.lang': 'Idiomas',\n 'layout.user.link.help': 'ajuda',\n 'layout.user.link.privacy': 'política de privacidade',\n 'layout.user.link.terms': 'termos de serviços',\n 'app.preview.down.block': 'Download this page to your local project'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/locales/zh-CN.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 default {\n test: '测试',\n home: '首页',\n 'navBar.lang': '语言',\n 'layout.user.link.help': '帮助',\n 'layout.user.link.privacy': '隐私',\n 'layout.user.link.terms': '条款',\n 'app.preview.down.block': '下载此页面到本地项目',\n 'app.welcome.link.fetch-blocks': '获取全部区块',\n 'app.welcome.link.block-list': '基于 block 开发,快速构建标准页面'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/locales/zh-TW.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 default {\n 'navBar.lang': '語言',\n 'layout.user.link.help': '幫助',\n 'layout.user.link.privacy': '隱私',\n 'layout.user.link.terms': '條款',\n 'app.preview.down.block': '下載此頁面到本地項目'\n};\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/models/user.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/pages/editor.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <monaco-editor\n ref=\"editorRef\"\n v-model=\"json\"\n :language=\"language\"\n height=\"200px\"\n check\n />\n {{json}}\n</template>\n<config>\n{\n \"name\": \"editor\",\n \"title\": \"monaco-editor\"\n}\n</config>\n<script>\nimport { onMounted, ref } from 'vue';\nimport { MonacoEditor } from '@fesjs/fes';\n\nexport default {\n components: {\n MonacoEditor\n },\n setup() {\n const editorRef = ref();\n const json = ref('');\n const language = ref('json');\n onMounted(() => {\n setTimeout(() => {\n language.value = 'html';\n }, 3000);\n });\n return {\n editorRef,\n json,\n language\n };\n }\n};\n</script>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/pages/index.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div :class=\"$style.red\">\n <a-input placeholder=\"请输入。。。\" />\n <a-button type=\"primary\">Primary</a-button>\n <div class=\"m-2\">国际化 {{t(\"test\")}}</div>\n fes & 拉夫德鲁 <br />\n <access :id=\"accessId\"> accessOnepicess1 <input /> </access>\n <div v-access=\"accessId\"> accessOnepicess2 <input /> </div>\n <input />\n <h4>数据字典</h4>\n <div v-for=\"item in enumsGet('status')\" :key=\"item.key\">{{item.value}}:{{item.key}}</div>\n <div v-for=\"item in roles\" :key=\"item.key\">{{item.name}}:{{item.disabled}}</div>\n <div>{{enumsGet('roles', '2', { dir: 'eName' })}}</div>\n </div>\n</template>\n<config>\n{\n \"name\": \"index\",\n \"title\": \"home\"\n}\n</config>\n<script>\nimport { ref, onMounted } from 'vue';\nimport {\n useAccess, useRouter, useI18n, locale, enums, request\n} from '@fesjs/fes';\nimport { Button, Input } from 'ant-design-vue';\n\nexport default {\n components: {\n [Button.name]: Button,\n [Input.name]: Input\n },\n setup() {\n const fes = ref('fes upgrade to vue3');\n const accessOnepicess = useAccess('/onepiece1');\n const localI18n = useI18n();\n const router = useRouter();\n const accessId = ref('/onepiece1');\n enums.push('roles', [\n {\n id: '1',\n cName: '系统管理员',\n eName: 'System',\n perm: ['1', '2', '3']\n },\n {\n id: '2',\n cName: '业务管理员',\n eName: 'Business',\n perm: ['1', '2']\n },\n {\n id: '3',\n cName: '普通用户',\n eName: 'User',\n perm: ['1']\n }\n ], { keyName: 'id' });\n const roles = enums.get('roles', {\n extend: [\n {\n key: 'name',\n dir: 'cName'\n },\n {\n key: 'disabled',\n transfer: item => item.value.perm.some(i => i >= 2)\n }\n ]\n });\n console.log('enums roles=>', roles);\n console.log('enums roles[1]=>', enums.get('roles', '1'));\n console.log('enums status[0]=> ', enums.get('status', 0));\n console.log('enums status concat', enums.concat('status', [['3', '普通的']], { extend: [{ key: 'name', dir: 'value' }] }));\n console.log('enums status get extend=>', enums.get('status', {\n extend: [\n {\n key: 'name',\n dir: 'value'\n },\n {\n key: 'disabled',\n transfer: item => item.key === '0'\n }\n ]\n }));\n onMounted(() => {\n console.log(router);\n setTimeout(() => {\n locale.setLocale({ locale: 'en-US' });\n locale.addLocale({ locale: 'ja-JP', messages: { test: 'テスト' } });\n console.log(locale.getAllLocales());\n }, 2000);\n setTimeout(() => {\n accessId.value = '11';\n }, 4000);\n\n console.log('测试 mock!!');\n request('/v2/file').then((data) => {\n console.log(data);\n }).catch((err) => {\n console.log(err);\n });\n request('/v2/movie/in_theaters_mock', { a: 1 }, 'get').then((data) => {\n console.log(data);\n }).catch((err) => {\n console.log(err);\n });\n\n console.log('测试 proxy!!');\n request('/v2/movie/in_theaters_proxy', { a: 1 }, {\n method: 'get',\n headers: { Accept: '*/*' }\n }).then((resp) => {\n console.log(resp);\n }).catch((err) => {\n console.log(err);\n });\n });\n return {\n accessId,\n fes,\n accessOnepicess,\n t: localI18n.t,\n enumsGet: enums.get,\n roles\n };\n },\n mounted() {\n console.log('$style:', this.$style);\n }\n};\n</script>\n\n<style module>\n.red {\n color: red;\n}\n.bold {\n font-weight: bold;\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/pages/onepiece.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div>{{fes}}</div>\n</template>\n<config>\n{\n \"name\": \"onepiece\",\n \"title\": \"onepiece\"\n}\n</config>\n<script>\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const fes = ref('fes upgrade to vue3');\n return {\n fes\n };\n }\n};\n</script>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/pages/store.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div class=\"haizekuo\">\n <h4>Vuex</h4>\n <div><button @click=\"increment\">click me:{{doubleCount}}</button></div>\n <div><button :disabled=\"disabled\" @click=\"login\">async login</button></div>\n <div><button @click=\"fooBarIncrement\">foo/bar:{{fooBarDoubleCount}}</button></div>\n <div>{{address}}</div>\n </div>\n</template>\n<config>\n{\n \"name\": \"store\",\n \"title\": \"vuex测试\"\n}\n</config>\n<script>\nimport { computed, ref } from 'vue';\nimport { useStore } from 'vuex';\nimport { MUTATION_TYPES, GETTER_TYPES, ACTION_TYPES } from '@fesjs/fes';\n\nexport default {\n setup() {\n const store = useStore();\n console.log('store==>', store);\n const disabled = ref(false);\n return {\n address: computed(() => store.getters[GETTER_TYPES.user.address]),\n doubleCount: computed(() => store.getters[GETTER_TYPES.counter.doubleCount]),\n disabled,\n increment: () => store.commit(MUTATION_TYPES.counter.increment),\n login: () => {\n disabled.value = true;\n store.dispatch(ACTION_TYPES.user.login).then((res) => {\n // eslint-disable-next-line no-alert\n window.alert(res);\n disabled.value = false;\n });\n },\n fooBarIncrement: () => store.commit(MUTATION_TYPES.fooBar.increment),\n fooBarDoubleCount: computed(() => store.getters[GETTER_TYPES.fooBar.doubleCount])\n };\n }\n};\n</script>\n\n<style scoped>\n.haizekuo {\n /* background: url('../images/icon.png'); */\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template/src/pages/test.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div>test</div>\n</template>\n<config>\n{\n \"name\": \"test\",\n \"title\": \"侧事故\"\n}\n</config>\n<script>\nimport { } from '@fesjs/fes';\n\nexport default {\n\n};\n</script>\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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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 '!<relative/path/to/filename>'\") 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":"<template>\n <div>{{msg}}</div>\n <div>{{obj.a}}</div>\n</template>\n\n<script lang=\"ts\" setup>\n// eslint-disable-next-line\nconst msg = 'hello world';\n\n// eslint-disable-next-line\nconst obj = {\n a: 1\n};\n</script>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/models/user.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/pages/index.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div class=\"onepiece\">\n fes h5 & 拉夫德鲁<br />\n <fes-icon :spin=\"true\" class=\"one-icon\" type=\"smile\" @click=\"clickIcon\" />\n <HelloWorld />\n <HelloTSX />\n <helloTS />\n </div>\n</template>\n<config>\n{\n \"title\": \"首页\",\n \"name\": \"testIndex\",\n \"layout\": \"false\"\n}\n</config>\n<script>\nimport { ref } from 'vue';\nimport { request } from '@fesjs/fes';\nimport HelloWorld from '@/components/helloWorld';\nimport HelloTSX from '@/components/helloTSX';\nimport helloTS from '@/components/helloTS';\n\nexport default {\n components: {\n HelloWorld,\n HelloTSX,\n helloTS\n },\n setup() {\n const fes = ref('fes upgrade to vue3');\n const rotate = ref(90);\n const clickIcon = () => {\n console.log('click Icon');\n };\n // request('/api', null, {\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // mergeRequest: true\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // mergeRequest: true\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // throttle: 3000,\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n\n const get = (id) => {\n request('/get/api', { id }, {\n method: 'get'\n });\n };\n\n const post = (id) => {\n request('/get/api', { id }, {\n });\n };\n\n get(1);\n get(2);\n get(3);\n\n post(1);\n post(2);\n post(3);\n\n\n // setTimeout(() => {\n // request('/api', null, {\n // throttle: 3000,\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n // }, 1000);\n\n // setTimeout(() => {\n // request('/api', null, {\n // throttle: 3000,\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // throttle: 3000,\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n // }, 3200);\n\n // request('/api', null, {\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n // request('/api', null, {\n // cache: true\n // }).then((res) => {\n // console.log(res);\n // });\n\n // request('/api', null, {\n // // skipErrorHandler: [500]\n // }).then((res) => {\n // console.log(res);\n // }).catch((err) => {\n // console.log('inner error', err);\n // });\n return {\n fes,\n rotate,\n clickIcon\n };\n }\n};\n</script>\n\n<style lang=\"less\" scoped>\n@import \"~@/styles/mixins/hairline\";\n@import \"~@/styles/mixins/hover\";\n\ndiv {\n padding: 20px;\n p {\n margin: 20px;\n }\n}\n.one-icon {\n color: yellow;\n font-size: 24px;\n .hover();\n}\n.onepiece {\n text-align: center;\n .hairline(\"top\");\n}\n</style>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-template-h5/src/pages/onepiece.vue","messages":[],"errorCount":0,"fatalErrorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":"<template>\n <div>{{fes}}</div>\n <img :src=\"publicPath + 'logo.png'\" />\n</template>\n<config>\n{\n \"title\": \"onepiece\",\n \"layout\": \"true\"\n}\n</config>\n<script>\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const fes = ref('fes upgrade to vue3');\n return {\n publicPath: process.env.BASE_URL,\n fes\n };\n }\n};\n</script>\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/Generator.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `⏎····copyFileSync,·readFileSync,·statSync,·writeFileSync⏎` with `·copyFileSync,·readFileSync,·statSync,·writeFileSync·`","line":1,"column":9,"nodeType":null,"messageId":"replace","endLine":3,"endColumn":1,"fix":{"range":[8,65],"text":" copyFileSync, readFileSync, statSync, writeFileSync "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":12,"column":3,"nodeType":null,"messageId":"insert","endLine":12,"endColumn":3,"fix":{"range":[262,262],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··` with `····`","line":14,"column":1,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":3,"fix":{"range":[268,270],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":16,"column":1,"nodeType":null,"messageId":"insert","endLine":16,"endColumn":1,"fix":{"range":[277,277],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":17,"column":1,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":1,"fix":{"range":[308,308],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":18,"column":7,"nodeType":null,"messageId":"insert","endLine":18,"endColumn":7,"fix":{"range":[336,336],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":19,"column":1,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":1,"fix":{"range":[354,354],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":21,"column":3,"nodeType":null,"messageId":"insert","endLine":21,"endColumn":3,"fix":{"range":[361,361],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `······` with `········`","line":22,"column":1,"nodeType":null,"messageId":"replace","endLine":22,"endColumn":7,"fix":{"range":[375,381],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":23,"column":3,"nodeType":null,"messageId":"insert","endLine":23,"endColumn":3,"fix":{"range":[405,405],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··` with `····`","line":25,"column":1,"nodeType":null,"messageId":"replace","endLine":25,"endColumn":3,"fix":{"range":[408,410],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":28,"column":3,"nodeType":null,"messageId":"insert","endLine":28,"endColumn":3,"fix":{"range":[462,462],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":29,"column":1,"nodeType":null,"messageId":"insert","endLine":29,"endColumn":1,"fix":{"range":[478,478],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":30,"column":7,"nodeType":null,"messageId":"insert","endLine":30,"endColumn":7,"fix":{"range":[544,544],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `······` with `········`","line":31,"column":1,"nodeType":null,"messageId":"replace","endLine":31,"endColumn":7,"fix":{"range":[596,602],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `console.log(`${chalk.green('Write:')}·${relative(this.cwd,·opts.target)}`` with `··console.log(⏎············`${chalk.green('Write:')}·${relative(this.cwd,·opts.target)}`⏎········`","line":32,"column":7,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":80,"fix":{"range":[643,716],"text":" console.log(\n `${chalk.green('Write:')} ${relative(this.cwd, opts.target)}`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":33,"column":1,"nodeType":null,"messageId":"insert","endLine":33,"endColumn":1,"fix":{"range":[719,719],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":34,"column":3,"nodeType":null,"messageId":"insert","endLine":34,"endColumn":3,"fix":{"range":[773,773],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":36,"column":1,"nodeType":null,"messageId":"insert","endLine":36,"endColumn":1,"fix":{"range":[776,776],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":37,"column":1,"nodeType":null,"messageId":"insert","endLine":37,"endColumn":1,"fix":{"range":[800,800],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `············`","line":38,"column":1,"nodeType":null,"messageId":"replace","endLine":38,"endColumn":11,"fix":{"range":[840,850],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":39,"column":11,"nodeType":null,"messageId":"insert","endLine":39,"endColumn":11,"fix":{"range":[876,876],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `············`","line":40,"column":1,"nodeType":null,"messageId":"replace","endLine":40,"endColumn":11,"fix":{"range":[887,897],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":41,"column":1,"nodeType":null,"messageId":"insert","endLine":41,"endColumn":1,"fix":{"range":[928,928],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":42,"column":7,"nodeType":null,"messageId":"insert","endLine":42,"endColumn":7,"fix":{"range":[944,944],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":43,"column":1,"nodeType":null,"messageId":"insert","endLine":43,"endColumn":1,"fix":{"range":[970,970],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":44,"column":11,"nodeType":null,"messageId":"insert","endLine":44,"endColumn":11,"fix":{"range":[1029,1029],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··········` with `············`","line":45,"column":1,"nodeType":null,"messageId":"replace","endLine":45,"endColumn":11,"fix":{"range":[1074,1084],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":46,"column":15,"nodeType":null,"messageId":"insert","endLine":46,"endColumn":15,"fix":{"range":[1127,1127],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··················` with `····················`","line":47,"column":1,"nodeType":null,"messageId":"replace","endLine":47,"endColumn":19,"fix":{"range":[1142,1160],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":48,"column":1,"nodeType":null,"messageId":"insert","endLine":48,"endColumn":1,"fix":{"range":[1183,1183],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":49,"column":19,"nodeType":null,"messageId":"insert","endLine":49,"endColumn":19,"fix":{"range":[1274,1274],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":50,"column":15,"nodeType":null,"messageId":"insert","endLine":50,"endColumn":15,"fix":{"range":[1310,1310],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":51,"column":1,"nodeType":null,"messageId":"insert","endLine":51,"endColumn":1,"fix":{"range":[1314,1314],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··············` with `················`","line":52,"column":1,"nodeType":null,"messageId":"replace","endLine":52,"endColumn":15,"fix":{"range":[1333,1347],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":53,"column":15,"nodeType":null,"messageId":"insert","endLine":53,"endColumn":15,"fix":{"range":[1410,1410],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `··············` with `················`","line":54,"column":1,"nodeType":null,"messageId":"replace","endLine":54,"endColumn":15,"fix":{"range":[1453,1467],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":55,"column":1,"nodeType":null,"messageId":"insert","endLine":55,"endColumn":1,"fix":{"range":[1500,1500],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":56,"column":11,"nodeType":null,"messageId":"insert","endLine":56,"endColumn":11,"fix":{"range":[1558,1558],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":57,"column":1,"nodeType":null,"messageId":"insert","endLine":57,"endColumn":1,"fix":{"range":[1560,1560],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `··`","line":58,"column":1,"nodeType":null,"messageId":"insert","endLine":58,"endColumn":1,"fix":{"range":[1570,1570],"text":" "}}],"errorCount":41,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":41,"fixableWarningCount":0,"source":"import {\n copyFileSync, readFileSync, statSync, writeFileSync\n} from 'fs';\nimport { dirname, relative, join } from 'path';\n\nimport chalk from 'chalk';\nimport mkdirp from 'mkdirp';\nimport glob from 'glob';\nimport Mustache from 'mustache';\n\nclass Generator {\n cwd;\n\n args;\n\n constructor({ cwd, args }) {\n this.cwd = cwd;\n this.args = args;\n }\n\n async run() {\n await this.writing();\n }\n\n // eslint-disable-next-line\n async writing() {}\n\n copyTpl(opts) {\n const tpl = readFileSync(opts.templatePath, 'utf-8');\n const content = Mustache.render(tpl, opts.context);\n mkdirp.sync(dirname(opts.target));\n console.log(`${chalk.green('Write:')} ${relative(this.cwd, opts.target)}`);\n writeFileSync(opts.target, content, 'utf-8');\n }\n\n copyDirectory(opts) {\n const files = glob.sync('**/*', {\n cwd: opts.path,\n dot: true,\n ignore: ['**/node_modules/**']\n });\n files.forEach((file) => {\n const absFile = join(opts.path, file);\n if (statSync(absFile).isDirectory()) return;\n if (file.endsWith('.tpl')) {\n this.copyTpl({\n templatePath: absFile,\n target: join(opts.target, file.replace(/\\.tpl$/, '')),\n context: opts.context\n });\n } else {\n console.log(`${chalk.green('Copy: ')} ${file}`);\n const absTarget = join(opts.target, file);\n mkdirp.sync(dirname(absTarget));\n copyFileSync(absFile, absTarget);\n }\n });\n }\n}\n\nexport default Generator;\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/cleanRequireCache.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···`","line":1,"column":25,"nodeType":null,"messageId":"insert","endLine":1,"endColumn":25,"fix":{"range":[24,24],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(require.cache[cachePath])` with `require.cache[cachePath]`","line":10,"column":29,"nodeType":null,"messageId":"replace","endLine":10,"endColumn":55,"fix":{"range":[407,433],"text":"require.cache[cachePath]"}}],"errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":2,"fixableWarningCount":0,"source":"export const isWindows = typeof process !== 'undefined' && process.platform === 'win32';\n\n// 暂时无法使用 jest 进行单元测试,原因可参见\n// https://github.com/facebook/jest/issues/5741\n\nexport default function (cacheKey) {\n // windows 下 require.cache 中路径 key 为类似 ‘c:\\demo\\.umirc.ts’\n const cachePath = isWindows ? cacheKey.replace(/\\//g, '\\\\') : cacheKey;\n if (require.cache[cachePath]) {\n const cacheParent = (require.cache[cachePath]).parent;\n let i = cacheParent?.children.length || 0;\n // 清理 require cache 中 parents 的引用\n while (i--) {\n if (cacheParent.children[i].id === cachePath) {\n cacheParent.children.splice(i, 1);\n }\n }\n\n delete require.cache[cachePath];\n }\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/compatESModuleRequire.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/delay.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `ms·=>·new·Promise(resolve` with `(ms)·=>·new·Promise((resolve)`","line":1,"column":16,"nodeType":null,"messageId":"replace","endLine":1,"endColumn":41,"fix":{"range":[15,40],"text":"(ms) => new Promise((resolve)"}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"export default ms => new Promise(resolve => setTimeout(resolve, ms));\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/index.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/mergeConfig.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 default function mergeConfig(defaultConfig, ...configs) {\n const ret = { ...defaultConfig };\n configs.forEach((config) => {\n if (!config) return;\n Object.keys(config).forEach((key) => {\n const val = config[key];\n if (typeof val === 'function') {\n ret[key] = val(ret[key]);\n } else {\n ret[key] = val;\n }\n });\n });\n return ret;\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/parseRequireDeps.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 `(crequire(content))` with `crequire(content)`","line":12,"column":12,"nodeType":null,"messageId":"replace","endLine":12,"endColumn":31,"fix":{"range":[300,319],"text":"crequire(content)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `o` with `(o)`","line":13,"column":14,"nodeType":null,"messageId":"replace","endLine":13,"endColumn":15,"fix":{"range":[333,334],"text":"(o)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `path` with `(path)`","line":14,"column":17,"nodeType":null,"messageId":"replace","endLine":14,"endColumn":21,"fix":{"range":[362,366],"text":"(path)"}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `(path·=>` with `((path)·=>⏎···········`","line":15,"column":13,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":21,"fix":{"range":[406,414],"text":"((path) =>\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":16,"column":1,"nodeType":null,"messageId":"insert","endLine":16,"endColumn":1,"fix":{"range":[424,424],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":17,"column":1,"nodeType":null,"messageId":"replace","endLine":17,"endColumn":17,"fix":{"range":[457,473],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":18,"column":1,"nodeType":null,"messageId":"insert","endLine":18,"endColumn":1,"fix":{"range":[501,501],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":19,"column":13,"nodeType":null,"messageId":"insert","endLine":19,"endColumn":13,"fix":{"range":[572,572],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `)` with `····)⏎········`","line":20,"column":9,"nodeType":null,"messageId":"replace","endLine":20,"endColumn":10,"fix":{"range":[583,584],"text":" )\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":28,"column":1,"nodeType":null,"messageId":"insert","endLine":28,"endColumn":1,"fix":{"range":[738,738],"text":" "}}],"errorCount":11,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":11,"fixableWarningCount":0,"source":"\n// @ts-ignore\nimport crequire from 'crequire';\nimport lodash from 'lodash';\nimport resolve from 'resolve';\nimport { readFileSync } from 'fs';\nimport { dirname } from 'path';\nimport winPath from './winPath';\n\nfunction parse(filePath) {\n const content = readFileSync(filePath, 'utf-8');\n return (crequire(content))\n .map(o => o.path)\n .filter(path => path.charAt(0) === '.')\n .map(path => winPath(\n resolve.sync(path, {\n basedir: dirname(filePath),\n extensions: ['.tsx', '.ts', '.jsx', '.js']\n })\n ));\n}\n\nexport default function parseRequireDeps(filePath) {\n const paths = [filePath];\n const ret = [winPath(filePath)];\n\n while (paths.length) {\n // 避免依赖循环\n const extraPaths = lodash.pullAll(parse(paths.shift()), ret);\n if (extraPaths.length) {\n paths.push(...extraPaths);\n ret.push(...extraPaths);\n }\n }\n\n return ret;\n}\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/resolvePkg.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Replace `pkgName·=>` with `(pkgName)·=>⏎···`","line":4,"column":20,"nodeType":null,"messageId":"replace","endLine":4,"endColumn":30,"fix":{"range":[85,95],"text":"(pkgName) =>\n "}}],"errorCount":1,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":1,"fixableWarningCount":0,"source":"import { dirname } from 'path';\nimport winPath from './winPath';\n\nconst resolvePkg = pkgName => winPath(dirname(require.resolve(`${pkgName}/package.json`)));\n\nexport default resolvePkg;\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/packages/fes-utils/src/winPath.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/scripts/build.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":15,"column":1,"nodeType":null,"messageId":"delete","endLine":16,"endColumn":1,"fix":{"range":[411,412],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎···········`","line":106,"column":21,"nodeType":null,"messageId":"insert","endLine":106,"endColumn":21,"fix":{"range":[2969,2969],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace ``Transform·to·${type}·for·${config.target·===·'browser'·?·chalk.yellow(shortFilePath)·:·chalk.blue(shortFilePath)}`` with `⏎············`Transform·to·${type}·for·${⏎················config.target·===·'browser'⏎····················?·chalk.yellow(shortFilePath)⏎····················:·chalk.blue(shortFilePath)⏎············}`⏎········`","line":107,"column":13,"nodeType":null,"messageId":"replace","endLine":107,"endColumn":128,"fix":{"range":[3050,3165],"text":"\n `Transform to ${type} for ${\n config.target === 'browser'\n ? chalk.yellow(shortFilePath)\n : chalk.blue(shortFilePath)\n }`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `⏎········`","line":132,"column":13,"nodeType":null,"messageId":"insert","endLine":132,"endColumn":13,"fix":{"range":[4064,4064],"text":"\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":133,"column":9,"nodeType":null,"messageId":"insert","endLine":133,"endColumn":9,"fix":{"range":[4086,4086],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `····})` with `········})⏎········`","line":134,"column":1,"nodeType":null,"messageId":"replace","endLine":134,"endColumn":7,"fix":{"range":[4106,4112],"text":" })\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":135,"column":1,"nodeType":null,"messageId":"insert","endLine":135,"endColumn":1,"fix":{"range":[4148,4148],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":136,"column":1,"nodeType":null,"messageId":"replace","endLine":136,"endColumn":9,"fix":{"range":[4195,4203],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":137,"column":1,"nodeType":null,"messageId":"insert","endLine":137,"endColumn":1,"fix":{"range":[4247,4247],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":138,"column":1,"nodeType":null,"messageId":"replace","endLine":138,"endColumn":9,"fix":{"range":[4305,4313],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":139,"column":9,"nodeType":null,"messageId":"insert","endLine":139,"endColumn":9,"fix":{"range":[4376,4376],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `········` with `············`","line":140,"column":1,"nodeType":null,"messageId":"replace","endLine":140,"endColumn":9,"fix":{"range":[4415,4423],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":141,"column":1,"nodeType":null,"messageId":"insert","endLine":141,"endColumn":1,"fix":{"range":[4461,4461],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":142,"column":1,"nodeType":null,"messageId":"replace","endLine":142,"endColumn":13,"fix":{"range":[4507,4519],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":143,"column":9,"nodeType":null,"messageId":"insert","endLine":143,"endColumn":9,"fix":{"range":[4565,4565],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":144,"column":1,"nodeType":null,"messageId":"replace","endLine":144,"endColumn":13,"fix":{"range":[4593,4605],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":145,"column":9,"nodeType":null,"messageId":"insert","endLine":145,"endColumn":9,"fix":{"range":[4665,4665],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `············` with `················`","line":146,"column":1,"nodeType":null,"messageId":"replace","endLine":146,"endColumn":13,"fix":{"range":[4698,4710],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":147,"column":1,"nodeType":null,"messageId":"insert","endLine":147,"endColumn":1,"fix":{"range":[4755,4755],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":148,"column":5,"nodeType":null,"messageId":"insert","endLine":148,"endColumn":5,"fix":{"range":[4769,4769],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `·config.target·===·'browser'·?·ESM_OUTPUT_DIR` with `⏎················config.target·===·'browser'⏎····················?·ESM_OUTPUT_DIR⏎···················`","line":160,"column":25,"nodeType":null,"messageId":"replace","endLine":160,"endColumn":70,"fix":{"range":[5198,5243],"text":"\n config.target === 'browser'\n ? ESM_OUTPUT_DIR\n "}}],"errorCount":21,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":21,"fixableWarningCount":0,"source":"// 关闭 import 规则\n/* eslint import/no-extraneous-dependencies: 0 */\n\nconst fs = require('fs');\nconst fse = require('fs-extra');\nconst path = require('path');\nconst merge = require('deepmerge');\nconst chokidar = require('chokidar');\nconst chalk = require('chalk');\nconst argv = require('yargs-parser')(process.argv.slice(2));\n\nconst compiler = require('./compiler');\nconst randomColor = require('./randomColor');\n\n\nconst ESM_OUTPUT_DIR = 'es';\nconst NODE_CJS_OUTPUT_DIR = 'lib';\nconst SOURCE_DIR = 'src';\nconst CONFIG_FILE_NAME = 'build.config.js';\nconst GLOBAL_CONFIG_PATH = path.join(process.cwd(), CONFIG_FILE_NAME);\nconst DEFAULT_CONFIG = {\n target: 'node',\n pkgs: [],\n copy: []\n};\n\nconst PACKAGE_PATH = path.join(process.cwd(), './packages');\n\nfunction genLog(pkgName) {\n return (msg) => {\n console.log(`${randomColor(pkgName)}: ${msg}`);\n };\n}\n\nfunction getPkgPath(pkgName) {\n return path.join(PACKAGE_PATH, pkgName);\n}\n\nfunction genShortPath(filePath) {\n const codePath = filePath.split(`/${SOURCE_DIR}/`)[1];\n return `${SOURCE_DIR}/${codePath}`;\n}\n\nfunction getPkgSourcePath(pkgName) {\n return path.join(getPkgPath(pkgName), SOURCE_DIR);\n}\n\nfunction getOutputPath(config, pkgName) {\n if (config.target === 'browser') {\n return path.join(getPkgPath(pkgName), ESM_OUTPUT_DIR);\n }\n\n return path.join(getPkgPath(pkgName), NODE_CJS_OUTPUT_DIR);\n}\n\nfunction getGlobalConfig() {\n if (fs.existsSync(GLOBAL_CONFIG_PATH)) {\n const userConfig = require(GLOBAL_CONFIG_PATH);\n return merge(DEFAULT_CONFIG, userConfig);\n }\n return DEFAULT_CONFIG;\n}\n\nfunction getPkgConfig(config, pkgName) {\n const pkgConfigPath = path.join(getPkgPath(pkgName), CONFIG_FILE_NAME);\n if (fs.existsSync(pkgConfigPath)) {\n return merge(config, require(pkgConfigPath));\n }\n\n return config;\n}\n\nfunction getNeedCompilerPkg(config) {\n // 用户通过 cli 指定的包,优先级最高\n if (argv.pkg) {\n return Array.isArray(argv.pkg) ? argv.pkg : argv.pkg;\n }\n // 默认编译所有 packages\n if (!config.pkgs?.length) {\n const pkgs = fs.readdirSync(PACKAGE_PATH);\n return pkgs;\n }\n\n return config.pkgs;\n}\n\nfunction cleanBeforeCompilerResult(pkgName, log) {\n const esmOutputDir = path.join(getPkgPath(pkgName), ESM_OUTPUT_DIR);\n const cjsOutputDir = path.join(getPkgPath(pkgName), NODE_CJS_OUTPUT_DIR);\n if (fs.existsSync(esmOutputDir)) {\n log(chalk.gray(`Clean ${ESM_OUTPUT_DIR} directory`));\n fse.removeSync(esmOutputDir);\n }\n if (fs.existsSync(cjsOutputDir)) {\n log(chalk.gray(`Clean ${NODE_CJS_OUTPUT_DIR} directory`));\n fse.removeSync(cjsOutputDir);\n }\n}\n\nfunction transformFile(filePath, outputPath, config, log) {\n if (/\\.[jt]sx?$/.test(path.extname(filePath))) {\n const code = fs.readFileSync(filePath, 'utf-8');\n const shortFilePath = genShortPath(filePath);\n const transformedCode = compiler(code, config);\n\n const type = config.target === 'browser' ? ESM_OUTPUT_DIR : NODE_CJS_OUTPUT_DIR;\n log(`Transform to ${type} for ${config.target === 'browser' ? chalk.yellow(shortFilePath) : chalk.blue(shortFilePath)}`);\n fse.outputFileSync(outputPath, transformedCode);\n } else {\n fse.copySync(filePath, outputPath);\n }\n}\n\nfunction compilerPkg(codeDir, outputDir, config, log) {\n const files = fs.readdirSync(codeDir);\n files.forEach((file) => {\n const filePath = path.join(codeDir, file);\n const outputFilePath = path.join(outputDir, file);\n const fileStats = fs.lstatSync(filePath);\n if (config.copy.includes(file)) {\n fse.copySync(filePath, outputFilePath);\n } else if (fileStats.isDirectory(filePath) && !/__tests__/.test(file)) {\n fse.ensureDirSync(outputFilePath);\n compilerPkg(filePath, outputFilePath, config, log);\n } else if (fileStats.isFile(filePath)) {\n transformFile(filePath, outputFilePath, config, log);\n }\n });\n}\n\nfunction watchFile(dir, outputDir, config, log) {\n chokidar.watch(dir, {\n ignoreInitial: true\n }).on('all', (event, changeFile) => {\n // 修改的可能是一个目录,一个文件,一个需要 copy 的文件 or 目录\n const baseName = path.basename(changeFile);\n const shortChangeFile = genShortPath(changeFile);\n const outputPath = changeFile.replace(dir, outputDir);\n const stat = fs.lstatSync(changeFile);\n log(`[${event}] ${shortChangeFile}`);\n if (config.copy.includes(baseName)) {\n fse.copySync(changeFile, outputPath);\n } else if (stat.isFile()) {\n transformFile(changeFile, outputPath, config, log);\n } else if (stat.isDirectory()) {\n compilerPkg(changeFile, outputPath, config);\n }\n });\n}\n\nfunction compilerPkgs(pkgs, globalConfig) {\n pkgs.forEach((pkgName) => {\n const sourceCodeDir = getPkgSourcePath(pkgName);\n if (fs.existsSync(sourceCodeDir)) {\n const log = genLog(pkgName);\n const config = getPkgConfig(globalConfig, pkgName);\n const outputDir = getOutputPath(config, pkgName);\n\n cleanBeforeCompilerResult(pkgName, log);\n const type = config.target === 'browser' ? ESM_OUTPUT_DIR : NODE_CJS_OUTPUT_DIR;\n log(chalk.white(`Build ${type} with babel`));\n compilerPkg(sourceCodeDir, outputDir, config, log);\n if (argv.watch) {\n log(chalk.magenta(`Start watch ${SOURCE_DIR} directory...`));\n watchFile(sourceCodeDir, outputDir, config, log);\n }\n }\n });\n}\n\nfunction main() {\n const globalConfig = getGlobalConfig();\n const pkgs = getNeedCompilerPkg(globalConfig);\n\n compilerPkgs(pkgs, globalConfig);\n}\n\nmain();\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/scripts/compiler.js","messages":[{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":6,"column":1,"nodeType":null,"messageId":"delete","endLine":7,"endColumn":1,"fix":{"range":[106,107],"text":""}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'@babel/preset-env',` with `⏎················'@babel/preset-env',⏎···············`","line":15,"column":14,"nodeType":null,"messageId":"replace","endLine":15,"endColumn":34,"fix":{"range":[321,341],"text":"\n '@babel/preset-env',\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":16,"column":17,"nodeType":null,"messageId":"insert","endLine":16,"endColumn":17,"fix":{"range":[360,360],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":17,"column":1,"nodeType":null,"messageId":"insert","endLine":17,"endColumn":1,"fix":{"range":[376,376],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":18,"column":13,"nodeType":null,"messageId":"replace","endLine":18,"endColumn":14,"fix":{"range":[428,429],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `'@babel/preset-env',` with `⏎················'@babel/preset-env',⏎···············`","line":28,"column":14,"nodeType":null,"messageId":"replace","endLine":28,"endColumn":34,"fix":{"range":[655,675],"text":"\n '@babel/preset-env',\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":29,"column":1,"nodeType":null,"messageId":"insert","endLine":29,"endColumn":1,"fix":{"range":[678,678],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Insert `····`","line":30,"column":17,"nodeType":null,"messageId":"insert","endLine":30,"endColumn":17,"fix":{"range":[726,726],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `················` with `····················`","line":31,"column":1,"nodeType":null,"messageId":"replace","endLine":31,"endColumn":17,"fix":{"range":[746,762],"text":" "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace `}` with `····}⏎············`","line":32,"column":13,"nodeType":null,"messageId":"replace","endLine":32,"endColumn":14,"fix":{"range":[800,801],"text":" }\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Replace ``config·target·error:·${config.target},·only·can·use·'node'·and·'browser'`` with `⏎········`config·target·error:·${config.target},·only·can·use·'node'·and·'browser'`⏎····`","line":44,"column":21,"nodeType":null,"messageId":"replace","endLine":44,"endColumn":95,"fix":{"range":[1066,1140],"text":"\n `config target error: ${config.target}, only can use 'node' and 'browser'`\n "}},{"ruleId":"prettier/prettier","severity":2,"message":"Delete `⏎`","line":45,"column":2,"nodeType":null,"messageId":"delete","endLine":46,"endColumn":1,"fix":{"range":[1144,1145],"text":""}}],"errorCount":12,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":12,"fixableWarningCount":0,"source":"// 关闭 import 规则\n/* eslint import/no-extraneous-dependencies: 0 */\n\nconst babel = require('@babel/core');\n\n\nfunction transform(code, options) {\n const result = babel.transformSync(code, options);\n return result.code;\n}\n\nfunction transformNodeCode(code) {\n return transform(code, {\n presets: [\n ['@babel/preset-env', {\n modules: 'cjs',\n targets: { node: '12' }\n }]\n ]\n });\n}\n\nfunction transformBrowserCode(code) {\n // 因为 fes.js 在生产打包的时候,会处理所有的 node_modules 下的文件,确保不会丢失必要 polyfill\n // 因此这里不对 polyfill 进行处理,避免全局污染\n return transform(code, {\n presets: [\n ['@babel/preset-env', {\n modules: false,\n useBuiltIns: false,\n targets: { chrome: '51' }\n }]\n ]\n });\n}\n\nfunction compiler(code, config) {\n if (!config.target || config.target === 'node') {\n return transformNodeCode(code);\n }\n if (config.target === 'browser') {\n return transformBrowserCode(code);\n }\n throw new Error(`config target error: ${config.target}, only can use 'node' and 'browser'`);\n}\n\n\nmodule.exports = compiler;\n","usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/scripts/randomColor.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]},{"filePath":"/Users/qlin/code/fes.js/vetur.config.js","messages":[],"errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":[]}]} |