eslint-plugin-use-agnostic 1.3.0 → 1.3.1

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.
@@ -1,21 +1,10 @@
1
- import url from "url";
2
- import path from "path";
1
+ import { createRequire } from "module";
2
+ const require = createRequire(import.meta.url);
3
3
 
4
- import { makeResolvedConfigData } from "comment-variables-resolve-config";
4
+ const raw = require("../../../comments.config.json");
5
+ export const resolvedConfigData = raw;
5
6
 
6
- const dirname = path.dirname(url.fileURLToPath(import.meta.url));
7
- const jsCommentsConfigPath = path.join(dirname, "../../../comments.config.js");
8
-
9
- const makeResolvedConfigDataResults = await makeResolvedConfigData(
10
- jsCommentsConfigPath
11
- );
12
-
13
- if (!makeResolvedConfigDataResults.success) {
14
- makeResolvedConfigDataResults.errors.forEach((e) => {
15
- console.error(e.message);
16
- });
17
- throw new Error("Failed to resolve config data.");
18
- }
19
-
20
- export const resolvedConfigData =
21
- makeResolvedConfigDataResults.resolvedConfigData;
7
+ /* Notes
8
+ We're actually not supposed to install comment-variables-resolve-config. What's supposed to happen is that the resolved config data should be made and consumed as a JSON either via a command in the CLI or automatically on save by the VS Code extension.
9
+ For the CLI, the decision has been taken to automatically create the JSON every time the CLI is successfully run with any command.
10
+ */
@@ -13,6 +13,10 @@ import { makeIntroForSpecificViolationMessage } from "../../../_commons/utilitie
13
13
 
14
14
  import { resolvedConfigData } from "../../../../jscomments/_commons/constants/bases.js";
15
15
 
16
+ // const resolvedConfigData = await import("../../../../comments.config.json", {
17
+ // assert: { type: "json" },
18
+ // });
19
+
16
20
  /**
17
21
  * @typedef {import('../../../../types/agnostic20/_commons/typedefs.js').Directive} Directive
18
22
  * @typedef {import('../../../../types/agnostic20/_commons/typedefs.js').Directives} Directives
@@ -16,6 +16,10 @@ import { makeIntroForSpecificViolationMessage } from "../../../_commons/utilitie
16
16
 
17
17
  import { resolvedConfigData } from "../../../../jscomments/_commons/constants/bases.js";
18
18
 
19
+ // const resolvedConfigData = await import("../../../../comments.config.json", {
20
+ // assert: { type: "json" },
21
+ // });
22
+
19
23
  /**
20
24
  * @typedef {import('../../../../types/directive21/_commons/typedefs.js').CommentedDirective} CommentedDirective
21
25
  * @typedef {import('../../../../types/directive21/_commons/typedefs.js').CommentedDirectiveWithoutUseAgnosticStrategies} CommentedDirectiveWithoutUseAgnosticStrategies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -41,7 +41,6 @@
41
41
  "test": "node tests/agnostic20/import-rules.test.js && node tests/directive21/import-rules.test.js"
42
42
  },
43
43
  "dependencies": {
44
- "comment-variables-resolve-config": "^1.9.0",
45
44
  "get-sourcecode-from-file-path": "^1.1.2",
46
45
  "resolve-importing-path": "^1.0.3",
47
46
  "tsconfig-paths": "^4.2.0",