eslint-plugin-big-react-app-plugin 0.1.6 → 0.1.8

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.
Files changed (36) hide show
  1. package/.history/lib/rules/public-api-imports_20251029144637.js +74 -0
  2. package/.history/lib/rules/public-api-imports_20251029144640.js +75 -0
  3. package/.history/lib/rules/public-api-imports_20251029144926.js +75 -0
  4. package/.history/lib/rules/public-api-imports_20251029144953.js +75 -0
  5. package/.history/lib/rules/public-api-imports_20251029145009.js +75 -0
  6. package/.history/lib/rules/public-api-imports_20251029145022.js +75 -0
  7. package/.history/lib/rules/public-api-imports_20251029145049.js +75 -0
  8. package/.history/lib/rules/public-api-imports_20251030070810.js +76 -0
  9. package/.history/lib/rules/public-api-imports_20251030070822.js +76 -0
  10. package/.history/package_20251029164755.json +33 -0
  11. package/.history/package_20251030070953.json +33 -0
  12. package/.history/tests/lib/rules/path-checker_19851026131459.js +44 -0
  13. package/.history/tests/lib/rules/path-checker_20251029145043.js +44 -0
  14. package/.history/tests/lib/rules/path-checker_20251029145120.js +44 -0
  15. package/.history/tests/lib/rules/path-checker_20251029145122.js +44 -0
  16. package/.history/tests/lib/rules/path-checker_20251029145130.js +44 -0
  17. package/.history/tests/lib/rules/path-checker_20251029145140.js +44 -0
  18. package/.history/tests/lib/rules/path-checker_20251030070901.js +44 -0
  19. package/.history/tests/lib/rules/public-api-imports_20251028164324.js +87 -0
  20. package/.history/tests/lib/rules/public-api-imports_20251029145051.js +87 -0
  21. package/.history/tests/lib/rules/public-api-imports_20251029145116.js +87 -0
  22. package/.history/tests/lib/rules/public-api-imports_20251029145250.js +87 -0
  23. package/.history/tests/lib/rules/public-api-imports_20251029145328.js +96 -0
  24. package/.history/tests/lib/rules/public-api-imports_20251029145415.js +96 -0
  25. package/.history/tests/lib/rules/public-api-imports_20251029145417.js +96 -0
  26. package/.history/tests/lib/rules/public-api-imports_20251029145434.js +96 -0
  27. package/.history/tests/lib/rules/public-api-imports_20251029150710.js +96 -0
  28. package/.history/tests/lib/rules/public-api-imports_20251029150715.js +96 -0
  29. package/.history/tests/lib/rules/public-api-imports_20251029150734.js +96 -0
  30. package/.history/tests/lib/rules/public-api-imports_20251029150749.js +96 -0
  31. package/.history/tests/lib/rules/public-api-imports_20251029153345.js +96 -0
  32. package/.history/tests/lib/rules/public-api-imports_20251029153548.js +96 -0
  33. package/.history/tests/lib/rules/public-api-imports_20251030070849.js +96 -0
  34. package/lib/rules/public-api-imports.js +4 -3
  35. package/package.json +1 -1
  36. package/tests/lib/rules/public-api-imports.js +9 -0
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ module.exports = {
5
+ meta: {
6
+ type: null,
7
+ docs: {
8
+ description: "description",
9
+ category: "Fill me in",
10
+ recommended: false,
11
+ url: null,
12
+ },
13
+ fixable: null,
14
+ schema: [
15
+ {
16
+ type: 'object',
17
+ properties: {
18
+ alias: {
19
+ type: 'string'
20
+ },
21
+ testFilesPatterns: {
22
+ type: 'array'
23
+ }
24
+ }
25
+ }
26
+ ],
27
+ },
28
+
29
+
30
+ create(context) {
31
+ const checkingLayers = {
32
+ "entities":"entities",
33
+ "features":"features",
34
+ "pages":"pages",
35
+ "widgets":"widgets",
36
+ }
37
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
38
+ return {
39
+ ImportDeclaration(node) {
40
+ // example app/entities/Article
41
+ const value = node.source.value;
42
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
43
+ //если путь относительный то выходим
44
+ if(isPathRelative(importTo)){
45
+ return;
46
+ }
47
+ //[enteties, article, ... далее еще что-то может быть]
48
+ const segments = importTo.split('/')
49
+ const layer = segments[0]//получаем слой
50
+ // проверяем что есть слой из массива
51
+
52
+ //[enteties, article, testing]
53
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
54
+
55
+ if(!checkingLayers[layer]){
56
+ return;
57
+ }
58
+ const isImportNotFromPublicApi = segments.length > 2;
59
+
60
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
61
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
62
+ }
63
+
64
+ if(isTestingPublicApi){
65
+ const currentFilePath = context.getFilename();
66
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
67
+ if(!isCurrentFileTesting){
68
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
69
+ }
70
+ }
71
+ }
72
+ };
73
+ },
74
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
68
+ if(!isCurrentFileTesting){
69
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
70
+ }
71
+ }
72
+ }
73
+ };
74
+ },
75
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const normalizedPath = path.normalize(currentFilePath).replace(/\\/g, '/')
68
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(currentFilePath, pattern))
69
+ if(!isCurrentFileTesting){
70
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
71
+ }
72
+ }
73
+ }
74
+ };
75
+ },
76
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ const micromatch = require("micromatch");
3
+ const {isPathRelative} = require("../helpers")
4
+ const path = require("path");
5
+ module.exports = {
6
+ meta: {
7
+ type: null,
8
+ docs: {
9
+ description: "description",
10
+ category: "Fill me in",
11
+ recommended: false,
12
+ url: null,
13
+ },
14
+ fixable: null,
15
+ schema: [
16
+ {
17
+ type: 'object',
18
+ properties: {
19
+ alias: {
20
+ type: 'string'
21
+ },
22
+ testFilesPatterns: {
23
+ type: 'array'
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ },
29
+
30
+
31
+ create(context) {
32
+ const checkingLayers = {
33
+ "entities":"entities",
34
+ "features":"features",
35
+ "pages":"pages",
36
+ "widgets":"widgets",
37
+ }
38
+ const {alias='', testFilesPatterns=[]} = context.options[0] ?? {};
39
+ return {
40
+ ImportDeclaration(node) {
41
+ // example app/entities/Article
42
+ const value = node.source.value;
43
+ const importTo = alias ? value.replace(`${alias}/`, "") : value;
44
+ //если путь относительный то выходим
45
+ if(isPathRelative(importTo)){
46
+ return;
47
+ }
48
+ //[enteties, article, ... далее еще что-то может быть]
49
+ const segments = importTo.split('/')
50
+ const layer = segments[0]//получаем слой
51
+ // проверяем что есть слой из массива
52
+
53
+ //[enteties, article, testing]
54
+ const isTestingPublicApi = segments[2] === 'testing' && segments.length < 4;
55
+
56
+ if(!checkingLayers[layer]){
57
+ return;
58
+ }
59
+ const isImportNotFromPublicApi = segments.length > 2;
60
+
61
+ if(isImportNotFromPublicApi && !isTestingPublicApi ) {
62
+ context.report({node: node, message: 'Абсолютный импорт разрешен только из Public API (index.ts)'});
63
+ }
64
+
65
+ if(isTestingPublicApi){
66
+ const currentFilePath = context.getFilename();
67
+ const normalizedPath = path.normalize(currentFilePath).replace(/\\/g, '/')
68
+ const isCurrentFileTesting = testFilesPatterns.some(pattern=>micromatch.isMatch(normalizedPath, pattern))
69
+ if(!isCurrentFileTesting){
70
+ context.report({node: node, message: 'Тестовые данные необходимо импортировать из publicApi/testing.ts'});
71
+ }
72
+ }
73
+ }
74
+ };
75
+ },
76
+ };