Skip to content

Commit a868a34

Browse files
dstaleybrettz9
authored andcommitted
remove duplicate test case
1 parent 3971ce1 commit a868a34

File tree

2 files changed

+81
-24
lines changed

2 files changed

+81
-24
lines changed

README.md

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,33 +1669,62 @@ function quux (foo, foo) {
16691669
* @param cfg.foo
16701670
* @param cfg.foo
16711671
*/
1672-
function quux ({foo, bar}) {
1672+
function quux ({foo}) {
16731673

16741674
}
16751675
// Message: Duplicate @param "cfg.foo"
16761676

1677+
/**
1678+
* @param cfg
1679+
* @param cfg.foo
1680+
*/
1681+
function quux ({foo, bar}) {
1682+
1683+
}
1684+
// Message: Missing @param "cfg.bar"
1685+
16771686
/**
16781687
* @param cfg
16791688
* @param cfg.foo
16801689
* @param [cfg.foo]
16811690
* @param baz
16821691
*/
1683-
function quux ({foo, bar}, baz) {
1692+
function quux ({foo}, baz) {
16841693

16851694
}
16861695
// Message: Duplicate @param "cfg.foo"
16871696

16881697
/**
16891698
* @param cfg
16901699
* @param cfg.foo
1691-
* @param [cfg.foo="with a default"]
16921700
* @param baz
16931701
*/
16941702
function quux ({foo, bar}, baz) {
16951703

1704+
}
1705+
// Message: Missing @param "cfg.bar"
1706+
1707+
/**
1708+
* @param cfg
1709+
* @param cfg.foo
1710+
* @param [cfg.foo="with a default"]
1711+
* @param baz
1712+
*/
1713+
function quux ({foo}, baz) {
1714+
16961715
}
16971716
// Message: Duplicate @param "cfg.foo"
16981717

1718+
/**
1719+
* @param cfg
1720+
* @param [cfg.foo="with a default"]
1721+
* @param baz
1722+
*/
1723+
function quux ({foo, bar}, baz) {
1724+
1725+
}
1726+
// Message: Missing @param "cfg.bar"
1727+
16991728
export class SomeClass {
17001729
/**
17011730
* @param prop
@@ -1704,6 +1733,35 @@ export class SomeClass {
17041733
}
17051734
// Message: Expected @param names to be "property". Got "prop".
17061735

1736+
export class SomeClass {
1737+
/**
1738+
* @param prop
1739+
* @param prop.foo
1740+
*/
1741+
constructor(prop: { foo: string, bar: string }) {}
1742+
}
1743+
// Message: Missing @param "prop.bar"
1744+
1745+
export class SomeClass {
1746+
/**
1747+
* @param prop
1748+
* @param prop.foo
1749+
* @param prop.bar
1750+
*/
1751+
constructor(options: { foo: string, bar: string }) {}
1752+
}
1753+
// Message: Missing @param "options.foo"
1754+
1755+
export class SomeClass {
1756+
/**
1757+
* @param options
1758+
* @param options.foo
1759+
* @param options.bar
1760+
*/
1761+
constructor(options: { foo: string }) {}
1762+
}
1763+
// Message: @param "options.bar" does not exist on options
1764+
17071765
/**
17081766
* @param foo
17091767
*/
@@ -1773,6 +1831,8 @@ function quux (...args) {
17731831

17741832
/**
17751833
* @param foo
1834+
* @param foo.a
1835+
* @param foo.b
17761836
*/
17771837
function quux ({a, b}) {
17781838

@@ -1819,6 +1879,15 @@ export class SomeClass {
18191879
constructor(private property: string) {}
18201880
}
18211881

1882+
export class SomeClass {
1883+
/**
1884+
* @param options
1885+
* @param options.foo
1886+
* @param options.bar
1887+
*/
1888+
constructor(options: { foo: string, bar: string }) {}
1889+
}
1890+
18221891
/**
18231892
* @param {Error} error Exit code
18241893
* @param {number} [code = 1] Exit code
@@ -1834,6 +1903,15 @@ function quux (foo) {
18341903

18351904
}
18361905
// Options: [{"allowExtraTrailingParamDocs":true}]
1906+
1907+
/**
1908+
* @param cfg
1909+
* @param cfg.foo
1910+
* @param baz
1911+
*/
1912+
function quux ({foo}, baz) {
1913+
1914+
}
18371915
````
18381916

18391917

test/rules/assertions/checkParamNames.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -374,27 +374,6 @@ export default {
374374
sourceType: 'module',
375375
},
376376
},
377-
{
378-
code: `
379-
export class SomeClass {
380-
/**
381-
* @param prop
382-
* @param prop.foo
383-
*/
384-
constructor(prop: { foo: string, bar: string }) {}
385-
}
386-
`,
387-
errors: [
388-
{
389-
line: 4,
390-
message: 'Missing @param "prop.bar"',
391-
},
392-
],
393-
parser: require.resolve('@typescript-eslint/parser'),
394-
parserOptions: {
395-
sourceType: 'module',
396-
},
397-
},
398377
{
399378
code: `
400379
export class SomeClass {

0 commit comments

Comments
 (0)