eslint-plugin-big-react-app-plugin 0.1.3 → 0.1.5
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/lib/rules/public-api-imports.js +25 -11
- package/package.json +2 -1
- package/tests/lib/rules/public-api-imports.js +3 -2
- package/.history/.gitignore_20251018083109 +0 -0
- package/.history/.gitignore_20251018083124 +0 -1
- package/.history/lib/helpers/index_20251018083334.js +0 -0
- package/.history/lib/helpers/index_20251018083357.js +0 -6
- package/.history/lib/helpers/index_20251018083414.js +0 -6
- package/.history/lib/helpers/index_20251018083417.js +0 -6
- package/.history/lib/helpers/index_20251018083618.js +0 -6
- package/.history/lib/helpers/index_20251018092620.js +0 -6
- package/.history/lib/helpers/index_20251018092627.js +0 -6
- package/.history/lib/rules/path-checker_20250906110609.js +0 -76
- package/.history/lib/rules/path-checker_20251016170231.js +0 -76
- package/.history/lib/rules/path-checker_20251016170238.js +0 -76
- package/.history/lib/rules/path-checker_20251016170240.js +0 -76
- package/.history/lib/rules/path-checker_20251016170512.js +0 -76
- package/.history/lib/rules/path-checker_20251016170543.js +0 -78
- package/.history/lib/rules/path-checker_20251016170608.js +0 -81
- package/.history/lib/rules/path-checker_20251016170627.js +0 -81
- package/.history/lib/rules/path-checker_20251016170714.js +0 -81
- package/.history/lib/rules/path-checker_20251016170716.js +0 -83
- package/.history/lib/rules/path-checker_20251016170723.js +0 -84
- package/.history/lib/rules/path-checker_20251016170726.js +0 -84
- package/.history/lib/rules/path-checker_20251016170750.js +0 -85
- package/.history/lib/rules/path-checker_20251016170808.js +0 -85
- package/.history/lib/rules/path-checker_20251016170811.js +0 -85
- package/.history/lib/rules/path-checker_20251016170821.js +0 -85
- package/.history/lib/rules/path-checker_20251016170941.js +0 -86
- package/.history/lib/rules/path-checker_20251016170953.js +0 -86
- package/.history/lib/rules/path-checker_20251016171234.js +0 -87
- package/.history/lib/rules/path-checker_20251016171235.js +0 -87
- package/.history/lib/rules/path-checker_20251016171244.js +0 -87
- package/.history/lib/rules/path-checker_20251016192227.js +0 -89
- package/.history/lib/rules/path-checker_20251016192245.js +0 -89
- package/.history/lib/rules/path-checker_20251018083151.js +0 -89
- package/.history/lib/rules/path-checker_20251018083710.js +0 -87
- package/.history/lib/rules/public-api-imports_20251018083042.js +0 -44
- package/.history/lib/rules/public-api-imports_20251018083211.js +0 -50
- package/.history/lib/rules/public-api-imports_20251018083235.js +0 -43
- package/.history/lib/rules/public-api-imports_20251018083244.js +0 -51
- package/.history/lib/rules/public-api-imports_20251018083454.js +0 -51
- package/.history/lib/rules/public-api-imports_20251018083640.js +0 -40
- package/.history/lib/rules/public-api-imports_20251018083748.js +0 -42
- package/.history/lib/rules/public-api-imports_20251018083818.js +0 -42
- package/.history/lib/rules/public-api-imports_20251018084540.js +0 -41
- package/.history/lib/rules/public-api-imports_20251018084843.js +0 -44
- package/.history/lib/rules/public-api-imports_20251018084847.js +0 -44
- package/.history/lib/rules/public-api-imports_20251018084906.js +0 -44
- package/.history/lib/rules/public-api-imports_20251018084913.js +0 -43
- package/.history/lib/rules/public-api-imports_20251018085014.js +0 -48
- package/.history/lib/rules/public-api-imports_20251018085807.js +0 -48
- package/.history/lib/rules/public-api-imports_20251018090400.js +0 -58
- package/.history/lib/rules/public-api-imports_20251018091033.js +0 -60
- package/.history/lib/rules/public-api-imports_20251018092312.js +0 -61
- package/.history/lib/rules/public-api-imports_20251018092340.js +0 -62
- package/.history/package_20250906110616.json +0 -32
- package/.history/package_20251016192249.json +0 -32
- package/.history/package_20251018085916.json +0 -32
- package/.history/package_20251018090415.json +0 -32
- package/.history/package_20251018091504.json +0 -32
- package/.history/package_20251018092723.json +0 -32
- package/.history/tests/lib/rules/path-checker_20250906083402.js +0 -31
- package/.history/tests/lib/rules/path-checker_20251016165925.js +0 -33
- package/.history/tests/lib/rules/path-checker_20251016170059.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170109.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170128.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170147.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170208.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170246.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170253.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170255.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170323.js +0 -34
- package/.history/tests/lib/rules/path-checker_20251016170411.js +0 -38
- package/.history/tests/lib/rules/path-checker_20251016170459.js +0 -38
- package/.history/tests/lib/rules/path-checker_20251016171025.js +0 -43
- package/.history/tests/lib/rules/path-checker_20251016171041.js +0 -43
- package/.history/tests/lib/rules/path-checker_20251016171053.js +0 -43
- package/.history/tests/lib/rules/path-checker_20251016171136.js +0 -42
- package/.history/tests/lib/rules/path-checker_20251016171410.js +0 -44
- package/.history/tests/lib/rules/public-api-imports_20251018083042.js +0 -31
- package/.history/tests/lib/rules/public-api-imports_20251018085128.js +0 -34
- package/.history/tests/lib/rules/public-api-imports_20251018085249.js +0 -34
- package/.history/tests/lib/rules/public-api-imports_20251018085350.js +0 -40
- package/.history/tests/lib/rules/public-api-imports_20251018085726.js +0 -36
- package/.history/tests/lib/rules/public-api-imports_20251018090807.js +0 -86
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview feature sliced relative path checker
|
|
3
|
-
* @author Vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/path-checker"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("path-checker", rule, {
|
|
23
|
-
valid: [
|
|
24
|
-
{
|
|
25
|
-
code: "import { HStack } from '../../../Stack/HStack/HStack'",
|
|
26
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
27
|
-
errors: [],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
invalid: [
|
|
32
|
-
// {
|
|
33
|
-
// code: "import { HStack } from 'shared/ui/Stack/index'",
|
|
34
|
-
// filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
35
|
-
// errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
36
|
-
// },
|
|
37
|
-
{
|
|
38
|
-
code: "import { HStack } from '@/shared/ui/Stack/index'",
|
|
39
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
40
|
-
errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview feature sliced relative path checker
|
|
3
|
-
* @author Vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/path-checker"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("path-checker", rule, {
|
|
23
|
-
valid: [
|
|
24
|
-
{
|
|
25
|
-
code: "import { HStack } from '../../../Stack/HStack/HStack'",
|
|
26
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
27
|
-
errors: [],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
invalid: [
|
|
32
|
-
{
|
|
33
|
-
code: "import { HStack } from 'shared/ui/Stack/index'",
|
|
34
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
35
|
-
errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
code: "import { HStack } from '@/shared/ui/Stack/index'",
|
|
39
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
40
|
-
errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview feature sliced relative path checker
|
|
3
|
-
* @author Vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/path-checker"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("path-checker", rule, {
|
|
23
|
-
valid: [
|
|
24
|
-
{
|
|
25
|
-
code: "import { HStack } from '../../../Stack/HStack/HStack'",
|
|
26
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
27
|
-
errors: [],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
invalid: [
|
|
32
|
-
{
|
|
33
|
-
code: "import { HStack } from 'shared/ui/Stack/index'",
|
|
34
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
35
|
-
errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
36
|
-
options:[{
|
|
37
|
-
alias:'@'
|
|
38
|
-
}]
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview feature sliced relative path checker
|
|
3
|
-
* @author Vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/path-checker"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("path-checker", rule, {
|
|
23
|
-
valid: [
|
|
24
|
-
{
|
|
25
|
-
code: "import { HStack } from '../../../Stack/HStack/HStack'",
|
|
26
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
27
|
-
errors: [],
|
|
28
|
-
},
|
|
29
|
-
],
|
|
30
|
-
|
|
31
|
-
invalid: [
|
|
32
|
-
{
|
|
33
|
-
code: "import { HStack } from 'shared/ui/Stack/index'",
|
|
34
|
-
filename:'C:\\Users\\ADMIN\\Documents\\GitHub\\ulbi\big-react-app\\src\\shared\\ui\\Popups\\ui\\ListBox\\ListBox.tsx',
|
|
35
|
-
errors: [{ message: "В рамках одного слайса все пути должны быть относительными" }],
|
|
36
|
-
options:[
|
|
37
|
-
{
|
|
38
|
-
alias:'@'
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
],
|
|
44
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview description
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester();
|
|
20
|
-
ruleTester.run("public-api-imports", rule, {
|
|
21
|
-
valid: [
|
|
22
|
-
// give me some code that won't trigger a warning
|
|
23
|
-
],
|
|
24
|
-
|
|
25
|
-
invalid: [
|
|
26
|
-
{
|
|
27
|
-
code: "",
|
|
28
|
-
errors: [{ message: "Fill me in.", type: "Me too" }],
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview description
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("public-api-imports", rule, {
|
|
23
|
-
|
|
24
|
-
valid: [
|
|
25
|
-
// give me some code that won't trigger a warning
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
invalid: [
|
|
29
|
-
{
|
|
30
|
-
code: "",
|
|
31
|
-
errors: [{ message: "Fill me in.", type: "Me too" }],
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview public API path checker
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
ruleTester.run("public-api-imports", rule, {
|
|
23
|
-
|
|
24
|
-
valid: [
|
|
25
|
-
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
invalid: [
|
|
29
|
-
{
|
|
30
|
-
code: "",
|
|
31
|
-
errors: [{ message: "Fill me in.", type: "Me too" }],
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview public API path checker
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const aliasOptions = [
|
|
24
|
-
{
|
|
25
|
-
alias:'@'
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
ruleTester.run("public-api-imports", rule, {
|
|
29
|
-
|
|
30
|
-
valid: [
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
|
|
34
|
-
invalid: [
|
|
35
|
-
{
|
|
36
|
-
code: "",
|
|
37
|
-
errors: [{ message: "Fill me in.", type: "Me too" }],
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview public API path checker
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions:{ecmaVersion:6, sourceType:'module'}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ruleTester.run("public-api-imports", rule, {
|
|
25
|
-
|
|
26
|
-
valid: [
|
|
27
|
-
|
|
28
|
-
],
|
|
29
|
-
|
|
30
|
-
invalid: [
|
|
31
|
-
{
|
|
32
|
-
code: "",
|
|
33
|
-
errors: [{ message: "Fill me in.", type: "Me too" }],
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview public API path checker
|
|
3
|
-
* @author vasilii
|
|
4
|
-
*/
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
//------------------------------------------------------------------------------
|
|
8
|
-
// Requirements
|
|
9
|
-
//------------------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
|
-
RuleTester = require("eslint").RuleTester;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
//------------------------------------------------------------------------------
|
|
16
|
-
// Tests
|
|
17
|
-
//------------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
const ruleTester = new RuleTester({
|
|
20
|
-
parserOptions: {ecmaVersion: 6, sourceType: 'module'}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const aliasOptions = [
|
|
24
|
-
{
|
|
25
|
-
alias: '@'
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
ruleTester.run("public-api-imports", rule, {
|
|
30
|
-
valid: [
|
|
31
|
-
{
|
|
32
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '../../model/slices/addCommentFormSlice'",
|
|
33
|
-
errors: [],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article'",
|
|
37
|
-
errors: [],
|
|
38
|
-
options: aliasOptions,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
filename: 'C:\\Users\\tim\\Desktop\\javascript\\production_project\\src\\entities\\file.test.ts',
|
|
42
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article/testing'",
|
|
43
|
-
errors: [],
|
|
44
|
-
options: [{
|
|
45
|
-
alias: '@',
|
|
46
|
-
testFilesPatterns: ['**/*.test.ts', '**/*.test.ts', '**/StoreDecorator.tsx']
|
|
47
|
-
}],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
filename: 'C:\\Users\\tim\\Desktop\\javascript\\production_project\\src\\entities\\StoreDecorator.tsx',
|
|
51
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article/testing'",
|
|
52
|
-
errors: [],
|
|
53
|
-
options: [{
|
|
54
|
-
alias: '@',
|
|
55
|
-
testFilesPatterns: ['**/*.test.ts', '**/*.test.ts', '**/StoreDecorator.tsx']
|
|
56
|
-
}],
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
|
|
60
|
-
invalid: [
|
|
61
|
-
{
|
|
62
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article/model/file.ts'",
|
|
63
|
-
errors: [{ message: "Абсолютный импорт разрешен только из Public API (index.ts)"}],
|
|
64
|
-
options: aliasOptions,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
filename: 'C:\\Users\\tim\\Desktop\\javascript\\production_project\\src\\entities\\StoreDecorator.tsx',
|
|
68
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article/testing/file.tsx'",
|
|
69
|
-
errors: [{message: 'Абсолютный импорт разрешен только из Public API (index.ts)'}],
|
|
70
|
-
options: [{
|
|
71
|
-
alias: '@',
|
|
72
|
-
testFilesPatterns: ['**/*.test.ts', '**/*.test.ts', '**/StoreDecorator.tsx']
|
|
73
|
-
}],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
filename: 'C:\\Users\\tim\\Desktop\\javascript\\production_project\\src\\entities\\forbidden.ts',
|
|
77
|
-
code: "import { addCommentFormActions, addCommentFormReducer } from '@/entities/Article/testing'",
|
|
78
|
-
errors: [{message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'}],
|
|
79
|
-
options: [{
|
|
80
|
-
alias: '@',
|
|
81
|
-
testFilesPatterns: ['**/*.test.ts', '**/*.test.ts', '**/StoreDecorator.tsx']
|
|
82
|
-
}],
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
});
|
|
86
|
-
|