#64562 closed defect (bug) (fixed)
JSHint: Bump esversion to 11 (ES2020)
| Reported by: | westonruter | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0 |
| Component: | Build/Test Tools | Version: | 6.9 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | javascript, coding-standards |
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.
6 months ago
#1
- Keywords has-patch added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/64562