nickdeis / eslint-plugin-no-secrets

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

Exclude JSON identifiers from parsing #18

Open constgen opened 3 years ago

constgen commented 3 years ago

We don't need to analyze strings that play a role of property names

nickdeis commented 3 years ago

Thank you @constgen for making this PR. I think I might later on refactor this so that I can use this in conjunction with ignoreIdentifiers. Let me know if you need any help with testing.

constgen commented 3 years ago

ignorePropertyNames will be more suitable option name for this feature. If you have no time may be I can add it if we really need it. What should be its default value?

nickdeis commented 3 years ago

Hey @constgen, Since identifiers and property names are different, I think there is room for both. Do you want to implement that in a separate PR or this one? Either way, fantastic work and thank you so much! Please let me know if you want to merge this and I'll be sure to publish it this weekend. Best, Nick

constgen commented 3 years ago

I am going to do this in this PR. Just give me your opinion on the description of the options names and default values

nickdeis commented 3 years ago

Hey @constgen , Let's create a separate option called ignoreProperties and give it the default value of an empty array. I want to keep things as backward compatible as possible, and creating a new property allows us to do that. Let me know if you need any help with implementing this. I'll keep this PR open until you are ready to merge. Thank you so much for all the work you are putting into this, it means quite a lot!