Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme doesn't say where the "settings" should be placed #2169

Closed
Br3nda opened this issue Feb 19, 2019 · 8 comments
Closed

Readme doesn't say where the "settings" should be placed #2169

Br3nda opened this issue Feb 19, 2019 · 8 comments

Comments

@Br3nda
Copy link

Br3nda commented Feb 19, 2019

in the README.md there's the following sentence

You should also specify settings that will be shared across all the plugin rules.
and a json/hash example

but it doesn't say where you would place these settings. Is it .eslintrc? If so, where in the structure? I tried top level but I get

Error: ESLint configuration in /home/brenda/projects/FSD/.eslintrc is invalid:
	- Unexpected top-level property "settings"".
@ljharb
Copy link
Member

ljharb commented Feb 20, 2019

Yes, in eslintrc, and at the top level (see https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js#L470 for an example).

What version of eslint do you have?

@Br3nda
Copy link
Author

Br3nda commented Feb 20, 2019

5.14.1

@ljharb
Copy link
Member

ljharb commented Feb 20, 2019

If you downgrade to 5.14.0 or 5.13, do you still see the problem?

@PeterMerkert
Copy link

Well, I agree that adding in the README where it should be located helps.
And further @Br3nda, I had the same issue and placing the settings key as the last entry in the eslintrc solved it for me.

@ljharb
Copy link
Member

ljharb commented Feb 24, 2019

The ordering shouldn’t matter; JSON schema, which eslint uses to validate its config, doesn’t care about order.

@ljharb
Copy link
Member

ljharb commented Feb 24, 2019

Maybe it has to appear after “react” in the plugins dir tho, so that it can be made valid?

@samsch
Copy link
Contributor

samsch commented Feb 27, 2019

This led me on a bit of a chase around for a bit too. An explicit note that settings is a top level config item in the eslint config would be great, perhaps referencing https://eslint.org/docs/user-guide/configuring#adding-shared-settings

It would also be helpful to know if what's shown is the effective default if you don't set anything yourself.

@ljharb
Copy link
Member

ljharb commented Feb 27, 2019

@samsch a PR to improve the docs would be appreciated, both here and in eslint core.

The options are shown on our readme.

samsch added a commit to samsch/eslint-plugin-inferno that referenced this issue Feb 27, 2019
@ljharb ljharb closed this as completed in b7f0b02 Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants