robatwilliams / es-compat

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

Use underlying plugin's prototype detection rules instead of custom no-restricted-syntax #73

Closed robatwilliams closed 5 months ago

robatwilliams commented 1 year ago

Various usages of no-restricted-syntax via ruleOptionsUtil.js to be replaced by specific plugin rules.

I don't remember why I ever wrote a custom rule for this, maybe to only use the underlying plugin where necessary. This plugin can't stand without that plugin, so may as well go all-in.

https://eslint-plugin-es.mysticatea.dev/#the-aggressive-mode needs enabling on a per-rule basis, as done for some of the ES2023 rules.

2022: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-string-prototype-at.html

2021: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-string-prototype-replaceall.html

2020: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-string-prototype-matchall.html

2019: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-flat.html https://eslint-community.github.io/eslint-plugin-es-x/rules/no-string-prototype-trimstart-trimend.html https://eslint-community.github.io/eslint-plugin-es-x/rules/no-symbol-prototype-description.html

2018: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-promise-prototype-finally.html

2017: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-string-prototype-padstart-padend.html

2016: https://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-includes.html

robatwilliams commented 5 months ago

Update es-versions.md too

robatwilliams commented 5 months ago

This isn't worth the hassle and breaking changes (to the plugin options and aggressiveness) - see comments on PR

robatwilliams commented 4 months ago

This has been split into #98 and #99