forked from ember-cli/eslint-plugin-ember
-
Notifications
You must be signed in to change notification settings - Fork 0
/
no-proxies.js
41 lines (35 loc) · 1.18 KB
/
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
38
39
40
41
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const rule = require('../../../lib/rules/no-proxies');
const RuleTester = require('eslint').RuleTester;
const { ERROR_MESSAGE } = rule;
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
const ruleTester = new RuleTester({
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
});
ruleTester.run('no-proxies', rule, {
valid: [
"import ANYTHING from '@ember/object';",
"import { ANYTHING } from '@ember/object';",
"import ObjectProxy from 'something/else';",
"import { ObjectProxy } from 'something/else';",
],
invalid: [
{
code: "import ObjectProxy from '@ember/object/proxy';",
output: null,
errors: [{ message: ERROR_MESSAGE, type: 'ImportDeclaration' }],
},
{
code: "import ArrayProxy from '@ember/array/proxy';",
output: null,
errors: [{ message: ERROR_MESSAGE, type: 'ImportDeclaration' }],
},
],
});