eslint-plugin-lit icon indicating copy to clipboard operation
eslint-plugin-lit copied to clipboard

Add filename checks

Open RoXuS opened this issue 2 years ago • 2 comments

Hey!

Thx for this plugin.

I suggest these 2 rules to check if the filename matches with lit class name and if the filename matches with element name.

RoXuS avatar Nov 16 '21 14:11 RoXuS

i feel like if we do adopt these rules, they should probably exist as one to keep them well scoped to lit.

a rule such as "file name matches class name" could exist in another plugin, unrelated to lit, and cover what the file-name-matches-element-class rule does and more.

so maybe we have a naming convention rule which uses the element name if one is found, and the class name otherwise.

@stramel if you get time can i get your thoughts on this too. i dont want the rules to end up being too generic, enough that they're not really lit-specific.

43081j avatar Nov 20 '21 18:11 43081j

I'm agree, theses rules should be one, I split them to allow more flexibility to the user.

So, I can regroup the rules to check class + element name + filename, if you prefer.

Maybe class should be optional in the rules? (element + filename OR class/element/filename).

RoXuS avatar Nov 21 '21 13:11 RoXuS