Skip to content

Commit 9f2fbb1

Browse files
committed
fix: @putout/plugin-remove-useless-arguments: method: exclude: ClassPrivateProperty
1 parent f3ee483 commit 9f2fbb1

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

packages/plugin-remove-useless-arguments/.eslintrc.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const {safeAlign} = require('eslint-plugin-putout/config');
4+
5+
module.exports = [
6+
...safeAlign, {
7+
ignores: ['**/fixture'],
8+
},
9+
];
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export class DrawCircle {
2+
#canvas: HTMLElement | SVGElement | null;
3+
4+
constructor(
5+
el: HTMLElement,
6+
radius: number,
7+
options: SpeccerOptionsInterface
8+
) {
9+
this.#init(el, radius, options);
10+
}
11+
}

packages/plugin-remove-useless-arguments/lib/method/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const {operator, types} = require('putout');
4-
54
const {compare} = operator;
65

76
const {
@@ -10,6 +9,7 @@ const {
109
isSuper,
1110
isClass,
1211
isClassProperty,
12+
isClassPrivateProperty,
1313
} = types;
1414

1515
module.exports.report = ({methodNode}) => {
@@ -43,6 +43,9 @@ module.exports.traverse = ({push}) => ({
4343
if (isClassProperty(methodNode))
4444
continue;
4545

46+
if (isClassPrivateProperty(methodNode))
47+
continue;
48+
4649
if (isRestElement(methodNode.params.at(-1)))
4750
continue;
4851

packages/plugin-remove-useless-arguments/lib/method/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ test('plugin-remove-useless-method: method: no report: getter', (t) => {
3333
t.noReport('getter');
3434
t.end();
3535
});
36+
37+
test('plugin-remove-useless-method: method: no report: private', (t) => {
38+
t.noReport('private');
39+
t.end();
40+
});

0 commit comments

Comments
 (0)