compatibility with react, functional-parameters ?
See original GitHub issueHi,
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:
- Created 4 years ago
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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 😃.