Skip to content

Commit

Permalink
refactor: update folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Howl authored and Howl committed Sep 29, 2024
1 parent ee014f4 commit f3c4be8
Show file tree
Hide file tree
Showing 223 changed files with 25,054 additions and 14,288 deletions.
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

82 changes: 82 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
root: true,
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
extends: ['plugin:@typescript-eslint/recommended-type-checked'],
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-ignore': 'allow-with-description',
'ts-expect-error': 'allow-with-description',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
},
},
],
parserOptions: {
requireConfigFile: false,
},
extends: [
'standard',
'prettier',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
],
plugins: ['react', 'react-native', 'import', 'jest', '@typescript-eslint'],
env: {
'react-native/react-native': true,
'jest/globals': true,
},
settings: {
'import/resolver': {
'babel-module': {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'object-shorthand': 'error',
curly: ['error', 'all'],
'no-case-declarations': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-uses-react': 'error',
'no-use-before-define': 'off',
eqeqeq: 'error',
'no-unreachable': 'error',
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
'react/react-in-jsx-scope': 'off',
camelcase: 'off',
},
};
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
64 changes: 27 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
apple/build
ios/build
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -30,49 +22,47 @@ DerivedData
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
android/build
*.iml
.idea
.project
.settings
.gradle
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/
android/src/main/JNILibs/
android/.cxx

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
package-lock.json

# vscode
jsconfig.json
.project
.vscode

# BUCK
buck-out/
bin/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
# CocoaPods
apple/Pods/

# generated by bob
lib/

# Eclipse
.settings/

# yarn
**/.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
lib/
# pre-commit
.husky/log.txt
41 changes: 41 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

print() {
echo " [PRECOMMIT]: $1" >&2
}

# `lint-staged` is great, but its' parsing capabilites of more advanced CLIs is poor.
# We can use it reliably only with programs that expect the following syntax:
# command [options] [arg1] [arg2] [arg3] ...
# more sophisiticated checks should be done in this script without `lint-staged`.
print 'Running "lint-staged" ...'
yarn lint-staged

LOGFILE=.husky/log.txt
try() {
if ! "$@" >"$LOGFILE" 2>&1; then
print "Errors detected. Aborting commit."
print "Error logs:\n"
cat "$LOGFILE"
exit 1
fi
}

# Some precommit checks can take several seconds. Therefore, we
# want them to trigger only when relevant files are staged.
STAGED_FILES=$(git diff-index HEAD --cached --name-only)

print "Checking for changes in TypeScript source files..."
if echo "$STAGED_FILES" | grep "packages/react-native-calendar-kit/src/.*\.\(ts\|tsx\)$" --silent; then
print "Running TypeScript checks..."

try yarn workspace @howljs/calendar-kit type:check

print "Success."
else
print "No changes. Skipping TypeScript checks."
fi

print "All good, committing..."

exit 0
4 changes: 4 additions & 0 deletions .lintstagedrc-common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('lint-staged').Config} */
module.exports = {
'*.(js|ts|tsx)': ['yarn eslint', 'yarn prettier --write'],
};
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
Loading

0 comments on commit f3c4be8

Please sign in to comment.