#64562 closed defect (bug) (fixed)
JSHint: Bump esversion to 11 (ES2020)
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | 6.9 |
| Component: | Build/Test Tools | Keywords: | |
| Focuses: | javascript, coding-standards | Cc: |
Description (last modified by )
In #63077, the .jshintrc had its esversion (docs) bumped from 6 to 10. This enabled the use of async functions. However, there is also 11 (ES2020) which includes features like:
- Nullish Coalescing Operator (
??): https://caniuse.com/wf-nullish-coalescing - Optional Chaining (
?.): https://caniuse.com/mdn-javascript_operators_optional_chaining - Dynamic
import(): https://caniuse.com/es6-module-dynamic-import
These features are already being used in WordPress core for code pulled in from Gutenberg, as seen here: https://github.com/search?q=repo%3AWordPress%2FWordPress+%2F%5Cw%2B%5C%3F%5C.%5Cw%2B%7C%5C%3F%5C%3F%2F+language%3AJavaScript&type=code
These features were all introduced in 2020. They are supported by the browsers that WordPress supports.
It's time to update .jshintrc to recognize that the these JavaScript language features are blessed for usage.
Change History (7)
This ticket was mentioned in PR #10808 on WordPress/wordpress-develop by @westonruter.
3 months ago
#1
- Keywords has-patch added
#2
@
3 months ago
- Keywords has-patch removed
- Owner set to westonruter
- Status changed from new to accepted
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/64562