Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix boolean comparison, remove flow-types packages #493

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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