Add eslint CLIEngine resolvePluginsRelativeTo constructor option (#39335)

* Add the resolvePluginsRelativeTo option

The documentation at https://eslint.org/docs/developer-guide/nodejs-api#cliengine shows this option

* Add for later versions of TypeScript, and tests
This commit is contained in:
Peter Belbin 2019-10-23 16:59:48 -05:00 committed by Wesley Wigham
parent 98a24059fc
commit 86ffa58e94
4 changed files with 4 additions and 0 deletions

View File

@ -492,6 +492,7 @@ cli = new CLIEngine({ ignorePattern: ['foo', 'bar'] });
cli = new CLIEngine({ useEslintrc: false });
cli = new CLIEngine({ parserOptions: {} });
cli = new CLIEngine({ plugins: ['foo'] });
cli = new CLIEngine({ resolvePluginsRelativeTo: 'test' });
cli = new CLIEngine({ rules: { 'test/example-rule': 1 } });
cli = new CLIEngine({ rulePaths: ['foo'] });
cli = new CLIEngine({ reportUnusedDisableDirectives: true });

View File

@ -519,6 +519,7 @@ export namespace CLIEngine {
parser?: string;
parserOptions?: Linter.ParserOptions;
plugins?: string[];
resolvePluginsRelativeTo?: string;
rules?: {
[name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions;
};

View File

@ -491,6 +491,7 @@ cli = new CLIEngine({ ignorePattern: 'foo' });
cli = new CLIEngine({ ignorePattern: ['foo', 'bar'] });
cli = new CLIEngine({ useEslintrc: false });
cli = new CLIEngine({ parserOptions: {} });
cli = new CLIEngine({ resolvePluginsRelativeTo: 'test' });
cli = new CLIEngine({ plugins: ['foo'] });
cli = new CLIEngine({ rules: { 'test/example-rule': 1 } });
cli = new CLIEngine({ rulePaths: ['foo'] });

View File

@ -515,6 +515,7 @@ export namespace CLIEngine {
parser?: string;
parserOptions?: Linter.ParserOptions;
plugins?: string[];
resolvePluginsRelativeTo?: string;
rules?: {
[name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions;
};