@pandacss/eslint-plugin 0.2.14 → 0.3.0
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/dist/{chunk-KSIVUN3F.mjs → chunk-Q5KKF6BL.mjs} +2 -2
- package/dist/index.js +11 -5
- package/dist/index.mjs +10 -4
- package/dist/utils/worker.js +41 -28
- package/dist/utils/worker.mjs +43 -30
- package/package.json +3 -1
|
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../node_modules/.pnpm/tsup@8.3.
|
|
30
|
+
// ../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
var init_esm_shims = __esm({
|
|
32
|
-
"../node_modules/.pnpm/tsup@8.3.
|
|
32
|
+
"../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
33
|
"use strict";
|
|
34
34
|
}
|
|
35
35
|
});
|
package/dist/index.js
CHANGED
|
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../node_modules/.pnpm/tsup@8.3.
|
|
31
|
+
// ../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/cjs_shims.js
|
|
32
32
|
var getImportMetaUrl, importMetaUrl;
|
|
33
33
|
var init_cjs_shims = __esm({
|
|
34
|
-
"../node_modules/.pnpm/tsup@8.3.
|
|
34
|
+
"../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/cjs_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
37
37
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -7884,7 +7884,7 @@ init_cjs_shims();
|
|
|
7884
7884
|
|
|
7885
7885
|
// package.json
|
|
7886
7886
|
var name = "@pandacss/eslint-plugin";
|
|
7887
|
-
var version = "0.
|
|
7887
|
+
var version = "0.3.0";
|
|
7888
7888
|
|
|
7889
7889
|
// src/configs/all.ts
|
|
7890
7890
|
init_cjs_shims();
|
|
@@ -8003,6 +8003,10 @@ var isValidStyledProp = (node, context) => {
|
|
|
8003
8003
|
var isPandaIsh = (name2, context) => {
|
|
8004
8004
|
const imports = getImports(context);
|
|
8005
8005
|
if (imports.length === 0) return false;
|
|
8006
|
+
const jsxFactory = syncAction("getJsxFactory", getSyncOpts(context));
|
|
8007
|
+
if (jsxFactory && name2 === jsxFactory) {
|
|
8008
|
+
return imports.some((imp) => imp.name === name2 || imp.alias === name2);
|
|
8009
|
+
}
|
|
8006
8010
|
return syncAction("matchFile", getSyncOpts(context), name2, imports);
|
|
8007
8011
|
};
|
|
8008
8012
|
var findDeclaration = (name2, context) => {
|
|
@@ -8047,8 +8051,10 @@ var isPandaProp = (node, context) => {
|
|
|
8047
8051
|
if (!isJSXMemberExpression(jsxAncestor.name) && !isJSXIdentifier(jsxAncestor.name)) return;
|
|
8048
8052
|
const name2 = isJSXMemberExpression(jsxAncestor.name) ? jsxAncestor.name.object.name : jsxAncestor.name.name;
|
|
8049
8053
|
const prop = node.name.name;
|
|
8050
|
-
|
|
8051
|
-
if (
|
|
8054
|
+
const isPandaComponent = isPandaIsh(name2, context) || isLocalStyledFactory(jsxAncestor, context);
|
|
8055
|
+
if (!isPandaComponent) return;
|
|
8056
|
+
const patternName = isJSXMemberExpression(jsxAncestor.name) ? void 0 : name2;
|
|
8057
|
+
if (typeof prop !== "string" || !isValidProperty(prop, context, patternName)) return;
|
|
8052
8058
|
return true;
|
|
8053
8059
|
};
|
|
8054
8060
|
var isStyledProperty = (node, context, calleeName) => {
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
__esm,
|
|
4
4
|
__toESM,
|
|
5
5
|
init_esm_shims
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q5KKF6BL.mjs";
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
var name, version;
|
|
10
10
|
var init_package = __esm({
|
|
11
11
|
"package.json"() {
|
|
12
12
|
name = "@pandacss/eslint-plugin";
|
|
13
|
-
version = "0.
|
|
13
|
+
version = "0.3.0";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8000,6 +8000,10 @@ var init_helpers = __esm({
|
|
|
8000
8000
|
isPandaIsh = (name2, context) => {
|
|
8001
8001
|
const imports = getImports(context);
|
|
8002
8002
|
if (imports.length === 0) return false;
|
|
8003
|
+
const jsxFactory = syncAction("getJsxFactory", getSyncOpts(context));
|
|
8004
|
+
if (jsxFactory && name2 === jsxFactory) {
|
|
8005
|
+
return imports.some((imp) => imp.name === name2 || imp.alias === name2);
|
|
8006
|
+
}
|
|
8003
8007
|
return syncAction("matchFile", getSyncOpts(context), name2, imports);
|
|
8004
8008
|
};
|
|
8005
8009
|
findDeclaration = (name2, context) => {
|
|
@@ -8044,8 +8048,10 @@ var init_helpers = __esm({
|
|
|
8044
8048
|
if (!isJSXMemberExpression(jsxAncestor.name) && !isJSXIdentifier(jsxAncestor.name)) return;
|
|
8045
8049
|
const name2 = isJSXMemberExpression(jsxAncestor.name) ? jsxAncestor.name.object.name : jsxAncestor.name.name;
|
|
8046
8050
|
const prop = node.name.name;
|
|
8047
|
-
|
|
8048
|
-
if (
|
|
8051
|
+
const isPandaComponent = isPandaIsh(name2, context) || isLocalStyledFactory(jsxAncestor, context);
|
|
8052
|
+
if (!isPandaComponent) return;
|
|
8053
|
+
const patternName = isJSXMemberExpression(jsxAncestor.name) ? void 0 : name2;
|
|
8054
|
+
if (typeof prop !== "string" || !isValidProperty(prop, context, patternName)) return;
|
|
8049
8055
|
return true;
|
|
8050
8056
|
};
|
|
8051
8057
|
isStyledProperty = (node, context, calleeName) => {
|
package/dist/utils/worker.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(worker_exports, {
|
|
|
35
35
|
runAsync: () => runAsync
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(worker_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_generator2 = require("@pandacss/generator");
|
|
39
39
|
var import_synckit = require("synckit");
|
|
40
40
|
|
|
41
41
|
// ../node_modules/.pnpm/@pandacss+preset-base@0.40.1/node_modules/@pandacss/preset-base/dist/index.mjs
|
|
@@ -3951,44 +3951,47 @@ var fixtureDefaults = {
|
|
|
3951
3951
|
serialized: (0, import_shared.stringifyJson)(config),
|
|
3952
3952
|
deserialize: () => (0, import_shared.parseJson)((0, import_shared.stringifyJson)(config))
|
|
3953
3953
|
};
|
|
3954
|
-
var
|
|
3955
|
-
const resolvedConfig = (0, import_config.mergeConfigs)([fixtureDefaults.config,
|
|
3956
|
-
return new
|
|
3957
|
-
...fixtureDefaults,
|
|
3958
|
-
config: resolvedConfig,
|
|
3959
|
-
tsconfig: {
|
|
3960
|
-
// @ts-expect-error
|
|
3961
|
-
useInMemoryFileSystem: true
|
|
3962
|
-
}
|
|
3963
|
-
});
|
|
3954
|
+
var createGeneratorContext = (userConfig) => {
|
|
3955
|
+
const resolvedConfig = userConfig ? (0, import_config.mergeConfigs)([fixtureDefaults.config, userConfig]) : fixtureDefaults.config;
|
|
3956
|
+
return new import_generator.Generator({ ...fixtureDefaults, config: resolvedConfig });
|
|
3964
3957
|
};
|
|
3965
3958
|
|
|
3966
3959
|
// src/utils/worker.ts
|
|
3967
3960
|
var import_ts_path = require("@pandacss/config/ts-path");
|
|
3968
3961
|
var import_config3 = require("@pandacss/config");
|
|
3969
3962
|
var import_path = __toESM(require("path"));
|
|
3963
|
+
var import_micromatch = __toESM(require("micromatch"));
|
|
3970
3964
|
var contextCache = {};
|
|
3971
3965
|
async function _getContext(configPath) {
|
|
3972
3966
|
if (!configPath) throw new Error("Invalid config path");
|
|
3973
3967
|
const cwd = import_path.default.dirname(configPath);
|
|
3974
|
-
const
|
|
3968
|
+
const conf = await (0, import_config3.loadConfig)({ file: configPath, cwd });
|
|
3969
|
+
const ctx = new import_generator2.Generator(conf);
|
|
3975
3970
|
return ctx;
|
|
3976
3971
|
}
|
|
3977
3972
|
async function getContext(opts) {
|
|
3978
3973
|
if (process.env.NODE_ENV === "test") {
|
|
3979
|
-
const ctx =
|
|
3980
|
-
|
|
3974
|
+
const ctx = createGeneratorContext({
|
|
3975
|
+
...panda_config_default,
|
|
3976
|
+
include: ["**/*"],
|
|
3977
|
+
exclude: ["**/Invalid.tsx", "**/panda.config.ts"],
|
|
3978
|
+
importMap: "./panda",
|
|
3979
|
+
jsxFactory: "styled"
|
|
3980
|
+
});
|
|
3981
3981
|
return ctx;
|
|
3982
3982
|
} else {
|
|
3983
3983
|
const configPath = (0, import_config3.findConfig)({ cwd: opts.configPath ?? opts.currentFile });
|
|
3984
|
+
const cwd = import_path.default.dirname(configPath);
|
|
3984
3985
|
if (!contextCache[configPath]) {
|
|
3985
3986
|
contextCache[configPath] = _getContext(configPath);
|
|
3986
3987
|
}
|
|
3987
|
-
return
|
|
3988
|
+
return contextCache[configPath];
|
|
3988
3989
|
}
|
|
3989
3990
|
}
|
|
3990
3991
|
async function filterInvalidTokens(ctx, paths) {
|
|
3991
|
-
|
|
3992
|
+
const invalid = paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
|
|
3993
|
+
console.error("filterInvalidTokens", { paths, invalid });
|
|
3994
|
+
return invalid;
|
|
3992
3995
|
}
|
|
3993
3996
|
async function filterDeprecatedTokens(ctx, tokens3) {
|
|
3994
3997
|
return tokens3.filter((token) => {
|
|
@@ -4009,31 +4012,35 @@ async function isColorAttribute(ctx, _attr) {
|
|
|
4009
4012
|
const category = await getPropCategory(ctx, _attr);
|
|
4010
4013
|
return category === "colors";
|
|
4011
4014
|
}
|
|
4012
|
-
var arePathsEqual = (path1, path2) => {
|
|
4013
|
-
const normalizedPath1 = import_path.default.resolve(path1);
|
|
4014
|
-
const normalizedPath2 = import_path.default.resolve(path2);
|
|
4015
|
-
return normalizedPath1 === normalizedPath2;
|
|
4016
|
-
};
|
|
4017
4015
|
async function isValidFile(ctx, fileName) {
|
|
4018
|
-
|
|
4016
|
+
const { include, exclude } = ctx.config;
|
|
4017
|
+
const cwd = ctx.config.cwd || process.cwd();
|
|
4018
|
+
const relativePath = import_path.default.isAbsolute(fileName) ? import_path.default.relative(cwd, fileName) : fileName;
|
|
4019
|
+
return import_micromatch.default.isMatch(relativePath, include, { ignore: exclude, dot: true });
|
|
4019
4020
|
}
|
|
4020
4021
|
async function resolveShorthands(ctx, name) {
|
|
4021
4022
|
return ctx.utility.getPropShorthandsMap().get(name);
|
|
4022
4023
|
}
|
|
4023
4024
|
async function resolveLongHand(ctx, name) {
|
|
4024
4025
|
const reverseShorthandsMap = /* @__PURE__ */ new Map();
|
|
4025
|
-
|
|
4026
|
+
const shorthands = ctx.utility.getPropShorthandsMap();
|
|
4027
|
+
for (const [key, values] of shorthands) {
|
|
4026
4028
|
for (const value of values) {
|
|
4027
4029
|
reverseShorthandsMap.set(value, key);
|
|
4028
4030
|
}
|
|
4029
4031
|
}
|
|
4030
|
-
|
|
4032
|
+
const result = reverseShorthandsMap.get(name);
|
|
4033
|
+
return result;
|
|
4031
4034
|
}
|
|
4032
4035
|
async function isValidProperty(ctx, name, patternName) {
|
|
4033
|
-
|
|
4034
|
-
if (
|
|
4036
|
+
const isValid = ctx.isValidProperty(name);
|
|
4037
|
+
if (isValid) return true;
|
|
4038
|
+
if (!patternName) return false;
|
|
4039
|
+
if (patternName === ctx.config.jsxFactory) {
|
|
4040
|
+
return false;
|
|
4041
|
+
}
|
|
4035
4042
|
const pattern = ctx.patterns.details.find((p) => p.baseName === patternName || p.jsx.includes(patternName))?.config.properties;
|
|
4036
|
-
if (!pattern) return;
|
|
4043
|
+
if (!pattern) return false;
|
|
4037
4044
|
return Object.keys(pattern).includes(name);
|
|
4038
4045
|
}
|
|
4039
4046
|
async function matchFile(ctx, name, imports) {
|
|
@@ -4041,11 +4048,15 @@ async function matchFile(ctx, name, imports) {
|
|
|
4041
4048
|
return file.match(name);
|
|
4042
4049
|
}
|
|
4043
4050
|
async function matchImports(ctx, result) {
|
|
4044
|
-
|
|
4051
|
+
const isMatch = ctx.imports.match(result, (mod) => {
|
|
4045
4052
|
const { tsOptions } = ctx.parserOptions;
|
|
4046
4053
|
if (!tsOptions?.pathMappings) return;
|
|
4047
4054
|
return (0, import_ts_path.resolveTsPathPattern)(tsOptions.pathMappings, mod);
|
|
4048
4055
|
});
|
|
4056
|
+
return isMatch;
|
|
4057
|
+
}
|
|
4058
|
+
async function getJsxFactory(ctx) {
|
|
4059
|
+
return ctx.config.jsxFactory;
|
|
4049
4060
|
}
|
|
4050
4061
|
async function runAsync(action, opts, ...args) {
|
|
4051
4062
|
const ctx = await getContext(opts);
|
|
@@ -4070,6 +4081,8 @@ async function runAsync(action, opts, ...args) {
|
|
|
4070
4081
|
return filterInvalidTokens(ctx, ...args);
|
|
4071
4082
|
case "getPropCategory":
|
|
4072
4083
|
return getPropCategory(ctx, ...args);
|
|
4084
|
+
case "getJsxFactory":
|
|
4085
|
+
return getJsxFactory(ctx);
|
|
4073
4086
|
case "filterDeprecatedTokens":
|
|
4074
4087
|
return filterDeprecatedTokens(ctx, ...args);
|
|
4075
4088
|
}
|
package/dist/utils/worker.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_esm_shims
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-Q5KKF6BL.mjs";
|
|
4
4
|
|
|
5
5
|
// src/utils/worker.ts
|
|
6
6
|
init_esm_shims();
|
|
7
|
-
import {
|
|
7
|
+
import { Generator as Generator2 } from "@pandacss/generator";
|
|
8
8
|
import { runAsWorker } from "synckit";
|
|
9
9
|
|
|
10
10
|
// ../fixture/src/index.ts
|
|
@@ -3936,16 +3936,9 @@ var fixtureDefaults = {
|
|
|
3936
3936
|
serialized: stringifyJson(config),
|
|
3937
3937
|
deserialize: () => parseJson(stringifyJson(config))
|
|
3938
3938
|
};
|
|
3939
|
-
var
|
|
3940
|
-
const resolvedConfig = mergeConfigs([fixtureDefaults.config,
|
|
3941
|
-
return new
|
|
3942
|
-
...fixtureDefaults,
|
|
3943
|
-
config: resolvedConfig,
|
|
3944
|
-
tsconfig: {
|
|
3945
|
-
// @ts-expect-error
|
|
3946
|
-
useInMemoryFileSystem: true
|
|
3947
|
-
}
|
|
3948
|
-
});
|
|
3939
|
+
var createGeneratorContext = (userConfig) => {
|
|
3940
|
+
const resolvedConfig = userConfig ? mergeConfigs([fixtureDefaults.config, userConfig]) : fixtureDefaults.config;
|
|
3941
|
+
return new Generator({ ...fixtureDefaults, config: resolvedConfig });
|
|
3949
3942
|
};
|
|
3950
3943
|
|
|
3951
3944
|
// ../fixture/src/layers.ts
|
|
@@ -3953,30 +3946,40 @@ init_esm_shims();
|
|
|
3953
3946
|
|
|
3954
3947
|
// src/utils/worker.ts
|
|
3955
3948
|
import { resolveTsPathPattern } from "@pandacss/config/ts-path";
|
|
3956
|
-
import { findConfig } from "@pandacss/config";
|
|
3949
|
+
import { findConfig, loadConfig } from "@pandacss/config";
|
|
3957
3950
|
import path from "path";
|
|
3951
|
+
import micromatch from "micromatch";
|
|
3958
3952
|
var contextCache = {};
|
|
3959
3953
|
async function _getContext(configPath) {
|
|
3960
3954
|
if (!configPath) throw new Error("Invalid config path");
|
|
3961
3955
|
const cwd = path.dirname(configPath);
|
|
3962
|
-
const
|
|
3956
|
+
const conf = await loadConfig({ file: configPath, cwd });
|
|
3957
|
+
const ctx = new Generator2(conf);
|
|
3963
3958
|
return ctx;
|
|
3964
3959
|
}
|
|
3965
3960
|
async function getContext(opts) {
|
|
3966
3961
|
if (process.env.NODE_ENV === "test") {
|
|
3967
|
-
const ctx =
|
|
3968
|
-
|
|
3962
|
+
const ctx = createGeneratorContext({
|
|
3963
|
+
...panda_config_default,
|
|
3964
|
+
include: ["**/*"],
|
|
3965
|
+
exclude: ["**/Invalid.tsx", "**/panda.config.ts"],
|
|
3966
|
+
importMap: "./panda",
|
|
3967
|
+
jsxFactory: "styled"
|
|
3968
|
+
});
|
|
3969
3969
|
return ctx;
|
|
3970
3970
|
} else {
|
|
3971
3971
|
const configPath = findConfig({ cwd: opts.configPath ?? opts.currentFile });
|
|
3972
|
+
const cwd = path.dirname(configPath);
|
|
3972
3973
|
if (!contextCache[configPath]) {
|
|
3973
3974
|
contextCache[configPath] = _getContext(configPath);
|
|
3974
3975
|
}
|
|
3975
|
-
return
|
|
3976
|
+
return contextCache[configPath];
|
|
3976
3977
|
}
|
|
3977
3978
|
}
|
|
3978
3979
|
async function filterInvalidTokens(ctx, paths) {
|
|
3979
|
-
|
|
3980
|
+
const invalid = paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
|
|
3981
|
+
console.error("filterInvalidTokens", { paths, invalid });
|
|
3982
|
+
return invalid;
|
|
3980
3983
|
}
|
|
3981
3984
|
async function filterDeprecatedTokens(ctx, tokens3) {
|
|
3982
3985
|
return tokens3.filter((token) => {
|
|
@@ -3997,31 +4000,35 @@ async function isColorAttribute(ctx, _attr) {
|
|
|
3997
4000
|
const category = await getPropCategory(ctx, _attr);
|
|
3998
4001
|
return category === "colors";
|
|
3999
4002
|
}
|
|
4000
|
-
var arePathsEqual = (path1, path2) => {
|
|
4001
|
-
const normalizedPath1 = path.resolve(path1);
|
|
4002
|
-
const normalizedPath2 = path.resolve(path2);
|
|
4003
|
-
return normalizedPath1 === normalizedPath2;
|
|
4004
|
-
};
|
|
4005
4003
|
async function isValidFile(ctx, fileName) {
|
|
4006
|
-
|
|
4004
|
+
const { include, exclude } = ctx.config;
|
|
4005
|
+
const cwd = ctx.config.cwd || process.cwd();
|
|
4006
|
+
const relativePath = path.isAbsolute(fileName) ? path.relative(cwd, fileName) : fileName;
|
|
4007
|
+
return micromatch.isMatch(relativePath, include, { ignore: exclude, dot: true });
|
|
4007
4008
|
}
|
|
4008
4009
|
async function resolveShorthands(ctx, name) {
|
|
4009
4010
|
return ctx.utility.getPropShorthandsMap().get(name);
|
|
4010
4011
|
}
|
|
4011
4012
|
async function resolveLongHand(ctx, name) {
|
|
4012
4013
|
const reverseShorthandsMap = /* @__PURE__ */ new Map();
|
|
4013
|
-
|
|
4014
|
+
const shorthands = ctx.utility.getPropShorthandsMap();
|
|
4015
|
+
for (const [key, values] of shorthands) {
|
|
4014
4016
|
for (const value of values) {
|
|
4015
4017
|
reverseShorthandsMap.set(value, key);
|
|
4016
4018
|
}
|
|
4017
4019
|
}
|
|
4018
|
-
|
|
4020
|
+
const result = reverseShorthandsMap.get(name);
|
|
4021
|
+
return result;
|
|
4019
4022
|
}
|
|
4020
4023
|
async function isValidProperty(ctx, name, patternName) {
|
|
4021
|
-
|
|
4022
|
-
if (
|
|
4024
|
+
const isValid = ctx.isValidProperty(name);
|
|
4025
|
+
if (isValid) return true;
|
|
4026
|
+
if (!patternName) return false;
|
|
4027
|
+
if (patternName === ctx.config.jsxFactory) {
|
|
4028
|
+
return false;
|
|
4029
|
+
}
|
|
4023
4030
|
const pattern = ctx.patterns.details.find((p) => p.baseName === patternName || p.jsx.includes(patternName))?.config.properties;
|
|
4024
|
-
if (!pattern) return;
|
|
4031
|
+
if (!pattern) return false;
|
|
4025
4032
|
return Object.keys(pattern).includes(name);
|
|
4026
4033
|
}
|
|
4027
4034
|
async function matchFile(ctx, name, imports) {
|
|
@@ -4029,11 +4036,15 @@ async function matchFile(ctx, name, imports) {
|
|
|
4029
4036
|
return file.match(name);
|
|
4030
4037
|
}
|
|
4031
4038
|
async function matchImports(ctx, result) {
|
|
4032
|
-
|
|
4039
|
+
const isMatch = ctx.imports.match(result, (mod) => {
|
|
4033
4040
|
const { tsOptions } = ctx.parserOptions;
|
|
4034
4041
|
if (!tsOptions?.pathMappings) return;
|
|
4035
4042
|
return resolveTsPathPattern(tsOptions.pathMappings, mod);
|
|
4036
4043
|
});
|
|
4044
|
+
return isMatch;
|
|
4045
|
+
}
|
|
4046
|
+
async function getJsxFactory(ctx) {
|
|
4047
|
+
return ctx.config.jsxFactory;
|
|
4037
4048
|
}
|
|
4038
4049
|
async function runAsync(action, opts, ...args) {
|
|
4039
4050
|
const ctx = await getContext(opts);
|
|
@@ -4058,6 +4069,8 @@ async function runAsync(action, opts, ...args) {
|
|
|
4058
4069
|
return filterInvalidTokens(ctx, ...args);
|
|
4059
4070
|
case "getPropCategory":
|
|
4060
4071
|
return getPropCategory(ctx, ...args);
|
|
4072
|
+
case "getJsxFactory":
|
|
4073
|
+
return getJsxFactory(ctx);
|
|
4061
4074
|
case "filterDeprecatedTokens":
|
|
4062
4075
|
return filterDeprecatedTokens(ctx, ...args);
|
|
4063
4076
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Eslint plugin for Panda CSS",
|
|
5
5
|
"author": "Abraham Aremu <anubra266@gmail.com>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,12 +32,14 @@
|
|
|
32
32
|
"@pandacss/shared": "^0.53.2",
|
|
33
33
|
"@typescript-eslint/utils": "^8.21.0",
|
|
34
34
|
"hookable": "^5.5.3",
|
|
35
|
+
"micromatch": "^4.0.8",
|
|
35
36
|
"synckit": "^0.9.0"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"eslint": "*"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
42
|
+
"@types/micromatch": "^4.0.10",
|
|
41
43
|
"typescript": "^5.7.2"
|
|
42
44
|
},
|
|
43
45
|
"scripts": {
|