ls-lint
ls-lint copied to clipboard
How to disable some specific names?
I'd like to prohibit using filename index.css
in my components but cannot find details about the syntax of regex used in the project to build a proper expression.
Please advise.
So everything for .css
should be allowed expect index.css
?
You're right, I want to allow any css filenames except index.css
https://regex101.com/r/xYtUN5/1 could work
@loeffel-io It showd the error:
error parsing regexp: invalid or unsupported Perl syntax:
(?!
"Go regex does not support lookarounds."
- thats sad
In this case you have to find a way to convert your lookarounds to std regex
just keep in mind that there is the ignore
pattern: https://ls-lint.org/1.x/configuration/the-basics.html#creating-configuration
maybe this can help you too
@basharov to make it more easy we could provide a not_regex
rule in v2
🤔
I also encountered the same scene. In my scenario, I want all tsx files except for the file name use***.tsx
to use the pascal case rule, and use***.tsx
to use the camel case rule. It doesn’t seem to meet my needs so far
I also encountered the same scene. In my scenario, I want all tsx files except for the file name
use***.tsx
to use the pascal case rule, anduse***.tsx
to use the camel case rule. It doesn’t seem to meet my needs so far
@LaamGinghong I keep all of my hooks in a separate directory (src/hooks
). That way, I can set up a separate rule for my hooks directory.
@loeffel-io I'm here looking for something similar. It would be nice to define reject patterns. index.css
is one example, but similarly, imagine a project using something like SASS or LESS. I would want to forbid all .css
files.
In my specific case, I'm trying to target inconsistent naming between .types.ts
and .type.ts
. I want to blacklist one of those. I tried .type.ts: "regex:"
but empty regex isn't allowed. Admittedly, that's a hack anyway.
Edit: Ah, I'm interested in the proposed "Strict Mode" #32.