Yury Solovyov
Yury Solovyov

Reputation: 515

Make ESLint check usage of buildins unavailable in configured environment

Is it possible to make ESLint warn/error when it encounters usage of globals that are known to not exist in environment set in config, and assuming there are no polyfills?

E.g. usage of Object.values or Object.assign in ES5 env.

Upvotes: 1

Views: 32

Answers (1)

btmills
btmills

Reputation: 4542

If you're targeting the browser, try eslint-plugin-compat. If you're using Node.js, eslint-plugin-node's no-unsupported-features rule will handle this.

Upvotes: 1

Related Questions