eslint-plugin-laygrd-plugin 0.0.4 → 0.0.6
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/README.md
CHANGED
|
@@ -34,7 +34,8 @@ Then configure the rules you want to use under the rules section.
|
|
|
34
34
|
```json
|
|
35
35
|
{
|
|
36
36
|
"rules": {
|
|
37
|
-
"laygrd-plugin/
|
|
37
|
+
"laygrd-plugin/fsd-relative-path": ['error, { alias: '@' }],
|
|
38
|
+
"laygrd-plugin/public-api-imports": ['error, { alias: '@' }]
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
```
|
|
@@ -47,7 +47,7 @@ module.exports = {
|
|
|
47
47
|
|
|
48
48
|
// skipping relative paths like '../ui/Button/Button'
|
|
49
49
|
if (isPathRelative(importSrc)) {
|
|
50
|
-
return
|
|
50
|
+
return;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
const segments = importSrc.split('/');
|
|
@@ -59,7 +59,7 @@ module.exports = {
|
|
|
59
59
|
// check only declared layers from project root
|
|
60
60
|
const layer = segments[0];
|
|
61
61
|
if (!layersToCheck[layer]) {
|
|
62
|
-
return
|
|
62
|
+
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (isImportNotFromPublicApi) {
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// Requirements
|
|
9
9
|
//------------------------------------------------------------------------------
|
|
10
10
|
|
|
11
|
-
const rule = require("../../../lib/rules/public-api-
|
|
11
|
+
const rule = require("../../../lib/rules/public-api-imports"),
|
|
12
12
|
RuleTester = require("eslint").RuleTester;
|
|
13
13
|
|
|
14
14
|
|
|
@@ -33,6 +33,12 @@ ruleTester.run("public-api-exports", rule, {
|
|
|
33
33
|
errors: [],
|
|
34
34
|
options: [{ alias: '@' }]
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
filename: 'C:\\Users\\Desktop\\Projects\\blog_app\\src\\widgets\\ThemeSwitcher\\ui\\ThemeSwitcher\\ThemeSwitcher',
|
|
38
|
+
code: "import { useCallback } from 'react'",
|
|
39
|
+
errors: [],
|
|
40
|
+
options: [{ alias: '@' }]
|
|
41
|
+
},
|
|
36
42
|
|
|
37
43
|
],
|
|
38
44
|
|