2016-04-15 67 views
0

我遇到問題與ESLint valid-jsdoc檢查給我一個錯誤以下。我錯過了什麼嗎?我以爲我捕獲了有效-jsdoc檢查將需要PageAdminPublication功能(選擇回調是罰款[更新有缺失的東西,通過@Jeremy拉詹指出I]一切ESLint JSDoc錯誤與回調

import { Mongo } from 'meteor/mongo' // eslint-disable-line no-unused-vars 

/** 
* @callback selectorToSearchCb 
* @param {object} selector extra stuff 
*/ 

/** 
* Administrative list publication. This provides access to all the whole collection with pagination. 
* Only allowed if the user is in the admin role. 
* 
* @param {string} publicationName publication name 
* @param {Mongo.Collection} collection mongo collection 
* @param (selectorToSearchCb) selectorToSearch selector to search function. This is used to convert input selectors to the search object for the find(). 
* @param {string} fields an array of field names that would be sent for edit and listing. 
* @return {void} 
*/ 
function PagedAdminPublication(publicationName, collection, selectorToSearch, ...fields) { 

回答

1

ESlint不會是。能爲你身邊selectorToSearchCb無效括號來解析評論您需要使用{selectorToSearchCb},而不是(selectorToSearchCb)

下面的工作對我來說:

/** 
    * Administrative list publication. This provides access to all the whole collection with pagination. 
    * Only allowed if the user is in the admin role. 
    * 
    * @param {string} publicationName publication name 
    * @param {Mongo.Collection} collection mongo collection 
    * @param {selectorToSearchCb} selectorToSearch selector to search function. This is used to convert input selectors to the search object for the find(). 
    * @param {string} fields an array of field names that would be sent for edit and listing. 
    * @return {void} 
    */ 
+0

衛生署derped謝謝,我不認爲這warran。現在堆棧溢出問題:P –