eslint-plugin-use-agnostic 1.6.4 → 1.6.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.
|
@@ -47,13 +47,14 @@ Indeed, Server Functions Modules have no business exporting JSX. `,
|
|
|
47
47
|
return {
|
|
48
48
|
ImportDeclaration: (node) =>
|
|
49
49
|
importsFlow(context, node, currentFileEffectiveDirective),
|
|
50
|
-
// that should work
|
|
51
50
|
ImportExpression: (node) =>
|
|
52
51
|
importsFlow(context, node, currentFileEffectiveDirective),
|
|
53
52
|
ExportNamedDeclaration: (node) =>
|
|
54
53
|
reExportsFlow(context, node, currentFileEffectiveDirective),
|
|
55
54
|
ExportAllDeclaration: (node) =>
|
|
56
55
|
reExportsFlow(context, node, currentFileEffectiveDirective),
|
|
56
|
+
// Unlike directive21, no ExportDefaultDeclaration because ExportDefaultDeclaration don't have source. The reason they're addressed in directive21 is specifically for Agnostic Strategies.
|
|
57
|
+
// ...but removed because export default can only be
|
|
57
58
|
};
|
|
58
59
|
},
|
|
59
60
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
|
|
3
3
|
import { resolveImportingPath } from "resolve-importing-path";
|
|
4
|
+
import { findUpSync } from "find-up";
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
EXTENSIONS,
|
|
@@ -106,7 +107,9 @@ const importedFileFlow = (context, node) => {
|
|
|
106
107
|
const resolvedImportPath = resolveImportingPath(
|
|
107
108
|
path.dirname(context.filename),
|
|
108
109
|
node.source.value,
|
|
109
|
-
|
|
110
|
+
findUpSync("tsconfig.json", {
|
|
111
|
+
cwd: path.dirname(context.filename),
|
|
112
|
+
}) ?? context.cwd
|
|
110
113
|
);
|
|
111
114
|
|
|
112
115
|
// does not operate on paths it did not resolve
|
|
@@ -57,7 +57,6 @@ Please include a Strategy that corresponds to the kind of module this export wou
|
|
|
57
57
|
return {
|
|
58
58
|
ImportDeclaration: (node) =>
|
|
59
59
|
importsFlow(context, node, verifiedCommentedDirective),
|
|
60
|
-
// that should work
|
|
61
60
|
ImportExpression: (node) =>
|
|
62
61
|
importsFlow(context, node, verifiedCommentedDirective),
|
|
63
62
|
ExportNamedDeclaration: (node) =>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
|
|
3
3
|
import { resolveImportingPath } from "resolve-importing-path";
|
|
4
|
+
import { findUpSync } from "find-up";
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
EXTENSIONS,
|
|
@@ -115,7 +116,9 @@ const importedFileFlow = (context, node) => {
|
|
|
115
116
|
const resolvedImportPath = resolveImportingPath(
|
|
116
117
|
path.dirname(context.filename),
|
|
117
118
|
node.source.value,
|
|
118
|
-
|
|
119
|
+
findUpSync("tsconfig.json", {
|
|
120
|
+
cwd: path.dirname(context.filename),
|
|
121
|
+
}) ?? context.cwd
|
|
119
122
|
);
|
|
120
123
|
|
|
121
124
|
// does not operate on paths it did not resolve
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-use-agnostic",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"test": "node tests/agnostic20/import-rules.test.js && node tests/directive21/import-rules.test.js"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"find-up": "^8.0.0",
|
|
46
47
|
"get-sourcecode-from-file-path": "^1.1.2",
|
|
47
48
|
"resolve-importing-path": "^1.0.3",
|
|
48
49
|
"typescript-eslint": "^8.32.0"
|