From 7a5d27becf68d55d4fb30334ab39dba5417c2f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz=20=28Peter=20Blazejewicz=29?= Date: Fri, 13 Mar 2020 02:18:24 +0100 Subject: [PATCH] feat(xo): update to v0.28 (#43076) - 'webpack' option added - tests updated https://github.com/xojs/xo/releases/tag/v0.28.0 https://github.com/xojs/xo/compare/v0.27.2...v0.28.0 Thanks! --- types/xo/index.d.ts | 9 ++++++++- types/xo/xo-tests.ts | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) 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) {