question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce directory casing in `filename-case`

See original GitHub issue

We’d like to enforce casing of both files and directories. Is that possible, or would it need some kind of “root” directory to avoid caring about directory name outside of the project? Easy enough to achieve with js config files I guess. There is context.getCwd(), could probably work as well

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:21
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fiskercommented, Nov 21, 2022

Stop thinking about BREAKING/NON-BRAKING, just make it correct, it’s never been something we care. https://github.com/sindresorhus/eslint-plugin-unicorn/issues/686#issuecomment-1320449464

1reaction
mrmckebcommented, Nov 21, 2022

Unfortunately that wasn’t clear to me in the initial issue, @SimenB.

  • I agree that people should enforce consistent casing throughout, which is why I didn’t introduce separate options for folder/directory casing. But not everyone feels that way (see @moshest’s comment).
  • The rule is named filename-case, which could be confusing to people if it starts checking the entire path without an opt-in/out. I’m not worried about a breaking change as much as breaking behaviour unexpectedly.

We could ship the rule today as minor change with an opt-in - as it’s ready to go - and wait for further feedback before pushing forward in another direction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I enforce filename and folder name convention in ...
I am looking for a rule which can enforce filename to be camelCase and folder name to be snake_case . How can I...
Read more >
Filename case changes broken in pull request.
A file rename only involving case changes doesn't show up properly in a pull request, even though they show correctly in the local...
Read more >
eslint-plugin-unicorn - npm
Name Description 💼 🚫 🔧 💡 consistent‑destructuring Use destructured variables over properties. ✓ 🔧 💡 custom‑error‑definition Enforce correct Error subclassing. ✓ 🔧 empty‑brace‑spaces Enforce no spaces...
Read more >
Git basics: Help my case-sensitive filename changes don't ...
There are some other ways of doing this as well. What is your preferred way of renaming a case-sensitive file/folder in Git? You...
Read more >
File Name Case Sensitivity | VisualSVN Help Center
Unix is case-sensitive. Subversion works on both platforms and this may be a problem. If you add to some folder in Subversion repository...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found