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!
This commit is contained in:
Piotr Błażejewicz (Peter Blazejewicz) 2020-03-13 02:18:24 +01:00 committed by GitHub
parent 65784a33d9
commit 7a5d27becf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

9
types/xo/index.d.ts vendored
View File

@ -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) <https://github.com/peterblazejewicz>
// 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;

View File

@ -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) {