Skip to content

Commit 9e9e986

Browse files
committed
feature: @putout/plugin-eslint: remove-useless-properties: innerComments: exclude
1 parent 7302b4a commit 9e9e986

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default defineConfig([
2+
safeAlign, {
3+
rules: {
4+
// 'n/no-unsupported-features/node-builtins': 'off',
5+
},
6+
},
7+
]);
8+

packages/plugin-eslint/lib/remove-useless-properties/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const fix = (path) => {
2323

2424
export const traverse = ({push}) => ({
2525
ObjectExpression(path) {
26+
if (path.node.innerComments)
27+
return;
28+
2629
if (path.node.properties.length)
2730
return;
2831

packages/plugin-eslint/lib/remove-useless-properties/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ test('eslint: remove-useless-properties: report', (t) => {
1313
t.end();
1414
});
1515

16+
test('eslint: remove-useless-properties: no report: comments', (t) => {
17+
t.noReport('comments');
18+
t.end();
19+
});
20+
1621
test('eslint: remove-useless-properties: transform', (t) => {
1722
t.transform('remove-useless-properties');
1823
t.end();

0 commit comments

Comments
 (0)