Skip to content

Commit c3b3b33

Browse files
feat: add name to each configuration (#75)
- Add `name` to recommended and strict configurations. Enforce via unit test. - Also add more keywords to the npm package as recommended by eslint.org. [Configuration name is optional but recommended](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-naming-conventions). The old eslintrc format does not support name, but since we don't support eslintrc, we're ok to add `name`.
1 parent 598a2ea commit c3b3b33

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"lint",
1919
"rules",
2020
"eslint",
21+
"eslintplugin",
22+
"eslint-plugin",
2123
"rxjs"
2224
],
2325
"sideEffects": false,

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)