Skip to content

Commit 7cfec29

Browse files
committed
INCOMPLETE (apparent problem in eslint itself with our use of Program:exit):
test(`no-undefined-types`): issues gajus#507
1 parent a611bf6 commit 7cfec29

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5733,6 +5733,30 @@ class SomeType {}
57335733
*/
57345734
function quux () {}
57355735
// Settings: {"jsdoc":{"mode":"closure"}}
5736+
5737+
import {myTypesA} from '../internal/file.js'; // ERROR
5738+
import {myTypesB} from '../internal/file.js'; // NO ERROR
5739+
5740+
/**
5741+
* @typedef newType
5742+
* @property {myTypesA.someType} someProp - Some prop.
5743+
*/
5744+
5745+
/**
5746+
* @param {newType} arg - Arg.
5747+
*/
5748+
function myFunctionA(arg) {
5749+
return arg;
5750+
}
5751+
5752+
/**
5753+
* @param {myTypesB.someType} arg - Arg.
5754+
*/
5755+
function myFunctionB(arg) {
5756+
return arg;
5757+
}
5758+
5759+
export {myFunctionA, myFunctionB};
57365760
````
57375761
57385762

test/rules/assertions/noUndefinedTypes.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,5 +705,38 @@ export default {
705705
},
706706
},
707707
},
708+
{
709+
code: `
710+
import {myTypesA} from '../internal/file.js'; // ERROR
711+
import {myTypesB} from '../internal/file.js'; // NO ERROR
712+
713+
/**
714+
* @typedef newType
715+
* @property {myTypesA.someType} someProp - Some prop.
716+
*/
717+
718+
/**
719+
* @param {newType} arg - Arg.
720+
*/
721+
function myFunctionA(arg) {
722+
return arg;
723+
}
724+
725+
/**
726+
* @param {myTypesB.someType} arg - Arg.
727+
*/
728+
function myFunctionB(arg) {
729+
return arg;
730+
}
731+
732+
export {myFunctionA, myFunctionB};
733+
`,
734+
parserOptions: {
735+
sourceType: 'module',
736+
},
737+
rules: {
738+
'no-unused-vars': ['error'],
739+
},
740+
},
708741
],
709742
};

0 commit comments

Comments
 (0)