Skip to content

Commit f63e4a0

Browse files
authored
ESLint plugin: Enable wp global by default in the recommended config (#16904)
1 parent e2c01f7 commit f63e4a0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.eslintrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module.exports = {
2626
plugins: [
2727
'import',
2828
],
29+
globals: {
30+
wp: 'off',
31+
},
2932
rules: {
3033
'@wordpress/react-no-unsafe-timeout': 'error',
3134
'no-restricted-syntax': [
@@ -126,9 +129,9 @@ module.exports = {
126129
browser: true,
127130
},
128131
globals: {
129-
browser: true,
130-
page: true,
131-
wp: true,
132+
browser: 'readonly',
133+
page: 'readonly',
134+
wp: 'readonly',
132135
},
133136
},
134137
],

packages/eslint-plugin/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
### New Features
99

1010
- 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)
11+
- Enable `wp` global by default in the `recommended` config.
1112

1213
## 2.4.0 (2019-08-05)
1314

packages/eslint-plugin/configs/recommended.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ module.exports = {
1212
globals: {
1313
window: true,
1414
document: true,
15+
wp: 'readonly',
1516
},
1617
};

0 commit comments

Comments
 (0)