eslint-config-xo

  • Version 5.0.0
  • Published
  • 105 kB
  • 22 dependencies
  • MIT license

Install

npm i eslint-config-xo
yarn add eslint-config-xo
pnpm add eslint-config-xo

Overview

ESLint shareable config for XO

Index

Variables

variable allExtensions

const allExtensions: string[];

    variable allFilesGlob

    const allFilesGlob: string;

      variable cssExtensions

      const cssExtensions: string[];

        variable defaultIgnores

        const defaultIgnores: string[];

          variable frameworkExtensions

          const frameworkExtensions: string[];

            variable htmlExtensions

            const htmlExtensions: string[];

              variable jsExtensions

              const jsExtensions: string[];

                variable jsFilesGlob

                const jsFilesGlob: string;

                  variable jsonExtensions

                  const jsonExtensions: string[];

                    variable mdExtensions

                    const mdExtensions: string[];

                      variable tsExtensions

                      const tsExtensions: string[];

                        variable tsFilesGlob

                        const tsFilesGlob: string;

                          variable typescriptParser

                          const typescriptParser: any;

                            Functions

                            function eslintConfigXo

                            eslintConfigXo: (options?: Options) => Linter.Config[];
                            • ESLint shareable config for XO with support for JavaScript and TypeScript.

                              Returns

                              An array of ESLint flat config objects.

                            function getPrettierConfig

                            getPrettierConfig: (options: {
                            prettier?: boolean | 'compat';
                            space?: boolean | number;
                            semicolon?: boolean;
                            files?: Linter.Config['files'];
                            }) => Linter.Config | undefined;
                            • Build the ESLint flat config object that integrates [Prettier](https://prettier.io), or undefined when prettier is falsy.

                              Mainly intended for the xo package to reuse XO's Prettier integration. When files is omitted, the config applies to all files.

                            Type Aliases

                            type Options

                            type Options = {
                            /**
                            Use browser globals instead of Node.js globals.
                            @default false
                            */
                            browser?: boolean;
                            /**
                            Use spaces for indentation instead of tabs.
                            Set to `true` for 2 spaces, or a number for a custom count.
                            @default false
                            */
                            space?: boolean | number;
                            /**
                            Use semicolons at the end of statements.
                            @default true
                            */
                            semicolon?: boolean;
                            /**
                            Integrate [Prettier](https://prettier.io).
                            - `true` — Run Prettier as an ESLint rule using XO's Prettier style, and disable the stylistic rules that would conflict with it. Requires `prettier` to be installed.
                            - `'compat'` — Only disable the stylistic rules that conflict with Prettier, for when you run Prettier separately (for example, from your editor or a script).
                            Prettier options you set in a `.prettierrc` still apply for anything XO does not configure (like `printWidth` or plugins), but XO's own style settings take precedence.
                            @default false
                            */
                            prettier?: boolean | 'compat';
                            /**
                            Ignore paths listed in your project's `.gitignore` file.
                            Pass `import.meta.url` from your ESLint config file so the `.gitignore` is resolved relative to it. It is a no-op if the file does not exist.
                            Not needed when using the [XO CLI](https://github.com/xojs/xo), which already respects `.gitignore`.
                            @example
                            ```
                            import eslintConfigXo from 'eslint-config-xo';
                            import {defineConfig} from 'eslint/config';
                            export default defineConfig([
                            ...eslintConfigXo({gitignore: import.meta.url}),
                            ]);
                            ```
                            */
                            gitignore?: string;
                            };

                              Package Files (1)

                              Dependencies (22)

                              Dev Dependencies (3)

                              Peer Dependencies (3)

                              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/eslint-config-xo.

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