robatwilliams / es-compat

Check JavaScript code compatibility with target runtime environments
MIT License
65 stars 13 forks source link

Compare versions correctly (fixes #30) #45

Closed lamansky closed 2 years ago

lamansky commented 2 years ago

eslint-plugin-ecmascript-compat currently compares version number strings with the >= operator, which only works if each component (major/minor/patch) of both version strings is the same number of digits, making the plugin unusable in many cases. (For example, the plugin currently evaluates 9.0.0 as being a higher version number than 10.0.0.) This patch adds proper version comparison.