Eslint prefer-const (#17864)

* adds prefer-const to eslint config and runs fixer

* reverts unintended change
This commit is contained in:
Jordan Reimer
2022-11-09 16:15:31 -07:00
committed by GitHub
parent 96d623d3fc
commit 483ef19946
464 changed files with 1701 additions and 1714 deletions

View File

@@ -94,9 +94,9 @@ export default class SearchSelect extends Component {
// inputValues are initially an array of strings from @inputValue
// map over so selectedOptions are objects
return inputValues.map((option) => {
let matchingOption = this.dropdownOptions.findBy(this.idKey, option);
const matchingOption = this.dropdownOptions.findBy(this.idKey, option);
// tooltip text comes from return of parent function
let addTooltip = this.args.renderInfoTooltip
const addTooltip = this.args.renderInfoTooltip
? this.args.renderInfoTooltip(option, this.dropdownOptions)
: false;
@@ -140,7 +140,7 @@ export default class SearchSelect extends Component {
return;
}
for (let modelType of this.args.models) {
for (const modelType of this.args.models) {
try {
let queryParams = {};
if (this.args.backend) {
@@ -150,7 +150,7 @@ export default class SearchSelect extends Component {
queryParams = this.args.queryObject;
}
// fetch options from the store
let options = yield this.store.query(modelType, queryParams);
const options = yield this.store.query(modelType, queryParams);
// store both select + unselected options in tracked property used by wildcard filter
this.allOptions = [...this.allOptions, ...options.mapBy('id')];
@@ -194,7 +194,7 @@ export default class SearchSelect extends Component {
if (searchResults && searchResults.length && searchResults.firstObject.groupName) {
return !searchResults.some((group) => group.options.findBy('id', id));
}
let existingOption =
const existingOption =
this.dropdownOptions &&
(this.dropdownOptions.findBy('id', id) || this.dropdownOptions.findBy('name', id));
if (this.args.disallowNewItems && !existingOption) {