xo 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/options-manager.js +89 -6
- package/node_modules/@typescript-eslint/eslint-plugin/README.md +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +21 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +37 -31
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js +10 -10
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js +17 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js +14 -8
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js +133 -43
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js +12 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +9 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js +2 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +8 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js +4 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js +8 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js +8 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js +42 -12
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js +6 -3
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js +1 -2
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js +5 -5
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js +31 -23
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js +5 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +133 -4
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +166 -86
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +2 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js +20 -5
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +3 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js +0 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +3 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -1
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js +27 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js +9 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js +9 -0
- package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js.map +1 -0
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +3 -30
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +6 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +8 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +74 -95
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +3 -1
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +9 -5
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +9 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +11 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +19 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +9 -21
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +15 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +9 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +9 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +8 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +10 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +7 -33
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +7 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +7 -43
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +11 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +8 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +34 -9
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +7 -11
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +6 -38
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +10 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +8 -28
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +6 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +11 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +11 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +6 -26
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +10 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +11 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +6 -13
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +6 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +25 -29
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +6 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +6 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +8 -4
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +6 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +10 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +6 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +48 -2
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +16 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +6 -4
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +6 -16
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +6 -31
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +6 -18
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +6 -20
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +6 -24
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +6 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +6 -12
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +6 -45
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +10 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +6 -22
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +6 -25
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +6 -15
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +9 -19
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +8 -14
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +11 -27
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -23
- package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +12 -18
- package/node_modules/@typescript-eslint/eslint-plugin/package.json +5 -5
- package/node_modules/@typescript-eslint/parser/README.md +1 -1
- package/node_modules/@typescript-eslint/parser/package.json +5 -5
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +2 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +6 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +1 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +4 -0
- package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts +1 -1
- package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
- package/node_modules/@typescript-eslint/type-utils/package.json +4 -4
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +1 -1
- package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +1 -0
- package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/types/package.json +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +2 -2
- package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
- package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js +2 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js +3 -4
- package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js.map +1 -1
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts +4 -0
- package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map +1 -1
- package/node_modules/@typescript-eslint/utils/package.json +5 -5
- package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
- package/node_modules/eslint-config-xo-typescript/index.js +27 -11
- package/node_modules/eslint-config-xo-typescript/package.json +5 -4
- package/package.json +10 -10
- package/node_modules/@typescript-eslint/parser/_ts3.4/dist/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/parser/_ts3.4/dist/parser.d.ts +0 -20
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/containsAllTypesByName.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getConstrainedTypeAtLocation.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getContextualType.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getDeclaration.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getSourceFileOfNode.d.ts +0 -6
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTokenAtPosition.d.ts +0 -3
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeArguments.d.ts +0 -3
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeName.d.ts +0 -8
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/index.d.ts +0 -15
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isTypeReadonly.d.ts +0 -20
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isUnsafeAssignment.d.ts +0 -17
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/predicates.d.ts +0 -52
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/propertyTypes.d.ts +0 -4
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/requiresQuoting.d.ts +0 -4
- package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/typeFlagUtils.d.ts +0 -11
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +0 -1732
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/index.d.ts +0 -5
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +0 -3
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +0 -35
- package/node_modules/@typescript-eslint/types/_ts3.4/dist/ts-estree.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ast-converter.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert-comments.d.ts +0 -11
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert.d.ts +0 -157
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createDefaultProgram.d.ts +0 -12
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createIsolatedProgram.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createProjectProgram.d.ts +0 -11
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createSourceFile.d.ts +0 -5
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createWatchProgram.d.ts +0 -19
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/getScriptKind.d.ts +0 -5
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +0 -22
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/useProvidedPrograms.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/index.d.ts +0 -10
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/jsx/xhtml-entities.d.ts +0 -2
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/node-utils.d.ts +0 -230
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +0 -188
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +0 -25
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/semantic-or-syntactic-errors.d.ts +0 -13
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +0 -9
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +0 -175
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/index.d.ts +0 -4
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +0 -18
- package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/version-check.d.ts +0 -3
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts +0 -6
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/helpers.d.ts +0 -47
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/index.d.ts +0 -5
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/misc.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/predicates.d.ts +0 -180
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts +0 -35
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +0 -18
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts +0 -10
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts +0 -17
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +0 -9
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/nullThrows.d.ts +0 -14
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/index.d.ts +0 -8
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/json-schema.d.ts +0 -2
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/AST.d.ts +0 -9
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts +0 -137
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ESLint.d.ts +0 -376
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Linter.d.ts +0 -326
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts +0 -2
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Rule.d.ts +0 -389
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +0 -154
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Scope.d.ts +0 -44
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts +0 -342
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/index.d.ts +0 -10
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts +0 -19
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts +0 -15
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts +0 -28
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts +0 -55
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts +0 -103
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts +0 -17
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts +0 -16
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/index.d.ts +0 -11
- package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-estree.d.ts +0 -3
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/get-keys.d.ts +0 -4
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/index.d.ts +0 -3
- package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/visitor-keys.d.ts +0 -6
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require all enum members to be literal values.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-literal-enum-member** for documentation.
|
|
4
8
|
|
|
5
9
|
TypeScript allows the value of an enum member to be many different kinds of valid JavaScript expressions. However, because enums create their own scope whereby each enum member becomes a variable in that scope, unexpected values could be used at runtime. Example:
|
|
6
10
|
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-namespace-keyword** for documentation.
|
|
4
8
|
|
|
5
9
|
In an effort to prevent further confusion between custom TypeScript modules and the new ES2015 modules, starting
|
|
6
10
|
with TypeScript `v1.5` the keyword `namespace` is now the preferred way to declare custom TypeScript modules.
|
|
@@ -13,19 +17,6 @@ This rule aims to standardize the way modules are declared.
|
|
|
13
17
|
|
|
14
18
|
If you are using the ES2015 module syntax, then you will not need this rule.
|
|
15
19
|
|
|
16
|
-
## Options
|
|
17
|
-
|
|
18
|
-
```jsonc
|
|
19
|
-
// .eslintrc.json
|
|
20
|
-
{
|
|
21
|
-
"rules": {
|
|
22
|
-
"@typescript-eslint/prefer-namespace-keyword": "error"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
This rule is not configurable.
|
|
28
|
-
|
|
29
20
|
## Further Reading
|
|
30
21
|
|
|
31
22
|
- [Modules](https://www.typescriptlang.org/docs/handbook/modules.html)
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce using the nullish coalescing operator instead of logical chaining.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-nullish-coalescing** for documentation.
|
|
4
8
|
|
|
5
9
|
TypeScript 3.7 added support for the nullish coalescing operator.
|
|
6
10
|
This operator allows you to safely cascade a value when dealing with `null` or `undefined`.
|
|
@@ -46,6 +50,7 @@ This rule aims enforce the usage of the safer operator.
|
|
|
46
50
|
```ts
|
|
47
51
|
type Options = [
|
|
48
52
|
{
|
|
53
|
+
ignoreTernaryTests?: boolean;
|
|
49
54
|
ignoreConditionalTests?: boolean;
|
|
50
55
|
ignoreMixedLogicalExpressions?: boolean;
|
|
51
56
|
},
|
|
@@ -53,12 +58,53 @@ type Options = [
|
|
|
53
58
|
|
|
54
59
|
const defaultOptions = [
|
|
55
60
|
{
|
|
61
|
+
ignoreTernaryTests: true;
|
|
56
62
|
ignoreConditionalTests: true,
|
|
57
63
|
ignoreMixedLogicalExpressions: true,
|
|
58
64
|
},
|
|
59
65
|
];
|
|
60
66
|
```
|
|
61
67
|
|
|
68
|
+
### `ignoreTernaryTests`
|
|
69
|
+
|
|
70
|
+
Setting this option to `true` (the default) will cause the rule to ignore any ternary expressions that could be simplified by using the nullish coalescing operator.
|
|
71
|
+
|
|
72
|
+
Incorrect code for `ignoreTernaryTests: false`, and correct code for `ignoreTernaryTests: true`:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const foo: any = 'bar';
|
|
76
|
+
foo !== undefined && foo !== null ? foo : 'a string';
|
|
77
|
+
foo === undefined || foo === null ? 'a string' : foo;
|
|
78
|
+
foo == undefined ? 'a string' : foo;
|
|
79
|
+
foo == null ? 'a string' : foo;
|
|
80
|
+
|
|
81
|
+
const foo: string | undefined = 'bar';
|
|
82
|
+
foo !== undefined ? foo : 'a string';
|
|
83
|
+
foo === undefined ? 'a string' : foo;
|
|
84
|
+
|
|
85
|
+
const foo: string | null = 'bar';
|
|
86
|
+
foo !== null ? foo : 'a string';
|
|
87
|
+
foo === null ? 'a string' : foo;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Correct code for `ignoreTernaryTests: false`:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const foo: any = 'bar';
|
|
94
|
+
foo ?? 'a string';
|
|
95
|
+
foo ?? 'a string';
|
|
96
|
+
foo ?? 'a string';
|
|
97
|
+
foo ?? 'a string';
|
|
98
|
+
|
|
99
|
+
const foo: string | undefined = 'bar';
|
|
100
|
+
foo ?? 'a string';
|
|
101
|
+
foo ?? 'a string';
|
|
102
|
+
|
|
103
|
+
const foo: string | null = 'bar';
|
|
104
|
+
foo ?? 'a string';
|
|
105
|
+
foo ?? 'a string';
|
|
106
|
+
```
|
|
107
|
+
|
|
62
108
|
### `ignoreConditionalTests`
|
|
63
109
|
|
|
64
110
|
Setting this option to `true` (the default) will cause the rule to ignore any cases that are located within a conditional test.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-optional-chain** for documentation.
|
|
4
8
|
|
|
5
9
|
TypeScript 3.7 added support for the optional chain operator.
|
|
6
10
|
This operator allows you to safely access properties and methods on objects when they are potentially `null` or `undefined`.
|
|
@@ -61,9 +65,15 @@ foo && foo.a && foo.a.b && foo.a.b.c;
|
|
|
61
65
|
foo && foo['a'] && foo['a'].b && foo['a'].b.c;
|
|
62
66
|
foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method();
|
|
63
67
|
|
|
68
|
+
// With empty objects
|
|
64
69
|
(((foo || {}).a || {}).b || {}).c;
|
|
65
70
|
(((foo || {})['a'] || {}).b || {}).c;
|
|
66
71
|
|
|
72
|
+
// With negated `or`s
|
|
73
|
+
!foo || !foo.bar;
|
|
74
|
+
!foo || !foo[bar];
|
|
75
|
+
!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz();
|
|
76
|
+
|
|
67
77
|
// this rule also supports converting chained strict nullish checks:
|
|
68
78
|
foo &&
|
|
69
79
|
foo.a != null &&
|
|
@@ -81,22 +91,13 @@ foo?.['a']?.b?.c;
|
|
|
81
91
|
foo?.a?.b?.method?.();
|
|
82
92
|
|
|
83
93
|
foo?.a?.b?.c?.d?.e;
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors.
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// .eslintrc.json
|
|
92
|
-
{
|
|
93
|
-
"rules": {
|
|
94
|
-
"@typescript-eslint/prefer-optional-chain": "warn"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
95
|
+
!foo?.bar;
|
|
96
|
+
!foo?.[bar];
|
|
97
|
+
!foo?.bar?.baz?.();
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
**Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors.
|
|
100
101
|
|
|
101
102
|
## When Not To Use It
|
|
102
103
|
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-readonly-parameter-types** for documentation.
|
|
4
8
|
|
|
5
9
|
Mutating function arguments can lead to confusing, hard to debug behavior.
|
|
6
10
|
Whilst it's easy to implicitly remember to not modify function arguments, explicitly typing arguments as readonly provides clear contract to consumers.
|
|
@@ -127,19 +131,6 @@ interface Foo {
|
|
|
127
131
|
|
|
128
132
|
## Options
|
|
129
133
|
|
|
130
|
-
```ts
|
|
131
|
-
interface Options {
|
|
132
|
-
checkParameterProperties?: boolean;
|
|
133
|
-
ignoreInferredTypes?: boolean;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const defaultOptions: Options = {
|
|
137
|
-
checkParameterProperties: true,
|
|
138
|
-
ignoreInferredTypes: false,
|
|
139
|
-
treatMethodsAsReadonly: false,
|
|
140
|
-
};
|
|
141
|
-
```
|
|
142
|
-
|
|
143
134
|
### `checkParameterProperties`
|
|
144
135
|
|
|
145
136
|
This option allows you to enable or disable the checking of parameter properties.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Require private members to be marked as `readonly` if they're never modified outside of the constructor."
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-readonly** for documentation.
|
|
4
8
|
|
|
5
9
|
This rule enforces that private members are marked as `readonly` if they're never modified outside of the constructor.
|
|
6
10
|
|
|
@@ -52,8 +56,6 @@ class Container {
|
|
|
52
56
|
|
|
53
57
|
## Options
|
|
54
58
|
|
|
55
|
-
This rule, in its default state, does not require any argument.
|
|
56
|
-
|
|
57
59
|
### `onlyInlineLambdas`
|
|
58
60
|
|
|
59
61
|
You may pass `"onlyInlineLambdas": true` as a rule option within an object to restrict checking only to members immediately assigned a lambda value.
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce using type parameter when calling `Array#reduce` instead of casting.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-reduce-type-parameter** for documentation.
|
|
4
8
|
|
|
5
9
|
It's common to call `Array#reduce` with a generic type, such as an array or object, as the initial value.
|
|
6
10
|
Since these values are empty, their types are not usable:
|
|
@@ -51,19 +55,6 @@ Examples of code for this rule:
|
|
|
51
55
|
);
|
|
52
56
|
```
|
|
53
57
|
|
|
54
|
-
## Options
|
|
55
|
-
|
|
56
|
-
```jsonc
|
|
57
|
-
// .eslintrc.json
|
|
58
|
-
{
|
|
59
|
-
"rules": {
|
|
60
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "warn"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
This rule is not configurable.
|
|
66
|
-
|
|
67
58
|
## When Not To Use It
|
|
68
59
|
|
|
69
60
|
If you don't want to use typechecking in your linting, you can't use this rule.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-regexp-exec** for documentation.
|
|
4
8
|
|
|
5
9
|
As `String#match` is defined to be the same as `RegExp#exec` when the regular expression does not include the `g` flag, prefer a consistent usage.
|
|
6
10
|
|
|
@@ -42,19 +46,6 @@ const search = /thing/;
|
|
|
42
46
|
search.exec(text);
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
## Options
|
|
46
|
-
|
|
47
|
-
```jsonc
|
|
48
|
-
// .eslintrc.json
|
|
49
|
-
{
|
|
50
|
-
"rules": {
|
|
51
|
-
"@typescript-eslint/prefer-regexp-exec": "warn"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
This rule is not configurable.
|
|
57
|
-
|
|
58
49
|
## When Not To Use It
|
|
59
50
|
|
|
60
51
|
If you prefer consistent use of `String#match` for both, with `g` flag and without it, you can turn this rule off.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce that `this` is used when only `this` type is returned.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-return-this-type** for documentation.
|
|
4
8
|
|
|
5
9
|
[Method chaining](https://en.wikipedia.org/wiki/Method_chaining) is a common pattern in OOP languages and TypeScript provides a special [polymorphic this type](https://www.typescriptlang.org/docs/handbook/2/classes.html#this-types).
|
|
6
10
|
If any type other than `this` is specified as the return type of these chaining methods, TypeScript will fail to cast it when invoking in subclass.
|
|
@@ -93,19 +97,6 @@ class Derived extends Base {
|
|
|
93
97
|
}
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
## Options
|
|
97
|
-
|
|
98
|
-
```jsonc
|
|
99
|
-
// .eslintrc.json
|
|
100
|
-
{
|
|
101
|
-
"rules": {
|
|
102
|
-
"@typescript-eslint/prefer-return-this-type": "warn"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
This rule is not configurable.
|
|
108
|
-
|
|
109
100
|
## When Not To Use It
|
|
110
101
|
|
|
111
102
|
If you don't use method chaining or explicit return values, you can safely turn this rule off.
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-string-starts-ends-with** for documentation.
|
|
4
8
|
|
|
5
9
|
There are multiple ways to verify if a string starts or ends with a specific string, such as `foo.indexOf('bar') === 0`.
|
|
6
|
-
|
|
7
10
|
Since ES2015 has added `String#startsWith` and `String#endsWith`, this rule reports other ways to be consistent.
|
|
8
11
|
|
|
9
12
|
## Rule Details
|
|
@@ -45,19 +48,6 @@ foo.startsWith('bar');
|
|
|
45
48
|
foo.endsWith('bar');
|
|
46
49
|
```
|
|
47
50
|
|
|
48
|
-
## Options
|
|
49
|
-
|
|
50
|
-
```jsonc
|
|
51
|
-
// .eslintrc.json
|
|
52
|
-
{
|
|
53
|
-
"rules": {
|
|
54
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "warn"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
This rule is not configurable.
|
|
60
|
-
|
|
61
51
|
## When Not To Use It
|
|
62
52
|
|
|
63
53
|
If you don't mind that style, you can turn this rule off safely.
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce using `@ts-expect-error` over `@ts-ignore`.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/prefer-ts-expect-error** for documentation.
|
|
4
8
|
|
|
5
9
|
TypeScript allows you to suppress all errors on a line by placing a single-line comment or a comment block line starting with `@ts-ignore` immediately before the erroring line.
|
|
6
10
|
While powerful, there is no way to know if a `@ts-ignore` is actually suppressing an error without manually investigating what happens when the `@ts-ignore` is removed.
|
|
@@ -62,19 +66,6 @@ const isOptionEnabled = (key: string): boolean => {
|
|
|
62
66
|
};
|
|
63
67
|
```
|
|
64
68
|
|
|
65
|
-
## Options
|
|
66
|
-
|
|
67
|
-
```jsonc
|
|
68
|
-
// .eslintrc.json
|
|
69
|
-
{
|
|
70
|
-
"rules": {
|
|
71
|
-
"@typescript-eslint/prefer-ts-expect-error": "warn"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
This rule is not configurable.
|
|
77
|
-
|
|
78
69
|
## When Not To Use It
|
|
79
70
|
|
|
80
71
|
If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able to use this rule, as the directive is not supported
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require any function or method that returns a Promise to be marked async.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/promise-function-async** for documentation.
|
|
4
8
|
|
|
5
9
|
Ensures that each function is only capable of:
|
|
6
10
|
|
|
@@ -36,32 +40,3 @@ async function functionReturnsPromise() {
|
|
|
36
40
|
return Promise.resolve('value');
|
|
37
41
|
}
|
|
38
42
|
```
|
|
39
|
-
|
|
40
|
-
## Options
|
|
41
|
-
|
|
42
|
-
Options may be provided as an object with:
|
|
43
|
-
|
|
44
|
-
- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`true` by default).
|
|
45
|
-
- `allowedPromiseNames` to indicate any extra names of classes or interfaces to be considered Promises when returned.
|
|
46
|
-
|
|
47
|
-
In addition, each of the following properties may be provided, and default to `true`:
|
|
48
|
-
|
|
49
|
-
- `checkArrowFunctions`
|
|
50
|
-
- `checkFunctionDeclarations`
|
|
51
|
-
- `checkFunctionExpressions`
|
|
52
|
-
- `checkMethodDeclarations`
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"@typescript-eslint/promise-function-async": [
|
|
57
|
-
"error",
|
|
58
|
-
{
|
|
59
|
-
"allowedPromiseNames": ["Thenable"],
|
|
60
|
-
"checkArrowFunctions": true,
|
|
61
|
-
"checkFunctionDeclarations": true,
|
|
62
|
-
"checkFunctionExpressions": true,
|
|
63
|
-
"checkMethodDeclarations": true
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
```
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce the consistent use of either backticks, double, or single quotes.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/quotes** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
7
11
|
This rule extends the base [`eslint/quotes`](https://eslint.org/docs/rules/quotes) rule.
|
|
8
12
|
It adds support for TypeScript features which allow quoted names, but not backtick quoted names.
|
|
9
|
-
|
|
10
|
-
## How to Use
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
{
|
|
14
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
15
|
-
"quotes": "off",
|
|
16
|
-
"@typescript-eslint/quotes": ["error"]
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Options
|
|
21
|
-
|
|
22
|
-
See [`eslint/quotes` options](https://eslint.org/docs/rules/quotes#options).
|
|
23
|
-
|
|
24
|
-
<sup>
|
|
25
|
-
|
|
26
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/quotes.md)
|
|
27
|
-
|
|
28
|
-
</sup>
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require `Array#sort` calls to always provide a `compareFunction`.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/require-array-sort-compare** for documentation.
|
|
4
8
|
|
|
5
9
|
This rule prevents invoking the `Array#sort()` method without providing a `compare` argument.
|
|
6
|
-
|
|
7
10
|
When called without a compare function, `Array#sort()` converts all non-undefined array elements into strings and then compares said strings based off their UTF-16 code units.
|
|
8
11
|
|
|
9
12
|
The result is that elements are sorted alphabetically, regardless of their type.
|
|
@@ -55,21 +58,6 @@ userDefinedType.sort();
|
|
|
55
58
|
|
|
56
59
|
## Options
|
|
57
60
|
|
|
58
|
-
The rule accepts an options object with the following properties:
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
type Options = {
|
|
62
|
-
/**
|
|
63
|
-
* If true, an array which all elements are string is ignored.
|
|
64
|
-
*/
|
|
65
|
-
ignoreStringArrays?: boolean;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const defaults = {
|
|
69
|
-
ignoreStringArrays: false,
|
|
70
|
-
};
|
|
71
|
-
```
|
|
72
|
-
|
|
73
61
|
### `ignoreStringArrays`
|
|
74
62
|
|
|
75
63
|
Examples of code for this rule with `{ ignoreStringArrays: true }`:
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Disallow async functions which have no `await` expression.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/require-await** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -18,21 +22,3 @@ const returnsPromise2 = () => returnsPromise1();
|
|
|
18
22
|
```
|
|
19
23
|
|
|
20
24
|
## How to Use
|
|
21
|
-
|
|
22
|
-
```jsonc
|
|
23
|
-
{
|
|
24
|
-
// note you must disable the base rule as it can report incorrect errors
|
|
25
|
-
"require-await": "off",
|
|
26
|
-
"@typescript-eslint/require-await": "error"
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Options
|
|
31
|
-
|
|
32
|
-
See [`eslint/require-await` options](https://eslint.org/docs/rules/require-await#options).
|
|
33
|
-
|
|
34
|
-
<sup>
|
|
35
|
-
|
|
36
|
-
Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/require-await.md)
|
|
37
|
-
|
|
38
|
-
</sup>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Require both operands of addition to have type `number` or `string`.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/restrict-plus-operands** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -24,22 +28,6 @@ var foo = 1n + 1n;
|
|
|
24
28
|
|
|
25
29
|
## Options
|
|
26
30
|
|
|
27
|
-
The rule accepts an options object with the following properties:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
type Options = {
|
|
31
|
-
// if true, check compound assignments (`+=`)
|
|
32
|
-
checkCompoundAssignments?: boolean;
|
|
33
|
-
// if true, 'any' itself and `string`,`bigint`, `number` is allowed.
|
|
34
|
-
allowAny?: boolean;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const defaults = {
|
|
38
|
-
checkCompoundAssignments: false,
|
|
39
|
-
allowAny: false,
|
|
40
|
-
};
|
|
41
|
-
```
|
|
42
|
-
|
|
43
31
|
### `checkCompoundAssignments`
|
|
44
32
|
|
|
45
33
|
Examples of code for this rule with `{ checkCompoundAssignments: true }`:
|
|
@@ -94,9 +82,3 @@ var fn = (a: any, b: number) => a + b;
|
|
|
94
82
|
```
|
|
95
83
|
|
|
96
84
|
## How to Use
|
|
97
|
-
|
|
98
|
-
```json
|
|
99
|
-
{
|
|
100
|
-
"@typescript-eslint/restrict-plus-operands": "error"
|
|
101
|
-
}
|
|
102
|
-
```
|
package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: 'Enforce template literal expressions to be of `string` type.'
|
|
3
|
+
---
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
> 🛑 This file is source code, not the primary documentation location! 🛑
|
|
6
|
+
>
|
|
7
|
+
> See **https://typescript-eslint.io/rules/restrict-template-expressions** for documentation.
|
|
4
8
|
|
|
5
9
|
## Rule Details
|
|
6
10
|
|
|
@@ -31,31 +35,6 @@ const msg3 = `stringWithKindProp = ${stringWithKindProp}`;
|
|
|
31
35
|
|
|
32
36
|
## Options
|
|
33
37
|
|
|
34
|
-
The rule accepts an options object with the following properties:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
type Options = {
|
|
38
|
-
// if true, also allow number type in template expressions
|
|
39
|
-
allowNumber?: boolean;
|
|
40
|
-
// if true, also allow boolean type in template expressions
|
|
41
|
-
allowBoolean?: boolean;
|
|
42
|
-
// if true, also allow any in template expressions
|
|
43
|
-
allowAny?: boolean;
|
|
44
|
-
// if true, also allow null and undefined in template expressions
|
|
45
|
-
allowNullish?: boolean;
|
|
46
|
-
// if true, also allow RegExp in template expressions
|
|
47
|
-
allowRegExp?: boolean;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const defaults = {
|
|
51
|
-
allowNumber: true,
|
|
52
|
-
allowBoolean: false,
|
|
53
|
-
allowAny: false,
|
|
54
|
-
allowNullish: false,
|
|
55
|
-
allowRegExp: false,
|
|
56
|
-
};
|
|
57
|
-
```
|
|
58
|
-
|
|
59
38
|
### `allowNumber`
|
|
60
39
|
|
|
61
40
|
Examples of additional **correct** code for this rule with `{ allowNumber: true }`:
|