question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: "Configuration for rule "react/jsx-sort-props" is invalid"

See original GitHub issue

Okay so just tried to update some packages, including some eslint-related stuff and shock-of-shocks it broke stuff… So I removed everything (rm -rf /node_modules, cleared out devDependencies in package.json), thinking I’d just re-install everything from scratch using this dumb long-ass command npm i -D eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y. Still broken (because I assume it tried to install the updated versions)… looks like something in the React package maybe?

screen shot 2016-08-16 at 4 10 14 pm

Trying to use this as an eslint config is actually stupid though. The number of times I’ve installed all this shit using the above command, only to have it throw errors is extremely frustrating. It’s dependants should just be included and I shouldn’t have to install all this extra bullshit just to use it. I understand the thinking behind it (what if not everyone wants the whole kitchen sink right) but clearly wider developer ergonomics were not a priority in designing this. Anyone have an alternative solution/one eslint config file will all the rules in it?

Anyway, for now I guess I’ll just revert to whatever versions I was using before and just never update anything because who knows what might break tomorrow ¯__(ツ)__/¯

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

6reactions
ljharbcommented, Aug 16, 2016

To install the config properly, please make sure to use the command in the readme that automatically installs the right peer dep versions for you (although I think you’ve got the right ones already).

As far as your complaints about peer deps and descendants, I agree, but that’s how eslint works - there is no way to avoid it short of changes in eslint itself.

Typically, these errors arise from editors using the global eslint instead of the local one - but your stack trace implies it’s using the local one, so I’m not really sure.

Have you restarted your editor after updating node_modules? Most editors cache things such that npm install while they’re still open will break them.

5reactions
himynameisdavecommented, Aug 16, 2016

Restarting Atom solved the issue! Will try this next time I’m getting issues, and will maybe even file an issue over there instead!

well done

Thank you sir! 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid configuration for rule "react/jsx-sort-props"
There is a bug in the linter rule's jsx-sort-props.js - although the docs reference a multiline property, said property does not exist anywhere ......
Read more >
Eslint-plugin-react NPM
JSX -specific rules ;, react/jsx-indent-props, Enforce props indentation in JSX ; ✓, react/jsx-key, Disallow missing key props in iterators/collection literals.
Read more >
eslint/eslint - Gitter
I'm getting this error from eslint, any help please? Oops! Something went wrong! :( ESLint: 4.9.0. ESLint couldn't find the plugin ...
Read more >
12 essential ESLint rules for React - LogRocket Blog
Introduction. ESLint has a comprehensive set of rules for JavaScript code that cover stylistic choices and prevent common bugs.
Read more >
@thibaudcolas/eslint-plugin-cookbook - Package Manager
Fast, reliable, and secure dependency management.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found