@tamagui/eslint-plugin 3.0.7 → 3.0.8
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/cjs/index.native.cjs +4 -4
- package/dist/cjs/index.native.js +4 -4
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/validFlatValues.native.cjs +2 -2
- package/dist/cjs/validFlatValues.native.js +2 -2
- package/dist/cjs/validFlatValues.native.js.map +1 -1
- package/dist/esm/index.native.js +4 -4
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/validFlatValues.native.js +2 -2
- package/dist/esm/validFlatValues.native.js.map +1 -1
- package/package.json +5 -5
|
@@ -49,15 +49,15 @@ var validFlatValues = {
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
create(context) {
|
|
52
|
+
var _ref;
|
|
52
53
|
var option = context.options[0];
|
|
53
54
|
var config = (option === null || option === void 0 ? void 0 : option.config) || {};
|
|
54
|
-
var
|
|
55
|
-
var strictPayloads = (_option_strictPayloads = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _option_strictPayloads !== void 0 ? _option_strictPayloads : false;
|
|
55
|
+
var strictPayloads = (_ref = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _ref !== void 0 ? _ref : false;
|
|
56
56
|
var registry = (0, import_tooling.createModifierRegistry)(config).registry;
|
|
57
57
|
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
58
58
|
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
59
59
|
var sourceCode = context.sourceCode;
|
|
60
|
-
var report = function(site) {
|
|
60
|
+
var report = function report2(site) {
|
|
61
61
|
var node = site.node;
|
|
62
62
|
var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {
|
|
63
63
|
config,
|
|
@@ -107,7 +107,7 @@ var validFlatValues = {
|
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
109
|
return { "Program:exit"(program) {
|
|
110
|
-
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function(name) {
|
|
110
|
+
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function isStyleProp(name) {
|
|
111
111
|
return styleProps.has(name);
|
|
112
112
|
} });
|
|
113
113
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -49,15 +49,15 @@ var validFlatValues = {
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
create(context) {
|
|
52
|
+
var _ref;
|
|
52
53
|
var option = context.options[0];
|
|
53
54
|
var config = (option === null || option === void 0 ? void 0 : option.config) || {};
|
|
54
|
-
var
|
|
55
|
-
var strictPayloads = (_option_strictPayloads = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _option_strictPayloads !== void 0 ? _option_strictPayloads : false;
|
|
55
|
+
var strictPayloads = (_ref = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _ref !== void 0 ? _ref : false;
|
|
56
56
|
var registry = (0, import_tooling.createModifierRegistry)(config).registry;
|
|
57
57
|
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
58
58
|
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
59
59
|
var sourceCode = context.sourceCode;
|
|
60
|
-
var report = function(site) {
|
|
60
|
+
var report = function report2(site) {
|
|
61
61
|
var node = site.node;
|
|
62
62
|
var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {
|
|
63
63
|
config,
|
|
@@ -107,7 +107,7 @@ var validFlatValues = {
|
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
109
|
return { "Program:exit"(program) {
|
|
110
|
-
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function(name) {
|
|
110
|
+
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function isStyleProp(name) {
|
|
111
111
|
return styleProps.has(name);
|
|
112
112
|
} });
|
|
113
113
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n default: () => index_default,\n rules: () => rules,\n validFlatValues: () => validFlatValues\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_extract_estree = require(\"@tamagui/language-service/extract-estree\");\nvar import_tooling = require(\"@tamagui/style-grammar/tooling\");\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n },\n strictPayloads: {\n type: \"boolean\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\n__export(index_exports, {\n default: () => index_default,\n rules: () => rules,\n validFlatValues: () => validFlatValues\n});\nmodule.exports = __toCommonJS(index_exports);\nvar import_extract_estree = require(\"@tamagui/language-service/extract-estree\");\nvar import_tooling = require(\"@tamagui/style-grammar/tooling\");\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n },\n strictPayloads: {\n type: \"boolean\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var _ref;\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var strictPayloads = (_ref = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _ref !== void 0 ? _ref : false;\n var registry = (0, import_tooling.createModifierRegistry)(config).registry;\n var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);\n var styleProps = (0, import_tooling.createStylePropSet)(config);\n var sourceCode = context.sourceCode;\n var report = function report2(site) {\n var node = site.node;\n var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {\n config,\n registry,\n candidates,\n strictPayloads\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = (0, import_tooling.canonicalizeStyleValue)(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, {\n isStyleProp: function isStyleProp(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\nvar rules = {\n \"valid-flat-values\": validFlatValues\n};\nvar plugin = {\n meta: {\n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AS,GAAG;GAC5B,IAAI,aAAa,GAAG,eAAe,uBAAsB,CAAE,KAAK,OAAO,QAAQ;GAC/E,IAAI,CAAC,UAAU,MAAM,UAAU,UAAU,KAAK,OAAO;GACrD,IAAI,YAAY,UAAU;GAC1B,QAAQ,OAAO;IACb;IACA,WAAW;IACX,MAAM,EACJ,UACF;IACA,IAAI,OAAO;KACT,OAAO,MAAM,YAAY,MAAM,KAAK,UAAU,SAAS,CAAC;IAC1D;GACF,CAAC;EACH;EACA,OAAO,EACL,eAAe,SAAS;GACtB,IAAI,SAAS,GAAG,sBAAsB,4BAA2B,CAAE,SAAS,EAC1E,aAAa,SAAS,YAAY,MAAM;IACtC,OAAO,WAAW,IAAI,IAAI;GAC5B,EACF,CAAC;GACD,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;GACvF,IAAI;IACF,KAAK,IAAI,YAAY,MAAM,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;KACtJ,IAAI,OAAO,MAAM;KACjB,OAAO,IAAI;IACb;GACF,SAAS,KAAK;IACZ,oBAAoB;IACpB,iBAAiB;GACnB,UAAU;IACR,IAAI;KACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;MAC1D,UAAU,OAAO;KACnB;IACF,UAAU;KACR,IAAI,mBAAmB;MACrB,MAAM;KACR;IACF;GACF;EACF,EACF;CACF;AACF;AACA,IAAI,QAAQ,EACV,qBAAqB,gBACvB;AACA,IAAI,SAAS;CACX,MAAM,EACJ,MAAM,yBACR;CACA;AACF;AACA,IAAI,gBAAgB"}
|
|
@@ -48,7 +48,7 @@ var validFlatValues = {
|
|
|
48
48
|
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
49
49
|
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
50
50
|
var sourceCode = context.sourceCode;
|
|
51
|
-
var report = function(site) {
|
|
51
|
+
var report = function report2(site) {
|
|
52
52
|
var node = site.node;
|
|
53
53
|
var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {
|
|
54
54
|
config,
|
|
@@ -97,7 +97,7 @@ var validFlatValues = {
|
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
99
|
return { "Program:exit"(program) {
|
|
100
|
-
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function(name) {
|
|
100
|
+
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function isStyleProp(name) {
|
|
101
101
|
return styleProps.has(name);
|
|
102
102
|
} });
|
|
103
103
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
@@ -48,7 +48,7 @@ var validFlatValues = {
|
|
|
48
48
|
var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);
|
|
49
49
|
var styleProps = (0, import_tooling.createStylePropSet)(config);
|
|
50
50
|
var sourceCode = context.sourceCode;
|
|
51
|
-
var report = function(site) {
|
|
51
|
+
var report = function report2(site) {
|
|
52
52
|
var node = site.node;
|
|
53
53
|
var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {
|
|
54
54
|
config,
|
|
@@ -97,7 +97,7 @@ var validFlatValues = {
|
|
|
97
97
|
});
|
|
98
98
|
};
|
|
99
99
|
return { "Program:exit"(program) {
|
|
100
|
-
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function(name) {
|
|
100
|
+
var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, { isStyleProp: function isStyleProp(name) {
|
|
101
101
|
return styleProps.has(name);
|
|
102
102
|
} });
|
|
103
103
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validFlatValues.native.js","names":[],"sources":["cjs/validFlatValues.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar validFlatValues_exports = {};\n__export(validFlatValues_exports, {\n validFlatValues: () => validFlatValues\n});\nmodule.exports = __toCommonJS(validFlatValues_exports);\nvar import_extract_estree = require(\"@tamagui/language-service/extract-estree\");\nvar import_tooling = require(\"@tamagui/style-grammar/tooling\");\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var registry = (0, import_tooling.createModifierRegistry)(config).registry;\n var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);\n var styleProps = (0, import_tooling.createStylePropSet)(config);\n var sourceCode = context.sourceCode;\n var report = function(site) {\n var node = site.node;\n var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {\n config,\n registry,\n candidates\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = (0, import_tooling.canonicalizeStyleValue)(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, {\n isStyleProp: function(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\n//# sourceMappingURL=validFlatValues.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QA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aAAa,QAAQ;EACzB,IAAI,SAAS,SAAS,MAAM;
|
|
1
|
+
{"version":3,"file":"validFlatValues.native.js","names":[],"sources":["cjs/validFlatValues.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar validFlatValues_exports = {};\n__export(validFlatValues_exports, {\n validFlatValues: () => validFlatValues\n});\nmodule.exports = __toCommonJS(validFlatValues_exports);\nvar import_extract_estree = require(\"@tamagui/language-service/extract-estree\");\nvar import_tooling = require(\"@tamagui/style-grammar/tooling\");\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var registry = (0, import_tooling.createModifierRegistry)(config).registry;\n var candidates = (0, import_tooling.createCandidatePropertyVocabulary)(config);\n var styleProps = (0, import_tooling.createStylePropSet)(config);\n var sourceCode = context.sourceCode;\n var report = function report2(site) {\n var node = site.node;\n var diagnostics = (0, import_tooling.diagnoseStyleValueProgram)(site.property, site.value, {\n config,\n registry,\n candidates\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = (0, import_tooling.canonicalizeStyleValue)(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = (0, import_extract_estree.extractStyleSitesFromEstree)(program, {\n isStyleProp: function isStyleProp(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\n//# sourceMappingURL=validFlatValues.js.map\n"],"mappings":";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AK,UAAU,SAAS,CAAC;IAC1D;GACF,CAAC;EACH;EACA,OAAO,EACL,eAAe,SAAS;GACtB,IAAI,SAAS,GAAG,sBAAsB,4BAA2B,CAAE,SAAS,EAC1E,aAAa,SAAS,YAAY,MAAM;IACtC,OAAO,WAAW,IAAI,IAAI;GAC5B,EACF,CAAC;GACD,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;GACvF,IAAI;IACF,KAAK,IAAI,YAAY,MAAM,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;KACtJ,IAAI,OAAO,MAAM;KACjB,OAAO,IAAI;IACb;GACF,SAAS,KAAK;IACZ,oBAAoB;IACpB,iBAAiB;GACnB,UAAU;IACR,IAAI;KACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;MAC1D,UAAU,OAAO;KACnB;IACF,UAAU;KACR,IAAI,mBAAmB;MACrB,MAAM;KACR;IACF;GACF;EACF,EACF;CACF;AACF"}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -21,15 +21,15 @@ var validFlatValues = {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
create(context) {
|
|
24
|
+
var _ref;
|
|
24
25
|
var option = context.options[0];
|
|
25
26
|
var config = (option === null || option === void 0 ? void 0 : option.config) || {};
|
|
26
|
-
var
|
|
27
|
-
var strictPayloads = (_option_strictPayloads = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _option_strictPayloads !== void 0 ? _option_strictPayloads : false;
|
|
27
|
+
var strictPayloads = (_ref = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _ref !== void 0 ? _ref : false;
|
|
28
28
|
var registry = createModifierRegistry(config).registry;
|
|
29
29
|
var candidates = createCandidatePropertyVocabulary(config);
|
|
30
30
|
var styleProps = createStylePropSet(config);
|
|
31
31
|
var sourceCode = context.sourceCode;
|
|
32
|
-
var report = function(site) {
|
|
32
|
+
var report = function report2(site) {
|
|
33
33
|
var node = site.node;
|
|
34
34
|
var diagnostics = diagnoseStyleValueProgram(site.property, site.value, {
|
|
35
35
|
config,
|
|
@@ -79,7 +79,7 @@ var validFlatValues = {
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
return { "Program:exit"(program) {
|
|
82
|
-
var sites = extractStyleSitesFromEstree(program, { isStyleProp: function(name) {
|
|
82
|
+
var sites = extractStyleSitesFromEstree(program, { isStyleProp: function isStyleProp(name) {
|
|
83
83
|
return styleProps.has(name);
|
|
84
84
|
} });
|
|
85
85
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { extractStyleSitesFromEstree } from \"@tamagui/language-service/extract-estree\";\nimport { canonicalizeStyleValue, createCandidatePropertyVocabulary, createModifierRegistry, createStylePropSet, diagnoseStyleValueProgram } from \"@tamagui/style-grammar/tooling\";\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n },\n strictPayloads: {\n type: \"boolean\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { extractStyleSitesFromEstree } from \"@tamagui/language-service/extract-estree\";\nimport { canonicalizeStyleValue, createCandidatePropertyVocabulary, createModifierRegistry, createStylePropSet, diagnoseStyleValueProgram } from \"@tamagui/style-grammar/tooling\";\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n },\n strictPayloads: {\n type: \"boolean\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var _ref;\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var strictPayloads = (_ref = option === null || option === void 0 ? void 0 : option.strictPayloads) !== null && _ref !== void 0 ? _ref : false;\n var registry = createModifierRegistry(config).registry;\n var candidates = createCandidatePropertyVocabulary(config);\n var styleProps = createStylePropSet(config);\n var sourceCode = context.sourceCode;\n var report = function report2(site) {\n var node = site.node;\n var diagnostics = diagnoseStyleValueProgram(site.property, site.value, {\n config,\n registry,\n candidates,\n strictPayloads\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = canonicalizeStyleValue(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = extractStyleSitesFromEstree(program, {\n isStyleProp: function isStyleProp(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\nvar rules = {\n \"valid-flat-values\": validFlatValues\n};\nvar plugin = {\n meta: {\n name: \"@tamagui/eslint-plugin\"\n },\n rules\n};\nvar index_default = plugin;\nexport {\n index_default as default,\n rules,\n validFlatValues\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AAEA,IAAI,kBAAkB;CACpB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,MAAM,EACJ,aAAa,kEACf;EACA,QAAQ,CACN;GACE,MAAM;GACN,YAAY;IACV,QAAQ,EACN,MAAM,SACR;IACA,gBAAgB,EACd,MAAM,UACR;GACF;GACA,UAAU,CACR,QACF;GACA,sBAAsB;EACxB,CACF;EACA,UAAU;GACR,kBAAkB;GAClB,uBAAuB;EACzB;CACF;CACA,OAAO,SAAS;EACd,IAAI;EACJ,IAAI,SAAS,QAAQ,QAAQ;EAC7B,IAAI,UAAU,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,WAAW,CAAC;EACjF,IAAI,kBAAkB,OAAO,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,oBAAoB,QAAQ,SAAS,KAAK,IAAI,OAAO;EACzI,IAAI,WAAW,uBAAuB,MAAM,CAAC,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C,aAAa,SAAS,YAAY,MAAM;IACtC,OAAO,WAAW,IAAI,IAAI;GAC5B,EACF,CAAC;GACD,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;GACvF,IAAI;IACF,KAAK,IAAI,YAAY,MAAM,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;KACtJ,IAAI,OAAO,MAAM;KACjB,OAAO,IAAI;IACb;GACF,SAAS,KAAK;IACZ,oBAAoB;IACpB,iBAAiB;GACnB,UAAU;IACR,IAAI;KACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;MAC1D,UAAU,OAAO;KACnB;IACF,UAAU;KACR,IAAI,mBAAmB;MACrB,MAAM;KACR;IACF;GACF;EACF,EACF;CACF;AACF;AACA,IAAI,QAAQ,EACV,qBAAqB,gBACvB;AACA,IAAI,SAAS;CACX,MAAM,EACJ,MAAM,yBACR;CACA;AACF;AACA,IAAI,gBAAgB"}
|
|
@@ -24,7 +24,7 @@ var validFlatValues = {
|
|
|
24
24
|
var candidates = createCandidatePropertyVocabulary(config);
|
|
25
25
|
var styleProps = createStylePropSet(config);
|
|
26
26
|
var sourceCode = context.sourceCode;
|
|
27
|
-
var report = function(site) {
|
|
27
|
+
var report = function report2(site) {
|
|
28
28
|
var node = site.node;
|
|
29
29
|
var diagnostics = diagnoseStyleValueProgram(site.property, site.value, {
|
|
30
30
|
config,
|
|
@@ -73,7 +73,7 @@ var validFlatValues = {
|
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
return { "Program:exit"(program) {
|
|
76
|
-
var sites = extractStyleSitesFromEstree(program, { isStyleProp: function(name) {
|
|
76
|
+
var sites = extractStyleSitesFromEstree(program, { isStyleProp: function isStyleProp(name) {
|
|
77
77
|
return styleProps.has(name);
|
|
78
78
|
} });
|
|
79
79
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validFlatValues.native.js","names":[],"sources":["esm/validFlatValues.native.js"],"sourcesContent":["import { extractStyleSitesFromEstree } from \"@tamagui/language-service/extract-estree\";\nimport { canonicalizeStyleValue, createCandidatePropertyVocabulary, createModifierRegistry, createStylePropSet, diagnoseStyleValueProgram } from \"@tamagui/style-grammar/tooling\";\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var registry = createModifierRegistry(config).registry;\n var candidates = createCandidatePropertyVocabulary(config);\n var styleProps = createStylePropSet(config);\n var sourceCode = context.sourceCode;\n var report = function(site) {\n var node = site.node;\n var diagnostics = diagnoseStyleValueProgram(site.property, site.value, {\n config,\n registry,\n candidates\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = canonicalizeStyleValue(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = extractStyleSitesFromEstree(program, {\n isStyleProp: function(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\nexport {\n validFlatValues\n};\n//# sourceMappingURL=validFlatValues.js.map\n"],"mappings":";;;;AAEA,IAAI,kBAAkB;CACpB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,MAAM,EACJ,aAAa,kEACf;EACA,QAAQ,CACN;GACE,MAAM;GACN,YAAY,EACV,QAAQ,EACN,MAAM,SACR,EACF;GACA,UAAU,CACR,QACF;GACA,sBAAsB;EACxB,CACF;EACA,UAAU;GACR,kBAAkB;GAClB,uBAAuB;EACzB;CACF;CACA,OAAO,SAAS;EACd,IAAI,SAAS,QAAQ,QAAQ;EAC7B,IAAI,UAAU,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,WAAW,CAAC;EACjF,IAAI,WAAW,uBAAuB,MAAM,CAAC,CAAC;EAC9C,IAAI,aAAa,kCAAkC,MAAM;EACzD,IAAI,aAAa,mBAAmB,MAAM;EAC1C,IAAI,aAAa,QAAQ;EACzB,IAAI,SAAS,SAAS,MAAM;
|
|
1
|
+
{"version":3,"file":"validFlatValues.native.js","names":[],"sources":["esm/validFlatValues.native.js"],"sourcesContent":["import { extractStyleSitesFromEstree } from \"@tamagui/language-service/extract-estree\";\nimport { canonicalizeStyleValue, createCandidatePropertyVocabulary, createModifierRegistry, createStylePropSet, diagnoseStyleValueProgram } from \"@tamagui/style-grammar/tooling\";\nvar validFlatValues = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n docs: {\n description: \"validate static Tamagui flat values with @tamagui/style-grammar\"\n },\n schema: [\n {\n type: \"object\",\n properties: {\n config: {\n type: \"object\"\n }\n },\n required: [\n \"config\"\n ],\n additionalProperties: false\n }\n ],\n messages: {\n invalidFlatValue: \"{{message}}\",\n nonCanonicalFlatValue: 'use the canonical flat value \"{{canonical}}\"'\n }\n },\n create(context) {\n var option = context.options[0];\n var config = (option === null || option === void 0 ? void 0 : option.config) || {};\n var registry = createModifierRegistry(config).registry;\n var candidates = createCandidatePropertyVocabulary(config);\n var styleProps = createStylePropSet(config);\n var sourceCode = context.sourceCode;\n var report = function report2(site) {\n var node = site.node;\n var diagnostics = diagnoseStyleValueProgram(site.property, site.value, {\n config,\n registry,\n candidates\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = diagnostics[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var diagnostic = _step.value;\n context.report({\n node,\n // the engine reports value-relative spans; surface them exactly\n loc: {\n start: sourceCode.getLocFromIndex(site.start + diagnostic.start),\n end: sourceCode.getLocFromIndex(site.start + diagnostic.end)\n },\n messageId: \"invalidFlatValue\",\n data: {\n message: diagnostic.message\n }\n });\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (diagnostics.length > 0) return;\n var formatted = canonicalizeStyleValue(site.value, registry);\n if (!formatted.ok || formatted.value === site.value) return;\n var canonical = formatted.value;\n context.report({\n node,\n messageId: \"nonCanonicalFlatValue\",\n data: {\n canonical\n },\n fix(fixer) {\n return fixer.replaceText(node, JSON.stringify(canonical));\n }\n });\n };\n return {\n \"Program:exit\"(program) {\n var sites = extractStyleSitesFromEstree(program, {\n isStyleProp: function isStyleProp(name) {\n return styleProps.has(name);\n }\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = sites[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var site = _step.value;\n report(site);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n };\n }\n};\nexport {\n validFlatValues\n};\n//# sourceMappingURL=validFlatValues.js.map\n"],"mappings":";;;;AAEA,IAAI,kBAAkB;CACpB,MAAM;EACJ,MAAM;EACN,SAAS;EACT,MAAM,EACJ,aAAa,kEACf;EACA,QAAQ,CACN;GACE,MAAM;GACN,YAAY,EACV,QAAQ,EACN,MAAM,SACR,EACF;GACA,UAAU,CACR,QACF;GACA,sBAAsB;EACxB,CACF;EACA,UAAU;GACR,kBAAkB;GAClB,uBAAuB;EACzB;CACF;CACA,OAAO,SAAS;EACd,IAAI,SAAS,QAAQ,QAAQ;EAC7B,IAAI,UAAU,WAAW,QAAQ,WAAW,KAAK,IAAI,KAAK,IAAI,OAAO,WAAW,CAAC;EACjF,IAAI,WAAW,uBAAuB,MAAM,CAAC,CAAC;EAC9C,IAAI,aAAa,kCAAkC,MAAM;EACzD,IAAI,aAAa,mBAAmB,MAAM;EAC1C,IAAI,aAAa,QAAQ;EACzB,IAAI,SAAS,SAAS,QAAQ,MAAM;GAClC,IAAI,OAAO,KAAK;GAChB,IAAI,cAAc,0B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C,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;KACtJ,IAAI,OAAO,MAAM;KACjB,OAAO,IAAI;IACb;GACF,SAAS,KAAK;IACZ,oBAAoB;IACpB,iBAAiB;GACnB,UAAU;IACR,IAAI;KACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;MAC1D,UAAU,OAAO;KACnB;IACF,UAAU;KACR,IAAI,mBAAmB;MACrB,MAAM;KACR;IACF;GACF;EACF,EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/eslint-plugin",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"test:web": "vitest --run test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@tamagui/style-grammar": "3.0.
|
|
35
|
-
"@tamagui/language-service": "3.0.
|
|
34
|
+
"@tamagui/style-grammar": "3.0.8",
|
|
35
|
+
"@tamagui/language-service": "3.0.8"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"eslint": ">=9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@tamagui/build": "3.0.
|
|
41
|
+
"@tamagui/build": "3.0.8",
|
|
42
42
|
"eslint": "10.8.0",
|
|
43
43
|
"vitest": "4.1.0"
|
|
44
44
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
48
48
|
"directory": "code/core/eslint-plugin"
|
|
49
49
|
},
|
|
50
|
-
"releaseSourceCommit": "
|
|
50
|
+
"releaseSourceCommit": "b723356193510591d9ad15877b8937e8e6a31910"
|
|
51
51
|
}
|