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.

Is no-nill too strict?

See original GitHub issue

Hi all! Thanks for this awesome eslint plugin! I can’t use null in objects, is that a bug or an expected behaviour? How can I solve this?

const defaultState = {
    token: null
}
export function reducer(state = defaultState, action){
    return state
}

/home/user/Scrivania/mercury-new/src/modules/auth/index.js
  3:12  error  Unallowed use of `null` or `undefined`  fp/no-nil


Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jfmengelscommented, Sep 10, 2016

Yes, Maybe is a monad. I recommend reading this (relatively short) book https://github.com/MostlyAdequate/mostly-adequate-guide, which talks about them in this chapter and which I thought was pretty good last time I read it. This one is pretty nice too, but the section about monads and Maybe is not yet written. I’ll try to find a nice short article dealing with Maybe.

0reactions
avalanche1commented, Nov 16, 2018

I use map() extensively with curly braces - which requires a return statement. Can we add a sub-rule for fp/no-nil to exclude map() from linting?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signs You Are Too Strict With Your Child
Kids need rules and structure, but being too firm isn't healthy. Here are the telltale signs that you're being too strict with your...
Read more >
How to act like a non-ill person when you are surrounded by ...
First, when asked how you are doing, give a short answer. “Good,” “fine,” and “alright” are all good choices, even “not too bad”...
Read more >
Intention of Non-Ill Will | Rick Hanson
It is perfectly appropriate to defend yourself, assert yourself, pursue your own interests – and to do all that on behalf of others,...
Read more >
In Sickness and in Health
Remember that the partner who is ill and the partner who is not ill will have very different emotional experiences. The non-ill partner...
Read more >
Sick People Can Be Good Parents Too
In her decision to give the father full custody, she said, “children who have a parent with cancer need more contact with the...
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