Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

1005 - '{0}' expected.

🔍 Regex Patterns

regexFind: /([a-zA-Z_$][a-zA-Z0-9_$]*)\\s+(number|string|boolean|any|object|Array|Function)/
regexReplace: $1: $2

💡 Suggestion

Add missing punctuation mark. Common fixes: comma between object properties, colon in type annotations, closing parenthesis in functions, or semicolon after statements.

📝 Examples

Example 1: Missing comma between object properties

const obj = {
-  name: "John"
+  name: "John",
   age: 30
}

Explanation: Missing comma between object literal properties

Example 2: Missing colon in type annotation

- let count number = 5
+ let count: number = 5

Explanation: Missing colon between variable name and type annotation

🖼️ Visual Output

Command

npx tsc ./docs/1005/index.ts --noEmit --pretty

Result

docs/1005/index.ts:3:3 - error TS1005: ',' expected.

3   age: 30
    ~~~

docs/1005/index.ts:6:11 - error TS1005: ',' expected.

6 let count number = 5
            ~~~~~~

OR (without --pretty flag):

docs/1005/index.ts(3,3): error TS1005: ',' expected.
docs/1005/index.ts(6,11): error TS1005: ',' expected.