Skip to content

Flat config types with typescript #299

Closed
@Slessi

Description

@Slessi

README says to do:

import playwright from 'eslint-plugin-playwright';

export default [
  {
    ...playwright.configs['flat/recommended'],

However I'm getting:

Property 'configs' does not exist on type 'typeof import("/Users/edward/Projects/frontend/node_modules/eslint-plugin-playwright/dist/index")'.

Maybe because I used require since I'm using CJS still? 🤷

const playwright = require('eslint-plugin-playwright');

module.exports = [
  {
    ...playwright.configs['flat/recommended'], // error

Are the docs wrong or the types wrong? Should I be doing playwright.default.configs['flat/recommended']? As the dist/index.d.ts has:

import * as eslint from 'eslint';

declare const _default: { /*stuff*/ };

export { _default as default };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions