12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- /// <reference types="stylelint" />
- /**
- * @param {string|undefined} key
- * @param {Options} options
- * @returns {Linter}
- */
- export default function getStylelint(
- key: string | undefined,
- { threads, ...options }: Options
- ): Linter;
- export type Stylelint = import('postcss').PluginCreator<
- import('stylelint').PostcssPluginOptions
- > & {
- lint: (
- options: import('stylelint').LinterOptions
- ) => Promise<import('stylelint').LinterResult>;
- rules: {
- [k: string]: import('stylelint').Rule<any, any>;
- };
- formatters: {
- [k: string]: import('stylelint').Formatter;
- };
- createPlugin: (
- ruleName: string,
- plugin: import('stylelint').Plugin<any, any>
- ) => {
- ruleName: string;
- rule: import('stylelint').Rule<any, any>;
- };
- createLinter: (
- options: import('stylelint').LinterOptions
- ) => import('stylelint').InternalApi;
- utils: {
- report: (problem: import('stylelint').Problem) => void;
- ruleMessages: <
- T extends import('stylelint').RuleMessages,
- R extends { [K in keyof T]: T[K] }
- >(
- ruleName: string,
- messages: T
- ) => R;
- validateOptions: (
- result: import('stylelint').PostcssResult,
- ruleName: string,
- ...optionDescriptions: import('stylelint').RuleOptions[]
- ) => boolean;
- checkAgainstRule: <T_1, O extends Object>(
- options: {
- ruleName: string;
- ruleSettings: import('stylelint').ConfigRuleSettings<T_1, O>;
- root: import('postcss').Root;
- },
- callback: (warning: import('postcss').Warning) => void
- ) => void;
- };
- };
- export type LintResult = import('stylelint').LintResult;
- export type Options = import('./options').Options;
- export type AsyncTask = () => Promise<void>;
- export type LintTask = (files: string | string[]) => Promise<LintResult[]>;
- export type Worker = JestWorker & {
- lintFiles: LintTask;
- };
- export type Linter = {
- stylelint: Stylelint;
- lintFiles: LintTask;
- cleanup: AsyncTask;
- threads: number;
- };
- import { Worker as JestWorker } from 'jest-worker';
|