Skip to content

Commit

Permalink
Add processor option
Browse files Browse the repository at this point in the history
Fixes #464
  • Loading branch information
sindresorhus committed Dec 8, 2020
1 parent 7731ea1 commit bf6eb25
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ const buildXOConfig = options => config => {
config.baseConfig.parser = options.parser;
}

if (options.processor) {
config.baseConfig.processor = options.processor;
}

config.baseConfig.settings = options.settings || {};
config.baseConfig.settings['import/resolver'] = gatherImportResolvers(options);

Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ Type: `string`

ESLint parser. For example, [`babel-eslint`](https://github.com/babel/babel-eslint) if you're using language features that ESLint doesn't yet support.

### processor

Type: `string`

[ESLint processor.](https://eslint.org/docs/user-guide/configuring#specifying-processor)

### esnext

Type: `boolean`\
Expand Down
6 changes: 6 additions & 0 deletions test/options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,12 @@ test('buildConfig: parser', t => {
t.deepEqual(config.baseConfig.parser, parser);
});

test('buildConfig: processor', t => {
const processor = 'svelte3/svelte3';
const config = manager.buildConfig({processor});
t.deepEqual(config.baseConfig.processor, processor);
});

test('buildConfig: settings', t => {
const settings = {'import/resolver': {webpack: {}}};
const config = manager.buildConfig({settings});
Expand Down

0 comments on commit bf6eb25

Please sign in to comment.