Skip to content

Commit c0430ac

Browse files
committed
Docs: document E054, E055, E056
1 parent c1b66fc commit c0430ac

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

docs/errors/E054.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# E054: unexpected token
2+
3+
If you get error E054, quick-lint-js does not understand your code for some
4+
reasons. The authors of quick-lint-js have not written a helpful message.
5+
6+
If you encounter this error, please [submit a bug
7+
report](https://github.com/quick-lint/quick-lint-js/issues).
8+
9+
Typically, this error occurs if code contains an operator which doesn't belong:
10+
11+
let person = "Sam";:
12+
13+
To fix this error, write correct JavaScript syntax:
14+
15+
let person = "Sam";

docs/errors/E055.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# E055: unmatched indexing bracket
2+
3+
```config-for-examples
4+
{
5+
"globals": {
6+
"friends": true
7+
}
8+
}
9+
```
10+
11+
It is an error to write the indexing operator `[` without its matching `]`:
12+
13+
for (let i = 0; i < friends.length; ++i) {
14+
let friend = friends[i;
15+
console.log[(`Hello, ${friend}!`);
16+
}
17+
18+
To fix this error, write the closing `]`, or remove the extraneous `[`:
19+
20+
for (let i = 0; i < friends.length; ++i) {
21+
let friend = friends[i];
22+
console.log(`Hello, ${friend}!`);
23+
}

docs/errors/E056.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# E056: unmatched parenthesis
2+
3+
It is an error to write the `(` without its matching `)`:
4+
5+
function fma(a, b, c) {
6+
return (a * b + c;
7+
}
8+
let five = (fma(2, 2, 1);
9+
10+
To fix this error, write the closing `)`, or remove the extraneous `(`:
11+
12+
function fma(a, b, c) {
13+
return (a * b) + c;
14+
}
15+
let five = fma(2, 2, 1);

0 commit comments

Comments
 (0)