File tree 3 files changed +65
-1
lines changed
3 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ const getFunctionParameterNames = (functionNode : Object) : Array<T> => {
142
142
return [ undefined , flattenRoots ( roots ) ] ;
143
143
}
144
144
145
- if ( param . type === 'RestElement' ) {
145
+ if ( [ 'RestElement' , 'ExperimentalRestProperty' ] . includes ( param . type ) ) {
146
146
return {
147
147
isRestProperty : isProperty ,
148
148
name : param . argument . name ,
Original file line number Diff line number Diff line change @@ -682,6 +682,32 @@ export default {
682
682
} ,
683
683
] ,
684
684
} ,
685
+ {
686
+ code : `
687
+ module.exports = class GraphQL {
688
+ /**
689
+ * @param fetchOptions
690
+ * @param cacheKey
691
+ */
692
+ fetch = ({ url, ...options }, cacheKey) => {
693
+ }
694
+ };
695
+ ` ,
696
+ errors : [
697
+ {
698
+ message : 'Missing @param "fetchOptions.url"' ,
699
+ } ,
700
+ {
701
+ message : 'Missing @param "fetchOptions.options"' ,
702
+ } ,
703
+ ] ,
704
+ options : [
705
+ {
706
+ checkRestProperty : true ,
707
+ } ,
708
+ ] ,
709
+ parser : require . resolve ( 'babel-eslint' ) ,
710
+ } ,
685
711
] ,
686
712
valid : [
687
713
{
Original file line number Diff line number Diff line change @@ -1857,6 +1857,44 @@ export default {
1857
1857
};
1858
1858
` ,
1859
1859
} ,
1860
+ {
1861
+ code : `
1862
+ module.exports = class GraphQL {
1863
+ /**
1864
+ * @param fetchOptions
1865
+ * @param cacheKey
1866
+ */
1867
+ fetch = ({ url, ...options }, cacheKey) => {
1868
+ }
1869
+ };
1870
+ ` ,
1871
+ errors : [
1872
+ {
1873
+ message : 'Missing JSDoc @param "fetchOptions.url" declaration.' ,
1874
+ } ,
1875
+ {
1876
+ message : 'Missing JSDoc @param "fetchOptions.options" declaration.' ,
1877
+ } ,
1878
+ ] ,
1879
+ options : [
1880
+ {
1881
+ checkRestProperty : true ,
1882
+ } ,
1883
+ ] ,
1884
+ output : `
1885
+ module.exports = class GraphQL {
1886
+ /**
1887
+ * @param fetchOptions
1888
+ * @param fetchOptions.url
1889
+ * @param fetchOptions.options
1890
+ * @param cacheKey
1891
+ */
1892
+ fetch = ({ url, ...options }, cacheKey) => {
1893
+ }
1894
+ };
1895
+ ` ,
1896
+ parser : require . resolve ( 'babel-eslint' ) ,
1897
+ } ,
1860
1898
] ,
1861
1899
valid : [
1862
1900
{
You can’t perform that action at this time.
0 commit comments