From 4bef436e13b1a7300f786d0a2056b465aeccbd50 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Fri, 27 Nov 2020 14:03:56 +0100 Subject: [PATCH] Add new rule to recommended --- .eslintrc.js | 1 + packages/eslint-plugin/CHANGELOG.md | 4 ++++ packages/eslint-plugin/configs/custom.js | 1 + 3 files changed, 6 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 6d841c60444bed..3ebed48f03c79a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -54,6 +54,7 @@ module.exports = { allowedTextDomain: 'default', }, ], + '@wordpress/no-unsafe-wp-apis': 'off', 'no-restricted-syntax': [ 'error', // NOTE: We can't include the forward slash in our regex or diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 794cde5a388552..7ed757c2ec00c7 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking Changes + +- Add `no-unsafe-wp-apis` to recommended rules ([#27327](https://github.com/WordPress/gutenberg/pull/27327)). + ### New Feature - Add `no-unsafe-wp-apis` rule to discourage usage of unsafe APIs ([#27301](https://github.com/WordPress/gutenberg/pull/27301)). diff --git a/packages/eslint-plugin/configs/custom.js b/packages/eslint-plugin/configs/custom.js index bd3d2db3b7429e..8964c5e5b82fc7 100644 --- a/packages/eslint-plugin/configs/custom.js +++ b/packages/eslint-plugin/configs/custom.js @@ -7,6 +7,7 @@ module.exports = { '@wordpress/no-global-active-element': 'error', '@wordpress/no-global-get-selection': 'error', '@wordpress/no-global-event-listener': 'warn', + '@wordpress/no-unsafe-wp-apis': 'error', }, overrides: [ {