From 5d78e9bd41d9aebbeccc6621b2482880bd8f6690 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Mon, 5 Aug 2019 16:50:55 +0200 Subject: [PATCH] ESLint plugin: Enable `wp` global by default in the `recommended` config --- .eslintrc.js | 9 ++++++--- packages/eslint-plugin/CHANGELOG.md | 1 + packages/eslint-plugin/configs/recommended.js | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2a6ad63b1eafc..49fb16807f356 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,6 +22,9 @@ module.exports = { 'plugin:@wordpress/eslint-plugin/recommended', 'plugin:jest/recommended', ], + globals: { + wp: 'off', + }, rules: { '@wordpress/react-no-unsafe-timeout': 'error', 'no-restricted-syntax': [ @@ -112,9 +115,9 @@ module.exports = { browser: true, }, globals: { - browser: true, - page: true, - wp: true, + browser: 'readonly', + page: 'readonly', + wp: 'readonly', }, }, ], diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index b8693b5eef709..e4ede1fbe0435 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -7,6 +7,7 @@ ### New Features - New Rule: [`@wordpress/no-unguarded-get-range-at`](https://github.com/WordPress/gutenberg/blob/master/packages/eslint-plugin/docs/rules/no-unguarded-get-range-at.md) +- Enable `wp` global by default in the `recommended` config. ## 2.4.0 (2019-08-05) diff --git a/packages/eslint-plugin/configs/recommended.js b/packages/eslint-plugin/configs/recommended.js index f7c264684ecaf..5aaead8880681 100644 --- a/packages/eslint-plugin/configs/recommended.js +++ b/packages/eslint-plugin/configs/recommended.js @@ -12,5 +12,6 @@ module.exports = { globals: { window: true, document: true, + wp: 'readonly', }, };