eslint-plugin-use-agnostic 1.7.2 → 1.7.4

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
@@ -78,8 +78,6 @@ With this list established, it thus becomes possible to recognize static import
78
78
 
79
79
  ## Caveats
80
80
 
81
- Base url and aliased import paths are currently resolved under the assumption that `process.cwd()` and `context.cwd` have the same value.
82
-
83
81
  It is up to you to confirm that your Agnostic Modules are indeed agnostic, meaning that they have neither server- nor client-side code. `eslint-plugin-use-agnostic`, at least at this time, does not do this verification for you.
84
82
 
85
83
  It is also up to you to ensure, as outlined above, that **you avoid** exporting React components along with other logics within the same modules (unless you have to per the design of your current framework), which may derail the linting in some cases. Separating exporting React components within their own modules ending with a JSX file extension, from exporting other logics within modules that don't end with a JSX file extension, is crucial for distinguishing between Components Modules and Logics Modules respectively.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",
package/types/index.d.ts CHANGED
@@ -326,7 +326,7 @@ export const commentedDirectives_reactDirectives: Readonly<{
326
326
  [USE_AGNOSTIC_STRATEGIES]: null;
327
327
  }>;
328
328
 
329
- /** Typing currently unavailable. To be used by chaining .importingCommentedDirective.importedCommentedDirective to obtained the reason why a module import is or not allowed. */
329
+ /** Typing currently unavailable. To be used by chaining `.importingCommentedDirective` `.importedCommentedDirective` `.value` to obtain the reason why a module import is or isn't allowed. */
330
330
  export const directive21Data: object;
331
331
 
332
332
  /**
@@ -408,22 +408,25 @@ export const getCommentedDirectiveFromCurrentModule: (
408
408
  * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
409
409
  * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
410
410
  * @param resolvedPath The resolved path of the imported module.
411
- * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
411
+ * @returns The commented directive, or lack thereof via `null`. Now also provides the obtained `SourceCode` object. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
412
412
  */
413
413
  export const getCommentedDirectiveFromImportedModule: (
414
414
  resolvedPath: string
415
- ) =>
416
- | "use server logics"
417
- | "use client logics"
418
- | "use agnostic logics"
419
- | "use server components"
420
- | "use client components"
421
- | "use agnostic components"
422
- | "use server functions"
423
- | "use client contexts"
424
- | "use agnostic conditions"
425
- | "use agnostic strategies"
426
- | null;
415
+ ) => {
416
+ commentedDirective:
417
+ | "use server logics"
418
+ | "use client logics"
419
+ | "use agnostic logics"
420
+ | "use server components"
421
+ | "use client components"
422
+ | "use agnostic components"
423
+ | "use server functions"
424
+ | "use client contexts"
425
+ | "use agnostic conditions"
426
+ | "use agnostic strategies"
427
+ | null;
428
+ sourceCode: ESLintSourceCode;
429
+ };
427
430
 
428
431
  /**
429
432
  * Ensures that a module's commented directive is consistent with its file extension (depending on whether it ends with 'x' for JSX).