Skip to content

Commit 87841e8

Browse files
committed
test(valid-types): example demonstrating array object properties; closes #596
1 parent 867edc3 commit 87841e8

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22663,6 +22663,18 @@ function quux() {
2266322663
*/
2266422664
function quux ( id, options ) {
2266522665
}
22666+
22667+
22668+
/**
22669+
* Assign the project to a list of employees.
22670+
* @param {Object[]} employees - The employees who are responsible for the project.
22671+
* @param {string} employees[].name - The name of an employee.
22672+
* @param {string} employees[].department - The employee's department.
22673+
*/
22674+
function assign(employees) {
22675+
// ...
22676+
}
22677+
// "jsdoc/valid-types": ["error"|"warn", {"allowEmptyNamepaths":true,"checkSeesForNamepaths":false}]
2266622678
````
2266722679

2266822680

src/rules/noUndefinedTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const extraTypes = [
1919
'Array', 'Object', 'RegExp', 'Date', 'Function',
2020
];
2121

22-
// https://www.typescriptlang.org/docs/handbook/utility-types.html
2322
const typescriptGlobals = [
23+
// https://www.typescriptlang.org/docs/handbook/utility-types.html
2424
'Partial',
2525
'Required',
2626
'Readonly',

test/rules/assertions/validTypes.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,5 +1619,25 @@ export default {
16191619
`,
16201620
ignoreReadme: true,
16211621
},
1622+
{
1623+
code: `
1624+
1625+
/**
1626+
* Assign the project to a list of employees.
1627+
* @param {Object[]} employees - The employees who are responsible for the project.
1628+
* @param {string} employees[].name - The name of an employee.
1629+
* @param {string} employees[].department - The employee's department.
1630+
*/
1631+
function assign(employees) {
1632+
// ...
1633+
}
1634+
`,
1635+
options: [
1636+
{
1637+
allowEmptyNamepaths: true,
1638+
checkSeesForNamepaths: false,
1639+
},
1640+
],
1641+
},
16221642
],
16231643
};

0 commit comments

Comments
 (0)