mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
958 stars 167 forks source link

'import()' expressions are not supported yet inconsistency #349

Open electriquo opened 1 year ago

electriquo commented 1 year ago

When running ESLint, I get

error  'import()' expressions are not supported yet  node/no-unsupported-features/es-syntax

Where import() is compatible since Node.js 13.2.0 and I am using Node.js 18.15.0

$ cat package.json | jq '.engines'
{
  "node": ">=18.15.0",
  "npm": ">=9.6.0"
}

The error seems to be false negative. Is this a bug or did is my configuration the issue?

robatwilliams commented 1 year ago

I have what seems to be the same issue - "Import and export declarations are not supported yet". Using v11.1.1 of this plugin.

Engines is "node": "^14.18.0 || >=16.0.0".

Even if I put an override comment at the top of a specific file to configure the version, I still get the error.

robatwilliams commented 1 year ago

There's a big map of features and versions supported since here. There is null in it for this particular feature.

https://github.com/mysticatea/eslint-plugin-node/blob/master/lib/rules/no-unsupported-features.js#L263

The message I'm getting though is "Import and export declarations are not supported yet", which comes from here https://github.com/mysticatea/eslint-plugin-node/blob/master/lib/rules/no-unsupported-features/es-syntax.js#L577. no-modules is an es-plugin-es feature by the same maintainer.

voxpelli commented 10 months ago

eslint-plugin-n is the maintained version of this module.

We switched to it in eg. eslint-config-standard / standard and it is maintained by me and other members of the official ESLint community organization.

electriquo commented 10 months ago

eslint-plugin-n is the maintained version of this module.

@voxpelli do you mean that eslint-plugin-n should be used instead of eslint-plugin-node?

voxpelli commented 10 months ago

@foolioo exactly 🙂