hapijs / eslint-config-hapi

Shareable ESLint config for the hapi ecosystem
Other
22 stars 23 forks source link

Add test for duplicate lint entries #9

Closed cjihrig closed 9 years ago

cjihrig commented 9 years ago

8 removed a duplicated rule in the config. We should have a test that loops over the keys in the config to make sure there are no duplicates.

AdriVanHoudt commented 9 years ago

how would you do this, the moment you require it it will just take the last occurrence of the key

AdriVanHoudt commented 9 years ago

some low level read line by line could work http://stackoverflow.com/questions/6156501/read-a-file-one-line-at-a-time-in-node-js/32599033#32599033

cjihrig commented 9 years ago

The config is just a couple of objects. Just loop over the keys and maintain a list of already seen keys.

AdriVanHoudt commented 9 years ago

the problem, as stated in first comment, is that when requiring, js will remove dupe keys and just assign the last value to it, so you will never have dupe keys

cjihrig commented 9 years ago

Oh, duh you're right. Yea, you would have to do it at the source code level.

AdriVanHoudt commented 9 years ago

:+1:

cjihrig commented 9 years ago

On second thought, this might be overkill. Closing.

AdriVanHoudt commented 9 years ago

yeah maybe, it is probably more sane to just go through it once and then keep it in mind for future updates

cjihrig commented 9 years ago

Conveniently, this is taken care of now, as of 7e7117398e7a4e1460d6739e2b9deb5281fdad31

AdriVanHoudt commented 9 years ago

I feel dumb now haha also are you linting a linting config? meta

cjihrig commented 9 years ago

Yes. lintception

AdriVanHoudt commented 9 years ago

and belly button uses lab which uses this === infinite dependency :O

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.