nickdeis / eslint-plugin-no-secrets

An eslint plugin to find strings that might be secrets/credentials
MIT License
127 stars 4 forks source link

question: find secrets in comments? #15

Closed tomsquest closed 3 years ago

tomsquest commented 3 years ago

Hi,

I tried your plugin and it works great, at least for secrets in source code.

Is there a way to make it find secrets in comments?

Sample:

// const passwords = "admin123"     <---- HERE I forget to remove this commented line
const password = ""

BTW, maybe related, we are using TypeScript.

Thanks

nickdeis commented 3 years ago

Hey @tomsquest, That's actually a really great idea! I think it's in line with this package's core purpose. Eslint does expose apis for linting comments, so I will see if I can add this feature. Thanks, Nick

nickdeis commented 3 years ago

Hey @tomsquest, I've added this feature in version 0.7.9. It should be on npm. Let me know how it works out for you, and if anything doesn't, feel free to reach out! Thanks for the suggestion, Nick

tomsquest commented 3 years ago

Hi @nickdeis ,

I just updated and it is working well ! :+1:

Thanks for the work !