-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added elint, prettier and husky
- Loading branch information
1 parent
00b8807
commit 71f2c6c
Showing
11 changed files
with
125 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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",[],[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' }], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
tabWidth: 2, | ||
semi: true, | ||
singleQuote: true, | ||
bracketSpacing: true, | ||
printWidth: 1200, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Text, View } from 'react-native'; | ||
|
||
const TestScreen = () => ( | ||
<View> | ||
<Text>TestScreen</Text> | ||
</View> | ||
); | ||
|
||
export default TestScreen; |