diff --git a/.eslintrc.js b/.eslintrc.js index d2837e62bd..d51be374f9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,10 @@ module.exports = { 'react/destructuring-assignment': 'off', 'react/require-default-props': 'off', 'react/no-unused-prop-types': 'off', - 'react/style-prop-object': 'off' + 'react/style-prop-object': 'off', + 'unicorn/prefer-negative-index': 'off', + 'default-param-last': 'off', + 'import/no-cycle': 'off', + 'unicorn/no-for-loop': 'off' } }; \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 19d973f432..055eb768b6 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,5 +1,5 @@ /* @flow */ -/* eslint import/no-default-export: off */ +/* eslint import/no-default-export: off, import/no-commonjs: off */ import { getKarmaConfig } from 'grumbler-scripts/config/karma.conf'; diff --git a/package.json b/package.json index 426e3649bf..e43219e3e0 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "babel-core": "^7.0.0-bridge.0", "commitizen": "^3.0.4", "cz-conventional-changelog": "^2.1.0", - "eslint-plugin-import": "2.16.0", "flow-bin": "^0.70.0", "fs-extra": "^4.0.2", "grumbler-scripts": "^3", diff --git a/src/config/config.js b/src/config/config.js index 9a5f1cbbe8..2a1bef26fb 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -35,7 +35,7 @@ export const config = { ? `//${ window.location.host }/base/src/load.js` : `//www.paypalobjects.com/api/${ __FILE_NAME__ }`, - // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex + // eslint-disable-next-line security/detect-unsafe-regex paypal_domain_regex: /^(https?|mock):\/\/[a-zA-Z0-9_.-]+\.paypal\.com(:\d+)?$/, version: __PAYPAL_CHECKOUT__.__MINOR_VERSION__, @@ -780,7 +780,7 @@ export const config = { loggerUri: `/xoplatform/logger/api/logger`, - loggerThrottlePercentage: 1.0, // 100% + loggerThrottlePercentage: 1, // 100% pptmUri: `/tagmanager/pptm.js`, diff --git a/src/lib/jsx.js b/src/lib/jsx.js index a937a42f0e..5bd78f97ac 100644 --- a/src/lib/jsx.js +++ b/src/lib/jsx.js @@ -103,7 +103,7 @@ export function jsxToHTML(name : string, props : PropsType, ...children : Childr export function jsxRender(template : string, renderers : { [string] : (string) =>?(JsxHTMLNode | $ReadOnlyArray) }) : JsxHTMLNode { - // eslint-disable-next-line security/detect-unsafe-regex, unicorn/no-unsafe-regex + // eslint-disable-next-line security/detect-unsafe-regex const nodes = regexMap(template, /\{\s*([a-z]+)(?::\s*([^} ]+))?\s*\}|([^${}]+)/g, (match, type, value, text) => { if (type) { if (!renderers[type]) { diff --git a/src/lib/util.js b/src/lib/util.js index 80773cec58..6bf138e264 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -212,7 +212,7 @@ export function stringifyError(err : mixed, level : number = 1) : string { return Object.prototype.toString.call(err); - } catch (newErr) { // eslint-disable-line unicorn/catch-error-name + } catch (newErr) { return `Error while stringifying error: ${ stringifyError(newErr, level + 1) }`; } } diff --git a/src/loader/util.js b/src/loader/util.js index 1230d4d044..789cfa2cd9 100644 --- a/src/loader/util.js +++ b/src/loader/util.js @@ -111,7 +111,7 @@ export function stringifyError(err : mixed, level : number = 1) : string { return Object.prototype.toString.call(err); - } catch (newErr) { // eslint-disable-line unicorn/catch-error-name + } catch (newErr) { return `Error while stringifying error: ${ stringifyError(newErr, level + 1) }`; } } diff --git a/src/resources/fundingLogos/eps.jsx b/src/resources/fundingLogos/eps.jsx index e480ebb47c..a7b2d9428c 100644 --- a/src/resources/fundingLogos/eps.jsx +++ b/src/resources/fundingLogos/eps.jsx @@ -53,8 +53,8 @@ export function epsLogo({ logoColor } : { logoColor : $Values - - + + diff --git a/src/resources/fundingLogos/payu.jsx b/src/resources/fundingLogos/payu.jsx index 435e7d03e1..76729c66ed 100644 --- a/src/resources/fundingLogos/payu.jsx +++ b/src/resources/fundingLogos/payu.jsx @@ -34,7 +34,7 @@ export function payuLogo({ logoColor } : { logoColor : $Values + - - + + - - + + diff --git a/src/resources/fundingLogos/verkkopankki.jsx b/src/resources/fundingLogos/verkkopankki.jsx index f6df4f575f..10bb6480d4 100644 --- a/src/resources/fundingLogos/verkkopankki.jsx +++ b/src/resources/fundingLogos/verkkopankki.jsx @@ -64,9 +64,9 @@ export function verkkopankkiLogo({ logoColor } : { logoColor : $Values - - - + + + @@ -74,18 +74,18 @@ export function verkkopankkiLogo({ logoColor } : { logoColor : $Values - + - + - + @@ -105,7 +105,7 @@ export function verkkopankkiLogo({ logoColor } : { logoColor : $Values - + @@ -130,26 +130,26 @@ export function verkkopankkiLogo({ logoColor } : { logoColor : $Values - + - + - + - - + + - + - - - + + + diff --git a/test/screenshot/images/button.locale=pt_BR&button.style.label=installment&button.style.installmentperiod=4.png b/test/screenshot/images/button.locale=pt_BR&button.style.label=installment&button.style.installmentperiod=4.png index 367fcad8ca..f42f829fd1 100644 Binary files a/test/screenshot/images/button.locale=pt_BR&button.style.label=installment&button.style.installmentperiod=4.png and b/test/screenshot/images/button.locale=pt_BR&button.style.label=installment&button.style.installmentperiod=4.png differ diff --git a/test/screenshot/screenshot.test.js b/test/screenshot/screenshot.test.js index 9526538118..23e684a835 100644 --- a/test/screenshot/screenshot.test.js +++ b/test/screenshot/screenshot.test.js @@ -57,7 +57,7 @@ for (const config of buttonConfigs) { const { page } = await setupBrowserPage; // fasten up the animation - await page._client.send('Animation.setPlaybackRate', { playbackRate: 12.0 }); + await page._client.send('Animation.setPlaybackRate', { playbackRate: 12 }); const filepath = `${ IMAGE_DIR }/${ filename }.png`; const diffpath = `${ IMAGE_DIR }/${ filename }-old.png`; @@ -104,6 +104,7 @@ for (const config of buttonConfigs) { delete window.navigator.mockUserAgent; if (decorate) { + // eslint-disable-next-line require-atomic-updates window.paypal.Button.props.funding.decorate = decorate; } diff --git a/test/tests/legacy/button.js b/test/tests/legacy/button.js index dc5f56503b..e0f3eee548 100644 --- a/test/tests/legacy/button.js +++ b/test/tests/legacy/button.js @@ -850,9 +850,9 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); - const content3 = (getElement('.paypal-button-content span', container3).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); + const content3 = (getElement('.paypal-button-content span', container3).textContent || '').trim(); assert.equal(content1, content2, 'en_US should match en_US'); assert.notEqual(content1, content3, 'en_US should not match en_FR'); @@ -880,8 +880,8 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); assert.equal(content1, content2, 'en_US should match no locale'); }); @@ -908,8 +908,8 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); assert.equal(content1, content2, 'en_US should match xx_XX'); }); @@ -936,8 +936,8 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); assert.equal(content1, content2, 'fr_US should match fr'); }); @@ -964,8 +964,8 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); assert.equal(content1, content2, 'en_US should match US'); }); @@ -992,8 +992,8 @@ describe('paypal legacy button options', () => { }).then(() => { - const content1 = (getElement('.paypal-button-content span', container1).innerText || '').trim(); - const content2 = (getElement('.paypal-button-content span', container2).innerText || '').trim(); + const content1 = (getElement('.paypal-button-content span', container1).textContent || '').trim(); + const content2 = (getElement('.paypal-button-content span', container2).textContent || '').trim(); assert.equal(content1, content2, 'en_FR should match FR'); });