Skip to content

Commit 292ecaa

Browse files
committed
feat(docs): document E0358
1 parent 5bd592e commit 292ecaa

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/errors/E0358.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# E0358: 'declare' should not be written inside a 'declare namespace'
2+
3+
Inside `declare namespace`, declarations (functions, classes, etc.) are
4+
automatically `declare`. It is a syntax error to explicitly write `declare` on
5+
these declarations:
6+
7+
```typescript
8+
declare namespace jQuery {
9+
declare function get(url);
10+
}
11+
```
12+
13+
To fix this error, remove the `declare` keyword:
14+
15+
```typescript
16+
declare namespace jQuery {
17+
function get(url);
18+
}
19+
```
20+
21+
Known issues with quick-lint-js:
22+
* [possible false positive with 'declare' inside 'declare
23+
module'](https://github.com/quick-lint/quick-lint-js/issues/1142)

0 commit comments

Comments
 (0)