Skip to content

Commit f3229ee

Browse files
author
[Interfaced] Кирилл Дронкин
committed
1.6.1
1 parent f44794e commit f3229ee

5 files changed

Lines changed: 217 additions & 444 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
## 1.6.1 (release date: 24.01.2019)
4+
5+
* `valid-jsdoc`: handle the new error message type that was added in `eslint@5.12`
6+
37
## 1.6.0 (release date: 6.12.2018)
48

59
* `caps-const`: fixed an exception on enum-variables checking

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2017-2018 Interfaced
3+
Copyright © 2017-2019 Interfaced
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the “Software”), to deal

lib/rules/redefined/valid-jsdoc.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ module.exports = {
1515
return Object.assign(originalRuleVisitor, {
1616
'FunctionExpression:exit': (node) => {
1717
contextCopy.report = (error) => {
18-
if (
19-
error.message === 'Unexpected @{{title}} tag; function has no return statement.' &&
20-
node.parent.type === 'MethodDefinition'
21-
) {
18+
if (node.parent.type === 'MethodDefinition' && detectReturnTagViolation(error)) {
2219
const classNode = node.parent.parent.parent;
2320

2421
const isInterfaceMethod = hasJSDocWithTags(classNode, ['interface'], sourceCode);
@@ -37,3 +34,14 @@ module.exports = {
3734
});
3835
}
3936
};
37+
38+
/**
39+
* @param {Object} error
40+
* @return {boolean}
41+
*/
42+
function detectReturnTagViolation(error) {
43+
return (
44+
error.message === 'Unexpected @{{title}} tag; function has no return statement.' ||
45+
error.messageId === 'unexpectedTag' // Since eslint@5.12
46+
);
47+
}

0 commit comments

Comments
 (0)