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

standard-strict #382

Closed
rstacruz opened this issue Jan 12, 2016 · 19 comments
Closed

standard-strict #382

rstacruz opened this issue Jan 12, 2016 · 19 comments

Comments

@rstacruz
Copy link
Member

What are your thoughts on making eslint-config-standard-strict?

This would be extra rules on top of eslint-config-standard that would add more checks, like:

  • no-div-regex (to catch return /=foo/)
  • no-invalid-this (to catch () => this)
  • no-unused-expressions
  • camelcase
  • and so on...

At first, it can be not integrated into standard at all, but eventually can be added as standard --strict and standard.lintFiles({ strict: true }). This will also set the precedent that we can have --no-react or similar flags.

@dcousens
Copy link
Member

no-invalid-this (to catch () => this)

What is wrong with that?

@rstacruz
Copy link
Member Author

Because that will raise an error in strict mode.

@pbrinkmeier
Copy link

I like the idea, but I would keep standard optionless and create this as standard-strict, as a seperate package.

@yoshuawuyts
Copy link
Contributor

yeah, we should avoid having options. @rstacruz have you raised those rules to be considered in individual issues? I'm not familiar with all of them, but perhaps they'd be a good addition.

@rstacruz
Copy link
Member Author

aye, a separate package makes sense. they were /sorta/ discussed in #216, with an exhaustive list of differences from xo here: #216 (comment)

nonetheless, i think it makes sense to do it in a separate package at first (think of it as "standard-staging"), and we can eventually migrate rules into upstream standard. It really is no big deal to build it as a separate package, it's basically:

/* eslintrc */
{
  "extends": [ "standard", "standard-react", "standard-strict" ]
}

@denis-sokolov
Copy link

Awkward...

@rstacruz
Copy link
Member Author

nice one denis!

@rstacruz
Copy link
Member Author

@feross
Copy link
Member

feross commented Feb 4, 2016

Not completely against this idea. Need to think about it more.

@feross
Copy link
Member

feross commented Feb 4, 2016

Here's another rule that would make sense for a stricter mode: #381

@feross
Copy link
Member

feross commented Feb 5, 2016

Another rule: standard/eslint-config-standard#21

@dcousens
Copy link
Member

dcousens commented Feb 5, 2016

Perhaps standard-strict could be allowed to break more often.

Make it the bleeding-edge of what can be expected in the next major version of standard?

@dcousens
Copy link
Member

dcousens commented Feb 5, 2016

Maybe standard-next? :P

@feross
Copy link
Member

feross commented Feb 5, 2016

One more rule: standard/eslint-config-standard#19

@rstacruz
Copy link
Member Author

rstacruz commented Feb 5, 2016

https://github.com/denis-sokolov/strict-standard

@denis-sokolov did some fine work on this.

@cesarandreu
Copy link
Contributor

@dcousens @feross Are you familiar with codemods? There's a Facebook library jscodeshift that lets you apply AST transformations to JS code, instead of doing text transformations.

It may be worth considering writing a few transforms for breaking changes. Even if they don't catch all the cases, it makes it much easier for people to upgrade their projects.

@feross
Copy link
Member

feross commented Feb 7, 2016

@cesarandreu Neat. This could come in handy for standard-format.

@dcousens
Copy link
Member

I'd say this has lost steam. Close?

@feross
Copy link
Member

feross commented Sep 27, 2016

We've basically been making standard slightly stricter with each release, but not too fast that users get upset or find it disruptive.

Now that we have --fix and it works really well, I'm more certain that that this is the right strategy to continue taking in standard.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

7 participants