Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

1003 - Identifier expected.

🔍 Regex Patterns

regexFind: /\d+\s+((function|enum|class|interface|type))\s*=\s*(.*)/
regexReplace: $1 myFunction = $3

💡 Suggestion

Add a valid identifier name after the keyword

📝 Examples

Example 1: Missing function name

- function = () => {};
+ function myFunction = () => {};

Explanation: Missing function name after function keyword

Example 2: Missing enum name

- enum = { A, B };
+ enum MyEnum = { A, B };

Explanation: Missing enum name after enum keyword

🖼️ Visual Output

Command

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

Result

docs/1003/index.ts:1:10 - error TS1003: Identifier expected.

1 function = () => {};

docs/1003/index.ts:2:6 - error TS1003: Identifier expected.

2 enum = { A, B };

OR (without --pretty flag):

docs/1003/index.ts(1,10): error TS1003: Identifier expected.
docs/1003/index.ts(2,6): error TS1003: Identifier expected.