Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/eslint-plugin-react-hooks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {Linter, Rule} from 'eslint';
import type { Linter, Rule } from 'eslint';

import ExhaustiveDeps from './rules/ExhaustiveDeps';
import {
Expand Down Expand Up @@ -50,15 +50,18 @@ const recommendedRuleConfigs: Linter.RulesRecord = {
...basicRuleConfigs,
...recommendedCompilerRuleConfigs,
};

const recommendedLatestRuleConfigs: Linter.RulesRecord = {
...basicRuleConfigs,
...recommendedLatestCompilerRuleConfigs,
};

const plugins = ['react-hooks'];
const plugins = ['react-hooks'] as const;

type ReactHooksFlatConfig = {
plugins: {react: any};
plugins: {
'react-hooks': unknown;
};
rules: Linter.RulesRecord;
};

Expand Down Expand Up @@ -88,11 +91,11 @@ const plugin = {

Object.assign(configs.flat, {
'recommended-latest': {
plugins: {'react-hooks': plugin},
plugins: { 'react-hooks': plugin },
rules: configs['recommended-latest'].rules,
},
recommended: {
plugins: {'react-hooks': plugin},
plugins: { 'react-hooks': plugin },
rules: configs.recommended.rules,
},
});
Expand Down
Loading