diff --git a/docs/errors/E0358.md b/docs/errors/E0358.md new file mode 100644 index 0000000000..e4cea7e60b --- /dev/null +++ b/docs/errors/E0358.md @@ -0,0 +1,23 @@ +# E0358: 'declare' should not be written inside a 'declare namespace' + +Inside `declare namespace`, declarations (functions, classes, etc.) are +automatically `declare`. It is a syntax error to explicitly write `declare` on +these declarations: + +```typescript +declare namespace jQuery { + declare function get(url); +} +``` + +To fix this error, remove the `declare` keyword: + +```typescript +declare namespace jQuery { + function get(url); +} +``` + +Known issues with quick-lint-js: +* [possible false positive with 'declare' inside 'declare + module'](https://github.com/quick-lint/quick-lint-js/issues/1142)