Skip to content

Commit 4b72915

Browse files
refactor: no wildcard import, no as unknown
1 parent 9b12e6e commit 4b72915

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/configs/recommended.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import type * as eslint from 'eslint';
1+
import type { ESLint, Linter } from 'eslint';
22

33
export const createRecommendedConfig = (
4-
plugin: eslint.ESLint.Plugin,
4+
plugin: ESLint.Plugin,
55
) => ({
66
name: 'rxjs-x/recommended' as const,
77
plugins: {
8-
'rxjs-x': plugin as unknown as eslint.ESLint.Plugin,
8+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
9+
'rxjs-x': plugin as ESLint.Plugin,
910
},
1011
rules: {
1112
'rxjs-x/no-async-subscribe': 'error',
@@ -29,4 +30,4 @@ export const createRecommendedConfig = (
2930
'rxjs-x/prefer-root-operators': 'error',
3031
'rxjs-x/throw-error': 'error',
3132
},
32-
} satisfies eslint.Linter.Config);
33+
} satisfies Linter.Config);

src/configs/strict.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import type * as eslint from 'eslint';
1+
import type { ESLint, Linter } from 'eslint';
22

33
export const createStrictConfig = (
4-
plugin: eslint.ESLint.Plugin,
4+
plugin: ESLint.Plugin,
55
) => ({
66
name: 'rxjs-x/strict' as const,
77
plugins: {
8-
'rxjs-x': plugin as unknown as eslint.ESLint.Plugin,
8+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
9+
'rxjs-x': plugin as ESLint.Plugin,
910
},
1011
rules: {
1112
'rxjs-x/no-async-subscribe': 'error',
@@ -40,4 +41,4 @@ export const createStrictConfig = (
4041
allowThrowingUnknown: false as const,
4142
}],
4243
},
43-
} satisfies eslint.Linter.Config);
44+
} satisfies Linter.Config);

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as eslint from 'eslint';
1+
import type { ESLint } from 'eslint';
22
import { name, version } from '../package.json';
33
import { createRecommendedConfig } from './configs/recommended';
44
import { createStrictConfig } from './configs/strict';
@@ -98,14 +98,14 @@ const plugin = {
9898
'suffix-subjects': suffixSubjectsRule,
9999
'throw-error': throwErrorRule,
100100
},
101-
} satisfies eslint.ESLint.Plugin;
101+
} satisfies ESLint.Plugin;
102102

103103
const rxjsX = {
104104
...plugin,
105105
configs: {
106106
recommended: createRecommendedConfig(plugin),
107107
strict: createStrictConfig(plugin),
108108
},
109-
} satisfies eslint.ESLint.Plugin;
109+
} satisfies ESLint.Plugin;
110110

111111
export default rxjsX;

0 commit comments

Comments
 (0)