question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please document no-restricted-syntax

See original GitHub issue

After moving to eslint-config-airbnb-base from eslint-config-airbnb I am now getting warnings related to the no-restricted-syntax rule (specified here), but no documentation backing this up exists in README.md.

Can the documentation be updated explaining the reasoning behind the choices in this rule?


In my particular case this was triggered on a for...in loop, so I’m guessing that having ForInStatement in the list of forbidden nodes would fall into the Iterators and Generators section.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

8reactions
ljharbcommented, May 27, 2016

@danez Object.keys(obj).forEach(key => { obj[key] }) - same works with Object.entries and Object.values, and with all the array iteration methods. There’s never a need to use a loop.

5reactions
lxcidcommented, Jul 10, 2017

Since async/await is stage 3 and there’s no way to async/await with higher-order functions like forEach, this is too restrictive for me.

for (const userProps in users) {
  await createUser(userProps);
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

no-restricted-syntax - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
How can I turn off ESLint's no-restricted-syntax rule just for ...
Check existing config. Based on the current master branch, eslint-config-airbnb currently disables four syntax forms:.
Read more >
Allow changes to parts of a protected document
Use Restrict Editing to protect parts that can or can't be changed, who can make changes, find areas you can edit, or unlock...
Read more >
eslint-plugin-jsdoc - npm
For no-missing-syntax and no-restricted-syntax , there is also a message property which allows customization of the message to be shown when ...
Read more >
RFC 6749: The OAuth 2.0 Authorization Framework
Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found