Skip to content

fix: Rename default export playwright - #483

Closed
regseb wants to merge 1 commit into
mskelton:mainfrom
regseb:patch-1
Closed

fix: Rename default export playwright#483
regseb wants to merge 1 commit into
mskelton:mainfrom
regseb:patch-1

Conversation

@regseb

@regseb regseb commented Aug 1, 2026

Copy link
Copy Markdown

When importing the default export, it's recommended to use the same name as the exported variable (cf. import-x/no-rename-default).

This package exports a variable named plugin. With the following file:

import { defineConfig } from '@eslint/config'
import playwright from 'eslint-plugin-playwright'

export default defineConfig([
  {
    files: ['tests/**'],
    extends: [playwright.configs['flat/recommended']],
    rules: {
      // Customize Playwright rules
      // ...
    },
  },
])

ESLint and import-x/no-rename-default report this error:

Caution: index.js has a default export plugin. This imports plugin as playwright. Check if you meant to write import plugin from 'eslint-plugin-playwright' instead.


With this pull request, we will be able to use the name playwright.

@mskelton

mskelton commented Aug 2, 2026

Copy link
Copy Markdown
Owner

This is silly, it doesn't matter what the name inside of the code is since it's a default export

@mskelton mskelton closed this Aug 2, 2026
@regseb
regseb deleted the patch-1 branch August 24, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants