Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support defineConfig of ESLint, instead of tseslint.config #998

Copy link
Copy link
@ldrick

Description

@ldrick
Issue body actions

Suggestion

See tseslint.config() is deprecated:
https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated

It is recommended to setup plugins with defineConfig of eslint.

Trying to setup this plugin the recommended way results in:

Type 'EslintPluginFunctional' is not assignable to type 'Plugin'.
Types of property 'configs' are incompatible.
Type 'SharedConfigs & Readonly<{ all: Config; lite: Config; recommended: Config; strict: Config; off: Config; disableTypeChecked: Config; ... 7 more ...; stylistic: Config; }>' is not assignable to type 'Record<string, ConfigObject | LegacyConfigObject<RulesConfig, RulesConfig> | ConfigObject[]> | undefined'.ts(2322)

What I did (extraction from eslint.config.js):

// @ts-check

import functionalPlugin from 'eslint-plugin-functional';
import { defineConfig } from 'eslint/config';
import typescriptEslint from 'typescript-eslint';

export default defineConfig(
	// register all of the plugins upfront
	{
		plugins: {
			['@typescript-eslint']: typescriptEslint.plugin,
			// @ts-expect-error not compatible to use defineConfig
			['functional']: functionalPlugin,
		},
	},
        // many more configuration ...
);
paulcyr and nakanoasaservice

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis issue needs to be triaged.This issue needs to be triaged.Type: IdeaMarks an idea, which might be accepted and implemented.Marks an idea, which might be accepted and implemented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.