@storm-software/eslint
Version:
A package containing the base ESLint configuration used by Storm Software across many projects.
56 lines (53 loc) • 1.51 kB
text/typescript
import { Awaitable } from 'eslint-flat-config-utils';
declare const parserPlain: {
meta: {
name: string;
};
parseForESLint: (code: string) => {
ast: {
body: never[];
comments: never[];
loc: {
end: number;
start: number;
};
range: number[];
tokens: never[];
type: string;
};
scopeManager: null;
services: {
isPlain: boolean;
};
visitorKeys: {
Program: never[];
};
};
};
declare function isInGitHooksOrLintStaged(): boolean;
declare function isInEditorEnv(): boolean;
declare function interopDefault<T>(m: Awaitable<T>): Promise<T extends {
default: infer U;
} ? U : T>;
declare function isPackageInScope(name: string): boolean;
declare function ensurePackages(packages: (string | undefined)[]): Promise<void>;
/**
* Rename plugin prefixes in a rule object.
* Accepts a map of prefixes to rename.
*
* @example
* ```ts
* import { renameRules } from '@storm-software/eslint'
*
* export default [{
* rules: renameRules(
* {
* '@typescript-eslint/indent': 'error'
* },
* { '@typescript-eslint': 'ts' }
* )
* }]
* ```
*/
declare function renameRules(rules: Record<string, any>, map: Record<string, string>): Record<string, any>;
export { ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, renameRules };