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

[dev]: Update eslint config version #1088

Merged
merged 6 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"watch:venia": "yarn workspace @magento/venia-concept run watch; cd - >/dev/null"
},
"devDependencies": {
"@magento/eslint-config": "~1.3.0",
"@magento/eslint-config": "~1.4.0",
"babel-eslint": "~10.0.1",
"babel-plugin-module-resolver": "~3.2.0",
"chalk": "~2.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function mockFetchReturned({
mockFetch.mockImplementationOnce(
(_, { signal }) =>
new Promise((resolve, reject) => {
let body = json
const body = json
? JSON.stringify(typeof json === 'function' ? json() : json)
: typeof text === 'function'
? text()
Expand Down
3 changes: 2 additions & 1 deletion packages/peregrine/src/util/intlPatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ const IntlPatches = {
symbol: currency
};
const { symbol, decimal, groupDelim } = format;
let [integer, fraction] = num
// eslint-disable-next-line prefer-const
const [integer, fraction] = num
.toFixed(maximumFractionDigits)
.match(/\d+/g);
const parts = [{ type: 'currency', value: symbol }];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ test('fails after a timeout if devcert never fulfills', async () => {
const oldIsTTY = process.stdin.isTTY;
process.stdin.isTTY = true;
let resolveHangingPromise;
let promise = new Promise(resolve => (resolveHangingPromise = resolve));
const promise = new Promise(resolve => (resolveHangingPromise = resolve));
devcert.certificateFor.mockReturnValueOnce(promise);
const certPromise = configureHost({ subdomain: 'no-hurry' });
jest.advanceTimersByTime(35000);
Expand Down
1 change: 1 addition & 0 deletions packages/upward-js/lib/resolvers/TemplateResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.exports = class TemplateResolver extends AbstractResolver {
providePromise
];

// eslint-disable-next-line prefer-const
supernova-at marked this conversation as resolved.
Show resolved Hide resolved
let [engine, template, rootEntries] = await Promise.all(toResolve);
debug('template retrieved, "%s"', template);
debug('rootEntries retrieved, %o', rootEntries.map(([name]) => name));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ test('removeItemFromCart resets the guest cart when removing the last item in th
getState.mockImplementationOnce(() => ({
cart: { guestCartId: 'CART', details: { items_count: 1 } }
}));
let payload = { item: 'ITEM' };
const payload = { item: 'ITEM' };

// removeItemFromCart() calls storage.removeItem() to clear the guestCartId
// but only if there's 1 item left in the cart
Expand Down Expand Up @@ -732,7 +732,7 @@ test('getCartDetails thunk creates a guest cart if no ID is found', async () =>
});

test('getCartDetails thunk deletes an old cart id and recreates a guest cart if cart ID is expired', async () => {
let tempStorage = {};
const tempStorage = {};
mockSetItem.mockImplementation((key, value) => {
tempStorage[key] = value;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/src/actions/user/asyncActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const assignGuestCartToCustomer = () =>

try {
const storage = new BrowserPersistence();
let guestCartId = storage.getItem('guestCartId');
const guestCartId = storage.getItem('guestCartId');
const payload = {
customerId: user.id,
storeId: user.store_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Trigger extends Component {
} = this.props;
const itemsQty = details.items_qty;
const iconColor = 'rgb(var(--venia-text))';
let svgAttributes = {
const svgAttributes = {
stroke: iconColor
};

Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/src/components/Input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Input extends Component {

get helpText() {
const { helpVisible, classes, helpText, helpType } = this.props;
let helpTypeClass = `${classes.helpText} ${classes[helpType]}`;
const helpTypeClass = `${classes.helpText} ${classes[helpType]}`;

return helpVisible ? (
<div className={helpTypeClass}>{helpText}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('renders with item data', () => {
test('list is inactive when kebab is closed', () => {
const wrapper = shallow(<Kebab classes={classes} isOpen={false} />).dive();

let menu = wrapper.find('ul');
const menu = wrapper.find('ul');
expect(menu.hasClass(classes.dropdown)).toBe(true);
expect(menu.hasClass(classes.dropdown_active)).toBe(false);
});
Expand All @@ -59,6 +59,6 @@ test('list gains "active" class when kebab is open', () => {
const wrapper = shallow(<Kebab classes={classes} />).dive();
wrapper.setState({ isOpen: true });

let menu = wrapper.find('ul');
const menu = wrapper.find('ul');
expect(menu.hasClass(classes.dropdown_active)).toBe(true);
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const item = {
test('passed functions are called from nested `Section` components', () => {
const removeItemFromCart = jest.fn();
const openOptionsDrawer = jest.fn();
let wrapper = shallow(
const wrapper = shallow(
<Product
classes={classes}
item={item}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import { transformItems } from 'src/selectors/purchaseHistory';
import PurchaseHistory from './purchaseHistory';
import actions, { getPurchaseHistory } from 'src/actions/purchaseHistory';

const mapStateToProps = ({ purchaseHistory }) => {
let { isFetching, items } = purchaseHistory;

items = transformItems(items);

const mapStateToProps = ({ purchaseHistory: { isFetching, items } }) => {
supernova-at marked this conversation as resolved.
Show resolved Hide resolved
return {
isFetching,
items
items: transformItems(items)
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test('display error message if there is a `signInError`', () => {
/>
).dive();

let errorMessage = shallow(wrapper.instance().errorMessage);
const errorMessage = shallow(wrapper.instance().errorMessage);
expect(errorMessage.html()).toContain(props.signInError.message);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/src/reducers/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const reducerMap = {
const storedBillingAddress = storage.getItem('billing_address');
const storedPaymentMethod = storage.getItem('paymentMethod');
const storedShippingAddress = storage.getItem('shipping_address');
let storedShippingMethod = storage.getItem('shippingMethod');
const storedShippingMethod = storage.getItem('shippingMethod');

return {
...state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('combine', () => {
});

test('test calling the single fail validator', () => {
let result = combine([isRequiredFail])();
const result = combine([isRequiredFail])();

expect(isRequiredFail).toHaveBeenCalledTimes(1);
expect(typeof result).toBe('string');
Expand All @@ -62,7 +62,7 @@ describe('combine', () => {
});

test('the first validator returned message, the second is never called', () => {
let result = combine([isRequiredFail, [hasLengthExactly, 4]])();
const result = combine([isRequiredFail, [hasLengthExactly, 4]])();

expect(isRequiredFail).toHaveBeenCalledTimes(1);
expect(hasLengthExactly).toHaveBeenCalledTimes(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import initObserver from '../initObserver';

// mock a simple observer-type generator
function* arrayObserver() {
let array = [];
const array = [];

array.push(yield);
array.push(yield);
Expand Down
4 changes: 2 additions & 2 deletions packages/venia-concept/src/util/combineValidators.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default callbacks => {
let result = null;

for (let i = 0; i < callbacks.length; i++) {
let callback = callbacks[i];
const callback = callbacks[i];

if (
callback == null ||
Expand All @@ -58,7 +58,7 @@ export default callbacks => {
}

if (Array.isArray(callback)) {
let [extendedCallback, extendedParam] = callback;
const [extendedCallback, extendedParam] = callback;

if (typeof extendedCallback !== 'function') {
throw new Error(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1915,10 +1915,10 @@
dependencies:
es-comments "^1.0.1"

"@magento/eslint-config@~1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@magento/eslint-config/-/eslint-config-1.3.0.tgz#12ec0052858e22af0a5270dff56c0035ff9a7a61"
integrity sha512-tJf5MGdUGKnl+mosIdmg5pqpolvy6WmwmKPWOXwzAJquLdN1sOjkEYfloCX4YB6oHDYYJkdxADJ15gvePPifRA==
"@magento/eslint-config@~1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@magento/eslint-config/-/eslint-config-1.4.0.tgz#b19dfcafa98c2c11bfc7bfa23d3b0e8ddc7aae0a"
integrity sha512-UV6MGHKrEkPmCGIuVdGZZM4JjgMpoYXAhGgun9Jqv0GiLumocgzhATRgCk0ykBb50Ztt/XiN9kxZfZ9MU0cJoA==

"@magento/express-sharp@~2.1.1-newdeps.1":
version "2.1.1-newdeps.1"
Expand Down