-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Howl
authored and
Howl
committed
Sep 29, 2024
1 parent
ee014f4
commit f3c4be8
Showing
223 changed files
with
25,054 additions
and
14,288 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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', | ||
}, | ||
}; |
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,3 +1,3 @@ | ||
*.pbxproj -text | ||
# specific for windows script files | ||
*.bat text eol=crlf | ||
/.yarn/** linguist-vendored | ||
/.yarn/releases/* binary | ||
/.yarn/plugins/**/* binary |
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,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 |
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,4 @@ | ||
/** @type {import('lint-staged').Config} */ | ||
module.exports = { | ||
'*.(js|ts|tsx)': ['yarn eslint', 'yarn prettier --write'], | ||
}; |
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 @@ | ||
build |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,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 |
Oops, something went wrong.