mattcg / language-tags

A Swiss Army knife for language tags.
63 stars 13 forks source link

Getting lint error in latest version of language-tags #15

Closed manju-s closed 1 year ago

manju-s commented 1 year ago

Hey Matt, After the release of version 1.0.6 eslint is picking up a Syntax error which is casuing our build to fail (screenshot below). When i lock the version to 1.0.5, the error goes away. Can you please look into it, or suggest a fix if it can be done from the consumer side. Thanks

image
mattcg commented 1 year ago

Hi manju, thanks for filing. I'm not really sure why this is an issue because static class fields are part of the ECMAScript standard. It seems that jshint is missing support for them even though they're standard. See: jshint/jshint/issues/3139

In the meantime it might make sense to exclude /node_modules from your linter.

enkhtulga commented 1 year ago

Any update for it? How to resolve it?

enkhtulga commented 1 year ago

@manju-s did you resolve the issue?

mattcg commented 1 year ago

I added an eslint config block to the package config file and bumped the version to 1.0.7 on npm. Can you retest? I no longer get any errors with eslint lib/.

manju-s commented 1 year ago

I added an eslint config block to the package config file and bumped the version to 1.0.7 on npm. Can you retest? I no longer get any errors with eslint lib/.

image

Still getting the same error Matt

mattcg commented 1 year ago

I guess that's because your linter isn't picking up the block in language-tags/package.json.

Shouldn't your linter configuration be ignoring the node_modules/ directory? Sure you only want to lint your own code and not that of third party modules?

Alternatively, if you also want to lint node_modules/, you'll have to set "ecmaVersion": 13 in your eslint configuration.

Unless you do that, there's nothing more I can do to fix this issue.

manju-s commented 1 year ago

I guess that's because your linter isn't picking up the block in language-tags/package.json.

Shouldn't your linter configuration be ignoring the node_modules/ directory? Sure you only want to lint your own code and not that of third party modules?

Alternatively, if you also want to lint node_modules/, you'll have to set "ecmaVersion": 13 in your eslint configuration.

Unless you do that, there's nothing more I can do to fix this issue.

Yes Matt, node_modules is added in eslintignore but for some reason it isn't working. Anyway, thanks for the help, please update if any additional fixes are made.

afc163 commented 1 year ago

https://github.com/cnpm/bug-versions/pull/217/files

language-tags 1.0.6 and 1.0.7 cannot work on node version like 1.0.5. Is it a better way to release a major version?

mattcg commented 1 year ago

Which nodejs version are you saying it doesn’t work in?

ljharb commented 1 year ago

@mattcg this is a breaking change in a patch version. v1.0.5 works in node 6; v1.0.6 does not (for example, becuase of the spread operator - babel could fix this for you). This breaks eslint-plugin-jsx-a11y.

Can you please publish a v1.0.8 that restores these node versions, and if you like, publish a v2 that drops them?

ljharb commented 1 year ago

ping @mattcg; there's still a breaking change in a patch version in v1.0.6 and v1.0.7.

mattcg commented 1 year ago

Wait, why would anyone be running node 6?

ljharb commented 1 year ago

All of my packages support as far back as possible, most down to node 0.4, but that’s irrelevant - semver applies to engine support. If you want to drop node 6 in a major, that’s fine, but not in a patch.

mattcg commented 1 year ago

Makes sense. How do you recommend to fix this?

ljharb commented 1 year ago

I suspect if you adjust your babel config to target the lowest version of node that language-tags v1 supports - which since it lacks an engines declaration, is basically 0.4 or 0.6 - that it'd Just Work without any source code changes.

ljharb commented 1 year ago

@mattcg are you interested in a PR for this? eslint-plugin-jsx-a11y is still pinned to v1.0.5.

mattcg commented 1 year ago

Yes. For sure!On 12 Aug 2023, at 00:35, Jordan Harband @.***> wrote: @mattcg are you interested in a PR for this? eslint-plugin-jsx-a11y is still pinned to v1.0.5.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

ljharb commented 1 year ago

@mattcg awesome! first is #17; once that's landed i'll put up one that adds babel.

ljharb commented 1 year ago

17 → #18 → #19