Skip to content

Commit b87c366

Browse files
Frontend audit (#1040)
* Frontend audit * Cleanup --------- Co-authored-by: Abhay V Ashokan <[email protected]>
1 parent 8a5ed70 commit b87c366

File tree

5 files changed

+3994
-2007
lines changed

5 files changed

+3994
-2007
lines changed

.husky/helpers/prevent_pushing_to_main.sh

-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ prevent_pushing_to_main() {
99
======================================================================================
1010
You are not authorized to push/commit directly to master/main branch in origin remote.
1111
Push from a new branch and make the PR.
12-
1312
Or if you are 100% sure you want to push/commit to master/main branch,
1413
then pass in the optional --no-verify option with the git command.
15-
1614
Example:
1715
# Warning: pushing to main is not recommended
1816
git push origin main --no-verify

.prettierrc.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
module.exports = require("@bigbinary/neeto-commons-frontend/configs/prettier.js");
1+
module.exports = {
2+
tailwindConfig: "./tailwind.config.js",
3+
trailingComma: "es5",
4+
arrowParens: "avoid",
5+
printWidth: 80,
6+
tabWidth: 2,
7+
useTabs: false,
8+
semi: true,
9+
quoteProps: "as-needed",
10+
jsxSingleQuote: false,
11+
singleQuote: false,
12+
bracketSpacing: true,
13+
bracketSameLine: false,
14+
proseWrap: "always",
15+
endOfLine: "lf",
16+
};

package.json

+79-67
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,28 @@
2727
"@babel/core": "^7.19.1",
2828
"@babel/eslint-parser": "7.17.0",
2929
"@babel/plugin-transform-runtime": "^7.19.1",
30-
"@babel/preset-env": "7.17.10",
31-
"@babel/preset-react": "7.16.7",
32-
"@babel/preset-typescript": "^7.18.6",
33-
"@babel/runtime": "^7.19.0",
34-
"@bigbinary/babel-preset-neeto": "^1.0.4",
35-
"@bigbinary/eslint-plugin-neeto": "^1.0.54",
36-
"@bigbinary/neeto-audit-frontend": "2.0.1",
37-
"@bigbinary/neeto-cist": "^1.0.2",
38-
"@bigbinary/neeto-commons-frontend": "^2.1.29",
39-
"@bigbinary/neeto-icons": "1.11.0",
40-
"@bigbinary/neeto-molecules": "^1.0.94",
41-
"@bigbinary/neetoui": "4.4.0",
42-
"@honeybadger-io/react": "2.0.1",
43-
"@rollup/plugin-alias": "3.1.9",
44-
"@rollup/plugin-babel": "5.3.1",
45-
"@rollup/plugin-commonjs": "22.0.2",
46-
"@rollup/plugin-json": "4.1.0",
47-
"@rollup/plugin-node-resolve": "13.3.0",
48-
"@rollup/plugin-replace": "4.0.0",
30+
"@babel/preset-env": "7.23.2",
31+
"@babel/preset-react": "7.22.15",
32+
"@babel/preset-typescript": "7.23.2",
33+
"@babel/runtime": "7.23.2",
34+
"@bigbinary/babel-preset-neeto": "1.0.6",
35+
"@bigbinary/eslint-plugin-neeto": "1.5.0",
36+
"@bigbinary/neeto-audit-frontend": "^2.0.9",
37+
"@bigbinary/neeto-cist": "1.0.9",
38+
"@bigbinary/neeto-commons-frontend": "3.2.4",
39+
"@bigbinary/neeto-filters-frontend": "3.2.8",
40+
"@bigbinary/neeto-icons": "1.18.0",
41+
"@bigbinary/neeto-molecules": "1.13.8",
42+
"@bigbinary/neetoui": "6.3.8",
43+
"@faker-js/faker": "8.2.0",
44+
"@honeybadger-io/js": "6.5.3",
45+
"@honeybadger-io/react": "6.1.9",
46+
"@rollup/plugin-alias": "5.0.1",
47+
"@rollup/plugin-babel": "6.0.4",
48+
"@rollup/plugin-commonjs": "25.0.7",
49+
"@rollup/plugin-json": "6.0.1",
50+
"@rollup/plugin-node-resolve": "15.2.3",
51+
"@rollup/plugin-replace": "5.0.4",
4952
"@storybook/addon-actions": "6.5.16",
5053
"@storybook/addon-docs": "6.5.16",
5154
"@storybook/addon-essentials": "6.5.16",
@@ -57,7 +60,7 @@
5760
"@storybook/preset-scss": "1.0.3",
5861
"@storybook/react": "6.5.16",
5962
"@storybook/testing-library": "0.0.13",
60-
"@svgr/rollup": "6.3.1",
63+
"@svgr/rollup": "8.1.0",
6164
"@tippyjs/react": "4.2.6",
6265
"@tiptap/extension-bubble-menu": "2.0.0-beta.199",
6366
"@tiptap/extension-character-count": "2.0.0-beta.199",
@@ -84,107 +87,116 @@
8487
"@uppy/drop-target": "2.0.1",
8588
"@uppy/react": "2.2.2",
8689
"@uppy/url": "2.2.0",
87-
"antd": "4.24.3",
88-
"autoprefixer": "^10.4.5",
90+
"antd": "5.10.2",
91+
"autoprefixer": "10.4.16",
8992
"axios": "1.6.2",
90-
"babel-loader": "^8.2.5",
91-
"babel-plugin-istanbul": "^6.1.1",
93+
"babel-loader": "9.1.3",
94+
"babel-plugin-istanbul": "6.1.1",
9295
"babel-plugin-js-logger": "1.0.17",
9396
"babel-plugin-macros": "3.1.0",
9497
"babel-plugin-preval": "^5.1.0",
9598
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
9699
"babel-preset-react": "6.24.1",
97-
"babel-preset-typescript": "^7.0.0-alpha.19",
98-
"classnames": "2.3.1",
100+
"babel-preset-typescript": "7.0.0-alpha.19",
101+
"classnames": "2.3.2",
99102
"crypto-js": "4.1.1",
100103
"css-loader": "6.7.1",
101104
"dompurify": "2.4.0",
102105
"emoji-mart": "5.2.2",
103-
"eslint": "8.14.0",
106+
"eslint": "8.52.0",
104107
"eslint-config-prettier": "8.5.0",
105-
"eslint-plugin-cypress": "2.12.1",
106-
"eslint-plugin-import": "2.26.0",
108+
"eslint-plugin-cypress": "2.15.1",
109+
"eslint-plugin-import": "2.29.0",
107110
"eslint-plugin-jam3": "0.2.3",
108111
"eslint-plugin-json": "3.1.0",
109112
"eslint-plugin-prettier": "4.0.0",
110-
"eslint-plugin-promise": "6.0.0",
111-
"eslint-plugin-react": "7.29.4",
112-
"eslint-plugin-react-hooks": "4.5.0",
113-
"eslint-plugin-unused-imports": "2.0.0",
113+
"eslint-plugin-promise": "6.1.1",
114+
"eslint-plugin-react": "7.33.2",
115+
"eslint-plugin-react-hooks": "4.6.0",
116+
"eslint-plugin-security": "1.7.1",
117+
"eslint-plugin-sonarjs": "0.21.0",
118+
"eslint-plugin-unused-imports": "3.0.0",
119+
"eslint-plugin-xss": "0.1.12",
114120
"express": "^4.18.2",
115-
"formik": "2.2.9",
121+
"formik": "2.4.5",
116122
"fuse.js": "6.6.2",
117-
"husky": "8.0.1",
118-
"i18next": "23.2.7",
119-
"js-logger": "^1.6.1",
120-
"lint-staged": "12.4.1",
123+
"husky": "8.0.3",
124+
"i18next": "23.6.0",
125+
"js-logger": "1.6.1",
126+
"lint-staged": "15.0.2",
121127
"lowlight": "2.7.0",
122128
"postcss": "8.4.14",
123129
"postcss-import": "14.1.0",
124130
"postcss-loader": "4.3.0",
125131
"postcss-preset-env": "7.8.2",
126132
"prettier": "2.6.2",
127133
"prettier-plugin-tailwindcss": "0.1.10",
128-
"ramda": "0.29.0",
134+
"qs": "6.11.2",
135+
"ramda": "0.29.1",
129136
"re-resizable": "6.9.9",
130-
"react": "^18.2.0",
137+
"react": "18.2.0",
131138
"react-colorful": "5.6.1",
132139
"react-doc-viewer": "^0.1.5",
133-
"react-dom": "^18.2.0",
140+
"react-dom": "18.2.0",
134141
"react-file-icon": "^1.3.0",
135142
"react-helmet": "6.1.0",
136143
"react-hotkeys-hook": "3.4.7",
137-
"react-i18next": "13.0.1",
144+
"react-i18next": "13.3.1",
138145
"react-masonry-infinite": "1.2.2",
139146
"react-popper": "2.3.0",
140147
"react-query": "3.39.3",
141-
"react-router-dom": "5.3.3",
142-
"react-toastify": "8.0.2",
148+
"react-router-dom": "5.3.4",
149+
"react-toastify": "8.2.0",
143150
"rollup": "2.79.1",
144151
"rollup-plugin-analyzer": "4.0.0",
152+
"rollup-plugin-cleaner": "1.0.0",
145153
"rollup-plugin-copy": "^3.5.0",
146154
"rollup-plugin-peer-deps-external": "2.2.4",
147155
"rollup-plugin-styles": "4.0.0",
148-
"sass": "1.55.0",
156+
"sass": "1.69.5",
149157
"sass-loader": "13.0.2",
150158
"storybook-dark-mode": "^2.1.1",
151159
"style-loader": "3.3.1",
152-
"tailwindcss": "^3.4.1",
160+
"tailwindcss": "3.4.1",
153161
"tippy.js": "6.3.7",
162+
"util": "0.12.5",
154163
"webpack": "5.73.0",
155164
"webpack-cli": "4.10.0",
156165
"webpack-dev-server": "4.9.3",
157-
"yup": "0.32.11"
166+
"yup": "1.3.2"
158167
},
159168
"peerDependencies": {
160169
"@bigbinary/babel-preset-neeto": "latest",
161170
"@bigbinary/neeto-cist": "latest",
162-
"@bigbinary/neeto-commons-frontend": "latest",
163-
"@bigbinary/neeto-icons": "latest",
164-
"@bigbinary/neeto-molecules": "latest",
165-
"@bigbinary/neetoui": "latest",
166-
"@honeybadger-io/react": "2.0.1",
171+
"@bigbinary/neeto-commons-frontend": "3.2.4",
172+
"@bigbinary/neeto-filters-frontend": "3.2.8",
173+
"@bigbinary/neeto-icons": "1.18.0",
174+
"@bigbinary/neeto-molecules": "1.13.8",
175+
"@bigbinary/neetoui": "6.3.8",
176+
"@honeybadger-io/js": "^6.5.3",
177+
"@honeybadger-io/react": "^6.1.9",
167178
"antd": "4.24.3",
168179
"axios": "1.6.2",
169-
"formik": "2.2.9",
170-
"i18next": "23.2.7",
180+
"classnames": "^2.3.2",
181+
"formik": "^2.4.5",
182+
"i18next": "^23.6.0",
171183
"js-logger": "^1.6.1",
172-
"ramda": "0.29.0",
173-
"react": "18.2.0",
174-
"react-dom": "18.2.0",
175-
"react-helmet": "6.1.0",
176-
"react-i18next": "13.0.1",
177-
"react-query": "3.39.3",
178-
"react-router-dom": "5.3.3",
179-
"react-toastify": "8.0.2",
180-
"yup": "0.32.11"
184+
"ramda": "^0.29.1",
185+
"react": "^18.2.0",
186+
"react-dom": "^18.2.0",
187+
"react-helmet": "^6.1.0",
188+
"react-i18next": "^13.3.1",
189+
"react-query": "^3.39.3",
190+
"react-router-dom": "^5.3.4",
191+
"react-toastify": "^8.2.0",
192+
"yup": "^0.32.11"
181193
},
182194
"scripts": {
183-
"prepare": "husky install",
184-
"storybook": "start-storybook -p 6006",
185-
"bundle": "NODE_ENV=production rollup -c rollup.config.js",
186195
"build": "build-storybook",
187-
"serve": "node .storybook/express"
196+
"bundle": "NODE_ENV=production rollup -c rollup.config.js",
197+
"prepare": "husky install",
198+
"serve": "node .storybook/express",
199+
"storybook": "start-storybook -p 6006"
188200
},
189201
"lint-staged": {
190202
"src/**/*.{js,jsx,json}": [

src/utils/ActiveStorageUpload.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
12
import { BasePlugin } from "@uppy/core";
23
import { isEmpty } from "ramda";
34

@@ -41,11 +42,10 @@ class ActiveStorageUpload extends BasePlugin {
4142
};
4243

4344
this.uppy.on("file-removed", removedFile => {
44-
if (removedFile.id === file.id) {
45-
upload.abort();
46-
if (isEmpty(this.uppy.getFiles())) {
47-
this.uppy.emit("complete");
48-
}
45+
if (!(removedFile.id === file.id)) return;
46+
upload.abort();
47+
if (isEmpty(this.uppy.getFiles())) {
48+
this.uppy.emit("complete");
4949
}
5050
});
5151

0 commit comments

Comments
 (0)