我不能掌握JQuery的風格指南中的Jshint說明: https://contribute.jquery.org/style-guide/js/#linting我應該使用jshint還是eslint來綁定jquery插件?
Jshint不能jQuery的核心github上找到。我看不到源中的任何.jshintrc文件。儘管如此,它還是很有魅力的,但沒有明確的指導。
我應該怎麼做才能使用JQuery方式?
我不能掌握JQuery的風格指南中的Jshint說明: https://contribute.jquery.org/style-guide/js/#linting我應該使用jshint還是eslint來綁定jquery插件?
Jshint不能jQuery的核心github上找到。我看不到源中的任何.jshintrc文件。儘管如此,它還是很有魅力的,但沒有明確的指導。
我應該怎麼做才能使用JQuery方式?
文件說:
以下常用的選項必須在所有項目中使用:
{ "boss": true, "curly": true, "eqeqeq": true, "eqnull": true, "expr": true, "immed": true, "noarg": true, "quotmark": "double", "smarttabs": true, "trailing": true, "undef": true, "unused": true }
所以剛創建在項目的根目錄內容的.jshintrc文件並運行jshint
(你已經安裝了,對不對?)或者如果你喜歡併發症,請使用grunt-jshint。
謝謝。一些Jquery的貢獻者在這裏補充說,他們現在更傾向於使用eslint,並且jquery.org文檔可能在全球被棄用: https://github.com/jquery/jquery.com/issues/155#issuecomment-268924532 –
轉移到:[ https://github.com/jquery/contribute.jquery.org/issues/14](https://github.com/jquery/contribute.jquery.org/issues/141): 應該使用特定的linter + linter配置每個Jquery子項目,具體取決於每個子項目回購中提供的內容。 –