Merge pull request #6307 from mabashian/eslint-5-6-upgrade

Bumps eslint from 5.6 to 6.8

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2020-03-17 20:24:13 +00:00
committed by GitHub
6 changed files with 544 additions and 249 deletions

View File

@@ -8,9 +8,7 @@
"modules": true "modules": true
} }
}, },
"plugins": [ "plugins": ["react-hooks"],
"react-hooks"
],
"extends": ["airbnb", "prettier", "prettier/react"], "extends": ["airbnb", "prettier", "prettier/react"],
"settings": { "settings": {
"import/resolver": { "import/resolver": {
@@ -34,7 +32,7 @@
"camelcase": "off", "camelcase": "off",
"arrow-parens": "off", "arrow-parens": "off",
"comma-dangle": "off", "comma-dangle": "off",
"//": "https://github.com/benmosher/eslint-plugin-import/issues/479#issuecomment-252500896", // https://github.com/benmosher/eslint-plugin-import/issues/479#issuecomment-252500896
"import/no-extraneous-dependencies": "off", "import/no-extraneous-dependencies": "off",
"max-len": [ "max-len": [
"error", "error",

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,7 @@
"enzyme": "^3.10.0", "enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.3.5", "enzyme-to-json": "^3.3.5",
"eslint": "^5.6.0", "eslint": "^6.8.0",
"eslint-config-airbnb": "^17.1.0", "eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^5.0.0", "eslint-config-prettier": "^5.0.0",
"eslint-import-resolver-webpack": "0.11.1", "eslint-import-resolver-webpack": "0.11.1",

View File

@@ -117,16 +117,18 @@ function InventoryGroupsList({ i18n, location, match }) {
setIsLoading(true); setIsLoading(true);
try { try {
/* eslint-disable no-await-in-loop, no-restricted-syntax */ /* eslint-disable no-await-in-loop */
/* Delete groups sequentially to avoid api integrity errors */ /* Delete groups sequentially to avoid api integrity errors */
for (const group of selected) { /* https://eslint.org/docs/rules/no-await-in-loop#when-not-to-use-it */
for (let i = 0; i < selected.length; i++) {
const group = selected[i];
if (option === 'delete') { if (option === 'delete') {
await GroupsAPI.destroy(+group.id); await GroupsAPI.destroy(+group.id);
} else if (option === 'promote') { } else if (option === 'promote') {
await InventoriesAPI.promoteGroup(inventoryId, +group.id); await InventoriesAPI.promoteGroup(inventoryId, +group.id);
} }
} }
/* eslint-enable no-await-in-loop, no-restricted-syntax */ /* eslint-enable no-await-in-loop */
} catch (error) { } catch (error) {
setDeletionError(error); setDeletionError(error);
} }

View File

@@ -81,8 +81,8 @@ describe('<OrganizationDetail />', () => {
{ label: 'Last Modified', value: '8/11/2019, 7:47:37 PM' }, { label: 'Last Modified', value: '8/11/2019, 7:47:37 PM' },
{ label: 'Max Hosts', value: '0' }, { label: 'Max Hosts', value: '0' },
]; ];
// eslint-disable-next-line no-restricted-syntax for (let i = 0; i < testParams.length; i++) {
for (const { label, value } of testParams) { const { label, value } = testParams[i];
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
const detail = await waitForElement(wrapper, `Detail[label="${label}"]`); const detail = await waitForElement(wrapper, `Detail[label="${label}"]`);
expect(detail.find('dt').text()).toBe(label); expect(detail.find('dt').text()).toBe(label);

View File

@@ -46,8 +46,8 @@ describe('<TeamDetail />', () => {
{ label: 'Created', value: '7/7/2015, 5:21:26 PM' }, { label: 'Created', value: '7/7/2015, 5:21:26 PM' },
{ label: 'Last Modified', value: '8/11/2019, 7:47:37 PM' }, { label: 'Last Modified', value: '8/11/2019, 7:47:37 PM' },
]; ];
// eslint-disable-next-line no-restricted-syntax for (let i = 0; i < testParams.length; i++) {
for (const { label, value } of testParams) { const { label, value } = testParams[i];
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
const detail = await waitForElement(wrapper, `Detail[label="${label}"]`); const detail = await waitForElement(wrapper, `Detail[label="${label}"]`);
expect(detail.find('dt').text()).toBe(label); expect(detail.find('dt').text()).toBe(label);