ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

update the lowest supported node version? #1669

Closed jimmywarting closed 2 years ago

jimmywarting commented 2 years ago

The linting and newest version of xo on a old codebase is a little... meh it clearly have fallen behind in the amount of things it yields about.

One of the thing i settled on was the features we use, and the targeted node.js version.

npm run lint | grep "the configured version range is >=6.4.0 <13 || >=14."
  ✖    74:5   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    78:5   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    82:5   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    86:5   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖   792:7   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖   827:7   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    30:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    56:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    13:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖   143:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    11:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    76:9   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    13:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    70:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    30:3   The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    31:3   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax
  ✖    12:53  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    52:28  Rest/spread properties are not supported until Node.js 8.3.0. The configured version range is >=6.4.0 <13 || >=14.                                               node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    12:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    12:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    14:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    35:11  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    16:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    18:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    17:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    12:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    13:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    11:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    22:18  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    10:10  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    13:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖     9:1   Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    12:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    15:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖     6:17  The http2 is not supported until Node.js 10.10.0 (backported: ^8.13.0). The configured version range is >=6.4.0 <13 || >=14.                                     node/no-unsupported-features/node-builtins
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖     9:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    11:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    10:10  Async functions are not supported until Node.js 7.6.0. The configured version range is >=6.4.0 <13 || >=14.                                                      node/no-unsupported-features/es-syntax
  ✖    67:5   The omission of catch binding is not supported until Node.js 10.0.0. The configured version range is >=6.4.0 <13 || >=14.                                        node/no-unsupported-features/es-syntax

what do you say about setting it to something more modern like >=12 ? v12 is ending it's long time support pretty soon now in April

niftylettuce commented 2 years ago

There's no reason why we shouldn't support older versions especially with the help of Babel.

I turned most of those lint errors to warnings via rules override, and for the ones you shared that are node/no-unsupported-features/es-syntax, it is due to the linter not respecting engines having multiple versions specified (obviously it's a bug).

Ref: https://github.com/mysticatea/eslint-plugin-node/issues/315

jimmywarting commented 2 years ago

couldn't we disabled the node/no-unsupported-features/es-syntax rule then if babel takes care of compiling any new es feature we may use then?

niftylettuce commented 2 years ago

I tried to disable that rule but it didn't work for me when I tried. Not sure if you want to go down that rabbit hole.