Stage 4 syntaxes in core rules
See original GitHub issueacorn
, the base of espree
, has supported async/await and trailing function commas: Acorn 4.0.0
espree
is going to support those, coming soon: https://github.com/eslint/espree/issues/287
Then, I’m starting to modify core rules to support those. In my head, the following rules need some tweaks.
- 1st
- #7170 no-dupe-args … Duplicate names in non-simple parameters are illegal syntax. We need to fix our tests since Acorn has enhanced the check. (4 tests are failing now with Acorn 4.0.0)
- #7170 no-redeclare … Duplicate names in exports are illegal syntax. We need to fix our tests since Acorn has enhanced the check. (2 tests are failing now with Acorn 4.0.0)
- 2nd
- #7176 arrow-parens … It has false positive/negative on async functions.
- #7179 keyword-spacing … It has false positive/negative on async functions.
- #7178 no-extra-parens … It should handle await expressions also by default.
- #7175 no-unused-expressions … It should handle await expressions also by default.
- #7173 prefer-arrow-callback … It has wrong autofix on async functions.
- #7180 space-before-function-paren … It should handle async arrow functions (as anonymous function?).
async(a) => a
. - #7174 space-unary-ops … It should handle await expressions. It has handled yield expressions already.
- 3rd
- #7172 array-callback-return … I think should not warn async functions as callbacks.
Promise.all(list.map(async x => { await doSomething(x) })
is legal usage. - #7181 comma-dangle … It should check functions also by opt-in.
- #7182 generator-star-spacing … To make sure, it needs tests for async functions.
- #7172 array-callback-return … I think should not warn async functions as callbacks.
Changelog:
space-before-function-paren
was added.space-unary-ops
was added.- Sorted by priority.
generator-star-spacing
was added.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Part 4. UN/EDIFACT Rules - Chapter 2.2 Syntax Rules | UNECE
SYNTAX LEVELS. This International Standard specifies syntax levels A and B whichare identical in all respects except for the character sets used. ...
Read more >4 Syntax and basic data types
A CSS style sheet, for any level of CSS, consists of a list of statements (see the grammar above). There are two kinds...
Read more >Syntax in the English Language: Definition, Examples, and 3 ...
4 Essential Rules of Syntax in the English Language · 1. A complete sentence requires a subject and a verb and expresses a...
Read more >Skills for Early Reading: Syntax - Evidence Based Early Literacy
Syntax. Reading is the act of processing text in order to derive meaning. To learn to read, children must develop both fluent word...
Read more >Rules for AWS IoT
Rules give your devices the ability to interact with AWS services. Rules are analyzed and actions are performed based on the MQTT topic...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve been working on a few of the issues on this list; see #7172, #7173, #7174, #7175, #7176.
Yes,
async function foo() {}
is valid. But we cannot remove the space betweenasync
andfunction
, sokeyword-spacing
rule ignores it.