From cbb911988e75701b090ea60c075ffd1463f32940 Mon Sep 17 00:00:00 2001 From: Charlike Mike Reagent Date: Sun, 15 Mar 2020 06:28:59 +0200 Subject: [PATCH] normalizing, merging & utils; use new config format entirely Signed-off-by: Charlike Mike Reagent --- custom-eslint-plugin.js | 3 + eslint.config.js | 100 ++++++++-- package.json | 3 + packages/eslint/example.js | 10 +- packages/eslint/foo.js | 108 +++++++++++ packages/eslint/src/api.js | 42 ++-- packages/eslint/src/index.js | 2 +- packages/eslint/src/lint-config.js | 36 ++-- packages/eslint/src/lint-files.js | 1 + packages/eslint/src/utils.js | 301 ++++++++++++++++++++++------- yarn.lock | 87 ++++++++- 11 files changed, 568 insertions(+), 125 deletions(-) create mode 100644 packages/eslint/foo.js diff --git a/custom-eslint-plugin.js b/custom-eslint-plugin.js index 96846d4..28883d1 100644 --- a/custom-eslint-plugin.js +++ b/custom-eslint-plugin.js @@ -2,4 +2,7 @@ module.exports = { parsers: { 'eslint-esnext': require('babel-eslint'), }, + // rules: { + // 'my-foo-plugin/some-my-rule': () => {}, + // }, }; diff --git a/eslint.config.js b/eslint.config.js index 835f334..6de9d08 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,4 +1,64 @@ +const myConfig = { + plugins: { + unicorn: require('eslint-plugin-unicorn'), + }, + rules: { + ...require('eslint-config-airbnb').rules, + 'unicorn/no-process-exit': ['error'], + 'unicorn/consistent-function-scoping': 'off', + 'no-unused-vars': 'error', + semi: 'error', + }, +}; + module.exports = [ + // { + // files: 'packages/*/src/**/*.js', + // plugins: { + // unicorn: require('eslint-plugin-unicorn'), + // 'custom-plugin': require('./custom-eslint-plugin'), + // }, + // languageOptions: { + // // directly requiring the parser + // // parser: require('babel-eslint'), + + // // or: through the loaded plugin + // parser: 'custom-plugin/eslint-esnext', + // ecmaVersion: 2020, + // sourceType: 'module', + // }, + // rules: { + // ...require('eslint-config-airbnb').rules, + // 'unicorn/no-process-exit': ['error'], + // 'unicorn/consistent-function-scoping': 'off', + // semi: 'error', + // }, + // }, + // { + // files: '**/__tests__/**/*.{js,jsx}', + // plugins: { + // unicorn: require('eslint-plugin-unicorn'), + // 'custom-plugin': require('./custom-eslint-plugin'), + // react: require('eslint-plugin-react'), + // }, + // languageOptions: { + // // directly requiring the parser + // // parser: require('babel-eslint'), + + // // or: through the loaded plugin + // parser: 'custom-plugin/eslint-esnext', + // ecmaVersion: 2020, + // sourceType: 'module', + // }, + // rules: { + // ...require('eslint-config-airbnb').rules, + // 'unicorn/no-process-exit': ['error'], + // 'unicorn/consistent-function-scoping': 'off', + // semi: 'error', + // 'react/jsx-uses-react': 'error', + // 'global-require': 'error', + // }, + // }, { name: 'loading-babel-eslint-parser-through-custom-plugin', plugins: { @@ -8,7 +68,14 @@ module.exports = [ // example using the custom loaded parser { + name: 'use-parser-from-custom-plugin', + plugins: { + baw: require('eslint-plugin-import'), + }, languageOptions: { + globals: { + qwqwqw: true, + }, // directly requiring the parser // parser: require('babel-eslint'), @@ -17,24 +84,29 @@ module.exports = [ }, }, { + name: 'lint-sources', files: 'packages/*/src/**/*.js', - plugins: { - unicorn: require('eslint-plugin-unicorn'), - }, - rules: { - 'unicorn/no-process-exit': ['error'], - 'unicorn/consistent-function-scoping': 'error', - semi: 'error', + ...myConfig, + }, + { + name: 'lang-options', + languageOptions: { + ecmaVersion: 2020, + sourceType: 'commonjs', }, }, { + name: 'lint-tests', files: '**/__tests__/**/*.{js,jsx}', - plugins: { - react: require('eslint-plugin-react'), - }, - rules: { - 'react/jsx-uses-react': 'error', - 'global-require': 'error', - }, + ...myConfig, + // { + // plugins: { + // react: require('eslint-plugin-react'), + // }, + // rules: { + // 'react/jsx-uses-react': 'error', + // 'global-require': 'error', + // }, + // }, }, ]; diff --git a/package.json b/package.json index 2853ef9..ffe417c 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,15 @@ "@zeit/ncc": "^0.21.1", "acorn-globals": "ForbesLindesay/acorn-globals#greenkeeper/acorn-7.1.1", "babel-eslint": "^10.1.0", + "defaults-deep": "^0.2.4", "eslint": "^6.8.0", "husky": "^4.2.3", "jest": "^25.1.0", "lerna": "^3.20.2", "lint-staged": "^10.0.8", "lockfile-lint": "^4.0.0", + "merge-deep": "^3.0.2", + "mixin-deep": "^2.0.1", "prettier": "^1.19.1", "prettier-plugin-pkgjson": "^0.2.4" }, diff --git a/packages/eslint/example.js b/packages/eslint/example.js index 735e76f..1720ea8 100644 --- a/packages/eslint/example.js +++ b/packages/eslint/example.js @@ -15,7 +15,7 @@ const utils = require('./src/utils'); await lintConfigItems(config, { config: oldCfg, // linter, - inject: true, + fix: true, // mapper: (ctx) => { // const meta = ctx.cacheFile && ctx.cacheFile.metadata; // const rep = (meta && meta.report) || null; @@ -30,14 +30,6 @@ const utils = require('./src/utils'); // }, }); - const used = process.memoryUsage(); - - Object.keys(used).forEach((key) => { - console.log( - `${key} ${Math.round((used[key] / 1024 / 1024) * 100) / 100} MB`, - ); - }); - // if (report.errorCount === 0 && report.warningCount === 0) { // console.log('No problems found.'); // return; diff --git a/packages/eslint/foo.js b/packages/eslint/foo.js new file mode 100644 index 0000000..a7b21ae --- /dev/null +++ b/packages/eslint/foo.js @@ -0,0 +1,108 @@ +// async function pFlatten(arr, ...args) { +// const items = await (await arr).reduce(async (acc, e) => { +// const accum = await acc; + +// let item = await e; + +// if (typeof item === 'function') { +// item = await item(...args); +// } +// if (!item) { +// return accum; +// } +// if (Array.isArray(item)) { +// // if the element is an array, fall flatten on it again and then take the returned value and concat it. +// return accum.concat(await pFlatten(item)); +// } +// // otherwise just concat the value. +// return accum.concat(item); +// }, Promise.resolve([])); // initial value for the accumulator is [] + +// return Promise.all(items); +// } + +// pFlatten( +// Promise.resolve([ +// null, +// { foo: 1 }, +// () => null, +// (ctx) => [ +// null, +// ctx.arr, +// { z: 4 }, +// [null, { sasa: 33 }, async () => ({ as: 2 })], +// async () => ({ dada: 22 }), +// ], +// async (ctx) => ({ a: 1, ...ctx.asyncFn }), +// [ +// null, +// { qux: 2 }, +// [null, { zaz: 3 }, () => ({ f: 123 })], +// async () => [null, { qw: 534 }], +// ], +// ]), +// { +// arr: { ok: 123 }, +// asyncFn: { zazzz: 888 }, +// }, +// ).then(console.log); + +const defaultsDeep = require('defaults-deep'); +const mergeDeep = require('merge-deep'); +const mixinDeep = require('mixin-deep'); + +console.log( + mixinDeep( + { + settings: {}, + languageOptions: { + globals: { + sas: 'ok', + }, + parser: 'str', + parserOptions: {}, + linterOptions: { + reportUnusedDisableDirectives: 'string', + }, + }, + plugins: { + react: { + rules: { + jsx: () => {}, + }, + }, + }, + rules: { + 'react/jsx': 'error', + semi: 'error', + }, + }, + { + settings: { foo: 123 }, + processor: 'md', + languageOptions: { + globals: { + win: 1, + sas: 'yep', + }, + ecmaVersion: 2020, + sourceType: 'module', + parser: 'babel-eslint', + }, + plugins: { + unicorn: { + rules: { + 'foo-bar': () => {}, + 'qux-zaz': () => {}, + }, + }, + }, + rules: { + 'unicorn/foo-bar': 'off', + 'unicorn/qux-zaz': 'error', + semi: 'off', + foobie: 'error', + }, + }, + ), +); diff --git a/packages/eslint/src/api.js b/packages/eslint/src/api.js index 12f8a71..57a091c 100644 --- a/packages/eslint/src/api.js +++ b/packages/eslint/src/api.js @@ -1,8 +1,11 @@ +/* eslint-disable max-statements */ /* eslint-disable no-continue */ /* eslint-disable no-restricted-syntax */ 'use strict'; +// require('v8-compile-cache'); + // const fs = require('fs'); // const util = require('util'); const path = require('path'); @@ -75,6 +78,7 @@ async function* resolvePatternsStream(patterns, options) { // // console.log(contexts); // return lintFiles(contexts, opts); // } + async function lintFiles(items, options) { const opts = { ...constants.DEFAULT_OPTIONS, ...options, forceLoad: true }; @@ -86,13 +90,14 @@ async function lintFiles(items, options) { contexts.map(async (ctx) => { const meta = ctx.cacheFile && ctx.cacheFile.metadata; - if (ctx.changed === false && ctx.notFound === false) { + if (ctx.changed === false && ctx.notFound === false && meta) { // console.log(ctx.file.path); results.push(meta.report); return; } const hrstart = process.hrtime(); + const { source, messages } = utils.lint({ ...opts, filename: ctx.file.path, @@ -106,22 +111,22 @@ async function lintFiles(items, options) { const hrend = process.hrtime(hrstart); - console.log('#', ctx.file.path); - console.info( - 'Execution time (hr): %ds %dms', - hrend[0], - hrend[1] / 1000000, - ); + if (opts.verbose) { + console.log('#', ctx.file.path); + console.log('# Size:', ctx.file.size); + console.info('# Execution time:', hrend[0], hrend[1] / 1000000); - const used = process.memoryUsage(); + const used = process.memoryUsage(); - Object.keys(used).forEach((key) => { - console.log( - `${key} ${Math.round((used[key] / 1024 / 1024) * 100) / 100} MB`, - ); - }); + Object.keys(used).forEach((key) => { + console.log( + `# ${key}:`, + Math.round((used[key] / 1024 / 1024) * 100) / 100, + ); + }); - console.log('########'); + console.log('########'); + } // const cacheReport = (meta && meta.report) || {}; // removing `source` from the meta cached, @@ -133,9 +138,9 @@ async function lintFiles(items, options) { const reportChanged = JSON.stringify(res) !== JSON.stringify(rep); // TODO optionally! - // if (res.errorCount > 0 || res.warningCount > 0) { - // // console.error(utils.cleanFrame([res])); - // } + if (res.errorCount > 0 || (res.warningCount > 0 && opts.warnings)) { + console.error(utils.cleanFrame([res])); + } // const { config, ...setts } = opts; // console.log(setts, reportChanged, ctx.file.path); @@ -149,7 +154,7 @@ async function lintFiles(items, options) { }), ); - const report = utils.createReportOrResult('results', results); + const report = utils.createReportOrResult('results', results.filter(Boolean)); report.contexts = contexts; return report; @@ -207,7 +212,6 @@ async function resolvePatterns(patterns, options) { const results = []; for await (const ctx of iterable) { - console.log(ctx.file.path); if (opts.forceLoad === true) { results.push(ctx); continue; diff --git a/packages/eslint/src/index.js b/packages/eslint/src/index.js index ed2f8b9..0ef12bf 100644 --- a/packages/eslint/src/index.js +++ b/packages/eslint/src/index.js @@ -1,5 +1,5 @@ /* eslint-disable global-require */ -/* eslint-disable import/no-dynamic-require */ +/* eslint-disable baw/no-dynamic-require */ /* eslint-disable max-statements */ /* eslint-disable no-restricted-syntax */ diff --git a/packages/eslint/src/lint-config.js b/packages/eslint/src/lint-config.js index 483ac26..eafb7b9 100644 --- a/packages/eslint/src/lint-config.js +++ b/packages/eslint/src/lint-config.js @@ -1,12 +1,13 @@ 'use strict'; +// require('v8-compile-cache'); // const path = require('path'); // const JestWorker = require('jest-worker').default; -const { constants } = require('./utils'); +const utils = require('./utils'); const lintFilesWrapper = require('./lint-files'); module.exports = async function lintConfigItems(configArrayItems, options) { - const opts = { ...constants.DEFAULT_OPTIONS, ...options }; + const opts = { ...utils.constants.DEFAULT_OPTIONS, ...options }; // const report = { // results: [], @@ -15,19 +16,28 @@ module.exports = async function lintConfigItems(configArrayItems, options) { // fixableErrorCount: 0, // fixableWarningCount: 0, // }; + const configItems = await utils.pFlatten( + configArrayItems, + utils.createFunctionConfigContext(), + opts, + ); + + const cfg = configItems + .filter((x) => !x.files) + .reduce(utils.normalizeAndMerge, {}); + + // NOTE: in future + // const [pluginName, parserName] = cfg.languageOptions.parser.split('/'); + // console.log(cfg.plugins[pluginName].parsers[parserName]); + + // console.log(cfg); return Promise.all( - [] - .concat(configArrayItems) - .filter(Boolean) + configItems + .filter((x) => x.files) .map(async (item) => { - if (!item.files) { - return; - } - - // TODO - // - lintFiles(item.files) - // - injectIntoLinter + const { files, ...configItem } = item; + const conf = utils.normalizeAndMerge(cfg, configItem); // rep.results // rep.errorCount += res.errorCount || 0; @@ -36,7 +46,7 @@ module.exports = async function lintConfigItems(configArrayItems, options) { // rep.fixableWarningCount += res.fixableWarningCount || 0; // const itemReport = await lintFiles(item.files, { ...opts, mapper }); - await lintFilesWrapper(item.files, opts); + await lintFilesWrapper(files, { ...opts, config: conf }); // const output = utils // .formatCodeframe(itemReport.results, false) diff --git a/packages/eslint/src/lint-files.js b/packages/eslint/src/lint-files.js index 16ce777..04e2bde 100644 --- a/packages/eslint/src/lint-files.js +++ b/packages/eslint/src/lint-files.js @@ -1,5 +1,6 @@ 'use strict'; +// require('v8-compile-cache'); const { constants } = require('./utils'); const { lintFiles } = require('./api'); diff --git a/packages/eslint/src/utils.js b/packages/eslint/src/utils.js index 688880a..6b5ff61 100644 --- a/packages/eslint/src/utils.js +++ b/packages/eslint/src/utils.js @@ -1,10 +1,13 @@ 'use strict'; +// require('v8-compile-cache'); + const fs = require('fs'); const util = require('util'); // const path = require('path');xx const crypto = require('crypto'); +const mixinDeep = require('mixin-deep'); const cacache = require('cacache'); const findFileUp = require('find-file-up'); const importFresh = require('import-fresh'); @@ -41,28 +44,29 @@ function createFunctionConfigContext(/* cwd, fresh */) { // const folderOfLoadedConfig = loadESLintConifg(); return { - name: 'eslint-next', + name: 'hela-eslint', version: eslintPackageJson.version, cwd: process.cwd(), - hasRule(config, ruleId) { - const cfg = config; - const ruleParts = ruleId.split('/'); - const pluginName = ruleParts.length > 1 ? ruleParts[0] : 'internals'; - const ruleName = ruleParts.length > 1 ? ruleParts[1] : 'eslint-rule-name'; - const plugin = cfg.plugins[pluginName]; - - // TODO Do we need to return false or throw in this case? - // if (!plugin) { - // throw new Error(`@hela/eslint: Plugin with "${pluginName}" not found.`); - // } - if (!plugin) { - return false; - } - if (!plugin.rules[ruleName]) { - return false; - } - return true; - }, + // NOTE: removed from the RFC + // hasRule(config, ruleId) { + // const cfg = config; + // const ruleParts = ruleId.split('/'); + // const pluginName = ruleParts.length > 1 ? ruleParts[0] : 'internals'; + // const ruleName = ruleParts.length > 1 ? ruleParts[1] : 'eslint-rule-name'; + // const plugin = cfg.plugins[pluginName]; + + // // TODO Do we need to return false or throw in this case? + // // if (!plugin) { + // // throw new Error(`@hela/eslint: Plugin with "${pluginName}" not found.`); + // // } + // if (!plugin) { + // return false; + // } + // if (!plugin.rules[ruleName]) { + // return false; + // } + // return true; + // }, }; } @@ -141,58 +145,114 @@ function hasha(value, options) { .digest(opts.digest); } -function injectIntoLinter(config, linter) { - if (!config) { - return linter; - } +function defineRulesFrom(pluginName, rules, linter) { + Object.keys(rules || {}).forEach((ruleName) => { + linter.defineRule(`${pluginName}/${ruleName}`, rules[ruleName]); + }); +} - const linterInstance = linter || new Linter(); +function isObject(val) { + return Boolean(val && typeof val === 'object' && !Array.isArray(val)); +} - [] - .concat(config.plugins) - .filter(Boolean) - .forEach((pluginName) => { - let plugin = null; +function getParser(parser, plugins) { + let parserMod = parser; + let parserName = ''; - if (pluginName.startsWith('@')) { - plugin = require(pluginName); - } else { - plugin = require(`eslint-plugin-${pluginName}`); - } + if (parser && typeof parser === 'string') { + // supports: + // - parser: '@my-scope/some-plugin/foo-parser` + // - parser: 'some-plugin/foo-parser` + if (parser.includes('/')) { + const parts = parser.split('/'); + + const pluginName = + parts.length === 2 ? parts[0] : `${parts[0]}/${parts[1]}`; + const key = parts.length === 2 ? parts[1] : parts[2]; - // note: defineRules is buggy - Object.keys(plugin.rules).forEach((ruleName) => { - linterInstance.defineRule( - `${pluginName}/${ruleName}`, - plugin.rules[ruleName], + const plugin = plugins + ? plugins[pluginName] + : eslintRequire('plugin', pluginName); + + if (!isObject(plugin.parsers)) { + throw new TypeError( + 'expect plugin "parsers" key to be an object like { "babel-eslint": require("babel-eslint") }', ); - }); - - // note: otherwise this should work - // linterInstance.defineRules( - // Object.keys(plugin.rules).reduce((acc, ruleName) => { - // acc[`${pluginName}/${ruleName}`] = plugin.rules[ruleName]; - - // return acc; - // }, {}), - // ); - }); - - if (config.parser && config.parser.startsWith('/')) { - if (config.parser.includes('babel-eslint')) { - config.parser = 'babel-eslint'; - } else if (config.parser.includes('@typescript-eslint/parser')) { - config.parser = '@typescript-eslint/parser'; + } + + parserMod = plugin.parsers[key]; + parserName = key; + } else { + // backward compat + // parser: 'babel-eslint` + parserMod = require(parser); + parserName = parser; } - // NOTE: more parsers } - // define only when we are passed with "raw" (not processed) config - if (config.parser && !config.parser.startsWith('/')) { - linterInstance.defineParser(config.parser, require(config.parser)); + if (!isObject(parserMod)) { + throw new TypeError('expect parser to be an object or a string'); } - return { linter: linterInstance, config: { ...config } }; + return { + parser: parserMod, + name: parserName || parserMod.name || 'unknown-parser', + }; +} + +function eslintRequire(type, name, itIsParser) { + let mod = null; + if (name.startsWith('@')) { + mod = require(name.includes('/') ? name : `${name}/eslint-${type}`); + } else if (itIsParser) { + mod = require(name); + } else { + mod = require(`eslint-${type}-${name}`); + } + + return mod; +} + +function injectIntoLinter(config, linter, linterOptions) { + const linterInstance = linter || new Linter(linterOptions); + if (!config) { + return linterInstance; + } + + Object.keys(config.plugins || {}).forEach((name) => { + defineRulesFrom(name, config.plugins[name].rules, linterInstance); + }); + + if (config.languageOptions && config.languageOptions.parser) { + const { parser, name: parserName } = getParser( + config.languageOptions.parser, + config.plugins, + ); + + linterInstance.defineParser(parserName, parser); + } + + // NOTE: delete `config.parser` and `config.plugins` intentionally, + // because linter.verify/verifyAndFix may not understand the new definitions + const { plugins: _, parser: __, ...cleanedConfig } = config; + // delete config.plugins; + // delete config.parser; + + // if (config.parser && config.parser.startsWith('/')) { + // if (config.parser.includes('babel-eslint')) { + // config.parser = 'babel-eslint'; + // } else if (config.parser.includes('@typescript-eslint/parser')) { + // config.parser = '@typescript-eslint/parser'; + // } + // // NOTE: more parsers + // } + + // define only when we are passed with "raw" (not processed) config + // if (config.parser && !config.parser.startsWith('/')) { + // linterInstance.defineParser(config.parser, require(config.parser)); + // } + + return { linter: linterInstance, config: cleanedConfig }; } function toIntegrity(value) { @@ -252,15 +312,22 @@ function calculateCount(type, items) { } function lint(options) { - const opts = { ...options }; + const opts = { inject: true, ...options }; const cfg = { ...opts.config, filename: opts.filename }; - // const linter = opts.linter || new Linter(); const filter = (x) => opts.warnings ? true : !opts.warnings && x.severity === 2; + const linterOptions = + cfg.linterOptions || + (cfg.languageOptions && cfg.languageOptions.linterOptions) || + opts.linterOptions; + + const $linter = opts.linter || new Linter(linterOptions); const { config, linter } = opts.inject - ? injectIntoLinter(cfg) - : { config: cfg, linter: opts.linter || new Linter() }; + ? injectIntoLinter(cfg, $linter, linterOptions) + : { config: cfg, linter: $linter }; + + console.log('loaded config', config); if (!opts.contents && !opts.text) { opts.contents = fs.readFileSync(config.filename, 'utf8'); @@ -297,6 +364,99 @@ function cleanFrame(rep) { .join('\n'); } +async function pFlatten(arr, ...args) { + const items = await (await arr).reduce(async (acc, e) => { + const accum = await acc; + + let item = await e; + + if (typeof item === 'function') { + item = await item(...args); + } + if (!item) { + return accum; + } + if (Array.isArray(item)) { + // if the element is an array, fall flatten on it again and then take the returned value and concat it. + return accum.concat(await pFlatten(item)); + } + // otherwise just concat the value. + return accum.concat(item); + }, Promise.resolve([])); // initial value for the accumulator is [] + + return Promise.all(items); +} + +function normalizePlugins(plugins) { + if (!plugins) { + return {}; + } + if (typeof plugins !== 'object') { + throw new TypeError( + 'plugins property is expected to be an object like { react: require("eslint-plugin-react") } or an array of plugin name strings like ["react"]', + ); + } + if (Array.isArray(plugins)) { + return plugins.reduce((acc, pluginName) => { + if (typeof pluginName !== 'string') { + throw new TypeError( + 'when plugins is an array it can contain only strings', + ); + } + acc[pluginName] = eslintRequire('plugin', pluginName); + return acc; + }, {}); + } + + return plugins; +} + +function normalizeAndMerge(target, item) { + // eslint-disable-next-line no-param-reassign + item.plugins = normalizePlugins(item.plugins); + + const accum = mixinDeep({ ...target }, item); + + // Object.keys(item.plugins).forEach((pluginName) => { + // if (target.plugins && target.plugins[pluginName]) { + // throw new Error( + // `config item with "${item.name}" name trying to override "${pluginName}" plugin namespace`, + // ); + // } + + // accum.plugins = accum.plugins || {}; + // accum.plugins[pluginName] = item.plugins[pluginName]; + // }); + + const lang = { ...accum.languageOptions }; + + if (lang.sourceType === 'commonjs') { + lang.sourceType = 'script'; + lang.globals = { + ...lang.globals, + require: true, + exports: true, + module: true, + }; + lang.parserOptions = mixinDeep( + { ...lang.parserOptions }, + { + ecmaFeatures: { globalReturn: true }, + }, + ); + } + + accum.parserOptions = { + ...lang.parserOptions, + ecmaVersion: lang.ecmaVersion, + sourceType: lang.sourceType, + }; + accum.globals = { ...lang.globals }; + + accum.languageOptions = lang; + return accum; +} + module.exports = { isFile, isCacheFile, @@ -304,6 +464,15 @@ module.exports = { toFile, injectIntoLinter, hasha, + + pFlatten, + normalizeAndMerge, + normalizePlugins, + getParser, + defineRulesFrom, + eslintRequire, + isObject, + hasInCache, toIntegrity, createReportOrResult, diff --git a/yarn.lock b/yarn.lock index e989ddb..fb10402 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2525,6 +2525,17 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +clone-deep@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-0.2.4.tgz#4e73dd09e9fb971cc38670c5dced9c1896481cc6" + integrity sha1-TnPdCen7lxzDhnDF3O2cGJZIHMY= + dependencies: + for-own "^0.1.3" + is-plain-object "^2.0.1" + kind-of "^3.0.2" + lazy-cache "^1.0.3" + shallow-clone "^0.1.2" + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -2993,6 +3004,15 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +defaults-deep@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/defaults-deep/-/defaults-deep-0.2.4.tgz#a479cfeafce025810fb93aa8d2dde0ee2d677cc6" + integrity sha512-V6BtqzcMvn0EPOy7f+SfMhfmTawq+7UQdt9yZH0EBK89+IHo5f+Hse/qzTorAXOBrQpxpwb6cB/8OgtaMrT+Fg== + dependencies: + for-own "^0.1.3" + is-extendable "^0.1.1" + lazy-cache "^0.2.3" + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -3972,11 +3992,23 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -for-in@^1.0.2: +for-in@^0.1.3: + version "0.1.8" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.8.tgz#d8773908e31256109952b1fdb9b3fa867d2775e1" + integrity sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE= + +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= +for-own@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -4724,7 +4756,7 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-buffer@^1.1.5: +is-buffer@^1.0.2, is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== @@ -4913,7 +4945,7 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -5564,6 +5596,13 @@ jsx-ast-utils@^2.2.1, jsx-ast-utils@^2.2.3: array-includes "^3.0.3" object.assign "^4.1.0" +kind-of@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-2.0.1.tgz#018ec7a4ce7e3a86cb9141be519d24c8faa981b5" + integrity sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU= + dependencies: + is-buffer "^1.0.2" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -5593,6 +5632,16 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +lazy-cache@^0.2.3: + version "0.2.7" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-0.2.7.tgz#7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65" + integrity sha1-f+3fLctu23fRHvHRF6tf/fCrG2U= + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= + lerna@^3.20.2: version "3.20.2" resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.20.2.tgz#abf84e73055fe84ee21b46e64baf37b496c24864" @@ -6072,6 +6121,15 @@ meow@^5.0.0: trim-newlines "^2.0.0" yargs-parser "^10.0.0" +merge-deep@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/merge-deep/-/merge-deep-3.0.2.tgz#f39fa100a4f1bd34ff29f7d2bf4508fbb8d83ad2" + integrity sha512-T7qC8kg4Zoti1cFd8Cr0M+qaZfOwjlPDEdZIIPPB2JZctjaPM4fX+i7HOId69tAti2fvO6X5ldfYUONDODsrkA== + dependencies: + arr-union "^3.1.0" + clone-deep "^0.2.4" + kind-of "^3.0.2" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -6233,6 +6291,19 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" +mixin-deep@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-2.0.1.tgz#9a6946bef4a368401b784970ae3caaaa6bab02fa" + integrity sha512-imbHQNRglyaplMmjBLL3V5R6Bfq5oM+ivds3SKgc6oRtzErEnBUUc5No11Z2pilkUvl42gJvi285xTNswcKCMA== + +mixin-object@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mixin-object/-/mixin-object-2.0.1.tgz#4fb949441dab182540f1fe035ba60e1947a5e57e" + integrity sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4= + dependencies: + for-in "^0.1.3" + is-extendable "^0.1.1" + mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" @@ -7802,6 +7873,16 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" +shallow-clone@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-0.1.2.tgz#5909e874ba77106d73ac414cfec1ffca87d97060" + integrity sha1-WQnodLp3EG1zrEFM/sH/yofZcGA= + dependencies: + is-extendable "^0.1.1" + kind-of "^2.0.1" + lazy-cache "^0.2.3" + mixin-object "^2.0.1" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"