Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (api, options) => {
api.registerCommand('modules:compile', () => {
console.log('Reading modules config file...');
const p = api.resolve('app/etc/modules.config.json');
if (!fs.existsSync(api.resolve('app/generated'))) {
Function exports
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (api, options) => {
api.registerCommand('modules:compile', () => {
console.log('Reading modules config file...');
const p = api.resolve('app/etc/modules.config.json');
if (!fs.existsSync(api.resolve('app/generated'))) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Replace ········if·(fs.existsSync(api.resolve('app/etc/modules.local.json'
with ····if·(fs.existsSync(api.resolve("app/etc/modules.local.json"
Open
if (fs.existsSync(api.resolve('app/etc/modules.local.json'))) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ······);⏎
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····if·(fs.existsSync(api.resolve(
app/etc/modules.${process.env.NODE_ENV}.json)))·{
with if·(⏎······fs.existsSync(api.resolve(
app/etc/modules.${process.env.NODE_ENV}.json))
Open
if (fs.existsSync(api.resolve(`app/etc/modules.${process.env.NODE_ENV}.json`))) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················moduleConfig.type·===·'package'
with ··········moduleConfig.type·===·"package"
Open
moduleConfig.type === 'package' &&
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········fs.writeFileSync(api.resolve('app/generated/module.require.js'),·fdArray.join('\n'));
with ····fs.writeFileSync(⏎······api.resolve("app/generated/module.require.js"),⏎······fdArray.join("\n")
Open
fs.writeFileSync(api.resolve('app/generated/module.require.js'), fdArray.join('\n'));
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
return undefined;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············moduleList·=·merge(moduleList,·require(api.resolve('app/etc/modules.local.json')));
with ······moduleList·=·merge(⏎········moduleList,⏎········require(api.resolve("app/etc/modules.local.json"))
Open
moduleList = merge(moduleList, require(api.resolve('app/etc/modules.local.json')));
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··api.registerCommand('modules:compile'
with api.registerCommand("modules:compile"
Open
api.registerCommand('modules:compile', () => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········console.log('Reading·modules·config·file...'
with ····console.log("Reading·modules·config·file..."
Open
console.log('Reading modules config file...');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
Object.keys(moduleList).forEach(moduleName => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
const moduleConfig = moduleList[moduleName];
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················(moduleConfig.hasOwnProperty('enabled'
with ··········(moduleConfig.hasOwnProperty("enabled"
Open
(moduleConfig.hasOwnProperty('enabled') ? moduleConfig.enabled : true)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········fdArray.push('];'
with ····fdArray.push("];"
Open
fdArray.push('];');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········let·fdArray·=·['export·default·['
with ····let·fdArray·=·["export·default·["
Open
let fdArray = ['export default ['];
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Definition for rule 'vue/attributes-order' was not found Open
const fs = require('fs'),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert );⏎··
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········const·p·=·api.resolve('app/etc/modules.config.json'
with ····const·p·=·api.resolve("app/etc/modules.config.json"
Open
const p = api.resolve('app/etc/modules.config.json');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········if·(!fs.existsSync(api.resolve('app/generated'
with ····if·(!fs.existsSync(api.resolve("app/generated"
Open
if (!fs.existsSync(api.resolve('app/generated'))) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········moduleList·=·merge(moduleList,·require(api.resolve(
app/etc/modules.${process.env.NODE_ENV}.json)));
with )·{⏎······moduleList·=·merge(⏎········moduleList,⏎········require(api.resolve(
app/etc/modules.${process.env.NODE_ENV}.json))
Open
moduleList = merge(moduleList, require(api.resolve(`app/etc/modules.${process.env.NODE_ENV}.json`)));
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····isObject·=·require('lodash/isObject'
with ··isObject·=·require("lodash/isObject"
Open
isObject = require('lodash/isObject'),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················console.log(
${moduleName}·=>·added·package·as·static·require·dependency);
with ··········console.log(⏎············
${moduleName}·=>·added·package·as·static·require·dependency`` Open
console.log(`${moduleName} => added package as static require dependency`);
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····merge·=·require('lodash/merge'
with ··merge·=·require("lodash/merge"
Open
merge = require('lodash/merge');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············fs.mkdirSync(api.resolve('app/generated'
with ······fs.mkdirSync(api.resolve("app/generated"
Open
fs.mkdirSync(api.resolve('app/generated'));
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
let moduleList = require(p);
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
if (isObject(moduleList[moduleName])) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
if (
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····console.log('Finished...'
with );⏎····console.log("Finished..."
Open
console.log('Finished...');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············console.error('modules.config.json·was·not·found·in·[app/etc]·folder'
with ······console.error("modules.config.json·was·not·found·in·[app/etc]·folder"
Open
console.error('modules.config.json was not found in [app/etc] folder');
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
if (!fs.existsSync(api.resolve(p))) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··········
Open
fdArray.push(` () => require('${moduleConfig.ref}'),`);
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'fs'
with "fs"
Open
const fs = require('fs'),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
/** @typedef {import('@vue/cli-service/lib/PluginAPI')} PluginAPI */
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ······}⏎······
with );⏎········}⏎
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/