Skip to content

Commit 3595a63

Browse files
authored
feat(eslint): publish eslint package (#140)
1 parent 4e99b13 commit 3595a63

44 files changed

Lines changed: 2485 additions & 4550 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/branch-validation.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ jobs:
5858
- name: 🏗 Setup Turborepo Cache
5959
uses: dtinth/setup-github-actions-caching-for-turbo@v1
6060

61-
- name: 🧹 Dedupe
62-
run: pnpm dedupe --check
63-
6461
- name: 🧪 Typecheck
6562
run: pnpm run typecheck
6663

.github/workflows/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
branches:
77
- main
8+
paths:
9+
- "packages/modal/**"
810

911
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1012
permissions:

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ dist
7575
junit.xml
7676
docs
7777

78-
**/README.md
79-
78+
**/modal/README.md
8079

8180
.pnp.*
8281
.yarn/*

examples/kitchen-sink/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExpoConfig } from "expo/config";
1+
import type { ExpoConfig } from "expo/config";
22

33
export default {
44
name: "react-native-magic-modal-example",

examples/kitchen-sink/babel.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
// @ts-expect-error -- TODO: Convert to TS
12
module.exports = (api) => {
3+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
24
api.cache(true);
35
return {
46
presets: ["babel-preset-expo"],
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { join } from "path";
2+
import { includeIgnoreFile } from "@eslint/compat";
3+
import reactNativeConfig from "magic-eslint-config/react-native";
4+
5+
/** @type {import('typescript-eslint').Config} */
6+
export default [
7+
includeIgnoreFile(join(import.meta.dirname, "../../.gitignore")),
8+
...reactNativeConfig,
9+
{
10+
rules: {
11+
"@shopify/jsx-no-hardcoded-content": "off",
12+
},
13+
},
14+
];

examples/kitchen-sink/metro.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-require-imports */
21
// https://github.com/expo/router/blob/main/apps/demo/metro.config.js
32
// Learn more https://docs.expo.io/guides/customizing-metro
43
const { getDefaultConfig } = require("expo/metro-config");
@@ -11,6 +10,7 @@ const workspaceRoot = path.resolve(projectRoot, "../..");
1110

1211
const config = getDefaultConfig(__dirname);
1312

13+
// @ts-expect-error -- TODO: Convert to TS
1414
config.watcher = {
1515
// +73.3
1616
...config.watcher,
@@ -22,15 +22,18 @@ config.watcher = {
2222
// 1. Watch all files within the monorepo
2323
config.watchFolders = [workspaceRoot];
2424
// 2. Let Metro know where to resolve packages and in what order
25+
// @ts-expect-error -- TODO: Convert to TS
2526
config.resolver.nodeModulesPaths = [
2627
path.resolve(projectRoot, "node_modules"),
2728
path.resolve(workspaceRoot, "node_modules"),
2829
];
2930

3031
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
32+
// @ts-expect-error -- TODO: Convert to TS
3133
config.resolver.disableHierarchicalLookup = true;
3234

3335
const { FileStore } = require("metro-cache");
36+
// @ts-expect-error -- TODO: Convert to TS
3437
config.cacheStores = [
3538
// Ensure the cache isn't shared between projects
3639
// this ensures the transform-time environment variables are changed to reflect

examples/kitchen-sink/package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
}
2626
}
2727
},
28-
"eslintConfig": {
29-
"root": true,
30-
"extends": [
31-
"@magic/eslint-config/expo"
32-
]
33-
},
3428
"dependencies": {
3529
"expo": "^52.0.16",
3630
"expo-constants": "~17.0.2",
@@ -41,16 +35,16 @@
4135
"expo-status-bar": "~2.0.0",
4236
"react": "18.3.1",
4337
"react-dom": "18.3.1",
44-
"react-native": "0.76.5",
38+
"react-native": "0.76.9",
4539
"react-native-gesture-handler": "2.20.2",
4640
"react-native-reanimated": "~3.16.5",
4741
"react-native-safe-area-context": "4.12.0",
48-
"react-native-screens": "~4.1.0",
42+
"react-native-screens": "~4.4.0",
4943
"react-native-web": "~0.19.13"
5044
},
5145
"devDependencies": {
5246
"@babel/core": "^7.20.0",
53-
"@magic/eslint-config": "workspace:*",
47+
"magic-eslint-config": "workspace:*",
5448
"@magic/prettier-config": "workspace:*",
5549
"@magic/tsconfig": "workspace:*",
5650
"expo-doctor": "1.12.4"

examples/kitchen-sink/src/app/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
/* eslint-disable react-native/no-color-literals */
2+
import type { Direction } from "react-native-magic-modal";
23
import React from "react";
34
import { Platform, Pressable, StyleSheet, Text } from "react-native";
45
import { ScrollView } from "react-native-gesture-handler";
5-
import {
6-
Direction,
7-
magicModal,
8-
MagicModalHideReason,
9-
} from "react-native-magic-modal";
6+
import { magicModal, MagicModalHideReason } from "react-native-magic-modal";
107
import { ZoomIn, ZoomOut } from "react-native-reanimated";
118
import { router } from "expo-router";
129
import { StatusBar } from "expo-status-bar";
@@ -39,14 +36,18 @@ const showModal = async () => {
3936
console.log("Modal closed with response:", await modalResponse.promise);
4037
};
4138

42-
type ModalResponse = {
39+
interface ModalResponse {
4340
message: string;
44-
};
41+
}
4542

4643
const showReplacingModals = async () => {
4744
const modalResponse = magicModal.show<ModalResponse>(() => <ExampleModal />);
4845

49-
await new Promise<void>((resolve) => setTimeout(() => resolve(), 1000));
46+
await new Promise<void>((resolve) =>
47+
setTimeout(() => {
48+
resolve();
49+
}, 1000),
50+
);
5051

5152
magicModal.hide<ModalResponse>(
5253
{ message: "close timeout" },
@@ -125,7 +126,9 @@ export default () => {
125126
<>
126127
<Pressable
127128
style={styles.button}
128-
onPress={() => router.push("/modal")}
129+
onPress={() => {
130+
router.push("/modal");
131+
}}
129132
>
130133
<Text style={styles.buttonText}>Open Modal Screen</Text>
131134
</Pressable>

examples/kitchen-sink/src/components/ExampleModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const ExampleModal = () => {
1515
This is an example to showcase the imperative Magic Modal!
1616
</Text>
1717
<Pressable
18-
onPress={() => hide("close button pressed")}
18+
onPress={() => {
19+
hide("close button pressed");
20+
}}
1921
style={styles.buttonContainer}
2022
>
2123
<Text style={styles.button}>Close Modal</Text>

0 commit comments

Comments
 (0)