Skip to content

Commit 2084ba1

Browse files
committed
fix(eslint-plugin-nestjs-tools): use correct rule name and add recommended config
1 parent 5101cb6 commit 2084ba1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/eslint-plugin/src/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ const { name, version } = require('../package.json') as {
99
version: string;
1010
};
1111

12-
export default {
12+
export = {
1313
meta: {
1414
name,
1515
version,
1616
},
1717
rules: { [returnClassInstanceName]: returnClassInstance },
18+
configs: {
19+
recommended: {
20+
parser: '@typescript-eslint/parser',
21+
rules: {
22+
[`${name}/${returnClassInstanceName}`]: 'error',
23+
},
24+
},
25+
},
1826
} satisfies Linter.Plugin;

packages/eslint-plugin/src/lib/return-class-instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable max-lines-per-function */
22
import { ESLintUtils } from '@typescript-eslint/utils';
33

4-
export const RULE_NAME = '@getlarge/eslint-plugin-nestjs-tools/return-class-instance';
4+
export const RULE_NAME = 'return-class-instance';
55

66
const getTypeNameFromReturnType = (rawReturnType: string) => {
77
return rawReturnType.replaceAll(/Promise<([^<>]*)>/g, '$1').replace(': ', '');

0 commit comments

Comments
 (0)