Skip to content

Commit

Permalink
fix boolean comparison, remove flow-types packages
Browse files Browse the repository at this point in the history
  • Loading branch information
henrinie-nc committed Jun 19, 2024
1 parent 0edbdd8 commit 762922a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 663 deletions.
3 changes: 1 addition & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-flow"
"@babel/preset-react"
],
"env": {
"test": {
Expand Down
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
"instrument": false
},
"scripts": {
"flow": "flow; test $? -eq 0 -o $? -eq 2",
"flow-typed": "flow-typed install",
"lint": "eslint src",
"serve": "webpack serve",
"start": "node scripts/start.js",
"compile": "node scripts/compile.js",
"precommit": "npm-run-all flow lint",
"precommit": "npm-run-all lint",
"prepush": "npm-run-all test",
"test": "mocha --require @babel/register --require ts-node/register --require tsconfig-paths/register --require src/test.ts \"src/**/*spec.ts\"",
"test:coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text --require ts-node/register --require tsconfig-paths/register mocha \"src/**/*spec.ts\" --exit",
Expand Down Expand Up @@ -79,7 +77,6 @@
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.5.5",
"@babel/preset-flow": "^7.23.3",
"@babel/preset-react": "^7.23.3",
"@babel/register": "^7.23.7",
"@hot-loader/react-dom": "17.0.2",
Expand Down Expand Up @@ -107,11 +104,9 @@
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^8.56.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-react": "^7.14.3",
"favicons-webpack-plugin": "^6.0.1",
"file-loader": "^6.2.0",
"flow-typed": "^3.9.0",
"fs-extra": "^11.2.0",
"html-webpack-plugin": "^5.6.0",
"json-loader": "^0.5.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ const renderNotes = ({
return <NewCollectionNote key={index} field={field} onCancel={handleCancel} onSave={handleSave} />;
})}
<Authorization allow={hasPermissions(usersPermissions, UsersPermissions.ADD_COLLECTIONNOTE)}>
{/** @ts-ignore: Operator '<' cannot be applied to types 'boolean' and 'number' */}
{!!fields.length < 1 && <AddButtonThird label='Lisää huomautus' onClick={handleAdd} />}
{fields.length === 0 && <AddButtonThird label='Lisää huomautus' onClick={handleAdd} />}
</Authorization>
</Fragment>;
};
Expand Down
Loading

0 comments on commit 762922a

Please sign in to comment.