Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

plugin idea: eslint-plugin-tcomb #62

Closed
gabro opened this issue May 30, 2016 · 10 comments
Closed

plugin idea: eslint-plugin-tcomb #62

gabro opened this issue May 30, 2016 · 10 comments

Comments

@gabro
Copy link
Member

gabro commented May 30, 2016

A plugin to enforce some conventions in tcomb.

Possible rules:

no-unnamed-types

description

types should always have a name

specs

check last arguments of type definitions


no-loose-structs

description

structs should be strict by default

specs

second argument of t.struct should be an object with strict: true

@gabro
Copy link
Member Author

gabro commented May 30, 2016

@gabro
Copy link
Member Author

gabro commented May 30, 2016

/cc @gcanti

@gcanti
Copy link

gcanti commented May 30, 2016

no-unchecked-enums

Description

every check involving a string (=== string) should be wrapped by an enum

Example

// bad
if (myvar === 'myenum') {
  ...
}

// good
if (myvar === MyEnum('myenum')) {
  ...
}

@giogonzo
Copy link
Member

giogonzo commented May 30, 2016

Nice!

=== 'string'

this check could be too broad, we probably have legit cases when you want to be able to === 'string'.. do we?

@gabro
Copy link
Member Author

gabro commented May 30, 2016

no-unchecked-enums I would love this, but I have the same concern

every check involving a string (=== string)

I fear this will have counter-examples, can we think of one?

@gabro
Copy link
Member Author

gabro commented May 30, 2016

In the meanwhile... https://github.com/buildo/eslint-plugin-tcomb

@gcanti
Copy link

gcanti commented May 30, 2016

@gabro awesome, I'll add a link to tcomb's README

@gabro
Copy link
Member Author

gabro commented May 30, 2016

other ideas: no-any

@gcanti
Copy link

gcanti commented May 30, 2016

We should open an issue (issues) on the new repo, I guess

@gabro
Copy link
Member Author

gabro commented May 30, 2016

Ok, closing this and let's track stuff on the repo

@gabro gabro closed this as completed May 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants