devexperts / dx-platform

Mozilla Public License 2.0
33 stars 24 forks source link

add some tslint rules #47

Open scink opened 6 years ago

scink commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

add tslint-immutable

raveclassic commented 5 years ago

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

sutarmin commented 5 years ago

@raveclassic I believe there is no such rule anymore

raveclassic commented 5 years ago

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

sutarmin commented 5 years ago

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 commented 5 years ago

I am suggest to add this code to our repo.

morozovamv commented 5 years ago

Add jsx-boolean-value