UNPKG

@nx/eslint

Version:

The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.

25 lines (24 loc) 2.06 kB
import { type GeneratorCallback, type Tree } from '@nx/devkit'; import type { Linter } from 'eslint'; export declare function findEslintFile(tree: Tree, projectRoot?: string): string | null; export declare function isEslintConfigSupported(tree: Tree, projectRoot?: string): boolean; export declare function updateRelativePathsInConfig(tree: Tree, sourcePath: string, destinationPath: string): void; export declare function determineEslintConfigFormat(content: string): 'mjs' | 'cjs'; export declare function addOverrideToLintConfig(tree: Tree, root: string, override: Partial<Linter.ConfigOverride<Linter.RulesRecord>>, options?: { insertAtTheEnd?: boolean; checkBaseConfig?: boolean; }): void; export declare function updateOverrideInLintConfig(tree: Tree, rootOrFile: string, lookup: (override: Linter.ConfigOverride<Linter.RulesRecord>) => boolean, update: (override: Linter.ConfigOverride<Linter.RulesRecord>) => Linter.ConfigOverride<Linter.RulesRecord>): void; export declare function lintConfigHasOverride(tree: Tree, rootOrFile: string, lookup: (override: Linter.ConfigOverride<Linter.RulesRecord>) => boolean, checkBaseConfig?: boolean): boolean; export declare function replaceOverridesInLintConfig(tree: Tree, root: string, overrides: Linter.ConfigOverride<Linter.RulesRecord>[]): void; export declare function addExtendsToLintConfig(tree: Tree, root: string, plugin: string | { name: string; needCompatFixup: boolean; } | Array<string | { name: string; needCompatFixup: boolean; }>, insertAtTheEnd?: boolean): GeneratorCallback; export declare function addPredefinedConfigToFlatLintConfig(tree: Tree, root: string, predefinedConfigName: string, moduleName?: string, moduleImportPath?: string, spread?: boolean, insertAtTheEnd?: boolean): void; export declare function addPluginsToLintConfig(tree: Tree, root: string, plugin: string | string[]): void; export declare function addIgnoresToLintConfig(tree: Tree, root: string, ignorePatterns: string[]): void; export declare function getPluginImport(pluginName: string): string;