Skip to content

Instantly share code, notes, and snippets.

@r3b311i0n
Last active February 22, 2018 18:47
Show Gist options
  • Save r3b311i0n/aa2efe6b60d2fa5e46a15e936fdbf3e1 to your computer and use it in GitHub Desktop.
Save r3b311i0n/aa2efe6b60d2fa5e46a15e936fdbf3e1 to your computer and use it in GitHub Desktop.
Fancy TSlint configuration.
---
extends:
- tslint:latest
- tslint-react
rulesDirectory:
- node_modules/tslint-microsoft-contrib
rules:
ban-types:
- true
- - Object
- Avoid using the `Object` type. Did you mean `object`?
- - Function
- Avoid using the `Function` type. Prefer a specific function type,
like `() => void`.
- - Boolean
- Avoid using the `Boolean` type. Did you mean `boolean`?
- - Number
- Avoid using the `Number` type. Did you mean `number`?
- - String
- Avoid using the `String` type. Did you mean `string`?
- - Symbol
- Avoid using the `Symbol` type. Did you mean `symbol`?
member-ordering:
- true
- order:
- constructor
- private-static-field
- protected-static-field
- public-static-field
- private-instance-field
- protected-instance-field
- public-instance-field
- private-static-method
- protected-static-method
- public-static-method
- private-instance-method
- protected-instance-method
- public-instance-method
member-access:
- true
- check-accessor
- check-constructor
- check-parameter-property
no-empty-interface: true
prefer-for-of: true
curly: true
no-duplicate-super: true
no-floating-promises: true
no-for-in-array: true
no-null-keyword: true
no-sparse-arrays: true
no-string-literal: true
no-switch-case-fall-through: true
no-unbound-method: true
no-unsafe-any: true
no-unsafe-finally: true
no-unused-expression: true
no-unused-variable:
- true
no-var-keyword: true
radix: true
restrict-plus-operands: true
strict-type-predicates: true
switch-default: true
triple-equals:
- true
- allow-undefined-check
use-isnan: true
cyclomatic-complexity:
- true
- 20
eofline: true
indent:
- true
- spaces
linebreak-style:
- true
- LF
max-classes-per-file:
- true
- 1
no-require-imports: true
arrow-parens: true
arrow-return-shorthand:
- true
class-name: true
import-spacing: true
interface-name:
- true
- always-prefix
interface-over-type-literal: true
match-default-export-name: true
newline-before-return: true
new-parens: true
no-angle-bracket-type-assertion: true
no-boolean-literal-compare: true
no-consecutive-blank-lines: true
no-trailing-whitespace:
- false
- ignore-comments
- ignore-template-strings
no-unnecessary-initializer: true
no-unnecessary-qualifier: true
object-literal-key-quotes:
- true
- as-needed
object-literal-shorthand: true
one-line:
- true
- check-catch
- check-finally
- check-else
- check-open-brace
- check-whitespace
one-variable-per-declaration:
- true
- ignore-for-loop
ordered-imports:
- true
- grouped-imports: true
quotemark:
- true
- single
- jsx-double
- avoid-escape
- avoid-template
semicolon:
- true
- always
- strict-bound-class-methods
variable-name:
- true
- ban-keywords
- check-format
- allow-leading-underscore
- allow-pascal-case
whitespace:
- true
- check-branch
- check-decl
- check-operator
- check-typecast
- check-rest-spread
- check-type-operator
jsx-alignment: true
jsx-curly-spacing:
- true
- never
jsx-no-lambda: true
jsx-no-string-ref: true
jsx-wrap-multiline: true
jsx-no-multiline-js: false
no-object-literal-type-assertion: true
object-literal-sort-keys:
- true
- match-declaration-order
- shorthand-first
await-promise: true
prefer-conditional-expression:
- true
- check-else-if
prefer-object-spread: true
binary-expression-operand-order: true
use-default-type-parameter: true
switch-final-break: true
max-line-length:
- true
-
limit: 140
ignore-pattern: //
no-duplicate-imports: false
no-submodule-imports:
- true
- preact/devtools
space-within-parens: 0
no-shadowed-variable: true
jsx-key: true
jsx-equals-spacing:
- true
- never
no-useless-files: true
no-parameter-reassignment: true
no-return-await: true
no-redundant-jsdoc: true
no-duplicate-switch-case: true
no-implicit-dependencies: true
no-unnecessary-class: true
ban-comma-operator: true
trailing-comma:
- true
- multiline:
objects: always
arrays: always
functions: never
typeLiterals: ignore
esSpecCompliant: true
completed-docs:
- true
- classes:
visibilities:
- exported
- enums: true
- enum-members:
privacies:
- public
- protected
- functions:
visibilities:
- exported
- interfaces:
visibilities:
- exported
- methods:
locations: instance
privacies:
- public
- protected
- namespaces: true
file-header:
- true
- Copyright
no-dynamic-delete: true,
prefer-readonly: true
no-default-export: true
jsx-use-translation-function: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment