un-ts / eslint-plugin-import-x

`eslint-plugin-import-x` is a fork of `eslint-plugin-import` that aims to provide a more performant and more lightweight version of the original plugin.
https://npm.im/eslint-plugin-import-x
MIT License
431 stars 19 forks source link

sourceType 'module' is not supported when ecmaVersion < 2015 #185

Open vladshcherbin opened 3 days ago

vladshcherbin commented 3 days ago

Hey 👋

I for the love of god can't understand what's this error. Even the simplest config gives it:

import js from '@eslint/js'
import eslintPluginImportX from 'eslint-plugin-import-x'

export default [
  js.configs.recommended,
  eslintPluginImportX.flatConfigs.recommended,
  {
    rules: {
      'comma-dangle': ['error', 'never'],
      'semi': ['error', 'never']
    }
  }
]

I've tried different setting configurations and language options with no luck.

image

node - 22.10.0 eslint - 9.15.0 eslint-plugin-import-x - 4.4.2

reproduction - https://github.com/vladshcherbin/eslint-import script - pnpm lint or pnpm eslint

SukkaW commented 2 days ago

@vladshcherbin I will look into this! I suspect https://github.com/un-ts/eslint-plugin-import-x/pull/181 is related.

huynhducduy commented 7 hours ago

Some other packages that I find having the same issue:

@eslint-react/eslint-plugin@1.16.1
@tanstack/eslint-plugin-query@5.60.1
eslint-config-flat-gitignore@0.3.0
eslint-plugin-i18next@6.1.0
eslint-plugin-no-use-extend-native@0.7.2
eslint-plugin-react-compiler@19.0.0-beta-8a03594-20241020
eslint-plugin-vitest@0.5.4
typescript-eslint@8.15.0
SukkaW commented 1 hour ago

cc @vladshcherbin @huynhducduy

I have created a PR #186 to fix the issue!