@philgibbins/code-style
Version:
Personal coding style configurations for editors/programming languages
318 lines (317 loc) • 7.63 kB
YAML
extends:
- 'tslint-eslint-rules'
#rules-directory:
# - 'path/to/custom/rules'
rules:
##############################################################################
# CORE TSLINT
##############################################################################
adjacent-overload-signatures: false
align: false
array-type:
options:
- generic
arrow-parens: false
arrow-return-shorthand: true
await-promise: true
ban-comma-operator: true
ban: false
ban-ts-ignore: true
ban-types: false
binary-expression-operand-order: true
callable-types: true
class-name: true
comment-format:
options:
- check-space
comment-type:
options:
- singleline
- multiline
- doc
completed-docs: true
curly: true
cyclomatic-complexity:
options:
- 20
deprecation: true
encoding: true
eofline: true
file-header: false
file-name-casing:
options:
- kebab-case
forin: false # TODO: understand this rule
function-constructor: true
import-blacklist: false
import-spacing: true
increment-decrement: false
indent:
options:
- spaces
- 2
interface-name: false
interface-over-type-literal: false
jsdoc-format: true
label-position: true
linebreak-style:
options:
- 'LF'
match-default-export-name: true
max-classes-per-file:
options:
- 1
max-file-line-count:
options:
- 300
max-line-length:
options:
limit: 120
# ignore-pattern: /regex-here/
member-access: true
member-ordering: false
new-parens: true
newline-before-return: false
newline-per-chained-call: true
no-angle-bracket-type-assertion: true
no-any: true
no-arg: true
no-bitwise: true
no-boolean-literal-compare: true
no-conditional-assignment: true
no-consecutive-blank-lines:
options:
- 2
no-console: true
no-construct: true
no-debugger: true
no-default-export: false
no-default-import: false
no-duplicate-imports: true
no-duplicate-super: true
no-duplicate-switch-case: true
no-duplicate-variable: true
no-dynamic-delete: true
no-empty: true
no-empty-interface: true
no-eval: true
no-floating-promises: true
no-for-in-array: true
no-implicit-dependencies: true
no-import-side-effect: true
no-inferrable-types:
options:
- ignore-params
no-inferred-empty-object-type: true
no-internal-module: true
no-invalid-template-strings: true
no-invalid-this: true
no-irregular-whitespace: true
no-magic-numbers: true
no-mergeable-namespace: true
no-misused-new: true
no-namespace: false
no-non-null-assertion: true
no-null-keyword: false
no-object-literal-type-assertion: true
no-parameter-properties: false
no-parameter-reassignment: true
no-redundant-jsdoc: false
no-reference: true
no-reference-import: true
no-require-imports: true
no-restricted-globals: false
no-return-await: true
no-shadowed-variable: true
no-sparse-arrays: true
no-string-literal: false
no-string-throw: true
no-submodule-imports: true
no-switch-case-fall-through: true
no-this-assignment: true
no-trailing-whitespace: true
no-unbound-method: true
no-unnecessary-callback-wrapper: true
no-unnecessary-class: true
no-unnecessary-initializer: true
no-unnecessary-qualifier: true
no-unnecessary-type-assertion: true
no-unsafe-any: true
no-unsafe-finally: true
no-unused-expression: true
no-unused-variable: true
# no-use-before-declare: true # discouraged, not performant, used for var
no-var-keyword: true
no-var-requires: true
no-void-expression: true
number-literal-format: true
object-literal-key-quotes:
options:
- as-needed
object-literal-shorthand: true
object-literal-sort-keys: false
one-line:
options:
- check-catch
- check-else
- check-finally
- check-open-brace
- check-whitespace
one-variable-per-declaration: true
only-arrow-functions:
options:
- allow-named-functions
ordered-imports: true
prefer-conditional-expression: true
prefer-const: true
prefer-for-of: true
prefer-function-over-method: true
prefer-method-signature: false
prefer-object-spread: true
prefer-readonly: true
prefer-switch: true
prefer-template: true
prefer-while: false
promise-function-async: true
quotemark:
options:
- single
- jsx-single
- avoid-escape
radix: true
restrict-plus-operands: true
return-undefined: true
semicolon:
options:
- always
space-before-function-paren:
options:
-
anonymous: never
named: never
asyncArrow: never
method: never
constructor: never
space-within-parens: false
strict-boolean-expressions: true
strict-type-predicates: true
switch-default: true
switch-final-break: false
trailing-comma: true
triple-equals: true
type-literal-delimiter: true
typedef:
options:
- arrow-call-signature
- call-signature
- parameter
- arrow-parameter
- property-declaration
- variable-declaration
- member-variable-declaration
- object-destructuring
- array-destructuring
typedef-whitespace:
options:
-
call-signature: nospace
index-signature: nospace
parameter: nospace
property-declaration: nospace
variable-declaration: nospace
-
call-signature: onespace
index-signature: onespace
parameter: onespace
property-declaration: onespace
variable-declaration: onespace
typeof-compare: true
unified-signatures: true
unnecessary-bind: true
unnecessary-constructor: true
use-default-type-parameter: true
use-isnan: true
variable-name:
options:
- check-format
- ban-keywords
whitespace:
options:
- check-branch
- check-decl
- check-operator
- check-module
- check-separator
- check-rest-spread
- check-type
- check-typecast
- check-type-operator
- check-preblock
- check-postbrace
##############################################################################
# TSLINT-ESLINT-RULES
##############################################################################
array-bracket-spacing:
options:
- always
block-spacing: true
brace-style:
options:
- '1tbs'
handle-callback-err: false
no-constant-condition: true
no-control-regex: true
no-duplicate-case: true
no-empty-character-class: tue
no-ex-assign: true
no-extra-boolean-cast: true
no-extra-semi: true
no-inner-declarations: true
no-invalid-regexp: true
no-multi-spaces: true
no-regex-spaces: true
no-unexpected-multiline: true
object-curly-spacing:
options:
- always
sort-imports: true
space-in-parens:
options:
- never
ter-arrow-body-style:
options:
- 'as-needed'
ter-arrow-parens:
options:
- 'as-needed'
ter-arrow-spacing: true
ter-computed-property-spacing:
options:
- never
ter-func-call-spacing:
options:
- never
ter-indent: true
ter-max-len:
options:
- 120
ter-newline-after-var: false
ter-no-irregular-whitespace: true
ter-no-mixed-spaces-and-tabs: true
ter-no-proto: true
ter-no-script-url: true
ter-no-self-compare: true
ter-no-sparse-arrays: true
ter-no-tabs: true
ter-padded-blocks:
options:
- never
ter-prefer-arrow-callback: true
valid-jsdoc: true
valid-typeof: true
#jsRules: true
defaultSeverity: error
#linterOptions:
# exclude:
# - 'path/to/excluded/files/*.*'
# format: