import type { TypedFlatConfigItem } from '@antfu/eslint-config'; /** * Builds the maninak rule preset. Returns a tuple `[maninakOptionsForAntfu, ...flatBlocks]`: * the first element is the options object passed to antfu's factory, the rest are flat-config * items appended after antfu has run. * * Exported as a function (not a static array) so that gates which depend on the consumer's * environment, like `isInConsumerDeps('vue')` and `isInConsumerDeps('tailwindcss')`, evaluate * lazily on every `maninak()` call. A static array would freeze those gates at module-load * time, which works fine in real consumer setups but breaks tests that run multiple specs * under different cwds. */ export default function buildConfig(): [{ ignores: string[]; stylistic: false; typescript: { overrides: { 'ts/ban-ts-comment': "off"; 'ts/consistent-type-definitions': ["warn", "interface"]; 'ts/consistent-type-imports': ["warn", { disallowTypeAnnotations: false; fixStyle: "inline-type-imports"; }]; 'func-style': ["warn", "declaration", { allowArrowFunctions: false; }]; 'no-nested-ternary': "warn"; complexity: ["warn", { max: number; }]; 'ts/no-explicit-any': "warn"; 'ts/no-extraneous-class': "warn"; 'ts/no-import-type-side-effects': "warn"; 'ts/unified-signatures': "warn"; 'ts/no-unused-vars': "off"; 'ts/array-type': ["warn", { default: "array"; readonly: "array"; }]; 'ts/explicit-member-accessibility': "warn"; 'ts/prefer-for-of': "warn"; 'ts/member-ordering': "warn"; 'ts/no-inferrable-types': "off"; 'ts/no-this-alias': "off"; 'ts/naming-convention': ["warn", { selector: "interface"; format: "PascalCase"[]; custom: { regex: string; match: false; }; }, { selector: "variable"; format: ("camelCase" | "UPPER_CASE")[]; leadingUnderscore: "allow"; trailingUnderscore: "allow"; }, { selector: "typeLike"; format: "PascalCase"[]; }]; 'ts/no-extra-non-null-assertion': "warn"; 'ts/prefer-function-type': "warn"; 'ts/indent': "off"; 'ts/consistent-type-assertions': ["warn", { assertionStyle: "as"; objectLiteralTypeAssertions: "allow-as-parameter"; }]; }; overridesTypeAware: { 'ts/no-floating-promises': "off"; 'ts/promise-function-async': "warn"; 'ts/restrict-template-expressions': "warn"; 'ts/return-await': ["warn", "always"]; 'ts/strict-boolean-expressions': "off"; 'ts/require-array-sort-compare': "warn"; 'ts/prefer-readonly': "warn"; 'ts/no-unnecessary-qualifier': "warn"; 'ts/no-duplicate-type-constituents': "warn"; 'ts/no-confusing-void-expression': ["warn", { ignoreArrowShorthand: true; }]; }; }; }, { rules: { 'pnpm/yaml-enforce-settings': "off"; 'jsonc/sort-keys': "off"; 'import/consistent-type-specifier-style': "off"; }; }, { plugins: { style: any; maninak: { rules: { 'prefer-concise-async-arrow': import("eslint").Rule.RuleModule; 'compact-return': import("eslint").Rule.RuleModule; 'jsdoc-oneline': import("eslint").Rule.RuleModule; 'jsdoc-max-len': import("eslint").Rule.RuleModule; }; }; }; rules: { 'no-console': ["warn", { allow: [string, string]; }]; 'no-unused-expressions': ["warn", { allowShortCircuit: true; allowTernary: true; allowTaggedTemplates: true; enforceForJSX: true; }]; 'antfu/curly': "off"; curly: ["warn", "all"]; 'no-debugger': "warn"; 'prefer-const': ["warn", { destructuring: "all"; ignoreReadBeforeAssign: true; }]; 'no-restricted-syntax': ["error", { selector: string; message: string; }, string, string]; 'no-confusing-arrow': ["warn", { allowParens: true; }]; 'no-extra-boolean-cast': "warn"; 'maninak/compact-return': "warn"; 'padding-line-between-statements': ["warn", { blankLine: "always"; prev: "directive"; next: "*"; }, { blankLine: "always"; prev: "*"; next: "multiline-block-like"; }, { blankLine: "any"; prev: "*"; next: "if"; }, { blankLine: "any"; prev: "singleline-let"; next: "multiline-block-like"; }, { blankLine: "any"; prev: "singleline-const"; next: "for"; }, { blankLine: "any"; prev: "singleline-const"; next: "while"; }, { blankLine: "any"; prev: "singleline-const"; next: "do"; }, { blankLine: "any"; prev: "*"; next: "function"; }, { blankLine: "always"; prev: "class"; next: "function"; }, { blankLine: "always"; prev: "function"; next: "function"; }, { blankLine: "always"; prev: "expression"; next: "function"; }, { blankLine: "always"; prev: "multiline-expression"; next: "function"; }]; 'id-length': ["warn", { min: number; max: number; exceptions: string[]; }]; 'max-len': ["warn", { code: number; tabWidth: number; ignoreComments: true; ignoreTrailingComments: true; ignoreTemplateLiterals: true; ignoreRegExpLiterals: true; ignoreUrls: true; ignorePattern: string; }]; 'no-restricted-imports': ["error", { paths: { name: string; message: string; }[]; }]; 'space-before-function-paren': ["warn", { anonymous: "always"; named: "never"; asyncArrow: "always"; }]; 'prefer-exponentiation-operator': "warn"; 'prefer-rest-params': "warn"; 'prefer-spread': "warn"; 'prefer-template': "warn"; 'template-curly-spacing': "warn"; 'maninak/prefer-concise-async-arrow': "warn"; 'arrow-parens': ["warn", "always", { requireForBlockBody: true; }]; 'spaced-comment': ["warn", "always", { line: { markers: string[]; exceptions: string[]; }; block: { markers: string[]; exceptions: string[]; balanced: true; }; }]; 'consistent-return': "warn"; complexity: ["warn", number]; 'require-await': "warn"; 'max-statements-per-line': "warn"; 'no-empty': ["warn", { allowEmptyCatch: true; }]; 'no-multiple-empty-lines': ["warn", { max: number; maxBOF: number; maxEOF: number; }]; 'no-useless-return': "warn"; 'no-undef-init': "warn"; 'perfectionist/sort-imports': ["warn", { internalPattern: string[]; groups: (string | [string, string, string, string] | [string, string, string])[]; newlinesBetween: "ignore"; newlinesInside: "ignore"; order: "asc"; type: "natural"; }]; 'perfectionist/sort-named-imports': ["warn", { order: "asc"; type: "natural"; }]; 'perfectionist/sort-named-exports': ["warn", { order: "asc"; type: "natural"; }]; 'perfectionist/sort-exports': ["warn", { order: "asc"; type: "natural"; }]; 'unused-imports/no-unused-imports': "warn"; 'unused-imports/no-unused-vars': ["warn", { vars: "all"; varsIgnorePattern: string; args: "after-used"; argsIgnorePattern: string; }]; 'maninak/jsdoc-oneline': ["warn", { maxColumns: number; }]; 'maninak/jsdoc-max-len': ["warn", { maxColumns: number; }]; 'antfu/if-newline': "warn"; 'antfu/import-dedupe': "warn"; 'antfu/top-level-function': "warn"; 'antfu/consistent-chaining': "off"; 'antfu/consistent-list-newline': ["warn", { CallExpression: false; }]; 'node/prefer-global/process': ["warn", "always"]; 'style/member-delimiter-style': ["warn", { multiline: { delimiter: "none"; requireLast: true; }; singleline: { delimiter: "semi"; requireLast: false; }; }]; }; }, { files: string[]; ignores: string[]; plugins: { prettier: any; }; rules: any; }, { files: string[]; rules: { 'prettier/prettier': ["warn", { parser: string; overrides?: Array<{ files: string | string[]; excludeFiles?: string | string[]; options?: import("prettier").Options; }>; semi?: boolean | undefined; singleQuote?: boolean | undefined; jsxSingleQuote?: boolean | undefined; trailingComma?: "all" | "none" | "es5" | undefined; bracketSpacing?: boolean | undefined; objectWrap?: "collapse" | "preserve" | undefined; bracketSameLine?: boolean | undefined; rangeStart?: number | undefined; rangeEnd?: number | undefined; filepath?: string | undefined; requirePragma?: boolean | undefined; insertPragma?: boolean | undefined; checkIgnorePragma?: boolean | undefined; proseWrap?: "preserve" | "always" | "never" | undefined; arrowParens?: "always" | "avoid" | undefined; plugins?: (string | URL | import("prettier").Plugin)[] | undefined; htmlWhitespaceSensitivity?: "ignore" | "css" | "strict" | undefined; endOfLine?: "auto" | "lf" | "crlf" | "cr" | undefined; quoteProps?: "consistent" | "as-needed" | "preserve" | undefined; vueIndentScriptAndStyle?: boolean | undefined; embeddedLanguageFormatting?: "off" | "auto" | undefined; singleAttributePerLine?: boolean | undefined; experimentalOperatorPosition?: "start" | "end" | undefined; experimentalTernaries?: boolean | undefined; jsxBracketSameLine?: boolean | undefined; printWidth?: number | undefined; tabWidth?: number | undefined; useTabs?: boolean | undefined; parentParser?: string | undefined | undefined; __embeddedInHtml?: boolean | undefined | undefined; }]; }; }, { files: string[]; rules: { 'ts/explicit-function-return-type': ["warn", { allowExpressions: true; allowConciseArrowFunctionExpressionsStartingWithVoid: true; allowIIFEs: true; }]; }; }, { files: string[]; plugins: { jasmine: any; }; rules: { 'jasmine/new-line-before-expect': "warn"; 'jasmine/new-line-between-declarations': "warn"; 'test/prefer-lowercase-title': "off"; 'test/consistent-test-it': ["warn", { fn: "it"; }]; }; }, { files: string[]; rules: { 'ts/no-var-requires': "off"; }; }, { files: string[]; rules: { 'ts/no-var-requires': "off"; 'ts/explicit-function-return-type': "off"; 'ts/no-unsafe-assignment': "off"; 'ts/no-unsafe-argument': "off"; 'ts/no-unsafe-member-access': "off"; 'ts/no-unsafe-call': "off"; 'ts/no-unsafe-return': "off"; }; }, { files: string[]; rules: { 'ts/no-var-requires': "error"; }; }, { files: string[]; rules: { 'id-length': "off"; 'ts/no-explicit-any': "off"; 'unused-imports/no-unused-imports': "off"; 'unused-imports/no-unused-vars': "off"; }; }, { files: string[]; rules: { 'max-len': "off"; }; }, ...(TypedFlatConfigItem | { name: string; files: string[]; plugins: { 'prettier-vue': any; }; rules: any; } | { name: string; files: string[]; rules: { 'vue/dot-notation': ["warn", { allowKeywords: true; }]; 'vue/eqeqeq': ["warn", "smart"]; 'vue/no-empty-pattern': "warn"; 'vue/no-irregular-whitespace': "warn"; 'vue/object-shorthand': ["warn", "always", { ignoreConstructors: false; avoidQuotes: true; }]; 'vue/prefer-template': "warn"; 'vue/prefer-use-template-ref'?: "warn" | undefined; 'vue/define-props-declaration'?: ["warn", "type-based"] | undefined; 'vue/define-emits-declaration'?: ["warn", "type-based"] | undefined; 'vue/no-unused-emit-declarations'?: "warn" | undefined; 'vue/component-api-style'?: ["warn", ["script-setup"]] | undefined; 'vue/prefer-define-options'?: "warn" | undefined; 'vue/require-typed-ref'?: "warn" | undefined; 'vue/html-self-closing': ["warn", { html: { void: "always"; normal: "never"; component: "always"; }; svg: "always"; math: "always"; }]; 'vue/no-v-html': "error"; 'vue/require-prop-types': "warn"; 'vue/require-default-prop': "warn"; 'vue/html-indent': "off"; 'vue/html-closing-bracket-newline': "off"; 'vue/multiline-html-element-content-newline': "off"; 'vue/singleline-html-element-content-newline': "off"; 'vue/max-attributes-per-line': "off"; 'vue/block-tag-newline': "off"; 'vue/operator-linebreak': "off"; 'vue/quote-props': "off"; 'vue/multi-word-component-names': "warn"; 'vue/prefer-import-from-vue': "warn"; 'vue/no-dupe-keys': "error"; 'vue/no-v-text-v-html-on-component': "warn"; 'vue/no-setup-props-reactivity-loss': "warn"; 'vue/block-order': ["warn", { order: string[]; }]; 'vue/component-name-in-template-casing': ["warn", "PascalCase"]; 'vue/component-options-name-casing': ["warn", "PascalCase"]; 'vue/custom-event-name-casing': ["warn", "camelCase"]; 'vue/define-macros-order': ["warn", { order: string[]; }]; 'vue/html-comment-content-spacing': ["warn", "always", { exceptions: string[]; }]; 'vue/no-restricted-v-bind': ["warn", string]; 'vue/no-useless-v-bind': "warn"; 'vue/no-unused-refs': "warn"; 'vue/prefer-separate-static-class': "warn"; 'vue/no-unused-properties': ["warn", { deepData: true; groups: ("props" | "data" | "computed" | "methods" | "setup")[]; }]; 'vue/no-undef-components': "off" | "warn"; 'vue/no-undef-properties': "warn"; 'vue/max-template-depth': ["warn", { maxDepth: number; }]; 'vue/no-required-prop-with-default': ["warn", { autofix: false; }]; 'vue/html-button-has-type': ["warn", { button: true; submit: true; reset: true; }]; }; plugins?: undefined; })[]]; export declare const requireJsdocInUtilsBlocks: TypedFlatConfigItem[];