@wordpress/eslint-plugin 9.1.2-next.5df0cd52b7.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,50 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## 9.1.1-next.0 (2021-08-17)
5
+ ## 10.0.0 (2022-01-27)
6
+
7
+ ### Breaking Changes
8
+
9
+ - The peer dependency constraint for ESLint has been updated from `^6 || ^7` to `^8`.
10
+ - The bundled `@typescript-eslint/eslint-plugin` dependency has been updated from requiring `^4.31.0` to requiring `^5.3.0` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
11
+ - The bundled `@typescript-eslint/parser` dependency has been updated from requiring `^4.31.0` to requiring `^5.3.0` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
12
+ - The bundled `eslint-config-prettier` dependency has been updated from requiring `^7.1.0` to requiring `^8.3.0` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
13
+ - The bundled `eslint-plugin-jest` dependency has been updated from requiring `^24.1.3` to requiring `^25.2.3` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
14
+ - The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^36.0.8` to requiring `^37.0.3` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
15
+ - The bundled `globals` dependency has been updated from requiring `^12.0.0` to requiring `^13.12.0` ([#36283](https://github.com/WordPress/gutenberg/pull/36283)).
16
+
17
+ ### Enhancement
18
+
19
+ - Omit verification for WordPress dependencies in the import statements since they get externalized when used with WordPress ([#37639](https://github.com/WordPress/gutenberg/pull/37639)).
20
+
21
+ ### Bug Fix
22
+
23
+ - Fix Babel config resolution when a custom ESLint config present ([#37406](https://github.com/WordPress/gutenberg/pull/37406)). Warning: it won't recognize the `babel.config.json` file present in the project until the upstream bug in `cosmiconfig` is fixed.
24
+
25
+ ## 9.3.0 (2021-11-15)
26
+
27
+ ### Enhancements
28
+
29
+ - Replaced deprecated `babel-eslint` dependency with `@babel/eslint-parser` ([#36244](https://github.com/WordPress/gutenberg/pull/36244)).
30
+ - The bundled `eslint-plugin-import` dependency has been updated from requiring `^2.23.4` to requiring `^2.25.2` ([#36244](https://github.com/WordPress/gutenberg/pull/36244)).
31
+
32
+ ## 9.2.0 (2021-10-12)
33
+
34
+ ### Enhancement
35
+
36
+ - The bundled `eslint-plugin-jsdoc` dependency has been updated from requiring `^34.1.0` to requiring `^36.0.8` ([#34338](https://github.com/WordPress/gutenberg/pull/34338)).
37
+
38
+ ### Bug Fix
39
+
40
+ - Use Jest related rules only when the `jest` package is installed ([#33120](https://github.com/WordPress/gutenberg/pull/33120)).
41
+
42
+ ## 9.1.2 (2021-09-09)
43
+
44
+ ### Bug Fix
45
+
46
+ - The recommended configuration will now respect `type` imports in TypeScript files ([#34055](https://github.com/WordPress/gutenberg/pull/34055)).
47
+
48
+ ## 9.1.1 (2021-08-23)
6
49
 
7
50
  ### Bug Fix
8
51
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2021 by the contributors
3
+ Copyright 2016-2022 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
package/README.md CHANGED
@@ -63,8 +63,9 @@ The granular rulesets will not define any environment globals. As such, if they
63
63
  | [gutenberg-phase](docs/rules/gutenberg-phase.md) | Governs the use of the `process.env.GUTENBERG_PHASE` constant | ✓ |
64
64
  | [no-base-control-with-label-without-id](/packages/eslint-plugin/docs/rules/no-base-control-with-label-without-id.md) | Disallow the usage of BaseControl component with a label prop set but omitting the id property | ✓ |
65
65
  | [no-unguarded-get-range-at](/packages/eslint-plugin/docs/rules/no-unguarded-get-range-at.md) | Disallow the usage of unguarded `getRangeAt` calls | ✓ |
66
+ | [no-unsafe-wp-apis](/packages/eslint-plugin/docs/rules/no-unsafe-wp-apis.md) | Disallow the usage of unsafe APIs from `@wordpress/*` packages | ✓ |
66
67
  | [no-unused-vars-before-return](/packages/eslint-plugin/docs/rules/no-unused-vars-before-return.md) | Disallow assigning variable values if unused before a return | ✓ |
67
- | [react-no-unsafe-timeout](/packages/eslint-plugin/docs/rules/react-no-unsafe-timeout.md) | Disallow unsafe `setTimeout` in component |
68
+ | [react-no-unsafe-timeout](/packages/eslint-plugin/docs/rules/react-no-unsafe-timeout.md) | Disallow unsafe `setTimeout` in component | |
68
69
  | [valid-sprintf](/packages/eslint-plugin/docs/rules/valid-sprintf.md) | Enforce valid sprintf usage | ✓ |
69
70
  | [i18n-ellipsis](/packages/eslint-plugin/docs/rules/i18n-ellipsis.md) | Disallow using three dots in translatable strings | ✓ |
70
71
  | [i18n-no-collapsible-whitespace](/packages/eslint-plugin/docs/rules/i18n-no-collapsible-whitespace.md) | Disallow collapsible whitespace in translatable strings | ✓ |
package/configs/custom.js CHANGED
@@ -6,7 +6,6 @@ module.exports = {
6
6
  '@wordpress/no-unguarded-get-range-at': 'error',
7
7
  '@wordpress/no-global-active-element': 'error',
8
8
  '@wordpress/no-global-get-selection': 'error',
9
- '@wordpress/no-global-event-listener': 'warn',
10
9
  '@wordpress/no-unsafe-wp-apis': 'error',
11
10
  },
12
11
  overrides: [
@@ -25,13 +24,7 @@ module.exports = {
25
24
  rules: {
26
25
  '@wordpress/no-global-active-element': 'off',
27
26
  '@wordpress/no-global-get-selection': 'off',
28
- '@wordpress/no-global-event-listener': 'off',
29
27
  },
30
28
  },
31
29
  ],
32
- settings: {
33
- react: {
34
- version: '16.6',
35
- },
36
- },
37
30
  };
package/configs/esnext.js CHANGED
@@ -1,11 +1,17 @@
1
- module.exports = {
1
+ /**
2
+ * External dependencies
3
+ */
4
+ const { cosmiconfigSync } = require( 'cosmiconfig' );
5
+
6
+ const config = {
7
+ parser: '@babel/eslint-parser',
8
+ parserOptions: {
9
+ sourceType: 'module',
10
+ },
2
11
  env: {
3
12
  es6: true,
4
13
  },
5
14
  extends: [ require.resolve( './es5.js' ) ],
6
- parserOptions: {
7
- sourceType: 'module',
8
- },
9
15
  rules: {
10
16
  // Disable ES5-specific (extended from ES5)
11
17
  'vars-on-top': 'off',
@@ -45,3 +51,18 @@ module.exports = {
45
51
  'template-curly-spacing': [ 'error', 'always' ],
46
52
  },
47
53
  };
54
+
55
+ // It won't recognize the `babel.config.json` file used in the project until the upstream bug in `cosmiconfig` is fixed:
56
+ // https://github.com/davidtheclark/cosmiconfig/issues/246.
57
+ const result = cosmiconfigSync( 'babel' ).search();
58
+ if ( ! result || ! result.filepath ) {
59
+ config.parserOptions = {
60
+ ...config.parserOptions,
61
+ requireConfigFile: false,
62
+ babelOptions: {
63
+ presets: [ require.resolve( '@wordpress/babel-preset-default' ) ],
64
+ },
65
+ };
66
+ }
67
+
68
+ module.exports = config;
package/configs/jsdoc.js CHANGED
@@ -105,6 +105,11 @@ module.exports = {
105
105
  'jsdoc/require-param-description': 'off',
106
106
  'jsdoc/require-returns': 'off',
107
107
  'jsdoc/require-yields': 'off',
108
+ 'jsdoc/tag-lines': 'off',
109
+ 'jsdoc/no-multi-asterisks': [
110
+ 'error',
111
+ { preventAtMiddleLines: false },
112
+ ],
108
113
  'jsdoc/check-access': 'error',
109
114
  'jsdoc/check-alignment': 'error',
110
115
  'jsdoc/check-line-alignment': [
package/configs/react.js CHANGED
@@ -6,7 +6,9 @@ module.exports = {
6
6
  },
7
7
  },
8
8
  settings: {
9
- 'import/extensions': [ '.js', '.jsx' ],
9
+ react: {
10
+ version: 'detect',
11
+ },
10
12
  },
11
13
  plugins: [ '@wordpress', 'react', 'react-hooks' ],
12
14
  rules: {
@@ -1,5 +1,12 @@
1
- module.exports = {
2
- parser: 'babel-eslint',
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ const { isPackageInstalled } = require( '../utils' );
5
+
6
+ // Exclude bundled WordPress packages from the list.
7
+ const wpPackagesRegExp = '^@wordpress/(?!(icons|interface))';
8
+
9
+ const config = {
3
10
  extends: [
4
11
  require.resolve( './jsx-a11y.js' ),
5
12
  require.resolve( './custom.js' ),
@@ -16,6 +23,10 @@ module.exports = {
16
23
  document: true,
17
24
  wp: 'readonly',
18
25
  },
26
+ settings: {
27
+ 'import/internal-regex': wpPackagesRegExp,
28
+ 'import/extensions': [ '.js', '.jsx' ],
29
+ },
19
30
  rules: {
20
31
  'import/no-extraneous-dependencies': [
21
32
  'error',
@@ -23,11 +34,19 @@ module.exports = {
23
34
  peerDependencies: true,
24
35
  },
25
36
  ],
26
- 'import/no-unresolved': 'error',
37
+ 'import/no-unresolved': [
38
+ 'error',
39
+ {
40
+ ignore: [ wpPackagesRegExp ],
41
+ },
42
+ ],
27
43
  'import/default': 'warn',
28
44
  'import/named': 'warn',
29
45
  },
30
- overrides: [
46
+ };
47
+
48
+ if ( isPackageInstalled( 'jest' ) ) {
49
+ config.overrides = [
31
50
  {
32
51
  // Unit test files and their helpers only.
33
52
  files: [ '**/@(test|__tests__)/**/*.js', '**/?(*.)test.js' ],
@@ -38,5 +57,7 @@ module.exports = {
38
57
  files: [ '**/specs/**/*.js', '**/?(*.)spec.js' ],
39
58
  extends: [ require.resolve( './test-e2e.js' ) ],
40
59
  },
41
- ],
42
- };
60
+ ];
61
+ }
62
+
63
+ module.exports = config;
@@ -21,7 +21,6 @@ const config = {
21
21
  extends: [
22
22
  require.resolve( './recommended-with-formatting.js' ),
23
23
  'plugin:prettier/recommended',
24
- 'prettier/react',
25
24
  ],
26
25
  rules: {
27
26
  'prettier/prettier': [ 'error', prettierConfig ],
@@ -35,15 +34,17 @@ if ( isPackageInstalled( 'typescript' ) ) {
35
34
  extensions: [ '.js', '.jsx', '.ts', '.tsx' ],
36
35
  },
37
36
  },
38
- 'import/core-modules': [ 'react' ],
39
37
  };
40
38
  config.extends.push( 'plugin:@typescript-eslint/eslint-recommended' );
41
39
  config.ignorePatterns = [ '**/*.d.ts' ];
40
+ config.plugins = [ '@typescript-eslint' ];
42
41
  config.overrides = [
43
42
  {
44
43
  files: [ '**/*.ts', '**/*.tsx' ],
45
44
  parser: '@typescript-eslint/parser',
46
45
  rules: {
46
+ 'no-duplicate-imports': 'off',
47
+ '@typescript-eslint/no-duplicate-imports': 'error',
47
48
  // Don't require redundant JSDoc types in TypeScript files.
48
49
  'jsdoc/require-param-type': 'off',
49
50
  'jsdoc/require-returns-type': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/eslint-plugin",
3
- "version": "9.1.2-next.5df0cd52b7.0",
3
+ "version": "10.0.0",
4
4
  "description": "ESLint plugin for WordPress development.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,26 +31,28 @@
31
31
  ],
32
32
  "main": "index.js",
33
33
  "dependencies": {
34
- "@typescript-eslint/eslint-plugin": "^4.15.0",
35
- "@typescript-eslint/parser": "^4.15.0",
36
- "@wordpress/prettier-config": "^1.1.1-next.5df0cd52b7.0",
37
- "babel-eslint": "^10.1.0",
34
+ "@babel/eslint-parser": "^7.16.0",
35
+ "@typescript-eslint/eslint-plugin": "^5.3.0",
36
+ "@typescript-eslint/parser": "^5.3.0",
37
+ "@wordpress/babel-preset-default": "^6.5.0",
38
+ "@wordpress/prettier-config": "^1.1.1",
38
39
  "cosmiconfig": "^7.0.0",
39
- "eslint-config-prettier": "^7.1.0",
40
- "eslint-plugin-import": "^2.23.4",
41
- "eslint-plugin-jest": "^24.1.3",
42
- "eslint-plugin-jsdoc": "^34.1.0",
43
- "eslint-plugin-jsx-a11y": "^6.4.1",
40
+ "eslint-config-prettier": "^8.3.0",
41
+ "eslint-plugin-import": "^2.25.2",
42
+ "eslint-plugin-jest": "^25.2.3",
43
+ "eslint-plugin-jsdoc": "^37.0.3",
44
+ "eslint-plugin-jsx-a11y": "^6.5.1",
44
45
  "eslint-plugin-prettier": "^3.3.0",
45
- "eslint-plugin-react": "^7.22.0",
46
- "eslint-plugin-react-hooks": "^4.2.0",
47
- "globals": "^12.0.0",
46
+ "eslint-plugin-react": "^7.27.0",
47
+ "eslint-plugin-react-hooks": "^4.3.0",
48
+ "globals": "^13.12.0",
48
49
  "prettier": "npm:wp-prettier@2.2.1-beta-1",
49
50
  "requireindex": "^1.2.0"
50
51
  },
51
52
  "peerDependencies": {
52
- "eslint": "^6 || ^7",
53
- "typescript": "^4"
53
+ "@babel/core": ">=7",
54
+ "eslint": ">=8",
55
+ "typescript": ">=4"
54
56
  },
55
57
  "peerDependenciesMeta": {
56
58
  "typescript": {
@@ -60,5 +62,5 @@
60
62
  "publishConfig": {
61
63
  "access": "public"
62
64
  },
63
- "gitHead": "558d577d12bec15f05e694eb49a094836d885cca"
65
+ "gitHead": "d95ccb9366e249133cdb1d7b25c382446b9ee502"
64
66
  }
@@ -17,24 +17,25 @@ const ruleTester = new RuleTester( {
17
17
 
18
18
  const valid = [
19
19
  // Callback functions
20
- `import { createRegistrySelector } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; createRegistrySelector(( select ) => { select(store); });`,
21
- `import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; useSelect(( select ) => { select(store); });`,
22
- `import { withSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withSelect(( select ) => { select(store); });`,
23
- `import { withDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withDispatch(( select ) => { select(store); });`,
24
- `import { withDispatch as withDispatchAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withDispatchAlias(( select ) => { select(store); });`,
20
+ `import { createRegistrySelector } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; createRegistrySelector(( select ) => { select(coreStore); });`,
21
+ `import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; useSelect(( select ) => { select(coreStore); });`,
22
+ `import { withSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withSelect(( select ) => { select(coreStore); });`,
23
+ `import { withDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withDispatch(( select ) => { select(coreStore); });`,
24
+ `import { withDispatch as withDispatchAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; withDispatchAlias(( select ) => { select(coreStore); });`,
25
25
 
26
26
  // Direct function calls
27
- `import { useDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; useDispatch( store );`,
28
- `import { dispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; dispatch( store );`,
29
- `import { select } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; select( store );`,
30
- `import { resolveSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; resolveSelect( store );`,
31
- `import { resolveSelect as resolveSelectAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; resolveSelectAlias( store );`,
27
+ `import { useDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; useDispatch( coreStore );`,
28
+ `import { dispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; dispatch( coreStore );`,
29
+ `import { useSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; useSelect( coreStore );`,
30
+ `import { select } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; select( coreStore );`,
31
+ `import { resolveSelect } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; resolveSelect( coreStore );`,
32
+ `import { resolveSelect as resolveSelectAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; resolveSelectAlias( coreStore );`,
32
33
 
33
34
  // Object property function calls
34
- `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.select( store );`,
35
- `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.dispatch( store );`,
36
- `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.resolveSelect( store );`,
37
- `import { controls as controlsAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controlsAlias.resolveSelect( store );`,
35
+ `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.select( coreStore );`,
36
+ `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.dispatch( coreStore );`,
37
+ `import { controls } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controls.resolveSelect( coreStore );`,
38
+ `import { controls as controlsAlias } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; controlsAlias.resolveSelect( coreStore );`,
38
39
  ];
39
40
 
40
41
  const createSuggestionTestCase = ( code, output ) => ( {
@@ -63,6 +64,7 @@ const invalid = [
63
64
  // Direct function calls
64
65
  `import { useDispatch } from '@wordpress/data'; useDispatch( 'core' );`,
65
66
  `import { dispatch } from '@wordpress/data'; dispatch( 'core' );`,
67
+ `import { useSelect } from '@wordpress/data'; useSelect( 'core' );`,
66
68
  `import { select } from '@wordpress/data'; select( 'core' );`,
67
69
  `import { resolveSelect } from '@wordpress/data'; resolveSelect( 'core' );`,
68
70
  `import { resolveSelect as resolveSelectAlias } from '@wordpress/data'; resolveSelectAlias( 'core' );`,
@@ -78,9 +78,13 @@ function collectAllNodesFromDirectFunctionCalls( context, node ) {
78
78
  const specifiers = node.specifiers.filter(
79
79
  ( specifier ) =>
80
80
  specifier.imported &&
81
- [ 'useDispatch', 'dispatch', 'select', 'resolveSelect' ].includes(
82
- specifier.imported.name
83
- )
81
+ [
82
+ 'useDispatch',
83
+ 'dispatch',
84
+ 'useSelect',
85
+ 'select',
86
+ 'resolveSelect',
87
+ ].includes( specifier.imported.name )
84
88
  );
85
89
  const references = getReferences( context, specifiers );
86
90
  const possibleCallExpressionNodes = references
@@ -194,6 +198,7 @@ function getFixes( fixer, context, callNode ) {
194
198
  module.exports = {
195
199
  meta: {
196
200
  type: 'problem',
201
+ hasSuggestions: true,
197
202
  schema: [],
198
203
  messages: {
199
204
  doNotUseStringLiteral: `Do not use string literals ( '{{ argument }}' ) for accessing @wordpress/data stores. Pass the store definition instead`,
@@ -1,70 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { RuleTester } from 'eslint';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import rule from '../no-global-event-listener';
10
-
11
- const ruleTester = new RuleTester( {
12
- parserOptions: {
13
- ecmaVersion: 6,
14
- },
15
- } );
16
-
17
- ruleTester.run( 'no-global-event-listener', rule, {
18
- valid: [
19
- {
20
- code: 'ownerDocument.addEventListener();',
21
- },
22
- {
23
- code: 'ownerDocument.removeEventListener();',
24
- },
25
- {
26
- code: 'defaultView.addEventListener();',
27
- },
28
- {
29
- code: 'defaultView.removeEventListener();',
30
- },
31
- ],
32
- invalid: [
33
- {
34
- code: 'document.addEventListener();',
35
- errors: [
36
- {
37
- message:
38
- 'Avoid using (add|remove)EventListener with globals. Use `ownerDocument` or `ownerDocument.defaultView` on a node ref instead.',
39
- },
40
- ],
41
- },
42
- {
43
- code: 'document.removeEventListener();',
44
- errors: [
45
- {
46
- message:
47
- 'Avoid using (add|remove)EventListener with globals. Use `ownerDocument` or `ownerDocument.defaultView` on a node ref instead.',
48
- },
49
- ],
50
- },
51
- {
52
- code: 'window.addEventListener();',
53
- errors: [
54
- {
55
- message:
56
- 'Avoid using (add|remove)EventListener with globals. Use `ownerDocument` or `ownerDocument.defaultView` on a node ref instead.',
57
- },
58
- ],
59
- },
60
- {
61
- code: 'window.removeEventListener();',
62
- errors: [
63
- {
64
- message:
65
- 'Avoid using (add|remove)EventListener with globals. Use `ownerDocument` or `ownerDocument.defaultView` on a node ref instead.',
66
- },
67
- ],
68
- },
69
- ],
70
- } );
@@ -1,35 +0,0 @@
1
- module.exports = {
2
- meta: {
3
- type: 'problem',
4
- schema: [],
5
- },
6
- create( context ) {
7
- return {
8
- CallExpression( node ) {
9
- const { callee } = node;
10
- const { object, property } = callee;
11
-
12
- if ( ! object || ! property ) {
13
- return;
14
- }
15
-
16
- if ( object.name !== 'document' && object.name !== 'window' ) {
17
- return;
18
- }
19
-
20
- if (
21
- property.name !== 'addEventListener' &&
22
- property.name !== 'removeEventListener'
23
- ) {
24
- return;
25
- }
26
-
27
- context.report( {
28
- node,
29
- message:
30
- 'Avoid using (add|remove)EventListener with globals. Use `ownerDocument` or `ownerDocument.defaultView` on a node ref instead.',
31
- } );
32
- },
33
- };
34
- },
35
- };