Skip to content

Commit 40e689d

Browse files
committed
feat: version 1 with more customizable options
1 parent 3148ec0 commit 40e689d

57 files changed

Lines changed: 60630 additions & 16018 deletions

Some content is hidden

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

.commitlintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"header-max-length": [0, "always", 150],
5+
"subject-case": [0, "always", "sentence-case"],
6+
"type-enum": [
7+
2,
8+
"always",
9+
[
10+
"ci",
11+
"chore",
12+
"docs",
13+
"feat",
14+
"fix",
15+
"perf",
16+
"refactor",
17+
"revert",
18+
"style",
19+
"test"
20+
]
21+
]
22+
}
23+
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/**

.eslintrc.js

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
module.exports = {
22
root: true,
3-
extends: "@react-native-community",
3+
extends: [
4+
"eslint:recommended",
5+
"plugin:react/recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"@react-native-community",
8+
"prettier",
9+
],
10+
ignorePatterns: [
11+
"**/*/*.js",
12+
"*.js",
13+
"*.svg",
14+
"*.json",
15+
"*.png",
16+
"package.json",
17+
"package-lock.json",
18+
],
419
parser: "@typescript-eslint/parser",
5-
plugins: ["import", "eslint-plugin-import", "@typescript-eslint"],
20+
plugins: [
21+
"import",
22+
"react",
23+
"react-native",
24+
"prettier",
25+
"react-hooks",
26+
"@typescript-eslint",
27+
"promise",
28+
"jest",
29+
"unused-imports",
30+
],
31+
env: {
32+
browser: true,
33+
es2021: true,
34+
"jest/globals": true,
35+
"react-native/react-native": true,
36+
},
637
settings: {
738
"import/resolver": {
839
node: {
@@ -36,9 +67,25 @@ module.exports = {
3667
avoidEscape: true,
3768
},
3869
],
70+
"import/extensions": [
71+
"error",
72+
"never",
73+
{
74+
svg: "always",
75+
model: "always",
76+
style: "always",
77+
png: "always",
78+
jpg: "always",
79+
json: "always",
80+
constant: "always",
81+
},
82+
],
83+
"no-useless-catch": 0,
84+
"react-hooks/exhaustive-deps": 0,
3985
"max-len": ["error", 120],
40-
"@typescript-eslint/ban-ts-comment": 2,
41-
"@typescript-eslint/no-explicit-any": 2,
86+
"@typescript-eslint/ban-ts-comment": 1,
87+
"@typescript-eslint/no-empty-function": 0,
88+
"@typescript-eslint/no-explicit-any": 1,
4289
"@typescript-eslint/explicit-module-boundary-types": 0,
4390
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
4491
"react-native/no-unused-styles": 2,
@@ -47,9 +94,8 @@ module.exports = {
4794
"react-native/no-color-literals": 0,
4895
"react-native/no-raw-text": 0,
4996
"import/no-extraneous-dependencies": 2,
50-
"import/extensions": ["error", "never", { svg: "always" }],
5197
"import/no-named-as-default-member": 2,
52-
"import/order": ["error", { "newlines-between": "always" }],
98+
"import/order": 0,
5399
"import/no-duplicates": 2,
54100
"import/no-useless-path-segments": 2,
55101
"import/no-cycle": 2,
@@ -64,14 +110,14 @@ module.exports = {
64110
"import/no-deprecated": 0,
65111
"@typescript-eslint/indent": 0,
66112
"react-hooks/rules-of-hooks": 2,
67-
"react-hooks/exhaustive-deps": [
68-
"error",
69-
{ additionalHooks: "(useMemoOne)" },
70-
],
71-
"jest/no-identical-title": 2,
72-
"jest/valid-expect": 2,
73113
camelcase: 2,
74114
"prefer-destructuring": 2,
75115
"no-nested-ternary": 2,
116+
"prettier/prettier": [
117+
"error",
118+
{
119+
endOfLine: "auto",
120+
},
121+
],
76122
},
77123
};

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run prettier
5+
npm run lint

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/**

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"bracketSpacing": true,
3+
"jsxBracketSameLine": false,
4+
"singleQuote": false,
5+
"trailingComma": "all",
6+
"tabWidth": 2,
7+
"semi": true
8+
}

.prettierrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ It accepts every `Image` and `FastImage` props. You can use it like you used to.
6868

6969
# Configuration - Props
7070

71-
useNativeDriver?: boolean;
7271

7372
| Property | Type | Default | Description |
7473
| --------------------- | :-----------------: | :-------: | ------------------------------------- |
@@ -83,7 +82,7 @@ useNativeDriver?: boolean;
8382

8483
If you want to set your own component for the loading image, you should set this **style** for the top of the component
8584

86-
```javascript
85+
```tsc
8786
{
8887
top: 0,
8988
left: 0,
@@ -98,13 +97,19 @@ If you want to set your own component for the loading image, you should set this
9897

9998
## Customization Props
10099

101-
| Property | Type | Default | Description |
102-
| -------------------------- | :-----: | :-----: | ------------------------------------------- |
103-
| style | style | default | change or override main image style |
104-
| loadingImageStyle | style | default | change or override loading image style |
105-
| thumbnailAnimationDuration | number | default | change the thumbnail animation's duration |
106-
| imageAnimationDuration | number | default | change the main image animation's duration |
107-
| useNativeDriver | boolean | true | change the animations useNativeDriver value |
100+
101+
| Property | Type | Default | Description |
102+
|----------------------------|:--------:|:-------:|--------------------------------------------------|
103+
| style | style | default | change or override main image style |
104+
| loadingImageContainerStyle | style | default | change or override loading image container style |
105+
| loadingImageStyle | style | default | change or override loading image style |
106+
| thumbnailImageStyle | style | default | change or override thumbnail image style |
107+
| thumbnailAnimationDuration | number | default | change the thumbnail animation's duration |
108+
| imageAnimationDuration | number | default | change the main image animation's duration |
109+
| onLoad | function | default | calling the onLoad |
110+
| onThumbnailLoad | function | default | calling the onThumbnailLoad |
111+
| onLoadEnd | function | default | calling the onLoadEnd |
112+
| onError | function | default | calling the onError |
108113

109114
## Future Plans
110115

example/.buckconfig

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)