diff --git a/.eslintrc.js b/.eslintrc.js index 86c0172..518dbbb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,6 +53,8 @@ module.exports = { ], 'no-await-in-loop': 'off', + 'no-restricted-syntax': 'off', + 'import/no-unresolved': 'off', 'import/extensions': ['error', 'never', [ diff --git a/example/index.js b/example/index.js index fc0215d..905c567 100644 --- a/example/index.js +++ b/example/index.js @@ -18,6 +18,14 @@ const example = { four, } +const getAsync = data => new Promise(res => setTimeout(res, 1, data)) + +async function testAsync(list) { + for (const item of list) { + await getAsync(item) + } +} + const PART_NUM = 12 const inside = resolve( example, @@ -62,5 +70,9 @@ let target = global.meet target = example.first + OFFSET +export function fill() { + return testAsync() +} + export const demo = target * INCR export default example diff --git a/readme.md b/readme.md index 344c7d7..78a5a88 100644 --- a/readme.md +++ b/readme.md @@ -393,6 +393,17 @@ In Node.js LTS await in loop is native and optimized. > Enabled in react +## no-restricted-syntax: `off` + +https://eslint.org/docs/rules/no-restricted-syntax + +In node.js we want to use "await in for" without Futures. + +https://github.com/airbnb/javascript#iterators--nope + +> Enabled in react + + ## import/no-unresolved: `off` https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md