Skip to content

Commit 3aa4681

Browse files
committed
fix: 🐛 eslint config
1 parent 5e4ff28 commit 3aa4681

Some content is hidden

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

48 files changed

+229
-228
lines changed

hackathon/spacecraft/.eslintrc.js

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ module.exports = {
1414
plugins: [
1515
"react",
1616
"react-native",
17-
"simple-import-sort",
18-
"perfectionist", // Existing plugins plus 'perfectionist'
17+
"perfectionist", // Keep only 'perfectionist'
1918
],
2019
root: true, // Make sure eslint picks up the config at the root of the directory
2120
rules: {
2221
"@typescript-eslint/no-explicit-any": "warn", // Detect usage of `any` type
2322
"@typescript-eslint/no-unused-vars": "warn", // Detect unused variables
2423
camelcase: "off", // Disable camelcase rule
25-
"perfectionist/sort-imports": "error", // Previous perfectionist rule
26-
"perfectionist/sort-interfaces": ["error"], // New perfectionist rule
27-
"perfectionist/sort-objects": ["error", { type: "alphabetical" }], // New perfectionist rule
24+
"perfectionist/sort-imports": "error", // Perfectionist import sorting
25+
"perfectionist/sort-interfaces": ["error"], // Perfectionist interfaces sorting
26+
"perfectionist/sort-objects": ["error", { type: "alphabetical" }], // Perfectionist objects sorting
2827
"prettier/prettier": [
2928
"warn",
3029
{
@@ -35,19 +34,7 @@ module.exports = {
3534
"react-native/no-raw-text": 0, // Detect raw text outside of Text component
3635
"react-native/no-unused-styles": 2, // Detect unused StyleSheet rules
3736
"react-native/sort-styles": 2, // Enforce style definitions are sorted
38-
"simple-import-sort/exports": "warn", // Enforce sorting exports within module
39-
"simple-import-sort/imports": [
40-
"warn",
41-
{
42-
groups: [
43-
["^\\u0000"],
44-
["^react", "^@?\\w"],
45-
["^(@env)(/.*|$)"],
46-
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
47-
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
48-
],
49-
},
50-
],
37+
"react/no-unescaped-entities": "off",
5138
},
5239
settings: {
5340
perfectionist: {

hackathon/spacecraft/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from "react";
2+
import Constants from "expo-constants";
23
import { Provider as PaperProvider } from "react-native-paper";
34
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4-
import Constants from "expo-constants";
55

6-
import { AuthenticationProvider } from "~/context/Authentication";
6+
import { Navigator } from "~/navigation/Navigator";
77
import { NetworkProvider } from "~/context/Network";
88
import { useAppearanceTheme } from "~/hooks/useAppearanceTheme";
9-
import { Navigator } from "~/navigation/Navigator";
9+
import { AuthenticationProvider } from "~/context/Authentication";
1010

1111
const queryClient = new QueryClient();
1212

hackathon/spacecraft/api/types.d.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
export interface StarshipProps {
2+
films?: [];
3+
pilots?: [];
4+
name: string;
5+
url?: string;
26
MGLT?: string;
3-
cargo_capacity?: string;
4-
consumables?: string;
5-
cost_in_credits?: string;
6-
created?: string;
77
crew?: string;
8+
model: string;
89
edited?: string;
9-
films?: [];
10-
hyperdrive_rating?: string;
1110
length?: string;
12-
manufacturer?: string;
13-
max_atmosphering_speed?: string;
14-
model: string;
15-
name: string;
11+
created?: string;
1612
passengers?: string;
17-
pilots?: [];
13+
consumables?: string;
14+
manufacturer?: string;
15+
cargo_capacity?: string;
1816
starship_class?: string;
19-
url?: string;
17+
cost_in_credits?: string;
18+
hyperdrive_rating?: string;
19+
max_atmosphering_speed?: string;
2020
}
2121

2222
interface PeopleProps {
23+
url: string;
2324
name: string;
24-
height: string;
2525
mass: string;
26-
hair_color: string;
27-
skin_color: string;
28-
eye_color: string;
29-
birth_year: string;
26+
height: string;
3027
gender: string;
31-
homeworld: string;
28+
edited: string;
3229
films: string[];
30+
created: string;
31+
eye_color: string;
32+
homeworld: string;
3333
species: string[];
34+
hair_color: string;
35+
skin_color: string;
36+
birth_year: string;
3437
vehicles: string[];
3538
starships: string[];
36-
created: string;
37-
edited: string;
38-
url: string;
3939
}

hackathon/spacecraft/app.config.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
module.exports = {
2-
name: "spacecraft",
3-
description: "Learning materials for the `react-native-bootcamp` repository.",
4-
slug: "spacecraft",
5-
owner: "weshipit",
6-
version: "1.0.2",
7-
orientation: "portrait",
8-
icon: "./assets/icon.png",
9-
splash: {
10-
image: "./assets/splash.png",
11-
resizeMode: "contain",
12-
backgroundColor: "#ffffff",
13-
},
14-
updates: {
15-
fallbackToCacheTimeout: 0,
16-
url: "https://u.expo.dev/012accc3-4ce5-4bae-9f4d-2f842489f07a",
17-
},
18-
assetBundlePatterns: ["**/*"],
19-
ios: {
20-
supportsTablet: true,
21-
bundleIdentifier: "weshipit.today.spacecraft",
22-
appStoreUrl:
23-
"https://apps.apple.com/fr/app/retail-shake-scanner/id1234567890",
24-
},
252
android: {
263
adaptiveIcon: {
27-
foregroundImage: "./assets/adaptive-icon.png",
284
backgroundColor: "#FFFFFF",
5+
foregroundImage: "./assets/adaptive-icon.png",
296
},
307
package: "weshipit.today.spacecraft",
318
playStoreUrl:
329
"https://play.google.com/store/apps/details?id=weshipit.today.spacecraft",
3310
},
34-
web: {
35-
favicon: "./assets/favicon.png",
36-
},
11+
assetBundlePatterns: ["**/*"],
12+
description: "Learning materials for the `react-native-bootcamp` repository.",
3713
extra: {
38-
storybookEnabled: process.env.STORYBOOK_ENABLED,
3914
eas: {
4015
projectId: "012accc3-4ce5-4bae-9f4d-2f842489f07a",
4116
},
17+
storybookEnabled: process.env.STORYBOOK_ENABLED,
18+
},
19+
icon: "./assets/icon.png",
20+
ios: {
21+
appStoreUrl:
22+
"https://apps.apple.com/fr/app/retail-shake-scanner/id1234567890",
23+
bundleIdentifier: "weshipit.today.spacecraft",
24+
supportsTablet: true,
4225
},
26+
name: "spacecraft",
27+
orientation: "portrait",
28+
owner: "weshipit",
4329
plugins: [
4430
[
4531
"app-icon-badge",
4632
{
4733
// enable/ disable the plugin based on the environment (usually disabled for production builds)
48-
enabled: process.env.ENVIRONMENT === "production" ? false : true,
4934
badges: [
5035
{
36+
background: "#FF0000", // by default it will be black and we are only supporting hex format for colors
37+
color: "white", // by default it will be white and the only color supported for now is white and black
5138
text: process.env.ENVIRONMENT || "unkown", // banner text
5239
type: "banner", // banner or ribbon
53-
color: "white", // by default it will be white and the only color supported for now is white and black
54-
background: "#FF0000", // by default it will be black and we are only supporting hex format for colors
5540
},
5641
{
5742
text: process.env.version,
5843
type: "ribbon",
5944
},
6045
],
46+
enabled: process.env.ENVIRONMENT === "production" ? false : true,
6147
},
6248
],
6349
],
50+
slug: "spacecraft",
51+
splash: {
52+
backgroundColor: "#ffffff",
53+
image: "./assets/splash.png",
54+
resizeMode: "contain",
55+
},
56+
updates: {
57+
fallbackToCacheTimeout: 0,
58+
url: "https://u.expo.dev/012accc3-4ce5-4bae-9f4d-2f842489f07a",
59+
},
60+
version: "1.0.2",
61+
web: {
62+
favicon: "./assets/favicon.png",
63+
},
6464
};

hackathon/spacecraft/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module.exports = function (api) {
22
api.cache(true);
33
return {
4-
presets: ["babel-preset-expo"],
54
env: {
65
production: {
76
plugins: ["transform-remove-console", "react-native-paper/babel"],
@@ -10,5 +9,6 @@ module.exports = function (api) {
109
plugins: [
1110
"react-native-reanimated/plugin", // order matters
1211
],
12+
presets: ["babel-preset-expo"],
1313
};
1414
};

hackathon/spacecraft/metro.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// metro.config.js
22
const path = require("path");
3-
43
const { getDefaultConfig } = require("expo/metro-config");
54
const { generate } = require("@storybook/react-native/scripts/generate");
65

hackathon/spacecraft/src/components/Card.stories.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import { NavigationContainer } from "@react-navigation/native";
21
import type { StarshipProps } from "api/types";
32

3+
import { NavigationContainer } from "@react-navigation/native";
4+
45
import { StarshipCard } from "~/components/StarshipCard";
56

67
const shipFixture = {
7-
name: "Millennium Falcon",
88
model: "YT-1300 light freighter",
9+
name: "Millennium Falcon",
910
};
1011

1112
const tieFixture: StarshipProps = {
12-
name: "tieadvanced x1",
13-
model: "tieadvanced x1",
1413
cost_in_credits: "unknown",
14+
model: "tieadvanced x1",
15+
name: "tieadvanced x1",
1516
};
1617

1718
export default {

hackathon/spacecraft/src/components/FromInput.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import type { TextInputProps } from "react-native-paper";
2+
13
import React from "react";
24
import { View } from "react-native";
3-
import type { TextInputProps } from "react-native-paper";
45
import { TextInput } from "react-native-paper";
56

67
export const FormInput = ({
78
label,
8-
value,
99
onChangeText,
10+
value,
1011
...rest
1112
}: TextInputProps) => (
1213
<View style={{ paddingVertical: 8 }}>

hackathon/spacecraft/src/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
2+
import Constants from "expo-constants";
23
import { StyleSheet, View } from "react-native";
34
import { Text, useTheme } from "react-native-paper";
4-
import Constants from "expo-constants";
55

66
type HeaderProps = {
77
title: string;

hackathon/spacecraft/src/components/Image.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import React from "react";
21
// import type { ImageProps } from "expo-image";
32
import type { ImageProps } from "react-native";
4-
import { Image as RNImage } from "react-native";
53
import type { AnimatedProps } from "react-native-reanimated";
4+
5+
import React from "react";
66
import Animated from "react-native-reanimated";
7+
import { Image as RNImage } from "react-native";
78
import { Image as ExpoImage } from "expo-image";
89

910
const AnimatedImage = Animated.createAnimatedComponent(RNImage);

0 commit comments

Comments
 (0)