Skip to content

Commit

Permalink
fix: improve types for flat configs
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Apr 1, 2024
1 parent e55596c commit 68e6450
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/flat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ import stylistic from "#eslint-plugin-functional/configs/stylistic";
import { rules } from "#eslint-plugin-functional/rules";
import { __VERSION__ } from "#eslint-plugin-functional/utils/constants";

const functional = {
meta: {
name: "eslint-plugin-functional",
version: __VERSION__,
} as const,
const meta = {
name: "eslint-plugin-functional",
version: __VERSION__,
} as const;

const functional: FlatConfig.Plugin = {
meta,
rules,
} satisfies Omit<FlatConfig.Plugin, "configs">;
};

const configs = {
all: { plugins: { functional }, rules: all },
Expand Down Expand Up @@ -54,7 +56,11 @@ const configs = {
stylistic: { plugins: { functional }, rules: stylistic },
} satisfies Record<string, FlatConfig.Config>;

export default {
...functional,
configs,
} as const;
// eslint-disable-next-line functional/immutable-data, functional/no-expression-statements
functional.configs = configs;

export default functional as FlatConfig.Plugin & {
meta: typeof meta;
rules: typeof rules;
configs: typeof configs;
};

0 comments on commit 68e6450

Please sign in to comment.