dx-platform
dx-platform copied to clipboard
add some tslint rules
i suggest to add next rules:
- adjacent-overload-signatures - Enforces function overloads to be consecutive.
-
arrow-return-shorthand - Suggests to convert
() => { return x; }
to() => x
. - ban-comma-operator - Disallows the comma operator to be used. Read more about the comma operator here.
- 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’.
- eofline - Ensures the file ends with a newline.
- file-name-casing - Enforces a consistent file naming convention.
- indent - Enforces indentation with tabs or spaces.
- max-classes-per-file - A file may not contain more than the specified number of classes.
- member-access - Requires explicit visibility declarations for class members.
-
no-any - Disallows usages of
any
as a type declaration. -
no-boolean-literal-compare - Warns on comparison to a boolean literal, as in
x === true
. - ~~no-construct - Disallows access to the constructors of
String
,Number
, andBoolean
.~~ -
no-console - Bans the use of specified
console
methods. - ~~no-debugger - Disallows
debugger
statements.~~ - no-default-export - Disallows default exports in ES6-style modules.
-
no-duplicate-super - Warns if
super()
appears twice in a constructor. - ~~no-duplicate-switch-case - Prevents duplicate cases in switch statements.~~
- ~~no-duplicate-variable - Disallows duplicate variable declarations in the same block scope.~~
- no-empty - Disallows empty blocks.
- no-empty-interface - Forbids empty interfaces.
- no-for-in-array - Disallows iterating over an array with a for-in loop.
- 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.
- ~~no-namespace - Disallows use of internal modules and
namespace
s.~~ -
no-non-null-assertion - Disallows non-null assertions using the
!
postfix operator. - ~~no-require-imports - Disallows invocation of
require()
.~~ - no-shadowed-variable - Disallows shadowing variable declarations.
- no-use-before-declare - Disallows usage of variables before their declaration.
- ~~no-var-keyword - Disallows usage of the
var
keyword.~~ - ~~object-literal-shorthand - Enforces/disallows use of ES6 object literal shorthand.~~
- ~~prefer-const - Requires that variable declarations use
const
instead oflet
andvar
if possible.~~ -
prefer-switch - Prefer a
switch
statement to anif
statement with simple===
comparisons. - ~~radix - Requires the radix parameter to be specified when calling parseInt.~~
- restrict-plus-operands - When adding two variables, operands must both be of type number or of type string.
- ~~triple-equals - Requires
===
and!==
in place of==
and!=
.~~
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)?
add tslint-immutable
also add a rule similar to tsconfig no-unused-locals
@raveclassic I believe there is no such rule anymore
@sutarmin we can always include its source in the lint
package
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?
I am suggest to add this code to our repo.