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

Add optional patterns

Open jgrund opened this issue 8 years ago • 5 comments

As far as I can tell there is not a way to have an optional pattern.

This would be nice for matching pragmas that may not be in every file.

jgrund avatar Jun 20 '17 21:06 jgrund

I would classify this as an ESLint issue. Sometimes you want some ESLint rules applied to some files, but not others, it doesn't only apply to eslint-plugin-header.

silvenon avatar Jan 09 '18 15:01 silvenon

Never mind, I think I misread the issue.

silvenon avatar Jan 09 '18 21:01 silvenon

Here's an example where this would be useful.

On this project, we need the licence header to be present at all times, but the //@flow directive is optional.

(In this case one's a block comment and one's a line comment, but that's another issue.)

iocalebs avatar Mar 09 '18 13:03 iocalebs

Did this ever happen? I would really like to be able to make some header lines optional but I don't see a way to do that.

nbfowler avatar Jun 24 '20 19:06 nbfowler