diff --git a/types/xo/index.d.ts b/types/xo/index.d.ts index 4c6cef09dd..1966f14944 100644 --- a/types/xo/index.d.ts +++ b/types/xo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for xo 0.26 +// Type definitions for xo 0.28 // Project: https://github.com/xojs/xo#readme // Definitions by: Piotr Błażejewicz (Peter Blazejewicz) // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -55,6 +55,13 @@ export type Options = { semicolon?: boolean; /** Set it to true to get 2-space indentation or specify the number of spaces. */ space?: number | string; + /** + * 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; } & CLIEngineOptions & ESLintConfig & ESLintOptions; diff --git a/types/xo/xo-tests.ts b/types/xo/xo-tests.ts index 508c4d9864..32c993068a 100644 --- a/types/xo/xo-tests.ts +++ b/types/xo/xo-tests.ts @@ -6,6 +6,17 @@ import path = require('path'); const glob = path.join(__dirname, '..', '*.md'); const options: xo.Options = {}; +options.webpack = { + config: { + resolve: { + alias: { + file2alias: path.resolve(__dirname, process.cwd(), './file2.js'), + }, + }, + }, +}; +options.webpack = true; +options.webpack = false; if (options.semicolon === false && !options.prettier) { if (options.rules) {