여씨의 개발이야기

[JsHint] 오류 몇 가지 정리해보아요 본문

🐾 Programming Lang/🌐 React

[JsHint] 오류 몇 가지 정리해보아요

yeossi 2022. 3. 25. 16:42

요즘 weave scope 퍼블리싱을 하면서 jshint 오류를 계속 맞딱드리고 있다. (Weave Scope는 Docker 및 Kubernetes의 시각화 및 모니터링 도구이다.) 정리를 해두면 좋을 거 같아서 한 번에 정리해보겠다.

1. Script URL is a form of eval no-script-url

Examples of incorrect code for this rule:

/*eslint no-script-url: "error"*/

location.href = "javascript:void(0)";

location.href = `javascript:void(0)`;

 

2. Style prop value must be an object react/style-prop-object        

The issue is you are passing style as a String instead of an Object. React expects you to pass style in an object notation

style={{ blabla }}  // Object literal notation

 

계속해서 추가해나갈 예정 

Comments