I want to write a script that takes a javascript file and iterate through it line by line and check for single-line code comments. If there are any then push it to array and return that array.
For Example:
const array=[1,2,3,4,5];
//This comment needs to be detected and pushed to a new array
I have searched a lot about it and work through the Eslint(JS linter) but there is not any rule for single-line-comment but do have a rule for block-comment.