miaoda-expo-devkit 0.1.1-beta.47 → 0.1.1-beta.49
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.
|
@@ -45,6 +45,9 @@ function findProjectRoot(startPath) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// src/rules/no-undeclared-expo-plugin.ts
|
|
48
|
+
var PLUGIN_PACKAGE_ALIASES = /* @__PURE__ */ new Map([
|
|
49
|
+
["@react-native-async-storage/async-storage", "@react-native-async-storage/expo-with-async-storage"]
|
|
50
|
+
]);
|
|
48
51
|
var KNOWN_CONFIG_PLUGIN_PACKAGES = /* @__PURE__ */ new Set([
|
|
49
52
|
"expo-apple-authentication",
|
|
50
53
|
"expo-asset",
|
|
@@ -122,7 +125,8 @@ var requireExpoPluginRule = {
|
|
|
122
125
|
},
|
|
123
126
|
schema: [],
|
|
124
127
|
messages: {
|
|
125
|
-
missingPlugin: "'{{packageName}}' has a config plugin but is not declared in app.json \u2192 expo.plugins."
|
|
128
|
+
missingPlugin: "'{{packageName}}' has a config plugin but is not declared in app.json \u2192 expo.plugins.",
|
|
129
|
+
missingAliasPlugin: "'{{importPackage}}' requires '{{pluginPackage}}' to be declared in app.json \u2192 expo.plugins."
|
|
126
130
|
}
|
|
127
131
|
},
|
|
128
132
|
create(context) {
|
|
@@ -132,6 +136,19 @@ var requireExpoPluginRule = {
|
|
|
132
136
|
function check(node, importPath) {
|
|
133
137
|
const pkg = getPackageName(importPath);
|
|
134
138
|
if (!pkg) return;
|
|
139
|
+
const aliasPlugin = PLUGIN_PACKAGE_ALIASES.get(pkg);
|
|
140
|
+
if (aliasPlugin !== void 0) {
|
|
141
|
+
if (declaredPlugins.includes(aliasPlugin)) return;
|
|
142
|
+
const reportKey2 = `${projectRoot}::${pkg}`;
|
|
143
|
+
if (reportedPackages.has(reportKey2)) return;
|
|
144
|
+
reportedPackages.add(reportKey2);
|
|
145
|
+
context.report({
|
|
146
|
+
node,
|
|
147
|
+
messageId: "missingAliasPlugin",
|
|
148
|
+
data: { importPackage: pkg, pluginPackage: aliasPlugin }
|
|
149
|
+
});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
135
152
|
if (!KNOWN_CONFIG_PLUGIN_PACKAGES.has(pkg)) return;
|
|
136
153
|
if (declaredPlugins.includes(pkg)) return;
|
|
137
154
|
const reportKey = `${projectRoot}::${pkg}`;
|
|
@@ -46,6 +46,7 @@ function findProjectRoot(startPath) {
|
|
|
46
46
|
|
|
47
47
|
// src/rules/no-unused-expo-plugin.ts
|
|
48
48
|
var KNOWN_CONFIG_PLUGIN_PACKAGES = /* @__PURE__ */ new Set([
|
|
49
|
+
"@react-native-async-storage/expo-with-async-storage",
|
|
49
50
|
"expo-apple-authentication",
|
|
50
51
|
"expo-asset",
|
|
51
52
|
"expo-audio",
|