UNPKG

@manuth/eslint-plugin-typescript

Version:

A set of personal eslint-rulesets for TypeScript-projects

750 lines 33.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.recommendedWithTypeChecking = exports.weakWithTypeChecking = exports.recommended = exports.weak = void 0; const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); /** * The glob pattern for detecting JavaScript files. */ const jsPattern = [ "*.{js,mjs,cjs,jsx}" ]; /** * A set of patterns for translating source files to output files. */ const pathConverter = [ { include: [ "src/**/*.ts" ], replace: [ "^src/(.*)\\.ts$", "lib/$1.js" ] }, { include: [ "src/**/*.[cm]ts" ], replace: [ "^src/(.*)\\.([cm])ts$", "lib/$1.$2js" ] }, { include: [ "src/**" ], replace: [ "^src/(.*)$", "lib/$1" ] } ]; /** * A node filter for finding function declarations with non-void types. */ const nonVoidFilter = `:not([returnType.typeAnnotation.type='${typescript_estree_1.AST_NODE_TYPES.TSVoidKeyword}'])` + `:not([returnType.typeAnnotation.typeName.name='${"Promise"}'][returnType.typeAnnotation.typeArguments.params.0.type='${typescript_estree_1.AST_NODE_TYPES.TSVoidKeyword}'])`; /** * A node filter for finding non-override members. */ const nonOverrideFilter = ":not([override>0])"; /** * The weak configuration for rules which work without type checking. */ exports.weak = { name: "weak", config: { ["@stylistic/array-bracket-newline" /* ESLintRule.StylisticArrayBracketNewLine */]: [ "warn", "consistent" ], ["@stylistic/array-bracket-spacing" /* ESLintRule.StylisticArrayBracketSpacing */]: "warn", ["@stylistic/array-element-newline" /* ESLintRule.StylisticArrayElementNewline */]: [ "warn", "consistent" ], ["@stylistic/arrow-parens" /* ESLintRule.StylisticArrowParens */]: [ "off", "as-needed" ], ["@stylistic/arrow-spacing" /* ESLintRule.StylisticArrowSpacing */]: "warn", ["@stylistic/block-spacing" /* ESLintRule.StylisticBlockSpacing */]: "warn", ["@stylistic/brace-style" /* ESLintRule.StylisticBraceStyle */]: [ "warn", "allman", { allowSingleLine: true } ], ["@stylistic/comma-spacing" /* ESLintRule.StylisticCommaSpacing */]: "warn", ["@stylistic/comma-style" /* ESLintRule.StylisticCommaStyle */]: "warn", ["@stylistic/computed-property-spacing" /* ESLintRule.StylisticComputedPropertySpacing */]: "warn", ["@stylistic/eol-last" /* ESLintRule.StylisticEOLLast */]: "warn", ["@stylistic/function-call-argument-newline" /* ESLintRule.StylisticFunctionCallArgumentNewline */]: [ "warn", "consistent" ], ["@stylistic/function-call-spacing" /* ESLintRule.StylisticFunctionCallSpacing */]: "warn", ["@stylistic/generator-star-spacing" /* ESLintRule.StylisticGeneratorStarSpacing */]: [ "warn", { before: false, after: true, anonymous: "neither", method: { before: true, after: false } } ], ["@stylistic/indent" /* ESLintRule.StylisticIndent */]: [ "warn", 4, { SwitchCase: 1, FunctionDeclaration: { parameters: "first" }, FunctionExpression: { parameters: "first" }, CallExpression: { arguments: "off" } } ], ["@stylistic/indent-binary-ops" /* ESLintRule.StylisticIndentBinaryOPs */]: ["warn", 4], ["@stylistic/lines-between-class-members" /* ESLintRule.StylisticLinesBetweenClassMembers */]: ["warn", "always"], ["@stylistic/member-delimiter-style" /* ESLintRule.StylisticMemberDelimiterStyle */]: [ "warn", { singleline: { delimiter: "comma", requireLast: false }, multiline: { delimiter: "semi", requireLast: true } } ], ["@stylistic/multiline-ternary" /* ESLintRule.StylisticMultilineTernary */]: [ "warn", "always-multiline" ], ["@stylistic/new-parens" /* ESLintRule.StylisticNewParens */]: "warn", ["@stylistic/no-floating-decimal" /* ESLintRule.StylisticNoFloatingDecimal */]: "error", ["@stylistic/no-multiple-empty-lines" /* ESLintRule.StylisticNoMultipleEmptyLines */]: [ "warn", { max: 1, maxBOF: 0, maxEOF: 0 } ], ["@stylistic/no-multi-spaces" /* ESLintRule.StylisticNoMultiSpaces */]: "warn", ["@stylistic/no-trailing-spaces" /* ESLintRule.StylisticNoTrailingSpaces */]: "warn", ["@stylistic/no-whitespace-before-property" /* ESLintRule.StylisticNoWhitespaceBeforeProperty */]: "warn", ["@stylistic/object-curly-newline" /* ESLintRule.StylisticObjectCurlyNewline */]: [ "warn", { multiline: true, consistent: true } ], ["@stylistic/object-curly-spacing" /* ESLintRule.StylisticObjectCurlySpacing */]: [ "warn", "always" ], ["@stylistic/object-property-newline" /* ESLintRule.StylisticObjectPropertyNewline */]: [ "warn", { allowAllPropertiesOnSameLine: true } ], ["@stylistic/quotes" /* ESLintRule.StylisticQuotes */]: [ "warn", "double", { avoidEscape: true } ], ["@stylistic/rest-spread-spacing" /* ESLintRule.StylisticRestSpreadSpacing */]: "warn", ["@stylistic/semi" /* ESLintRule.StylisticSemi */]: [ "error", "always" ], ["@stylistic/semi-spacing" /* ESLintRule.StylisticSemiSpacing */]: "warn", ["@stylistic/semi-style" /* ESLintRule.StylisticSemiStyle */]: "warn", ["@stylistic/space-before-blocks" /* ESLintRule.StylisticSpaceBeforeBlocks */]: "warn", ["@stylistic/space-before-function-paren" /* ESLintRule.StylisticSpaceBeforeFunctionParen */]: [ "warn", { anonymous: "never", asyncArrow: "always", named: "never" } ], ["@stylistic/space-infix-ops" /* ESLintRule.StylisticSpaceInfixOPs */]: "warn", ["@stylistic/space-in-parens" /* ESLintRule.StylisticSpaceInParens */]: "warn", ["@stylistic/space-unary-ops" /* ESLintRule.StylisticSpaceUnaryOPs */]: "warn", ["@stylistic/switch-colon-spacing" /* ESLintRule.StylisticSwitchColonSpacing */]: "warn", ["@stylistic/template-curly-spacing" /* ESLintRule.StylisticTemplateCurlySpacing */]: "warn", ["@stylistic/type-annotation-spacing" /* ESLintRule.StylisticTypeAnnotationSpacing */]: "warn", ["@stylistic/yield-star-spacing" /* ESLintRule.StylisticYieldStarSpacing */]: "warn", ["@typescript-eslint/adjacent-overload-signatures" /* ESLintRule.TypeScriptAdjacentOverloadSignatures */]: "warn", ["@typescript-eslint/ban-ts-comment" /* ESLintRule.TypeScriptBanTSComment */]: "off", ["@typescript-eslint/camelcase" /* ESLintRule.TypeScriptCamelCase */]: "off", ["@typescript-eslint/class-name-casing" /* ESLintRule.TypeScriptClassNameCasing */]: "off", ["@typescript-eslint/consistent-type-definitions" /* ESLintRule.TypeScriptConsistentTypeDefinitions */]: "off", ["@typescript-eslint/default-param-last" /* ESLintRule.TypeScriptDefaultParamLast */]: "error", ["@typescript-eslint/explicit-function-return-type" /* ESLintRule.TypeScriptExplicitFunctionReturnType */]: "off", ["@typescript-eslint/explicit-module-boundary-types" /* ESLintRule.TypeScriptExplicitModuleBoundaryTypes */]: "off", ["@typescript-eslint/interface-name-prefix" /* ESLintRule.TypeScriptInterfaceNamePrefix */]: "off", ["@typescript-eslint/no-dynamic-delete" /* ESLintRule.TypeScriptNoDynamicDelete */]: "off", ["@typescript-eslint/no-empty-function" /* ESLintRule.TypeScriptNoEmptyFunction */]: "off", ["@typescript-eslint/no-empty-interface" /* ESLintRule.TypeScriptNoEmptyInterface */]: "off", ["@typescript-eslint/no-empty-object-type" /* ESLintRule.TypeScriptNoEmptyObjectType */]: "error", ["@typescript-eslint/no-explicit-any" /* ESLintRule.TypeScriptNoExplicitAny */]: "off", ["@typescript-eslint/no-misused-new" /* ESLintRule.TypeScriptNoMisusedNew */]: "error", ["@typescript-eslint/no-namespace" /* ESLintRule.TypeScriptNoNamespace */]: [ "warn", { allowDeclarations: true, allowDefinitionFiles: true } ], ["@typescript-eslint/no-non-null-assertion" /* ESLintRule.TypeScriptNoNonNullAssertion */]: "warn", ["@typescript-eslint/no-require-imports" /* ESLintRule.TypeScriptNoRequireImports */]: "off", ["@typescript-eslint/no-this-alias" /* ESLintRule.TypeScriptNoThisAlias */]: "off", ["@typescript-eslint/no-unsafe-function-type" /* ESLintRule.TypeScriptNoUnsafeFunctionType */]: "error", ["@typescript-eslint/no-unused-expressions" /* ESLintRule.TypeScriptNoUnusedExpressions */]: [ "warn", { allowShortCircuit: true, allowTernary: true, allowTaggedTemplates: true } ], ["@typescript-eslint/no-unused-vars" /* ESLintRule.TypeScriptNoUnusedVars */]: [ "warn", { args: "none", caughtErrors: "none", destructuredArrayIgnorePattern: "^_" } ], ["@typescript-eslint/no-use-before-define" /* ESLintRule.TypeScriptNoUseBeforeDefine */]: "off", ["@typescript-eslint/no-wrapper-object-types" /* ESLintRule.TypeScriptNoWrapperObjectTypes */]: "error", ["@typescript-eslint/parameter-properties" /* ESLintRule.TypeScriptParameterProperties */]: "error", ["@typescript-eslint/prefer-as-const" /* ESLintRule.TypeScriptPreferAsConst */]: "warn", ["@typescript-eslint/prefer-for-of" /* ESLintRule.TypeScriptPreferForOf */]: "warn", ["@typescript-eslint/prefer-function-type" /* ESLintRule.TypeScriptPreferFunctionType */]: "warn", ["@typescript-eslint/prefer-namespace-keyword" /* ESLintRule.TypeScriptPreferNamespaceKeyword */]: "error", ["@typescript-eslint/triple-slash-reference" /* ESLintRule.TypeScriptTripleSlashReference */]: "off", ["@typescript-eslint/unified-signatures" /* ESLintRule.TypeScriptUnifiedSignatures */]: "off", ["@eslint-community/eslint-comments/disable-enable-pair" /* ESLintRule.ESLintCommentDisableEnablePair */]: [ "error", { allowWholeFile: true } ], ["@eslint-community/eslint-comments/no-aggregating-enable" /* ESLintRule.ESLintCommentNoAggregatingEnable */]: "error", ["@eslint-community/eslint-comments/no-duplicate-disable" /* ESLintRule.ESLintCommentNoDuplicateDisable */]: "error", ["@eslint-community/eslint-comments/no-unlimited-disable" /* ESLintRule.ESLintCommentNoUnlimitedDisable */]: "error", ["@eslint-community/eslint-comments/no-unused-disable" /* ESLintRule.ESLintCommentNoUnusedDisable */]: "error", ["@eslint-community/eslint-comments/no-unused-enable" /* ESLintRule.ESLintCommentNoUnusedEnable */]: "error", ["@eslint-community/eslint-comments/require-description" /* ESLintRule.ESLintCommentRequireDescription */]: [ "off", { ignore: [ "exported", "global", "globals" ] } ], ["import/newline-after-import" /* ESLintRule.ImportNewLineAfterImport */]: "warn", ["import/no-default-export" /* ESLintRule.ImportNoDefaultExport */]: "off", ["import/no-extraneous-dependencies" /* ESLintRule.ImportNoExtraneousDependencies */]: "error", ["import/order" /* ESLintRule.ImportOrder */]: [ "warn", { groups: [ "builtin", [ "external", "internal" ], [ "parent", "sibling", "index" ] ], pathGroups: [ { pattern: "child_process", group: "builtin" } ], alphabetize: { order: "asc", caseInsensitive: true }, named: true } ], ["import-x/no-rename-default" /* ESLintRule.ImportXNoRenameDefault */]: "warn", ["jsdoc/check-tag-names" /* ESLintRule.JSDocCheckTagNames */]: "warn", ["jsdoc/check-values" /* ESLintRule.JSDocCheckValues */]: "warn", ["jsdoc/empty-tags" /* ESLintRule.JSDocEmptyTags */]: "warn", ["jsdoc/require-param-name" /* ESLintRule.JSDocRequireParamName */]: [ "warn", { contexts: [ "any" ] } ], ["n/no-unpublished-import" /* ESLintRule.NodeNoUnpublishedImport */]: [ "error", { convertPath: pathConverter } ], ["n/no-unpublished-require" /* ESLintRule.NodeNoUnpublishedRequire */]: [ "error", { convertPath: pathConverter } ], ["complexity" /* ESLintRule.Complexity */]: "off", ["curly" /* ESLintRule.Curly */]: "off", ["dot-notation" /* ESLintRule.DotNotation */]: "off", ["eqeqeq" /* ESLintRule.EQEQEQ */]: [ "warn", "always" ], ["grouped-accessor-pairs" /* ESLintRule.GroupedAccessorPairs */]: [ "warn", "getBeforeSet" ], ["guard-for-in" /* ESLintRule.GuardForIn */]: "off", ["max-classes-per-file" /* ESLintRule.MaxClassesPerFile */]: "off", ["max-len" /* ESLintRule.MaxLen */]: "off", ["no-async-promise-executor" /* ESLintRule.NoAsyncPromiseExecutor */]: "off", ["no-bitwise" /* ESLintRule.NoBitwise */]: "off", ["no-caller" /* ESLintRule.NoCaller */]: "error", ["no-case-declarations" /* ESLintRule.NoCaseDeclarations */]: "off", ["no-cond-assign" /* ESLintRule.NoCondAssign */]: "error", ["no-console" /* ESLintRule.NoConsole */]: "off", ["no-constant-condition" /* ESLintRule.NoConstantCondition */]: "warn", ["no-constructor-return" /* ESLintRule.NoConstructorReturn */]: "error", ["no-control-regex" /* ESLintRule.NoControlRegex */]: "off", ["no-debugger" /* ESLintRule.NoDebugger */]: "warn", ["no-duplicate-case" /* ESLintRule.NoDuplicateCase */]: "error", ["no-empty" /* ESLintRule.NoEmpty */]: "off", ["no-empty-pattern" /* ESLintRule.NoEmptyPattern */]: "off", ["no-eval" /* ESLintRule.NoEval */]: "warn", ["no-fallthrough" /* ESLintRule.NoFallthrough */]: "error", ["no-implicit-coercion" /* ESLintRule.NoImplicitCoercion */]: "warn", ["no-inner-declarations" /* ESLintRule.NoInnerDeclarations */]: "off", ["no-invalid-this" /* ESLintRule.NoInvalidThis */]: "off", ["no-lonely-if" /* ESLintRule.NoLonelyIf */]: "warn", ["no-new-wrappers" /* ESLintRule.NoNewWrappers */]: "error", ["no-octal-escape" /* ESLintRule.NoOctalEscape */]: "warn", ["no-regex-spaces" /* ESLintRule.NoRegexSpaces */]: "off", ["no-sequences" /* ESLintRule.NoSequences */]: "error", ["no-shadow" /* ESLintRule.NoShadow */]: "off", ["no-sparse-arrays" /* ESLintRule.NoSparseArrays */]: "error", ["no-throw-literal" /* ESLintRule.NoThrowLiteral */]: "error", ["no-undef-init" /* ESLintRule.NoUndefInit */]: "warn", ["no-unreachable" /* ESLintRule.NoUnreachable */]: "off", ["no-unsafe-finally" /* ESLintRule.NoUnsafeFinally */]: "error", ["no-unused-labels" /* ESLintRule.NoUnusedLabels */]: "warn", ["no-useless-catch" /* ESLintRule.NoUselessCatch */]: "off", ["no-useless-rename" /* ESLintRule.NoUselessRename */]: "warn", ["no-var" /* ESLintRule.NoVar */]: "error", ["no-void" /* ESLintRule.NoVoid */]: "warn", ["object-shorthand" /* ESLintRule.ObjectShorthand */]: "warn", ["one-var" /* ESLintRule.OneVar */]: [ "warn", "never" ], ["prefer-const" /* ESLintRule.PreferConst */]: "off", ["prefer-object-spread" /* ESLintRule.PreferObjectSpread */]: "warn", ["prefer-rest-params" /* ESLintRule.PreferRestParams */]: "warn", ["prefer-spread" /* ESLintRule.PreferSpread */]: "warn", ["use-isnan" /* ESLintRule.UseIsNaN */]: "warn", ["yoda" /* ESLintRule.Yoda */]: "warn" }, overrides: [ { name: "js", include: jsPattern, config: { ["valid-typeof" /* ESLintRule.ValidTypeof */]: "error" } }, { name: "ts", include: [ "*.{ts,cts,mts,tsx}" ], config: { ["@typescript-eslint/explicit-function-return-type" /* ESLintRule.TypeScriptExplicitFunctionReturnType */]: [ "warn", { allowExpressions: true } ], ["@typescript-eslint/explicit-member-accessibility" /* ESLintRule.TypeScriptExplicitMemberAccessibility */]: [ "warn", { accessibility: "explicit" } ], ["@typescript-eslint/no-require-imports" /* ESLintRule.TypeScriptNoRequireImports */]: [ "off", { allowAsImport: true } ], ["jsdoc/no-types" /* ESLintRule.JSDocNoTypes */]: [ "warn", { contexts: [ "any" ] } ] } }, { name: "type-tests", include: [ "*.test-d.ts" ], config: { ["@typescript-eslint/naming-convention" /* ESLintRule.TypeScriptNamingConvention */]: "off", ["@typescript-eslint/no-deprecated" /* ESLintRule.TypeScriptNoDeprecated */]: "off", ["@typescript-eslint/no-namespace" /* ESLintRule.TypeScriptNoNamespace */]: "off", ["@typescript-eslint/no-unused-vars" /* ESLintRule.TypeScriptNoUnusedVars */]: "off", ["import/no-extraneous-dependencies" /* ESLintRule.ImportNoExtraneousDependencies */]: "off", ["jsdoc/require-jsdoc" /* ESLintRule.JSDocRequireJSDoc */]: "off" } } ] }; /** * The weak configuration for rules which work without type checking. */ exports.recommended = { name: "recommended", config: { ["@stylistic/comma-dangle" /* ESLintRule.StylisticCommaDangle */]: ["error", "never"], ["@stylistic/operator-linebreak" /* ESLintRule.StylisticOperatorLineBreak */]: [ "warn", "after" ], ["@stylistic/padded-blocks" /* ESLintRule.StylisticPaddedBlocks */]: [ "warn", "never" ], ["@stylistic/padding-line-between-statements" /* ESLintRule.StylisticPaddingLineBetweenStatements */]: [ "warn", { blankLine: "always", prev: "*", next: "multiline-block-like" }, { blankLine: "always", prev: "multiline-block-like", next: "*" }, { blankLine: "any", prev: "multiline-block-like", next: [ "return", "break", "continue" ] } ], ["@stylistic/quote-props" /* ESLintRule.StylisticQuoteProps */]: [ "warn", "as-needed" ], ["@stylistic/spaced-comment" /* ESLintRule.StylisticSpacedComment */]: [ "warn", "always", { markers: [ "/" ] } ], ["@typescript-eslint/array-type" /* ESLintRule.TypeScriptArrayType */]: [ "warn", { default: "array-simple" } ], ["@typescript-eslint/member-ordering" /* ESLintRule.TypeScriptMemberOrdering */]: [ "warn", { default: [ // Fields "static-field", "field", "public-static-field", "public-field", "protected-static-field", "protected-field", "#private-static-field", "private-static-field", "#private-field", "private-field", // Constructors "constructor", "public-constructor", "protected-constructor", "private-constructor", // Index signature "signature", "call-signature", // Accessors "static-accessor", "accessor", "public-static-accessor", "public-accessor", "protected-static-accessor", "protected-accessor", "#private-static-accessor", "private-static-accessor", "#private-accessor", "private-accessor", // Getters & Setters ["static-get", "static-set"], ["get", "set"], ["public-static-get", "public-static-set"], ["public-get", "public-set"], ["protected-static-get", "protected-static-set"], ["protected-get", "protected-set"], ["#private-static-get", "#private-static-set"], ["private-static-get", "private-static-set"], ["#private-get", "#private-set"], ["private-get", "private-set"], // Methods "static-method", "method", "public-static-method", "public-method", "protected-static-method", "protected-method", "private-static-method", "private-method" ] } ], ["@typescript-eslint/no-for-in-array" /* ESLintRule.TypeScriptNoForInArray */]: "error", ["@typescript-eslint/no-inferrable-types" /* ESLintRule.TypeScriptNoInferrableTypes */]: "error", ["import/no-duplicates" /* ESLintRule.ImportNoDuplicates */]: "warn", ["jsdoc/check-alignment" /* ESLintRule.JSDocCheckAlignment */]: "warn", ["jsdoc/check-indentation" /* ESLintRule.JSDocCheckIndentation */]: "warn", ["jsdoc/check-param-names" /* ESLintRule.JSDocCheckParamNames */]: "warn", ["jsdoc/check-syntax" /* ESLintRule.JSDocCheckSyntax */]: "warn", ["jsdoc/require-description" /* ESLintRule.JSDocRequireDescription */]: [ "warn", { contexts: [ typescript_estree_1.AST_NODE_TYPES.ClassDeclaration, typescript_estree_1.AST_NODE_TYPES.ClassExpression, typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration, typescript_estree_1.AST_NODE_TYPES.FunctionExpression, typescript_estree_1.AST_NODE_TYPES.MethodDefinition, typescript_estree_1.AST_NODE_TYPES.TSEnumDeclaration, typescript_estree_1.AST_NODE_TYPES.TSEnumMember, typescript_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, typescript_estree_1.AST_NODE_TYPES.PropertyDefinition, typescript_estree_1.AST_NODE_TYPES.TSPropertySignature, typescript_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition, typescript_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition, typescript_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSMethodSignature, typescript_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, `${typescript_estree_1.AST_NODE_TYPES.ExportNamedDeclaration}[declaration.type='${typescript_estree_1.AST_NODE_TYPES.VariableDeclaration}']`, `${typescript_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration}[declaration.type='${typescript_estree_1.AST_NODE_TYPES.VariableDeclaration}']` ] } ], ["jsdoc/require-jsdoc" /* ESLintRule.JSDocRequireJSDoc */]: [ "warn", { require: { ClassDeclaration: true, ClassExpression: false, ArrowFunctionExpression: false, FunctionDeclaration: true, FunctionExpression: false, MethodDefinition: false }, contexts: [ `${typescript_estree_1.AST_NODE_TYPES.MethodDefinition}${nonOverrideFilter}`, typescript_estree_1.AST_NODE_TYPES.TSEnumDeclaration, typescript_estree_1.AST_NODE_TYPES.TSEnumMember, typescript_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, `${typescript_estree_1.AST_NODE_TYPES.PropertyDefinition}${nonOverrideFilter}`, typescript_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, typescript_estree_1.AST_NODE_TYPES.TSPropertySignature, `${typescript_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition}${nonOverrideFilter}`, typescript_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSMethodSignature, typescript_estree_1.AST_NODE_TYPES.TSDeclareFunction, `${typescript_estree_1.AST_NODE_TYPES.ExportNamedDeclaration}[declaration.type='${typescript_estree_1.AST_NODE_TYPES.VariableDeclaration}']`, `${typescript_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration}[declaration.type='${typescript_estree_1.AST_NODE_TYPES.VariableDeclaration}']` ] } ], ["jsdoc/require-param-description" /* ESLintRule.JSDocRequireParamDescription */]: [ "warn", { contexts: [ "any" ] } ], ["jsdoc/require-param" /* ESLintRule.JSDocRequireParam */]: [ "warn", { exemptedBy: [], checkSetters: false, contexts: [ typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration, typescript_estree_1.AST_NODE_TYPES.FunctionExpression, typescript_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, typescript_estree_1.AST_NODE_TYPES.TSMethodSignature, typescript_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration, typescript_estree_1.AST_NODE_TYPES.TSDeclareFunction, typescript_estree_1.AST_NODE_TYPES.TSFunctionType ] } ], ["jsdoc/require-returns" /* ESLintRule.JSDocRequireReturns */]: [ "warn", { checkGetters: false, exemptedBy: [], contexts: [ `${typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression}${nonVoidFilter}`, `${typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration}${nonVoidFilter}`, `${typescript_estree_1.AST_NODE_TYPES.FunctionExpression}${nonVoidFilter}` ] } ], ["jsdoc/tag-lines" /* ESLintRule.JSDocTagLines */]: [ "warn", "any", { startLines: 1 } ] }, overrides: [ { name: "js", include: jsPattern, config: { ["jsdoc/require-param-type" /* ESLintRule.JSDocRequireParamType */]: [ "warn", { contexts: [ "any" ] } ], ["jsdoc/require-returns-type" /* ESLintRule.JSDocRequireReturnsType */]: [ "warn", { contexts: [ "any" ] } ] } } ] }; /** * The weak configuration for rules which require type checking. */ exports.weakWithTypeChecking = { name: "weak-with-type-checking", config: { ["@typescript-eslint/await-thenable" /* ESLintRule.TypeScriptAwaitThenable */]: "warn", ["@typescript-eslint/consistent-type-assertions" /* ESLintRule.TypeScriptConsistentTypeAssertions */]: "warn", ["@typescript-eslint/no-confusing-void-expression" /* ESLintRule.TypeScriptNoConfusingVoidExpression */]: [ "warn", { ignoreArrowShorthand: true } ], ["@typescript-eslint/no-deprecated" /* ESLintRule.TypeScriptNoDeprecated */]: "warn", ["@typescript-eslint/no-floating-promises" /* ESLintRule.TypeScriptNoFloatingPromises */]: "off", ["@typescript-eslint/no-unnecessary-boolean-literal-compare" /* ESLintRule.TypeScriptNoUnnecessaryBooleanLiteralCompare */]: "warn", ["@typescript-eslint/no-unnecessary-qualifier" /* ESLintRule.TypeScriptNoUnnecessaryQualifier */]: "warn", ["@typescript-eslint/no-unnecessary-type-arguments" /* ESLintRule.TypeScriptNoUnnecessaryTypeArguments */]: "warn", ["@typescript-eslint/no-unnecessary-type-assertion" /* ESLintRule.TypeScriptNoUnnecessaryTypeAssertion */]: "warn", ["@typescript-eslint/only-throw-error" /* ESLintRule.TypeScriptOnlyThrowError */]: "warn", ["@typescript-eslint/prefer-includes" /* ESLintRule.TypeScriptPreferIncludes */]: "warn", ["@typescript-eslint/prefer-nullish-coalescing" /* ESLintRule.TypeScriptPreferNullishCoalescing */]: "warn", ["@typescript-eslint/prefer-optional-chain" /* ESLintRule.TypeScriptPreferOptionalChain */]: "warn", ["@typescript-eslint/prefer-string-starts-ends-with" /* ESLintRule.TypeScriptPreferStringStartsEndsWith */]: "warn", ["@typescript-eslint/restrict-plus-operands" /* ESLintRule.TypeScriptRestrictPlusOperands */]: [ "warn", { skipCompoundAssignments: false } ], ["@typescript-eslint/unbound-method" /* ESLintRule.TypeScriptUnboundMethod */]: "off" } }; /** * The recommended configuration for rules which require type checking. */ exports.recommendedWithTypeChecking = { name: "recommended-with-type-checking", config: { ["@typescript-eslint/naming-convention" /* ESLintRule.TypeScriptNamingConvention */]: [ "warn", { selector: "enumMember", format: ["PascalCase"] }, { selector: "typeLike", format: ["PascalCase"] }, { selector: "interface", prefix: ["I"], format: ["PascalCase"] }, { selector: "typeParameter", prefix: ["T"], format: ["PascalCase"] } ] } }; //# sourceMappingURL=rule-configs.cjs.map