forked from ember-cli/eslint-plugin-ember
-
Notifications
You must be signed in to change notification settings - Fork 0
/
no-proxies.js
36 lines (31 loc) · 890 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
'use strict';
const ERROR_MESSAGE = 'Do not use array or object proxies.';
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
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, ERROR_MESSAGE);
}
},
};
},
};