xo
- Version 4.0.0
- Published
- 93.8 kB
- 19 dependencies
- MIT license
Install
npm i xoyarn add xopnpm add xoOverview
JavaScript/TypeScript linter (ESLint wrapper) with great defaults
Index
Variables
variable ignoredFileWarningMessage
const ignoredFileWarningMessage: string;variable noFilesFoundErrorMessage
const noFilesFoundErrorMessage: string;Classes
class Xo
class Xo {}constructor
constructor(_linterOptions: LinterOptions, _baseXoConfig?: XoConfigOptions);method calculateConfigForFile
calculateConfigForFile: (filePath: string) => Promise<Linter.Config>;method ensureCacheDirectory
ensureCacheDirectory: () => Promise<void>;Ensures the cache directory exists. This needs to run once before both tsconfig handling and running ESLint occur.
method getFormatter
getFormatter: (name: string) => Promise<ESLint.LoadedFormatter>;method getProjectEslintConfig
getProjectEslintConfig: () => Promise<Linter.Config[]>;Create an ESLint flat config for editor integrations using the same XO pipeline as the CLI.
method handleUnincludedTsFiles
handleUnincludedTsFiles: (files?: string[]) => Promise<void>;Checks every TS file to ensure it is included in the tsconfig. Any that are not included are routed through a generated tsconfig (
tsconfig.generated.json) so that autofix works correctly across multiple ESLint passes.Parameter files
The TypeScript files being linted.
method initEslint
initEslint: ( files?: string[], cliIgnores?: string[], shouldStripDefaultIgnores?: boolean) => Promise<void>;Initializes the ESLint instance on the XO instance.
method lintFiles
static lintFiles: ( globs: string | undefined, options: LinterOptions & XoConfigOptions) => Promise<XoLintResult>;Static helper for backwards compatibility and use in editor extensions and other tools.
Lints the files on the XO instance.
Parameter globs
Glob pattern to pass to
globby.Throws
Error
method lintText
static lintText: ( code: string, options: LintTextOptions & LinterOptions & XoConfigOptions) => Promise<XoLintResult>;Static helper for backwards compatibility and use in editor extensions and other tools.
Lints the text on the XO instance.
method outputFixes
static outputFixes: (results: XoLintResult) => Promise<void>;Write the fixes to disk.
method setEslintConfig
setEslintConfig: ( cliIgnores?: string[], shouldStripDefaultIgnores?: boolean) => void;method setXoConfig
setXoConfig: () => Promise<void>;Sets the XO config on the XO instance.
Package Files (1)
Dependencies (19)
Dev Dependencies (9)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto 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/xo.
- Markdown[](https://www.jsdocs.io/package/xo)
- HTML<a href="https://www.jsdocs.io/package/xo"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2698 ms. - Missing or incorrect documentation? Open an issue for this package.
