2016-07-27 2 views
2

ES6 구문을 사용하면 변형 된 변수와 인수의 이름을 바꿀 수 있습니다.JSDoc 사용하기 재 명명 된 이름이 바뀐 함수 인수에 주석을 달려면 어떻게해야합니까?

변수 :

const {requestID: _requestID, notifyChanges: _notifyChanges} = someObject; 
console.log(_requestID, _notifyChanges); 

인수 : Parameter 'requestID' described in JSDoc does not appear in function signature

를 내가 제대로 주석을 얼마나 :

/** 
* Creates a cloud ready request. 
* @param {String} requestID Request ID used for for tracing and logs 
* @param {Boolean} [notifyChanges] Send an event to the message queue. 
*/ 
function createRequest({ 
    requestID: _requestID, 
    notifyChanges: _notifyChanges = false, 
}) { 
    console.log(_requestID, _notifyChanges); 
}); 

심지어 자바 스크립트 코드는 위의 유효하지만은 JSDoc 오류가 말을 보여줍니다 JSDoc에서 함수 인수를 재 명명하고 이름을 변경 했습니까? JSDoc 매개 변수 이름에

답변

3

사용 대장 :이 WebStorm IDE 2016.2에서 테스트되었습니다

/** 
* Creates a cloud ready request. 
* @param {String} _requestID:requestID Request ID used for for tracing and logs 
* @param {Boolean} [_notifyChanges:notifyChanges] Send an event to the message queue. 
*/ 
function createRequest({ 
    requestID: _requestID, 
    notifyChanges: _notifyChanges = false, 
}) { 
    console.log(_requestID, _notifyChanges); 
}); 

. 잘 작동합니다.

관련 문제