diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 0000000..5c3aafd --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"/Users/burhanyilmaz/girisim/womob/src/screens/Test/index.tsx":"1"},{"size":149,"mtime":1704617600996,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10og7mo","/Users/burhanyilmaz/girisim/womob/src/screens/Test/index.tsx",[],[]] \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..7857ac9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,24 @@ +module.exports = { + root: true, + extends: ['universe/native'], + rules: { + '@typescript-eslint/no-shadow': ['error'], + 'no-shadow': 'off', + 'no-undef': 'off', + indent: ['error', 2], + quotes: ['error', 'single'], + semi: ['error', 'always'], + 'no-console': ['error'], + '@typescript-eslint/no-unused-vars': ['error'], + 'no-use-before-define': 'off', + 'newline-before-return': ['error'], + 'react-hooks/exhaustive-deps': 0, + 'react/function-component-definition': 0, + 'arrow-body-style': [1, 'as-needed'], + 'object-curly-spacing': ['error', 'always'], + 'eslint-disable-next-line': 'off', + 'prettier/prettier': 'error', + 'import/newline-after-import': ['error'], + 'padding-line-between-statements': ['error', { blankLine: 'always', prev: '*', next: 'export' }], + }, +}; diff --git a/.husky/_/.gitignore b/.husky/_/.gitignore new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/.husky/_/.gitignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/.husky/_/husky.sh b/.husky/_/husky.sh new file mode 100644 index 0000000..cec959a --- /dev/null +++ b/.husky/_/husky.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env sh +if [ -z "$husky_skip_init" ]; then + debug () { + if [ "$HUSKY_DEBUG" = "1" ]; then + echo "husky (debug) - $1" + fi + } + + readonly hook_name="$(basename -- "$0")" + debug "starting $hook_name..." + + if [ "$HUSKY" = "0" ]; then + debug "HUSKY env variable is set to 0, skipping hook" + exit 0 + fi + + if [ -f ~/.huskyrc ]; then + debug "sourcing ~/.huskyrc" + . ~/.huskyrc + fi + + readonly husky_skip_init=1 + export husky_skip_init + sh -e "$0" "$@" + exitCode="$?" + + if [ $exitCode != 0 ]; then + echo "husky - $hook_name hook exited with code $exitCode (error)" + fi + + if [ $exitCode = 127 ]; then + echo "husky - command not found in PATH=$PATH" + fi + + exit $exitCode +fi diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..8baba6b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,19 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +if yarn run format; then + echo "✅ Code is formatted." +else + echo "❌ Code is not formatted. And maybe you need this command ⚠️ ⚠️ ⚠️ git add . ⚠️ ⚠️ ⚠️" + exit 1 +fi + + +if yarn validate ; then + echo "✅ Code is valid." +else + yarn validate --fix + echo "❌ Code is invalid. And maybe you need this command ⚠️ ⚠️ ⚠️ git add . ⚠️ ⚠️ ⚠️" + exit 1 +fi + diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..365bbc4 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,9 @@ + module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + tabWidth: 2, + semi: true, + singleQuote: true, + bracketSpacing: true, + printWidth: 1200, +} diff --git a/App.tsx b/App.tsx index b8f7637..fb5895e 100644 --- a/App.tsx +++ b/App.tsx @@ -1,12 +1,10 @@ -import { StatusBar } from "expo-status-bar"; -import { Text, View } from "react-native"; +import { StatusBar } from 'expo-status-bar'; +import { Text, View } from 'react-native'; export default function App() { return ( - - Open up App.tsx to start working on your app! - + Open up App.tsx to start working on your app! ); diff --git a/babel.config.js b/babel.config.js index 2fa972a..b56cafc 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,7 +1,8 @@ -module.exports = function(api) { +module.exports = function (api) { api.cache(true); + return { presets: ['babel-preset-expo'], - plugins: ["nativewind/babel"] + plugins: ['nativewind/babel'], }; }; diff --git a/bun.lockb b/bun.lockb index 7647933..f1d0523 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 32190bf..0bf5bc5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,14 @@ "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", - "web": "expo start --web" + "web": "expo start --web", + "lint": "eslint --cache \"./src/**/*.{ts,tsx,jsx,js}\" --max-warnings=0", + "lint:fix": "yarn lint --fix ", + "validate": "yarn prettier --check \"./src/**/*.{ts,tsx,js,jsx}\" && yarn lint ", + "format": "prettier --write \"./src/**/*.{ts,tsx,js,jsx}\"", + "format:test": "prettier --write \"./src/**/*.spec.{ts,tsx,js,jsx}\"", + "husky:install": "husky install", + "build:android:local": "eas build --platform android --local --profile preview" }, "dependencies": { "expo": "~49.0.15", @@ -18,8 +25,19 @@ "devDependencies": { "@babel/core": "^7.20.0", "@types/react": "~18.2.14", + "@typescript-eslint/eslint-plugin": "^6.4.0", + "eslint": "^8.56.0", + "eslint-config-standard-with-typescript": "^43.0.0", + "eslint-config-universe": "^12.0.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", + "eslint-plugin-prettier": "^5.1.2", + "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-react": "^7.33.2", + "husky": "^8.0.3", + "prettier": "^3.1.1", "tailwindcss": "3.3.2", - "typescript": "^5.1.3" + "typescript": "*" }, "private": true } diff --git a/src/screens/Test/index.tsx b/src/screens/Test/index.tsx new file mode 100644 index 0000000..dc75837 --- /dev/null +++ b/src/screens/Test/index.tsx @@ -0,0 +1,9 @@ +import { Text, View } from 'react-native'; + +const TestScreen = () => ( + + TestScreen + +); + +export default TestScreen;