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.

compatibility with react, functional-parameters ?

See original GitHub issue

Hi,

First of all, great little addition to eslint! Trying to use ramba (looked at immutablejs but settled on ramba in the end) - I needed a way to ensure I was doing any mutable operations - and this library seems to nail it ! Thanks!

One thing, I decided to implement the

 "plugin:functional/lite"

I was wondering if the order matters, I have it placed here, just before the prettier extends.

  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:functional/lite",
    "prettier/@typescript-eslint",
    "prettier"
  ],

After enabling the lite version I noticed that it was complaining where I was using parameterless functions - react has many ( every component could potentially be a parameterless functions) i.e.

export const App = () => { // This is a component, it takes no params (props)
  // const location = useLocation()

So I did an override, and it seems to have fixed it. Am I missing anything else?

    "functional/functional-parameters": [
      "error",
      {
        "enforceParameterCount": false
      }
    ],

Thanks once again!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
jonaskellocommented, Dec 13, 2019

Yes, that might be a good idea. Also for people looking just to disable mutation perhaps there should be an `immutable’ preset or something like that.

0reactions
jonaskellocommented, Dec 28, 2019

@RebeccaStevens I have not yet used spectrum but it seems like a nice alternative to slack, gitter etc. 😃. I was thinking this plugin could be a channel in a larger eslint community but could not find any community for eslint. So I set up a separate community for this plugin here and added a badge to the readme. Please go join 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing Functions to Components - React
How do I bind a function to a component instance? ... yes, it is OK, and it is often the easiest way to...
Read more >
What is the second parameter for in a React functional ...
In short, when you define contextTypes field in a functional component, you'll receive an object with the defined shape as a second parameter....
Read more >
React Functional Components: In-Depth Guide - KnowledgeHut
As discussed above, react components are the core building blocks of any react application. It is reusable and works independently. The goal of ......
Read more >
React Functional Components, Props, and JSX - freeCodeCamp
Normally in frontend-related projects, we keep HTML, CSS, and JavaScript code in separate files. However in React, this works a bit differently.
Read more >
React Function Components
When using arrow functions for React components, nothing changes for the props. They are still accessible as arguments as before. It's a React...
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