Skip to content

Commit

Permalink
cleanup #142
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 11, 2016
1 parent 519ad1b commit c17358b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions options-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>
Expand All @@ -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

Expand Down

0 comments on commit c17358b

Please sign in to comment.