@bamboocss/eslint-plugin 1.12.3 → 1.13.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.
package/LICENSE.md CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2023 Segun Adebayo
4
+ Copyright (c) 2026 Gajus Kuizinas
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6
7
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
package/dist/index.cjs CHANGED
@@ -8,12 +8,12 @@ require("@typescript-eslint/utils/ts-eslint");
8
8
  let _bamboocss_shared = require("@bamboocss/shared");
9
9
  //#region package.json
10
10
  var name = "@bamboocss/eslint-plugin";
11
- var version = "1.12.3";
11
+ var version = "1.13.1";
12
12
  //#endregion
13
13
  //#region src/utils/index.ts
14
14
  const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
15
- const isBase = process.env.NODE_ENV !== "test" || require("url").pathToFileURL(__filename).href.endsWith("dist/index.js");
16
- const _syncAction = (0, synckit.createSyncFn)((0, node_path.join)((0, node_url.fileURLToPath)(new URL(isBase ? "./" : "../../dist", require("url").pathToFileURL(__filename).href)), "utils/worker.mjs"));
15
+ const isSourceRun = require("url").pathToFileURL(__filename).href.endsWith("/src/utils/index.ts");
16
+ const _syncAction = (0, synckit.createSyncFn)((0, node_path.join)((0, node_url.fileURLToPath)(new URL(isSourceRun ? "../../dist" : "./", require("url").pathToFileURL(__filename).href)), "utils/worker.mjs"));
17
17
  const cache = /* @__PURE__ */ new Map();
18
18
  const syncAction = ((...args) => {
19
19
  const cacheKey = JSON.stringify(args);
package/dist/index.mjs CHANGED
@@ -8,12 +8,12 @@ import "@typescript-eslint/utils/ts-eslint";
8
8
  import { getArbitraryValue } from "@bamboocss/shared";
9
9
  //#region package.json
10
10
  var name = "@bamboocss/eslint-plugin";
11
- var version = "1.12.3";
11
+ var version = "1.13.1";
12
12
  //#endregion
13
13
  //#region src/utils/index.ts
14
14
  const createRule = ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
15
- const isBase = process.env.NODE_ENV !== "test" || import.meta.url.endsWith("dist/index.js");
16
- const _syncAction = createSyncFn(join(fileURLToPath(new URL(isBase ? "./" : "../../dist", import.meta.url)), "utils/worker.mjs"));
15
+ const isSourceRun = import.meta.url.endsWith("/src/utils/index.ts");
16
+ const _syncAction = createSyncFn(join(fileURLToPath(new URL(isSourceRun ? "../../dist" : "./", import.meta.url)), "utils/worker.mjs"));
17
17
  const cache = /* @__PURE__ */ new Map();
18
18
  const syncAction = ((...args) => {
19
19
  const cacheKey = JSON.stringify(args);
@@ -21,7 +21,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- let synckit = require("synckit");
25
24
  let _bamboocss_config = require("@bamboocss/config");
26
25
  let _bamboocss_config_ts_path = require("@bamboocss/config/ts-path");
27
26
  let _bamboocss_generator = require("@bamboocss/generator");
@@ -29,11 +28,13 @@ let micromatch = require("micromatch");
29
28
  micromatch = __toESM(micromatch);
30
29
  let path = require("path");
31
30
  path = __toESM(path);
31
+ let synckit = require("synckit");
32
32
  //#region src/utils/worker.ts
33
33
  const contextCache = {};
34
+ const testContextModule = process.env.BAMBOO_ESLINT_TEST_CONTEXT;
34
35
  async function getContext(options) {
35
- if (process.env.NODE_ENV === "test") {
36
- const { createGeneratorContext } = await import("../../tests/fixtures/create-context");
36
+ if (testContextModule) {
37
+ const { createGeneratorContext } = await import(testContextModule);
37
38
  return createGeneratorContext({
38
39
  exclude: ["**/Invalid.tsx", "**/bamboo.config.ts"],
39
40
  importMap: "./bamboo",
@@ -1,5 +1,3 @@
1
- import { Generator } from "@bamboocss/generator";
2
-
3
1
  //#region src/utils/index.d.ts
4
2
  type ImportResult = {
5
3
  alias: string;
@@ -17,7 +15,7 @@ type DeprecatedToken = string | {
17
15
  category: string;
18
16
  value: string;
19
17
  };
20
- declare function getContext(options: Options): Promise<Generator>;
18
+ declare function getContext(options: Options): Promise<any>;
21
19
  type MatchImportResult = {
22
20
  alias: string;
23
21
  mod: string;
@@ -1,6 +1,3 @@
1
- import { ESLintUtils } from "@typescript-eslint/utils";
2
- import { Generator } from "@bamboocss/generator";
3
-
4
1
  //#region src/utils/index.d.ts
5
2
  type ImportResult = {
6
3
  alias: string;
@@ -18,7 +15,7 @@ type DeprecatedToken = string | {
18
15
  category: string;
19
16
  value: string;
20
17
  };
21
- declare function getContext(options: Options): Promise<Generator>;
18
+ declare function getContext(options: Options): Promise<any>;
22
19
  type MatchImportResult = {
23
20
  alias: string;
24
21
  mod: string;
@@ -1,21 +1,15 @@
1
- import { ESLintUtils } from "@typescript-eslint/utils";
2
- import { join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { createSyncFn, runAsWorker } from "synckit";
5
1
  import { findConfig, loadConfig } from "@bamboocss/config";
6
2
  import { resolveTsPathPattern } from "@bamboocss/config/ts-path";
7
3
  import { Generator } from "@bamboocss/generator";
8
4
  import micromatch from "micromatch";
9
5
  import path from "path";
10
- ESLintUtils.RuleCreator((name) => `https://github.com/bamboocss/bamboo/blob/main/packages/eslint-plugin/docs/rules/${name}.md`);
11
- const isBase = process.env.NODE_ENV !== "test" || import.meta.url.endsWith("dist/index.js");
12
- createSyncFn(join(fileURLToPath(new URL(isBase ? "./" : "../../dist", import.meta.url)), "utils/worker.mjs"));
13
- //#endregion
6
+ import { runAsWorker } from "synckit";
14
7
  //#region src/utils/worker.ts
15
8
  const contextCache = {};
9
+ const testContextModule = process.env.BAMBOO_ESLINT_TEST_CONTEXT;
16
10
  async function getContext(options) {
17
- if (process.env.NODE_ENV === "test") {
18
- const { createGeneratorContext } = await import("../../tests/fixtures/create-context");
11
+ if (testContextModule) {
12
+ const { createGeneratorContext } = await import(testContextModule);
19
13
  return createGeneratorContext({
20
14
  exclude: ["**/Invalid.tsx", "**/bamboo.config.ts"],
21
15
  importMap: "./bamboo",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@bamboocss/eslint-plugin",
3
- "version": "1.12.3",
3
+ "version": "1.13.1",
4
4
  "description": "ESLint plugin for Bamboo CSS",
5
- "homepage": "https://bamboo-css.com",
5
+ "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -36,9 +36,9 @@
36
36
  "@typescript-eslint/utils": "^8.21.0",
37
37
  "micromatch": "^4.0.8",
38
38
  "synckit": "^0.9.0",
39
- "@bamboocss/config": "1.12.3",
40
- "@bamboocss/generator": "1.12.3",
41
- "@bamboocss/shared": "1.12.3"
39
+ "@bamboocss/config": "1.13.1",
40
+ "@bamboocss/generator": "1.13.1",
41
+ "@bamboocss/shared": "1.13.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/micromatch": "^4.0.10",
@@ -46,10 +46,10 @@
46
46
  "eslint": "^9.35.0",
47
47
  "multiline-ts": "^4.0.1",
48
48
  "typescript": "^5.7.2",
49
- "@bamboocss/preset-bamboo": "1.12.3",
50
- "@bamboocss/dev": "1.12.3",
51
- "@bamboocss/preset-base": "1.12.3",
52
- "@bamboocss/types": "1.12.3"
49
+ "@bamboocss/dev": "1.13.1",
50
+ "@bamboocss/preset-bamboo": "1.13.1",
51
+ "@bamboocss/preset-base": "1.13.1",
52
+ "@bamboocss/types": "1.13.1"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "eslint": "*"