Skip to content

Commit

Permalink
fix: no-dedupe with setters or getters (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt authored and gajus committed Nov 12, 2019
1 parent 6f71442 commit da05064
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utilities/getParameterName.js
Expand Up @@ -30,6 +30,10 @@ export default (identifierNode, context) => {
tokenIndex++;
}

if (identifierNode.kind === 'set' || identifierNode.kind === 'get') {
tokenIndex++;
}

return context.getSourceCode().getFirstToken(identifierNode, tokenIndex).value;
}

Expand Down
3 changes: 3 additions & 0 deletions tests/rules/assertions/noDupeKeys.js
Expand Up @@ -111,5 +111,8 @@ export default {
{
code: 'type a = { b: <C>(config: { ...C, key: string}) => C }',
},
{
code: 'export interface Foo { get foo(): boolean; get bar(): string; }',
},
],
};

0 comments on commit da05064

Please sign in to comment.