Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
119
rated 0 times [  120] [ 1]  / answers: 1 / hits: 51265  / 7 Years ago, tue, may 23, 2017, 12:00:00

I have the below JSON response, to validate the __place, i used responseData.search[0].edges[0].node.__place



{
data: {
search: [
{
__place: SearchResultItemConnection,
edges: [
{
cursor: New,
node: {
__place: Delhi,
name: AIIMS
}
}
]
}
]
}
}


I'm getting the ESLint error stating error Unexpected dangling '_' in '__typename' no-underscore-dangle



I went through the link, http://eslint.org/docs/rules/no-underscore-dangle but i'm not able to resolve this.



Could anyone know how to resolve this, instead of changing the rules?


More From » eslint

 Answers
63

You can add the following comment before the code line which yields the error:



/* eslint no-underscore-dangle: [error, { allow: [__place] }]*/
responseData.search[0].edges[0].node.__place


or add



/* eslint no-underscore-dangle: 0 */


to disable this specific rule for that script file.


[#57693] Friday, May 19, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarod

Total Points: 62
Total Questions: 111
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
jarod questions
;