From 8f9cb1d9ed5e3f4af4ba8546e903c0acc468b9c0 Mon Sep 17 00:00:00 2001 From: Jason Weinzierl Date: Tue, 3 Dec 2024 11:04:05 -0600 Subject: [PATCH 1/2] chore: add keywords per by eslint.org eslint.org recommends adding eslint, eslintplugin, and eslint-plugin keywords to plugin npm packages. --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 915cd7ec..5bc7ab39 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "lint", "rules", "eslint", + "eslintplugin", + "eslint-plugin", "rxjs" ], "sideEffects": false, From 820c88f85314cd54b8e3e405023b3d2a3ab19100 Mon Sep 17 00:00:00 2001 From: Jason Weinzierl Date: Tue, 3 Dec 2024 11:12:46 -0600 Subject: [PATCH 2/2] 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. --- src/configs/recommended.ts | 1 + src/configs/strict.ts | 1 + tests/configs/recommended.test.ts | 4 ++++ tests/configs/strict.test.ts | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/src/configs/recommended.ts b/src/configs/recommended.ts index 5f6e53fd..c29e47a7 100644 --- a/src/configs/recommended.ts +++ b/src/configs/recommended.ts @@ -3,6 +3,7 @@ import { TSESLint } from '@typescript-eslint/utils'; export const createRecommendedConfig = ( plugin: TSESLint.FlatConfig.Plugin, ) => ({ + name: 'rxjs-x/recommended' as const, plugins: { 'rxjs-x': plugin, }, diff --git a/src/configs/strict.ts b/src/configs/strict.ts index 9d685ade..aca1e482 100644 --- a/src/configs/strict.ts +++ b/src/configs/strict.ts @@ -3,6 +3,7 @@ import { TSESLint } from '@typescript-eslint/utils'; export const createStrictConfig = ( plugin: TSESLint.FlatConfig.Plugin, ) => ({ + name: 'rxjs-x/strict' as const, plugins: { 'rxjs-x': plugin, }, diff --git a/tests/configs/recommended.test.ts b/tests/configs/recommended.test.ts index f52dcc6f..27e2fa5c 100644 --- a/tests/configs/recommended.test.ts +++ b/tests/configs/recommended.test.ts @@ -14,4 +14,8 @@ describe('recommended', () => { expect(ruleEntry).toEqual('error'); } }); + + it('should be named', () => { + expect(config.name).toEqual('rxjs-x/recommended'); + }); }); diff --git a/tests/configs/strict.test.ts b/tests/configs/strict.test.ts index cd213fc4..0e393d20 100644 --- a/tests/configs/strict.test.ts +++ b/tests/configs/strict.test.ts @@ -16,4 +16,8 @@ describe('strict', () => { expect(config.rules).toHaveProperty(rule); } }); + + it('should be named', () => { + expect(config.name).toEqual('rxjs-x/strict'); + }); });