File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ # E052: unexpected '#'
2
+
3
+ ``` config-for-examples
4
+ {
5
+ "globals": {
6
+ "encrypt": true,
7
+ "sendMessage": true,
8
+
9
+ "synchronous": true,
10
+ "blocking": true
11
+ }
12
+ }
13
+ ```
14
+
15
+ In JavaScript, ` # ` is used for shebangs at the beginning of a file (e.g.
16
+ ` #!/usr/bin/env node ` ) and private properties. (` # ` does not start a comment.)
17
+ It is an error to use ` # ` anywhere else:
18
+
19
+ class Auth {
20
+ #password;
21
+
22
+ authenticate() {
23
+ # synchronous (blocking)
24
+ sendMessage(encrypt(this.# password));
25
+ }
26
+ }
27
+
28
+ To fix this error, write the property's name after ` # ` , and use ` // ` for line
29
+ comments:
30
+
31
+ class Auth {
32
+ #password;
33
+
34
+ authenticate() {
35
+ // synchronous (blocking)
36
+ sendMessage(encrypt(this.#password));
37
+ }
38
+ }
Original file line number Diff line number Diff line change
1
+ # E147: unexpected identifier in expression; missing operator before
2
+
3
+ ``` config-for-examples
4
+ {
5
+ "globals": {
6
+ "add": true,
7
+ "dos": true,
8
+ "two": true
9
+ }
10
+ }
11
+ ```
12
+
13
+ It is an error to write two variable names without an operator in between:
14
+
15
+ const quatro = (dos dos);
16
+ const four = add(two two);
17
+
18
+ To fix this error, remove one of the variables, or add an operator:
19
+
20
+ const quatro = (dos + dos);
21
+ const four = add(two, two);
You can’t perform that action at this time.
0 commit comments