-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
normalizing, merging & utils; use new config format entirely
Signed-off-by: Charlike Mike Reagent <[email protected]>
- Loading branch information
1 parent
7b3440b
commit cbb9119
Showing
11 changed files
with
568 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
}, | ||
}, | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.