@types/xo

  • Version 0.39.8
  • Published
  • 5.9 kB
  • 1 dependency
  • MIT license

Install

npm i @types/xo
yarn add @types/xo
pnpm add @types/xo

Overview

TypeScript definitions for xo

Index

Variables

variable getErrorResults

const getErrorResults: any;
  • Can be used to filter out all the non error messages from the report object.

Functions

function getConfig

getConfig: (
options: CLIEngineOptions & { filePath: string }
) => ReturnType<eslint.ESLint['calculateConfigForFile']>;

    function getFormatter

    getFormatter: (
    format?: string
    ) => (
    results: eslint.ESLint.LintResult[],
    data?: eslint.ESLint.LintResultData
    ) => string;

    function lintFiles

    lintFiles: (
    patterns: string | string[],
    options?: Options
    ) => ResultReport | Promise<ResultReport>;

      function lintText

      lintText: (text: string, options?: Options) => ResultReport;

        function outputFixes

        outputFixes: (report: ResultReport) => void;
        • Used to output fixes from report to disk. It does by looking for files that have an output property in their results

        Interfaces

        interface ResultReport

        interface ResultReport {}

          property errorCount

          readonly errorCount: number;

            property results

            readonly results: eslint.ESLint.LintResult[];

              property warningCount

              readonly warningCount: number;

                Type Aliases

                type CLIEngineOptions

                type CLIEngineOptions = Pick<
                eslint.ESLint.Options,
                'baseConfig' | 'cwd' | 'extensions' | 'fix' | 'ignore'
                > & {
                envs?: string[] | undefined;
                globals?: string[] | undefined;
                parser?: string | undefined;
                plugins?: string[];
                rules?:
                | {
                [name: string]:
                | eslint.Linter.RuleLevel
                | eslint.Linter.RuleLevelAndOptions;
                }
                | undefined;
                };

                  type ESLintConfig

                  type ESLintConfig = Pick<eslint.Linter.Config, 'extends' | 'settings'>;

                    type ESLintOptions

                    type ESLintOptions = Pick<eslint.Linter.LintOptions, 'filename'>;

                      type Options

                      type Options = {
                      /** Some paths are ignored by default, including paths in .gitignore and .eslintignore. Additional ignores can be added here */
                      ignores?: string[] | undefined;
                      /** Enable rules specific to the Node.js versions within the configured range */
                      nodeVersion?: string | boolean | undefined;
                      /** Format code with Prettier */
                      prettier?: boolean | undefined;
                      /**
                      * Print the ESLint configuration for the given file
                      */
                      printConfig?: string | undefined;
                      /** Set it to false to enforce no-semicolon style. */
                      semicolon?: boolean | undefined;
                      /** Set it to true to get 2-space indentation or specify the number of spaces. */
                      space?: boolean | number | undefined;
                      /**
                      * Use {@link https://github.com/benmosher/eslint-plugin-import/tree/master/resolvers/webpack}
                      * to resolve import search paths. This is enabled automatically if a `webpack.config.js` file is found.
                      * Set this to a boolean to explicitly enable or disable the resolver.
                      * @default false
                      */
                      webpack?: boolean | object | undefined;
                      } & CLIEngineOptions &
                      ESLintConfig &
                      ESLintOptions;

                        Package Files (1)

                        Dependencies (1)

                        Dev Dependencies (0)

                        No dev dependencies.

                        Peer Dependencies (0)

                        No peer dependencies.

                        Badge

                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/xo.

                        • Markdown
                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/xo)
                        • HTML
                          <a href="https://www.jsdocs.io/package/@types/xo"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>