-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
feature request: more possible config file names #182
Comments
I can try a PR for this if needed. |
You can use |
You're right, so this isn't a blocking issue, but rather a nice-to-have convivence for end-users. |
Just wondering, is there any tool out there that tries to read all of those variations? |
And probably more? Not sure. Note that ESLint explicitly does not, but many users are mad/frustrated about this because it goes against the rest of the ecosystem and Node.js itself! |
Thanks. Not sure whether all of them offer similar to what you request here though ;) Anyway, I'm in camp "explicit is usually better", which is also one of the ideas in ESM (explicit extension). The mess with migrating from CJS to ESM is unfortunate, but I'm not sure whether tooling should also maintain the same state of hybrid/complexity. Over time the list of conventions keeps growing and growing. It would be great if the ecosystem adopted a convention such as a Since Knip offers a solution for cases that need a different solution I'm going to close this issue. |
Thanks for the input. What does red strike-through mean? Just checked one sample: turns out release-please has only |
Just had someone else expecting |
I simply used the native browser search (Command + F) to find the word 'config' in one of my repositories (highlighted in yellow). I crossed out in red those configs that have 'config' in their name but are not actually configs (or like |
@webpro eslint/eslint#17863 was opened 2 days ago. |
I've seen this link floating around in some of the places I frequent: https://dot-config.github.io/ |
That's a different discussion. The new ESLint flat config file name is
This doesn't make it better? Unless the ecosystem reaches consensus about the folder name: |
Sorry, you're right, I didn't re-read this thread carefully enough. |
Others think it should be an un-dotted Interesting discussion still, but as much as I love to have a common default everyone & everything actually respects, I'm not very confident this will ever happen. |
Interesting. I opened up an issue over there, I am curious to see what they think about the recent push for ".config" instead of "config".
Well, we got most of the ecosystem to converge around Prettier, so you never know. =p |
One of the reasons I think it's hard to reach consensus is that the Either way, as mentioned, I'm leaning towards adding the |
🚀 This issue has been resolved in v4.0.0-canary.3. See Release 4.0.0-canary.3 for release notes. |
It's not a breaking change, but I'd like to add it to the v4 changelog. You can try v4 canary today including this change with e.g. |
What about adding ".config.json" and ".config.jsonc"? Was that intentionally skipped? |
No, it was not even requested. |
Ah, well that might be worth adding as well. CSpell already supports "cspell.config.json" and "cspell.config.jsonc", for example. |
Currently,
knip
supports these configuration names:However, I think this should be expanded. First of all, it is common to name
.ts
and.js
files with an extension according to whether or not the file is CommonJS / ESM. Meaning thatknip
should support:Additionally, I think that Knip should follow the style of the existing tools in the ecosystem. Most notably, ESLint has a config file of
eslint.config.js
and Prettier has a config file ofprettier.config.mjs
and Jest has a config file ofjest.config.mjs
. So, I think Knip should support:Furthermore, the docs should actively recommend that people use this config file naming format so that we match the rest of the ecosystem.
Additionally, note that this is more than a semantic or stylistic issue. TypeScript throws errors for a
knip.ts
when it is inside of a CommonJS project. Renaming the file toknip.mts
fixes the problem, but thenknip
no longer picks up the file.So this is a blocker.(This can be worked around with the--config
flag.)The text was updated successfully, but these errors were encountered: