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

[Snyk] Upgrade eslint-config-expensify from 2.0.48 to 2.0.50 #728

Merged
merged 6 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/Cookie.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function enabled() {
const cookieName = `cookieTest_${Math.floor(Math.random() * 1000)}`;
const cookieValue = 'enabled';
set(cookieName, cookieValue, 1);
const result = Boolean(document.cookie.indexOf(cookieName) >= 0) || false;
const result = document.cookie.indexOf(cookieName) >= 0 || false;
if (result) {
remove(cookieName);
}
Expand Down
9 changes: 4 additions & 5 deletions lib/components/form/element/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class Combobox extends React.Component {

const formatOption = (option) => ({
focused: false,
isSelected: option.selected && (isEqual(option.value, currentValue) || Boolean(alreadySelected.find((item) => item.value === option.value))),
isSelected: option.selected && (isEqual(option.value, currentValue) || !!alreadySelected.find((item) => item.value === option.value)),
...option,
});

Expand Down Expand Up @@ -551,7 +551,7 @@ class Combobox extends React.Component {
const deselectOption = (initialOption) => {
const option = initialOption;
const isSelected = isEqual(option.value, val);
option.isSelected = isSelected || Boolean(this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value));
option.isSelected = isSelected || !!this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value);

return option;
};
Expand Down Expand Up @@ -655,7 +655,7 @@ class Combobox extends React.Component {
}
const state = this.getStartState(noDefaultValue, this.options, newAlreadySelectedOptions);
const handleDropdownStateChange = () => {
this.props.onDropdownStateChange(Boolean(state.isDropdownOpen));
this.props.onDropdownStateChange(!!state.isDropdownOpen);
};
this.setState(state, handleDropdownStateChange);
}
Expand Down Expand Up @@ -859,8 +859,7 @@ class Combobox extends React.Component {
const formatOption = (option) => ({
focused: false,
isSelected:
isEqual(option.value ? option.value.toUpperCase : '', value.toUpperCase()) ||
Boolean(this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value)),
isEqual(option.value ? option.value.toUpperCase : '', value.toUpperCase()) || !!this.props.alreadySelectedOptions.find((optionItem) => optionItem.value === option.value),
...option,
});

Expand Down
10 changes: 5 additions & 5 deletions lib/str.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const Str = {
* @returns True if the string is a domain name
*/
isValidDomainName(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.DOMAIN));
return !!String(str).match(Constants.CONST.REG_EXP.DOMAIN);
},

/**
Expand All @@ -359,7 +359,7 @@ const Str = {
* @returns True if the string is a valid hyperlink
*/
isValidURL(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.HYPERLINK));
return !!String(str).match(Constants.CONST.REG_EXP.HYPERLINK);
},

/**
Expand All @@ -371,7 +371,7 @@ const Str = {
* @returns True if the string is an email
*/
isValidEmail(str: string): boolean {
return Boolean(String(str).match(Constants.CONST.REG_EXP.EMAIL));
return !!String(str).match(Constants.CONST.REG_EXP.EMAIL);
},

/**
Expand All @@ -382,7 +382,7 @@ const Str = {
* @returns True if the string is an valid email created by comment markdown.
*/
isValidEmailMarkdown(str: string): boolean {
return Boolean(String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`));
return !!String(str).match(`^${Constants.CONST.REG_EXP.MARKDOWN_EMAIL}$`);
},

/**
Expand Down Expand Up @@ -818,7 +818,7 @@ const Str = {
if (this.isString(value)) {
return value.toLowerCase() === 'true';
}
return Boolean(value);
return !!value;
},

/**
Expand Down
127 changes: 5 additions & 122 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"babel-jest": "^29.0.0",
"babelify": "10.0.0",
"eslint": "^8.57.0",
"eslint-config-expensify": "^2.0.48",
"eslint-config-expensify": "^2.0.50",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
Loading