Skip to content

Commit 6b183bc

Browse files
committed
build: enable JSDoc lint rules for TypeScript
1 parent 58f787f commit 6b183bc

File tree

2 files changed

+301
-4
lines changed

2 files changed

+301
-4
lines changed

etc/eslint/rules/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var rules = merge(
4747
require( './nodejs.js' ),
4848
require( './style.js' ),
4949
require( './es2015.js' ),
50-
require( './stdlib.js')
50+
require( './stdlib.js' )
5151
);
5252

5353

etc/eslint/rules/typescript.js

Lines changed: 300 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,14 +1521,311 @@ rules[ 'import/order' ] = [
15211521
*/
15221522
rules[ 'indent' ] = [ 'error', 'tab' ];
15231523

1524+
/**
1525+
* Ensures param names in JSDoc match those in the function declaration.
1526+
*
1527+
* @name jsdoc/check-param-names
1528+
* @memberof rules
1529+
* @type {string}
1530+
* @default 'error'
1531+
* @see [check-param-names]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-param-names.md}
1532+
*/
1533+
rules[ 'jsdoc/check-param-names' ] = 'error';
1534+
1535+
/**
1536+
* Ensures property names in JSDoc are valid.
1537+
*
1538+
* @name jsdoc/check-property-names
1539+
* @memberof rules
1540+
* @type {string}
1541+
* @default 'error'
1542+
* @see [check-property-names]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-property-names.md}
1543+
*/
1544+
rules[ 'jsdoc/check-property-names' ] = 'error';
1545+
1546+
/**
1547+
* Checks for invalid JSDoc syntax.
1548+
*
1549+
* @name jsdoc/check-syntax
1550+
* @memberof rules
1551+
* @type {string}
1552+
* @default 'error'
1553+
* @see [check-syntax]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-syntax.md}
1554+
*/
1555+
rules[ 'jsdoc/check-syntax' ] = 'error';
1556+
1557+
/**
1558+
* Checks that JSDoc tag names are valid.
1559+
*
1560+
* @name jsdoc/check-tag-names
1561+
* @memberof rules
1562+
* @type {Array}
1563+
* @default 'error'
1564+
* @see [check-tag-names]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-tag-names.md}
1565+
*/
1566+
rules['jsdoc/check-tag-names'] = 'error';
1567+
1568+
/**
1569+
* Checks for empty JSDoc tags.
1570+
*
1571+
* @name jsdoc/empty-tags
1572+
* @memberof rules
1573+
* @type {string}
1574+
* @default 'error'
1575+
* @see [empty-tags]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/empty-tags.md}
1576+
*/
1577+
rules[ 'jsdoc/empty-tags' ] = 'error';
1578+
1579+
/**
1580+
* Checks that the @implements tag is used correctly on classes.
1581+
*
1582+
* @name jsdoc/implements-on-classes
1583+
* @memberof rules
1584+
* @type {string}
1585+
* @default 'error'
1586+
* @see [implements-on-classes]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/implements-on-classes.md}
1587+
*/
1588+
rules[ 'jsdoc/implements-on-classes' ] = 'error';
1589+
1590+
/**
1591+
* Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
1592+
*
1593+
* @name jsdoc/multiline-blocks
1594+
* @memberof rules
1595+
* @type {string}
1596+
* @default 'error'
1597+
* @see [multiline-blocks]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/multiline-blocks.md}
1598+
*/
1599+
rules[ 'jsdoc/multiline-blocks' ] = 'error';
1600+
1601+
/**
1602+
* Prevents blank lines in block descriptions.
1603+
*
1604+
* @name jsdoc/no-blank-block-descriptions
1605+
* @memberof rules
1606+
* @type {string}
1607+
* @default 'error'
1608+
* @see [no-blank-block-descriptions]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/no-blank-block-descriptions.md}
1609+
*/
1610+
rules[ 'jsdoc/no-blank-block-descriptions' ] = 'error';
1611+
1612+
/**
1613+
* Prevents use of default values in JSDoc tags.
1614+
*
1615+
* @name jsdoc/no-defaults
1616+
* @memberof rules
1617+
* @type {string}
1618+
* @default 'error'
1619+
* @see [no-defaults]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/no-defaults.md}
1620+
*/
1621+
rules[ 'jsdoc/no-defaults' ] = 'error';
1622+
1623+
/**
1624+
* Prevents use of multiple asterisks at the beginning of lines.
1625+
*
1626+
* @name jsdoc/no-multi-asterisks
1627+
* @memberof rules
1628+
* @type {string}
1629+
* @default 'error'
1630+
* @see [no-multi-asterisks]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/no-multi-asterisks.md}
1631+
*/
1632+
rules[ 'jsdoc/no-multi-asterisks' ] = 'error';
1633+
1634+
/**
1635+
* Requires that each JSDoc line starts with an asterisk.
1636+
*
1637+
* @name jsdoc/require-asterisk-prefix
1638+
* @memberof rules
1639+
* @type {string}
1640+
* @default 'error'
1641+
* @see [require-asterisk-prefix]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-asterisk-prefix.md}
1642+
*/
1643+
rules[ 'jsdoc/require-asterisk-prefix' ] = 'error';
1644+
1645+
/**
1646+
* Requires that all functions have a description.
1647+
*
1648+
* @name jsdoc/require-description
1649+
* @memberof rules
1650+
* @type {string}
1651+
* @default 'error'
1652+
* @see [require-description]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-description.md}
1653+
*/
1654+
rules[ 'jsdoc/require-description' ] = 'error';
1655+
1656+
/**
1657+
* Requires a hyphen before the @param description.
1658+
*
1659+
* @name jsdoc/require-hyphen-before-param-description
1660+
* @memberof rules
1661+
* @type {string}
1662+
* @default 'error'
1663+
* @see [require-hyphen-before-param-description]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-hyphen-before-param-description.md}
1664+
*/
1665+
rules[ 'jsdoc/require-hyphen-before-param-description' ] = 'error';
1666+
1667+
/**
1668+
* Requires that all functions have JSDoc documentation.
1669+
*
1670+
* @name jsdoc/require-jsdoc
1671+
* @memberof rules
1672+
* @type {string}
1673+
* @default 'error'
1674+
* @see [require-jsdoc]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-jsdoc.md}
1675+
*/
1676+
rules[ 'jsdoc/require-jsdoc' ] = 'error';
1677+
1678+
/**
1679+
* Requires that all function parameters are documented.
1680+
*
1681+
* @name jsdoc/require-param
1682+
* @memberof rules
1683+
* @type {string}
1684+
* @default 'error'
1685+
* @see [require-param]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-param.md}
1686+
*/
1687+
rules[ 'jsdoc/require-param' ] = 'error';
1688+
1689+
/**
1690+
* Requires that @param tag has description value.
1691+
*
1692+
* @name jsdoc/require-param-description
1693+
* @memberof rules
1694+
* @type {string}
1695+
* @default 'error'
1696+
* @see [require-param-description]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-param-description.md}
1697+
*/
1698+
rules[ 'jsdoc/require-param-description' ] = 'error';
1699+
1700+
/**
1701+
* Requires that all @param tags have names.
1702+
*
1703+
* @name jsdoc/require-param-name
1704+
* @memberof rules
1705+
* @type {string}
1706+
* @default 'error'
1707+
* @see [require-param-name]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-param-name.md}
1708+
*/
1709+
rules[ 'jsdoc/require-param-name' ] = 'error';
1710+
1711+
/**
1712+
* Requires that all function properties are documented.
1713+
*
1714+
* @name jsdoc/require-property
1715+
* @memberof rules
1716+
* @type {string}
1717+
* @default 'error'
1718+
* @see [require-property]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-property.md}
1719+
*/
1720+
rules[ 'jsdoc/require-property' ] = 'error';
1721+
1722+
/**
1723+
* Requires that @property tag has description value.
1724+
*
1725+
* @name jsdoc/require-property-description
1726+
* @memberof rules
1727+
* @type {string}
1728+
* @default 'error'
1729+
* @see [require-property-description]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-property-description.md}
1730+
*/
1731+
rules[ 'jsdoc/require-property-description' ] = 'error';
1732+
1733+
/**
1734+
* Requires that all @property tags have names.
1735+
*
1736+
* @name jsdoc/require-property-name
1737+
* @memberof rules
1738+
* @type {string}
1739+
* @default 'error'
1740+
* @see [require-property-name]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-property-name.md}
1741+
*/
1742+
rules[ 'jsdoc/require-property-name' ] = 'error';
1743+
1744+
/**
1745+
* Requires that @property tags have type values.
1746+
*
1747+
* @name jsdoc/require-property-type
1748+
* @memberof rules
1749+
* @type {string}
1750+
* @default 'error'
1751+
* @see [require-property-type]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-property-type.md}
1752+
*/
1753+
rules[ 'jsdoc/require-property-type' ] = 'error';
1754+
1755+
/**
1756+
* Requires returns are documented.
1757+
*
1758+
* @name jsdoc/require-returns
1759+
* @memberof rules
1760+
* @type {string}
1761+
* @default 'error'
1762+
* @see [require-returns]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-returns.md}
1763+
*/
1764+
rules[ 'jsdoc/require-returns' ] = 'error';
1765+
1766+
/**
1767+
* Requires a return statement in function body if a @returns tag is specified in JSDoc comment.
1768+
*
1769+
* @name jsdoc/require-returns-check
1770+
* @memberof rules
1771+
* @type {string}
1772+
* @default 'error'
1773+
* @see [require-returns-check]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-returns-check.md}
1774+
*/
1775+
rules[ 'jsdoc/require-returns-check' ] = 'error';
1776+
1777+
/**
1778+
* Requires that @returns tag has description value.
1779+
*
1780+
* @name jsdoc/require-returns-description
1781+
* @memberof rules
1782+
* @type {string}
1783+
* @default 'error'
1784+
* @see [require-returns-description]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-returns-description.md}
1785+
*/
1786+
rules[ 'jsdoc/require-returns-description' ] = 'error';
1787+
1788+
/**
1789+
* Requires that @throws statements are documented.
1790+
*
1791+
* @name jsdoc/require-throws
1792+
* @memberof rules
1793+
* @type {string}
1794+
* @default 'error'
1795+
* @see [require-throws]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/require-throws.md}
1796+
*/
1797+
rules[ 'jsdoc/require-throws' ] = 'error';
1798+
1799+
/**
1800+
* Requires that tags are sorted alphabetically.
1801+
*
1802+
* @name jsdoc/sort-tags
1803+
* @memberof rules
1804+
* @type {string}
1805+
* @default [ 'error', {...} ]
1806+
* @see [sort-tags]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/sort-tags.md}
1807+
*/
1808+
rules[ 'jsdoc/sort-tags' ] = ['error', {
1809+
'linesBetween': 1,
1810+
'tagSequence': [
1811+
{
1812+
'tags': [ 'param', 'throws', 'returns', 'see' ]
1813+
},
1814+
{
1815+
'tags': [ 'examples' ]
1816+
}
1817+
],
1818+
'reportIntraTagGroupSpacing': false
1819+
}];
1820+
15241821
/**
15251822
* Disables the JSDoc rule for checking alignment.
15261823
*
15271824
* @name jsdoc/check-alignment
15281825
* @memberof rules
15291826
* @type {string}
15301827
* @default 'off'
1531-
* @see [check-alignment]{@link https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-alignment}
1828+
* @see [check-alignment]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-alignment.md}
15321829
*/
15331830
rules[ 'jsdoc/check-alignment' ] = 'off';
15341831

@@ -1539,7 +1836,7 @@ rules[ 'jsdoc/check-alignment' ] = 'off';
15391836
* @memberof rules
15401837
* @type {string}
15411838
* @default 'off'
1542-
* @see [check-indentation]{@link https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-indentation}
1839+
* @see [check-indentation]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/check-indentation.md}
15431840
*/
15441841
rules[ 'jsdoc/check-indentation' ] = 'off';
15451842

@@ -1554,7 +1851,7 @@ rules[ 'jsdoc/check-indentation' ] = 'off';
15541851
* @memberof rules
15551852
* @type {string}
15561853
* @default 'error'
1557-
* @see [no-types]{@link https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-types}
1854+
* @see [no-types]{@link https://github.com/gajus/eslint-plugin-jsdoc/tree/main/docs/rules/no-types.md}
15581855
*/
15591856
rules[ 'jsdoc/no-types' ] = 'error';
15601857

0 commit comments

Comments
 (0)