Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Relax 'recommended' rules or make them auto-fixable #4305

Closed
aghoneim92 opened this issue Nov 20, 2018 · 6 comments · Fixed by #4871
Closed

Relax 'recommended' rules or make them auto-fixable #4305

aghoneim92 opened this issue Nov 20, 2018 · 6 comments · Fixed by #4871

Comments

@aghoneim92
Copy link
Contributor

aghoneim92 commented Nov 20, 2018

The recommended rules include some (imho) impossible rules to abide by. Sorting your object keys? Why would I want them alphabetic if they made more sense in some other ordering? Furthermore, it's not a fixable rule, it just complains. I am a huge fan of Typescript and consider linting a very important tool. However, rules like:

  • object-literal-sort-keys
  • ordered-imports
  • interface-name

are too opinionated and prove a burden on the programmer who already has lots of problems to solve while developing a project. The set of 'recommended' rules should, in my opinion, be much more lax than that to reduce the barrier of entry to Typescript and tslint. They should be guiding and helpful, not opinionated and pedantic.

I propose removing the more 'extreme' rules from the recommended ruleset.

@JoshuaKGoldberg
Copy link
Contributor

Strong +1 to this. It's been brought up before. Anything that's enabled in tslint-config-prettier is probably no longer necessary in the recommended ruleset, along with similar naming rules such as interface-name. Accepting PRs to fix this!

@JoshuaKGoldberg
Copy link
Contributor

Taking another look at this - technically, this would be a breaking change. Still accepting PRs but they'll likely have to wait until 6.0.0 to be merged in.

@ericanderson
Copy link
Member

Agreed that this is a breaking change and I agree that formatters should do formatting, not linters.

I recently started a new typescript project, took tslint:recommended and found myself setting this immediately:

    // Add rules
    "no-implicit-dependencies": true,

    // Disable recommended rules
    "interface-name": false,
    "object-literal-sort-keys": false,

Can we get a proposal for what the new set would be? We could put in a new preset for tslint:unsafe-and-unstable-recommended that would allow us to play with what the future would look like and get it in now without causing a breaking change.

@RWOverdijk
Copy link

I agree that formatters should do formatting, not linters.

@ericanderson Me too, but there are fixable rules. Alphabetically sorting your keys is cool, but adding it to existing projects is suffering. A fixer would be really really nice, but I guess that would also go in a separate issue.

Any links you can gimme?

@JoshuaKGoldberg
Copy link
Contributor

Removing the Type: Breaking Change label per #4811. Now accepting PRs!

@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants