-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ESLint to version 7.8+ for more optional chaining support in TM editor #1060
Comments
There are a few related new operators that need support: Optional chaining operator obj.val?.prop
obj.val?.[expr]
obj.arr?.[index]
obj.func?.(args) Null-ish coalescing operator leftExpr ?? rightExpr Logical assignment operators expr1 &&= expr2 // AND
expr1 ||= expr2 // OR
expr1 ??= expr2 // null-ish coalescing Also the new async loop syntax: for await (variable of iterable) {
statement
} and the private field syntax for classes: class ClassWithPrivateField {
#privateField
}
class ClassWithPrivateMethod {
#privateMethod() {
return 'hello world'
}
}
class ClassWithPrivateStaticField {
static #PRIVATE_STATIC_FIELD
} I think that's everything that's not supported in the current spec. |
All, except expr1 &&= expr2 // AND should work at the latest BETA version 4.12.6121. |
@Dediggefedde What is the Tampermonkey version used for your test? |
@derjanb A minimal example would be
Remove the ? and highlighting/indention seems fine. Execution with ? works without errors or warnings. |
You can get the beta version from here: https://www.tampermonkey.net/?browser=firefox |
I have this in code:
Expected Behavior
Optional chaining should be permitted.
See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
Actual Behavior
This brakes ESLint built in TM editor and also code highlighting goes funky... For example text in backticks never ends. See example script below.
Specifications
Script
You can see an example code here:
https://github.com/Eccenux/iitc-plugin-fs-puzzle-helper/tree/master/my-plugin/dist
The text was updated successfully, but these errors were encountered: