Skip to content

Commit 8cf2110

Browse files
authored
Merge pull request #2 from scaleflex/Improve-refactor-to-support-React-18-T9926
Improve: Refactoring & Upgrade to React18 - T9926
2 parents cd2686b + 930f7fd commit 8cf2110

21 files changed

+6745
-932
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[
44
"@babel/preset-env"
55
],
6-
"@babel/preset-react"
6+
["@babel/preset-react", {"runtime": "automatic"}]
77
],
88
"plugins": [
99
"@babel/plugin-syntax-dynamic-import",

.eslintrc.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"plugin:react/recommended",
8+
"airbnb"
9+
],
10+
"overrides": [
11+
],
12+
"ignorePatterns": ["webpack-demo.config.js", "**/vendor/*.js"],
13+
"parserOptions": {
14+
"ecmaVersion": "latest",
15+
"sourceType": "module"
16+
},
17+
"plugins": [
18+
"react"
19+
],
20+
"rules": {
21+
"no-useless-escape": "off",
22+
"linebreak-style": 0,
23+
"no-debugger":"off",
24+
"jsx-quotes": [
25+
"error",
26+
"prefer-double"
27+
],
28+
"max-lines": [
29+
"warn",
30+
{
31+
"max": 1250,
32+
"skipBlankLines": true,
33+
"skipComments": true
34+
}
35+
],
36+
"max-len": [
37+
"warn",
38+
{
39+
"code": 1120,
40+
"tabWidth": 4,
41+
"ignoreComments": true,
42+
"ignoreTrailingComments": true,
43+
"ignoreUrls": true
44+
}
45+
],
46+
"no-param-reassign": 0,
47+
"no-multiple-empty-lines": [
48+
"error",
49+
{
50+
"max": 2,
51+
"maxEOF": 0
52+
}
53+
],
54+
"no-use-before-define": [
55+
"error",
56+
{
57+
"functions": false
58+
}
59+
],
60+
"no-unused-vars": "warn",
61+
"react/function-component-definition": [
62+
"error",
63+
{
64+
"namedComponents": "function-declaration"
65+
}
66+
],
67+
"react/jsx-key": "error",
68+
"react/require-default-props": "off",
69+
"no-underscore-dangle": "off",
70+
"no-plusplus": "off",
71+
"react/forbid-prop-types": "off",
72+
"react/prop-types": "off",
73+
"react/jsx-uses-react": "off",
74+
"react/no-danger": "off",
75+
"camelcase": "off",
76+
"consistent-return": "off",
77+
"react/jsx-filename-extension": [
78+
"error",
79+
{
80+
"extensions": [
81+
".js",
82+
".jsx"
83+
]
84+
}
85+
],
86+
"react/jsx-pascal-case": "warn",
87+
"react/jsx-one-expression-per-line": "warn",
88+
"react/jsx-no-useless-fragment": "warn",
89+
"react/jsx-no-duplicate-props": "error",
90+
"react/jsx-wrap-multilines": "warn",
91+
"react/no-array-index-key": "off",
92+
"react/jsx-props-no-spreading": "off",
93+
"react/react-in-jsx-scope": "off",
94+
"import/newline-after-import": [
95+
"error",
96+
{
97+
"count": 2
98+
}
99+
],
100+
"import/no-unresolved": "error",
101+
"import/no-cycle": "off",
102+
"import/no-unused-modules": "off",
103+
"import/no-commonjs": "error",
104+
"import/no-nodejs-modules": "warn",
105+
"import/first": "warn",
106+
"import/exports-last": "error",
107+
"import/no-duplicates": "warn",
108+
"import/no-namespace": "off",
109+
"import/order": "warn",
110+
"import/prefer-default-export": "off",
111+
"import/no-extraneous-dependencies": "off",
112+
"import/no-anonymous-default-export": "error",
113+
"jsx-a11y/no-noninteractive-element-interactions": "off",
114+
"jsx-a11y/click-events-have-key-events": "off",
115+
"react-hooks/exhaustive-deps": "off",
116+
"react/no-unescaped-entities": "off"
117+
}
118+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Types of changes:
2525
- ...
2626

2727
-------------
28+
## 2.0.0 - 2022-08-19
29+
### Fixed
30+
- Low preview image width
31+
2832
## 1.6.9 - 2022-04-29
2933
### Fixed
3034
- Low preview image width

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Release](https://img.shields.io/badge/release-v1.6.9-blue.svg)](https://github.com/scaleflex/js-cloudimage-responsive/releases)
1+
[![Release](https://img.shields.io/github/v/release/scaleflex/react-cloudimage-responsive-plain)](https://github.com/scaleflex/js-cloudimage-responsive/releases)
22
[![Free plan](https://img.shields.io/badge/price-includes%20free%20plan-green.svg)](https://www.cloudimage.io/en/home#b38181a6-b9c8-4015-9742-7b1a1ad382d5)
33
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing)
44
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
@@ -70,6 +70,7 @@ Cloudimage, contact us at
7070

7171
* [Demo](#demo)
7272
* [Responsive plugins family](#plugin_family)
73+
* [Compatibility](#compatibility)
7374
* [Requirements](#requirements)
7475
* [Step 1: Installation](#installation)
7576
* [Step 2: Initialize](#initialize)
@@ -95,10 +96,15 @@ loading time.
9596
In order to use Cloudimage responsive plugins on your single-page application, please check out Cloudimage responsive plugins for vanilla Javascript and the most popular Javascript frameworks.
9697

9798
<details>
98-
<summary>Javascript</summary>
99-
<a href="https://github.com/scaleflex/js-cloudimage-responsive">Js Cloudimage Responsive (Low Quality Preview)</a><br/>
100-
<a href="https://github.com/scaleflex/js-cloudimage-responsive/blob/master/README-BLUR-HASH.md">Js Cloudimage Responsive (Blur-hash)</a><br/>
101-
<a href="https://github.com/scaleflex/js-cloudimage-responsive/blob/master/README-PLAIN.md">Js Cloudimage Responsive (Plain)</a>
99+
<summary>React</summary>
100+
<a href="https://github.com/scaleflex/react-cloudimage-responsive">React Cloudimage Responsive (Low Quality Preview)</a><br/>
101+
<a href="https://github.com/scaleflex/react-cloudimage-responsive-blur-hash">React Cloudimage Responsive (Blur-hash)</a><br/>
102+
<a href="https://github.com/scaleflex/react-cloudimage-responsive-plain">React Cloudimage Responsive (Plain)</a>
103+
</details>
104+
105+
<details>
106+
<summary>Next.js</summary>
107+
<a href="https://github.com/scaleflex/next-cloudimage-responsive">Vue Cloudimage Responsive (Low Quality Preview)</a><br/>
102108
</details>
103109

104110
<details>
@@ -113,6 +119,13 @@ In order to use Cloudimage responsive plugins on your single-page application, p
113119
<a href="https://github.com/scaleflex/ng-cloudimage-responsive">Angular Cloudimage Responsive (Low Quality Preview)</a><br/>
114120
</details>
115121

122+
## <a name="compatibility"></a> Compatibility
123+
| Version | React Version |
124+
|---------|--------------|
125+
| >4.0.0 | >=18.0.0 |
126+
| <=1.6.9 | <=17.x.x |
127+
128+
116129
## <a name="requirements"/> Requirements
117130

118131
To use the Cloudimage Responsive plugin, you will need a

0 commit comments

Comments
 (0)