I try to update own eslint config to altest version and get error on Travis:
TypeError: classes.includes is not a function
at /path/to/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js:27:20
at Array.some (native)
at /path/to/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js:26:45
at Array.filter (native)
at Object.<anonymous> (/path/to/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js:24:44)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
includes not support on this versions http://node.green/#ES2016 :sob:
We should use https://www.npmjs.com/package/array-includes for this.
@ljharb maybe use babel-preset-env https://github.com/babel/babel-preset-env be good solution, avoid next same error?
Babel transpiles syntax, not API; and running babel-polyfill in production is not really a good idea.
babel-preset-env can't know in foo.includes when foo is an array or not, so it'd have to polyfill.
@ljharb
Babel transpiles syntax, not API; and running babel-polyfill in production is not really a good idea.
just interesting, why? Wherever I used it, there was never a problem
It's not spec-compliant in subtle ways and it contains regenerator-runtime, which is slow.
@ljharb should we use https://www.npmjs.com/package/array-includes in src/index.js or just where we use this method in lib/util/isInteractiveElement.js
Why not use something like lodash?
@evilebottnawi just where it's used, in isInteractiveElement.
@jadengore because array-includes is spec-compliant, and will use the native method when available, and can be removed easily when node 4 support is dropped.