diff --git a/options-manager.js b/options-manager.js index 440688f7..32e8f752 100644 --- a/options-manager.js +++ b/options-manager.js @@ -124,10 +124,6 @@ function buildConfig(opts) { config.baseConfig.extends = ['xo/esnext', path.join(__dirname, 'config/plugins.js')]; } - if (opts.parser) { - config.baseConfig.parser = opts.parser; - } - if (opts.rules) { Object.assign(config.rules, opts.rules); } @@ -136,6 +132,10 @@ function buildConfig(opts) { config.baseConfig.settings = opts.settings; } + if (opts.parser) { + config.baseConfig.parser = opts.parser; + } + if (opts.extends && opts.extends.length > 0) { // TODO: this logic needs to be improved, preferably use the same code as ESLint // user's configs must be resolved to their absolute paths diff --git a/readme.md b/readme.md index 873c8a83..7286a474 100644 --- a/readme.md +++ b/readme.md @@ -180,12 +180,6 @@ Override any of the [default rules](https://github.com/sindresorhus/eslint-confi Please take a moment to consider if you really need to use this option. -### settings - -Type: `object` - -Anything you put here gets passed to `settings` in the ESLint configuration; some of the ESLint plugins use this. For example, to configure the `import` ruleset to use the webpack configuration for determining search paths, you can put `{'import/resolver': 'webpack'}` here. - ### semicolon Type: `boolean`
@@ -211,11 +205,18 @@ Type: `Array` Allow more extensions to be linted besides `.js` and `.jsx`. Make sure they're supported by ESLint or an ESLint plugin. +### settings + +Type: `Object` + +[Shared ESLint settings](http://eslint.org/docs/user-guide/configuring#adding-shared-settings) exposed to rules. For example, to configure the [`import`](https://github.com/benmosher/eslint-plugin-import#settings) plugin to use your webpack configuration for determining search paths, you can put `{"import/resolver": "webpack"}` here. + ### parser Type: `string` -Tell ESLint what parser to use, e.g. `"babel-eslint"` if you are using language features that ESLint doesn't support yet. +ESLint parser. For example, [`babel-eslint`](https://github.com/babel/babel-eslint) if you're using language features that ESLint doesn't yet support. + ## Config Overrides