Skip to content

Commit

Permalink
Added 19 more translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Sep 13, 2023
1 parent 12bf1ae commit bd9ff4b
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/hot-toes-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@total-typescript/error-translation-engine': patch
'ts-error-translator': patch
---

Added 19 more translations.
5 changes: 5 additions & 0 deletions packages/engine/errors/1015.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'Parameter cannot have question mark and initializer.'
---

You can use a question mark or an default value, but not both at once.
5 changes: 5 additions & 0 deletions packages/engine/errors/1240.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'Unable to resolve signature of property decorator when called as an expression.'
---

You can't use a decorator on an expression, like an arrow function.
5 changes: 5 additions & 0 deletions packages/engine/errors/1254.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."
---

You can't use runtime code in a declaration file.
5 changes: 5 additions & 0 deletions packages/engine/errors/1268.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."
---

Objects in TypeScript (and JavaScript!) can only have strings, numbers or symbols as keys. [Template literal types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) are a way of constructing strings.
5 changes: 5 additions & 0 deletions packages/engine/errors/1434.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'Unexpected keyword or identifier.'
---

There's a syntax error in your code, so I can't tell exactly what's wrong.
5 changes: 5 additions & 0 deletions packages/engine/errors/2305.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Module '{0}' has no exported member '{1}'."
---

'{1}' is not one of the things exported from '{0}'.
5 changes: 5 additions & 0 deletions packages/engine/errors/2312.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'An interface can only extend an object type or intersection of object types with statically known members.'
---

You might be trying to use an interface to extend a union type. This isn't possible.
5 changes: 5 additions & 0 deletions packages/engine/errors/2365.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Operator '{0}' cannot be applied to types '{1}' and '{2}'."
---

You can't use '{0}' on the types '{1}' and '{2}'.
5 changes: 5 additions & 0 deletions packages/engine/errors/2488.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."
---

Type '{0}' isn't iterable. To make it iterable, add a [`Symbol.iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator) key.
5 changes: 5 additions & 0 deletions packages/engine/errors/2556.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'A spread argument must either have a tuple type or be passed to a rest parameter.'
---

You're spreading arguments into a function. To do that, either the argument needs to be a tuple OR the function needs to accept a dynamic number of arguments.
5 changes: 5 additions & 0 deletions packages/engine/errors/2604.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "JSX element type '{0}' does not have any construct or call signatures."
---

'{0}' cannot be used as a JSX component because it isn't a function.
5 changes: 5 additions & 0 deletions packages/engine/errors/2614.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"
---

'{1}' is not one of the things exported from '{0}'. Did you mean to import '{1}' from '{0}' instead?
5 changes: 5 additions & 0 deletions packages/engine/errors/2686.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."
---

You might not have configured `jsx` in your `tsconfig.json` correctly. [Learn more](https://www.totaltypescript.com/react-refers-to-a-umd-global).
5 changes: 5 additions & 0 deletions packages/engine/errors/2722.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Cannot invoke an object which is possibly 'undefined'."
---

This function might be undefined. You'll need to check it's defined before calling it.
5 changes: 5 additions & 0 deletions packages/engine/errors/2739.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Type '{0}' is missing the following properties from type '{1}': {2}"
---

'{0}' is missing some required properties from type '{1}': {2}.
5 changes: 5 additions & 0 deletions packages/engine/errors/2775.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: 'Assertions require every name in the call target to be declared with an explicit type annotation.'
---

You might be using an `asserts` keyword on an arrow function. If you are, change the function to use the `function` keyword.
5 changes: 5 additions & 0 deletions packages/engine/errors/6244.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Cannot access ambient const enums when 'isolatedModules' is enabled."
---

You can't use const enums when `isolatedModules` is enabled.
5 changes: 5 additions & 0 deletions packages/engine/errors/7026.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."
---

`JSX.IntrinsicElements` has not been declared in the global scope. [Learn more](https://www.totaltypescript.com/what-is-jsx-intrinsicelements).
5 changes: 5 additions & 0 deletions packages/engine/errors/7053.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
original: "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."
---

You can't use '{0}' to index into '{1}'. [This article](https://www.totaltypescript.com/concepts/type-string-cannot-be-used-to-index-type) might help.
2 changes: 1 addition & 1 deletion packages/engine/src/tsErrorMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -4862,7 +4862,7 @@
"code": 6243
},

"Modules": {
"Cannot access ambient const enums when 'isolatedModules' is enabled.": {
"category": "Message",
"code": 6244
},
Expand Down

0 comments on commit bd9ff4b

Please sign in to comment.