-
-
Notifications
You must be signed in to change notification settings - Fork 204
/
no-proxies.js
37 lines (32 loc) · 951 Bytes
/
no-proxies.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
const ERROR_MESSAGE = 'Do not use array or object proxies.';
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow using array or object proxies',
category: 'Ember Object',
recommended: false,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-proxies.md',
},
fixable: null,
schema: [],
},
ERROR_MESSAGE,
create(context) {
return {
ImportDeclaration(node) {
if (
node.source.value === '@ember/object/proxy' ||
node.source.value === '@ember/array/proxy'
) {
context.report({ node, message: ERROR_MESSAGE });
}
},
};
},
};