-
Notifications
You must be signed in to change notification settings - Fork 13
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
Separate ts-for-js
and ts
#772
Comments
Could you explain how it makes things much messier? |
Sure, from my perspective, when I explicitly pulled in The messiness comes from the fact that If In any case, I believe This is because the lack of scoping is going to start causing bugs when the config is updated to the new Flat Config system - because // Speculative names from future version supporting flat config
import { ts, tsForJs } from 'eslint-config-hardcore';
export default [
ts,
tsForJs // a user might do this because they assume that ts-for-js is a separate config they need to include for JS files!
]; Would result in I think the fix for this is to completely separate the two configs so that they can be included in any order in a flat config (because they have different So, overall, I think the ask here is that either any interdependencies/relationships between the configs are made explicit in the README so users know what they're getting, and/or make the configs truly independent and live up to their documented use, so that when I include one, I'm getting just what I intended to include, and the configs are all additive and non-conflicting. |
Currently, importing
ts.json
also importsts-for-js.json
. This changes a lot of things at a global level, assuming that the user has kept the ESLint default of linting all.js
files.However, in my project, I made
.ts
files the default, and explicitly ban.js
files, so when I importts.json
and get all thets-for-js
rules along for the ride on my.ts
, it makes things much messier!Given that
ts-for-js
is listed separately on theREADME.md
, this behaviour was unexpected, as my expectation was that if I had both.ts
and.js
files, I would need to import both configs myself.I'd like to suggest that
ts.json
remove thets-for-js.json
import, and make it clear to users that they will need to import both if they have both.ts
and.js
files they want to lint with TypeScript.I know that's a breaking change, so as a non-breaking, but potentially more compatible alternative, could
ts-for-js.json
be updated to use{ overrides: { files: ["**/*.js"], rules: { ... } }
?The text was updated successfully, but these errors were encountered: