@ng-native/eslint-plugin 0.27.0 → 0.28.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.
Files changed (2) hide show
  1. package/index.mjs +13 -1
  2. package/package.json +2 -2
package/index.mjs CHANGED
@@ -151,6 +151,16 @@ function buildsForDesktop(context) {
151
151
  return platformsAbove(dirname(filename)).some((os) => DESKTOP_PLATFORMS.has(os));
152
152
  }
153
153
 
154
+ /**
155
+ * Whether the project a file is in lists iOS or Android in the nearest `app.json`'s
156
+ * `expo.platforms`. A desktop-only app lists desktop OSes alone. Read where the project lists a
157
+ * desktop OS, since with none listed it builds for both phones, as Expo does by default.
158
+ */
159
+ function buildsForPhone(context) {
160
+ const filename = context.physicalFilename ?? context.filename;
161
+ return platformsAbove(dirname(filename)).some((os) => os === 'ios' || os === 'android');
162
+ }
163
+
154
164
  function platformsAbove(directory) {
155
165
  const file = join(directory, 'app.json');
156
166
  const stat = statSync(file, { throwIfNoEntry: false });
@@ -282,7 +292,9 @@ const desktopOnlyEvents = {
282
292
  schema: [],
283
293
  },
284
294
  create(context) {
285
- if (isDomComponent(context) || !buildsForDesktop(context)) return {};
295
+ if (isDomComponent(context) || !buildsForDesktop(context) || !buildsForPhone(context)) {
296
+ return {};
297
+ }
286
298
  const check = (where, name) => {
287
299
  const event = name.split('.')[0];
288
300
  const known = DOM_EVENTS.get(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ng-native/eslint-plugin",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "ESLint rules for Angular Native: the DOM events, HTML controls and browser APIs that compile but do nothing on a device.",
5
5
  "keywords": [
6
6
  "angular",
@@ -17,7 +17,7 @@
17
17
  "./package.json": "./package.json"
18
18
  },
19
19
  "dependencies": {
20
- "@ng-native/metro": "0.27.0"
20
+ "@ng-native/metro": "0.28.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "angular-eslint": "^22.0.0",