import { constants, FlatESLintConfigItem } from '@eslint-sukka/shared'; export { constants } from '@eslint-sukka/shared'; interface OptionsIgnores { /** * If `customGlobs` is not provided, or provided one is set to `false` or `null`, only the built-in globs will be used. * * If `customGlobs` is `string` or `string[]`, it will be appended to the built-in globs. * * If `customGlobs` is `function`, it will be called with the built-in globs as the first argument, and the return value will be used as the final globs. * This is the only way to disable the built-in globs. */ customGlobs?: string | string[] | null | false | ((builtinGlobs: typeof constants.GLOB_EXCLUDE) => string[]); gitignore?: string | string[] | boolean | null; } declare function ignores(options?: OptionsIgnores): FlatESLintConfigItem[]; interface OptionsJavaScript { module?: boolean; /** * Apply the config to specific files. Default to eslint default. * * @default undefined */ files?: string | string[] | undefined | null; /** * Disable `no-console` rule in CLI files. * * - true: disable `no-console` in preset files glob * - false: do not disable `no-console` * - string | string[]: custom glob to disable `no-console` * * @default true */ disableNoConsoleInCLI?: boolean | string | string[]; env?: { /** * Enable browser global variables. * * @default true */ browser?: boolean; /** * Enable webextensions global variables. * * @default false */ webextensions?: boolean; /** * Enable userscript global variables. * * @default false */ greasemonkey?: boolean; /** * Custom global variables. * * @see [Configuring global variables](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-global-variables) */ customGlobals?: { [name: string]: boolean | 'off' | 'readonly' | 'readable' | 'writable' | 'writeable'; } | undefined; }; } interface OptionsTypeScript { allowJs?: boolean; isInEditor?: boolean; tsconfigPath?: string | string[] | true; tsconfigRootDir?: string; componentExtensions?: string[]; allowDefaultProject?: string[]; } interface OptionsLegacy { browser?: boolean; node?: boolean; files?: FlatESLintConfigItem['files']; } interface EslintReactAdditionalComponents { name: string; as: string; attributes: Array<{ name: string; as: string; defaultValue?: string; }>; } interface OptionsReact { files?: string | string[] | ((builtinFiles: string[]) => string[]); /** * @default '(useIsomorphicLayoutEffect|useSukkaManyOtherCustomEffectHookExample)' */ additionalHooks?: string; additionalHooksWithType?: Record; additionalComponents?: EslintReactAdditionalComponents[]; /** * @default 'error' */ reactCompiler?: boolean; nextjs?: boolean | string | string[]; remix?: boolean | string | string[]; reactRefresh?: { allowConstantExport?: boolean; }; } interface OptionsStyleX { opt?: StyleXESLintOptions; } interface StyleXESLintOptions { validImports?: string[]; propLimits?: PropLimits; allowOuterPseudoAndMedia?: boolean; banPropsForLegacy?: boolean; } interface PropLimits { [propertyName: string]: { limit: null | 'string' | 'number' | string | number | Array; reason: string; }; } interface OptionsNode { strict?: boolean; module?: boolean; files?: FlatESLintConfigItem['files']; hasTypeScript?: boolean; hasReact?: boolean; } type SharedOptions = Omit & { enable?: boolean; }; interface ESLintSukkaOptions { isInEditor?: boolean; ignores?: SharedOptions; js?: SharedOptions | boolean; json?: boolean; ts?: SharedOptions | boolean; pnpm?: boolean; yaml?: boolean; react?: SharedOptions | boolean; stylex?: SharedOptions | boolean; next?: boolean; node?: SharedOptions | boolean; legacy?: SharedOptions | boolean; stylistic?: boolean; } declare function sukka(options?: ESLintSukkaOptions, ...userConfig: FlatESLintConfigItem[]): Promise; export { ignores, sukka };