File tree Expand file tree Collapse file tree 3 files changed +114
-1
lines changed Expand file tree Collapse file tree 3 files changed +114
-1
lines changed Original file line number Diff line number Diff line change @@ -1862,6 +1862,41 @@ The following patterns are considered problems:
1862
1862
*/
1863
1863
// Message: Duplicate @property "foo"
1864
1864
1865
+ /**
1866
+ * @typedef (SomeType) SomeTypedef
1867
+ * @property cfg
1868
+ * @property cfg.foo
1869
+ * @property cfg.foo
1870
+ */
1871
+ function quux ({foo, bar}) {
1872
+
1873
+ }
1874
+ // Message: Duplicate @property "cfg.foo"
1875
+
1876
+ /**
1877
+ * @typedef (SomeType) SomeTypedef
1878
+ * @property cfg
1879
+ * @property cfg.foo
1880
+ * @property [cfg.foo]
1881
+ * @property baz
1882
+ */
1883
+ function quux ({foo, bar}, baz ) {
1884
+
1885
+ }
1886
+ // Message: Duplicate @property "cfg.foo"
1887
+
1888
+ /**
1889
+ * @typedef (SomeType) SomeTypedef
1890
+ * @property cfg
1891
+ * @property cfg.foo
1892
+ * @property [cfg.foo="with a default"]
1893
+ * @property baz
1894
+ */
1895
+ function quux ({foo, bar}, baz ) {
1896
+
1897
+ }
1898
+ // Message: Duplicate @property "cfg.foo"
1899
+
1865
1900
/**
1866
1901
* @typedef (SomeType) SomeTypedef
1867
1902
* @prop foo
@@ -1937,6 +1972,14 @@ function quux (code = 1) {
1937
1972
this .error = new Error (' oops' );
1938
1973
this .code = code;
1939
1974
}
1975
+
1976
+ /**
1977
+ * @typedef (SomeType) SomeTypedef
1978
+ * @property foo
1979
+ * @property foo.bar
1980
+ * @property foo.baz
1981
+ * @property bar
1982
+ */
1940
1983
````
1941
1984
1942
1985
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const validatePropertyNames = (
6
6
jsdoc , jsdocNode , utils ,
7
7
) => {
8
8
const propertyTags = entries ( jsdoc . tags ) . filter ( ( [ , tag ] ) => {
9
- return tag . tag === targetTagName && ! tag . name . includes ( '.' ) ;
9
+ return tag . tag === targetTagName ;
10
10
} ) ;
11
11
12
12
return propertyTags . some ( ( [ , tag ] , index ) => {
Original file line number Diff line number Diff line change @@ -56,6 +56,65 @@ export default {
56
56
*/
57
57
` ,
58
58
} ,
59
+ {
60
+ code : `
61
+ /**
62
+ * @typedef (SomeType) SomeTypedef
63
+ * @property cfg
64
+ * @property cfg.foo
65
+ * @property cfg.foo
66
+ */
67
+ function quux ({foo, bar}) {
68
+
69
+ }
70
+ ` ,
71
+ errors : [
72
+ {
73
+ line : 6 ,
74
+ message : 'Duplicate @property "cfg.foo"' ,
75
+ } ,
76
+ ] ,
77
+ } ,
78
+ {
79
+ code : `
80
+ /**
81
+ * @typedef (SomeType) SomeTypedef
82
+ * @property cfg
83
+ * @property cfg.foo
84
+ * @property [cfg.foo]
85
+ * @property baz
86
+ */
87
+ function quux ({foo, bar}, baz) {
88
+
89
+ }
90
+ ` ,
91
+ errors : [
92
+ {
93
+ line : 6 ,
94
+ message : 'Duplicate @property "cfg.foo"' ,
95
+ } ,
96
+ ] ,
97
+ } ,
98
+ {
99
+ code : `
100
+ /**
101
+ * @typedef (SomeType) SomeTypedef
102
+ * @property cfg
103
+ * @property cfg.foo
104
+ * @property [cfg.foo="with a default"]
105
+ * @property baz
106
+ */
107
+ function quux ({foo, bar}, baz) {
108
+
109
+ }
110
+ ` ,
111
+ errors : [
112
+ {
113
+ line : 6 ,
114
+ message : 'Duplicate @property "cfg.foo"' ,
115
+ } ,
116
+ ] ,
117
+ } ,
59
118
{
60
119
code : `
61
120
/**
@@ -191,5 +250,16 @@ export default {
191
250
}
192
251
` ,
193
252
} ,
253
+ {
254
+ code : `
255
+ /**
256
+ * @typedef (SomeType) SomeTypedef
257
+ * @property foo
258
+ * @property foo.bar
259
+ * @property foo.baz
260
+ * @property bar
261
+ */
262
+ ` ,
263
+ } ,
194
264
] ,
195
265
} ;
You can’t perform that action at this time.
0 commit comments