playwright-community / eslint-plugin-playwright

ESLint plugin for Playwright
https://www.npmjs.com/package/eslint-plugin-playwright
MIT License
281 stars 39 forks source link

Flat config types with typescript #299

Closed Slessi closed 4 months ago

Slessi commented 4 months ago

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 };
github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: