Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I allow only lowercase filenames including extensions and disallow all other filenames? #244

Open
romanstetsyk opened this issue Jul 31, 2024 · 3 comments

Comments

@romanstetsyk
Copy link

ls:
  .*: lowercase

As far as I can tell, ls-lint treats everything after the first dot as an extension. For example, test.SUBEXT.ts will pass the validation because test is lowercase. However, we have many files with different combinations of extensions and sub-extensions, so listing them all is not feasible.
How can I limit all filenames, sub-extensions, and extensions to lowercase only? Is it achievable using wildcards? Any tips would be appreciated!

Examples:
Allow only lowercase extensions, e.g. .jpg but disallow .JPG, .JpG, etc.
Allow only lowercase sub-extensions, e.g. .model.ts but disallow .MODEL.ts, .model.TS, etc.

@loeffel-io
Copy link
Owner

there is currently no support for linting the value of extensions and subextensions

but maybe you do something like this:

ls:
    .*: exists:0 # do not allow any other extension and specify only the allowed extensions bellow
    .jpg: ... 
    .ts: ... 

@romanstetsyk
Copy link
Author

Thanks for the suggestion! It works for files without sub-extensions. Unfortunately, I must include .*.* and .*.*.* to catch more cases of wrong filenames.

@loeffel-io
Copy link
Owner

#121 could make this even easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants