@plumeria/eslint-plugin 0.1.1 → 0.2.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.
|
@@ -42,7 +42,6 @@ module.exports = {
|
|
|
42
42
|
},
|
|
43
43
|
CallExpression(node) {
|
|
44
44
|
if (functionDepth > 0) {
|
|
45
|
-
// メンバー式(MemberExpression)の場合の処理
|
|
46
45
|
if (node.callee.type === 'MemberExpression') {
|
|
47
46
|
const objectName = node.callee.object.name;
|
|
48
47
|
const propertyName = node.callee.property.name;
|
|
@@ -53,7 +52,8 @@ module.exports = {
|
|
|
53
52
|
propertyName === 'create' ||
|
|
54
53
|
propertyName === 'global' ||
|
|
55
54
|
propertyName === 'keyframes' ||
|
|
56
|
-
propertyName === '
|
|
55
|
+
propertyName === 'defineVars' ||
|
|
56
|
+
propertyName === 'defineTheme'
|
|
57
57
|
) {
|
|
58
58
|
context.report({
|
|
59
59
|
node,
|
|
@@ -39,14 +39,11 @@ module.exports = {
|
|
|
39
39
|
const referencedKeys = new Set();
|
|
40
40
|
|
|
41
41
|
return {
|
|
42
|
-
// Filter out `css.global` and find objects in functions
|
|
43
42
|
CallExpression(node) {
|
|
44
43
|
if (
|
|
45
44
|
node.callee.type === 'MemberExpression' &&
|
|
46
45
|
node.callee.object.name === 'css' &&
|
|
47
|
-
node.callee.property.name
|
|
48
|
-
node.callee.property.name !== 'defineThemeVars' &&
|
|
49
|
-
node.callee.property.name !== 'keyframes'
|
|
46
|
+
node.callee.property.name === 'create'
|
|
50
47
|
) {
|
|
51
48
|
const arg = node.arguments[0];
|
|
52
49
|
if (
|
|
@@ -71,7 +68,6 @@ module.exports = {
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
},
|
|
74
|
-
// `styles.header_main` の参照を記録
|
|
75
71
|
MemberExpression(node) {
|
|
76
72
|
if (
|
|
77
73
|
node.object.type === 'Identifier' &&
|
|
@@ -80,7 +76,6 @@ module.exports = {
|
|
|
80
76
|
const fullKey = `${node.object.name}.${node.property.name}`;
|
|
81
77
|
referencedKeys.add(fullKey);
|
|
82
78
|
|
|
83
|
-
// TypeScript の型情報を取得し、ジャンプ可能かチェック
|
|
84
79
|
if (parserServices && checker) {
|
|
85
80
|
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
|
|
86
81
|
const symbol = checker.getSymbolAtLocation(tsNode);
|
|
@@ -161,9 +161,11 @@ function buildColorMixPattern() {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
const colorMixString = buildColorMixPattern();
|
|
164
|
+
const lightDarkValue = `${colorValue}|${colorMixString}|${varString}`;
|
|
165
|
+
const lightDarkString = `light-dark\\((?:${lightDarkValue}),\\s*(?:${lightDarkValue})\\)`;
|
|
164
166
|
|
|
165
167
|
const colorRegex = new RegExp(
|
|
166
|
-
`^(${colorValue}|${colorMixString}|${varString})$`,
|
|
168
|
+
`^(${colorValue}|${colorMixString}|${lightDarkString}|${varString})$`,
|
|
167
169
|
);
|
|
168
170
|
const colorSource = colorRegex.source.slice(1, -1);
|
|
169
171
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Zero-runtime, expressive CSS-in-JS library for TypeScript.",
|
|
5
5
|
"repository": "github:zss-in-js/plumeria",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|