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

add some tslint rules #47

Open
scink opened this issue Aug 8, 2018 · 8 comments
Open

add some tslint rules #47

scink opened this issue Aug 8, 2018 · 8 comments

Comments

@scink
Copy link
Contributor

scink commented Aug 8, 2018

i suggest to add next rules:

  1. adjacent-overload-signatures - Enforces function overloads to be consecutive.
  2. arrow-return-shorthand - Suggests to convert () => { return x; } to () => x.
  3. ban-comma-operator - Disallows the comma operator to be used. Read more about the comma operator here.
  4. binary-expression-operand-order - In a binary expression, a literal should always be on the right-hand side if possible. For example, prefer ‘x + 1’ over ‘1 + x’.
  5. eofline - Ensures the file ends with a newline.
  6. file-name-casing - Enforces a consistent file naming convention.
  7. indent - Enforces indentation with tabs or spaces.
  8. max-classes-per-file - A file may not contain more than the specified number of classes.
  9. member-access - Requires explicit visibility declarations for class members.
  10. no-any - Disallows usages of any as a type declaration.
  11. no-boolean-literal-compare - Warns on comparison to a boolean literal, as in x === true.
  12. no-construct - Disallows access to the constructors of String, Number, and Boolean.
  13. no-console - Bans the use of specified console methods.
  14. no-debugger - Disallows debugger statements.
  15. no-default-export - Disallows default exports in ES6-style modules.
  16. no-duplicate-super - Warns if super() appears twice in a constructor.
  17. no-duplicate-switch-case - Prevents duplicate cases in switch statements.
  18. no-duplicate-variable - Disallows duplicate variable declarations in the same block scope.
  19. no-empty - Disallows empty blocks.
  20. no-empty-interface - Forbids empty interfaces.
  21. no-for-in-array - Disallows iterating over an array with a for-in loop.
  22. no-magic-numbers - Disallows the use constant number values outside of variable assignments. When no list of allowed values is specified, -1, 0 and 1 are allowed by default.
  23. no-namespace - Disallows use of internal modules and namespaces.
  24. no-non-null-assertion - Disallows non-null assertions using the ! postfix operator.
  25. no-require-imports - Disallows invocation of require().
  26. no-shadowed-variable - Disallows shadowing variable declarations.
  27. no-use-before-declare - Disallows usage of variables before their declaration.
  28. no-var-keyword - Disallows usage of the var keyword.
  29. object-literal-shorthand - Enforces/disallows use of ES6 object literal shorthand.
  30. prefer-const - Requires that variable declarations use const instead of let and var if possible.
  31. prefer-switch - Prefer a switch statement to an if statement with simple === comparisons.
  32. radix - Requires the radix parameter to be specified when calling parseInt.
  33. restrict-plus-operands - When adding two variables, operands must both be of type number or of type string.
  34. triple-equals - Requires === and !== in place of == and !=.
@raveclassic
Copy link
Contributor

adjacent-overload-signatures
Enforces function overloads to be consecutive - in which way?

max-classes-per-file
A file may not contain more than the specified number of classes. - which one?

member-access
Requires explicit visibility declarations for class members. - only with no-public

no-empty-interface
Forbids empty interfaces. - does it allow empty inheritance (like Monad)?

@scink
Copy link
Contributor Author

scink commented Aug 14, 2018

add tslint-immutable

@raveclassic
Copy link
Contributor

also add a rule similar to tsconfig no-unused-locals

@sutarmin
Copy link
Contributor

@raveclassic
Copy link
Contributor

@sutarmin we can always include its source in the lint package

@sutarmin
Copy link
Contributor

we can always include its source

Valid point. I found custom rule no-unused but it's doing a bit more than just no-unused-locals, details here. I think we might give it a try. I'm not sure if it's a good idea to copy-paste source to our repo but it's the easiest approach. What do you think, guys?

@mankdev mankdev closed this as completed Oct 24, 2018
@mankdev mankdev reopened this Oct 24, 2018
@mankdev
Copy link
Contributor

mankdev commented Oct 24, 2018

I am suggest to add this code to our repo.

@raveclassic raveclassic removed this from the NEXT milestone Aug 28, 2019
@morozovamv
Copy link
Collaborator

Add jsx-boolean-value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants