Target specific presets
ai opened this issue · 8 comments
plugin:es5/no-es2015
presets are great. But we could go further.
Main problem with ES2015+ features is compatibility problems. So let’s create a preset based on browsers, node version. Like: plugin:es5/ie
, plugin:es5/modern-browsers
(only Edge), plugin:es5/node4
.
This preset is useful, but also they will show plugin benefits in better way from your docs. Best docs is a code example. And preset in code example shows why this plugin is useful and should be installed.
@ai I guess the best way for this plugin - to be like babel-preset-env, but in linting stage.
Browserslist support will be so awesome!
But we could start from some manually targets and then add dynamic one. Anyway we will need this ie
list of rules.
People want node4
preset ;) https://twitter.com/jon_neal/status/819910992100462592
Yes, if they are writing for Node v4 LTS compatibility, this would be very helpful.
Any more thoughts on implementing this? I need to support W8.1/IE11 and had a Math.log10 usage sneak past code review. We rely on linters to catch unsupported features so this plugin is a big help. Would like to have something similar to https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features.md but against ES5 supported features not Node version.
I had a look at https://github.com/amilajack/eslint-plugin-compat and it might do what I am needing. It uses @ai 's Browserslist so that's pretty cool.