Skip to content

Commit 820c88f

Browse files
feat: add names to configurations
Name is optional but useful in error messages and the config inspector. It's not supported by old eslintrc, but since we don't support eslintrc, we're fine to add it.
1 parent 8f9cb1d commit 820c88f

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

src/configs/recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { TSESLint } from '@typescript-eslint/utils';
33
export const createRecommendedConfig = (
44
plugin: TSESLint.FlatConfig.Plugin,
55
) => ({
6+
name: 'rxjs-x/recommended' as const,
67
plugins: {
78
'rxjs-x': plugin,
89
},

src/configs/strict.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { TSESLint } from '@typescript-eslint/utils';
33
export const createStrictConfig = (
44
plugin: TSESLint.FlatConfig.Plugin,
55
) => ({
6+
name: 'rxjs-x/strict' as const,
67
plugins: {
78
'rxjs-x': plugin,
89
},

tests/configs/recommended.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ describe('recommended', () => {
1414
expect(ruleEntry).toEqual('error');
1515
}
1616
});
17+
18+
it('should be named', () => {
19+
expect(config.name).toEqual('rxjs-x/recommended');
20+
});
1721
});

tests/configs/strict.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ describe('strict', () => {
1616
expect(config.rules).toHaveProperty(rule);
1717
}
1818
});
19+
20+
it('should be named', () => {
21+
expect(config.name).toEqual('rxjs-x/strict');
22+
});
1923
});

0 commit comments

Comments
 (0)