-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintcache
1 lines (1 loc) · 20.7 KB
/
.eslintcache
1
[{"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\index.js":"1","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\App.js":"2","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Products.jsx":"3","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Product\\Product.jsx":"4","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Product\\productStyles.js":"5","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\index.js":"6","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Navbar\\Navbar.jsx":"7","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Navbar\\navbarStyles.js":"8","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\productsStyles.js":"9","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\lib\\commerce.js":"10","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\Cart.jsx":"11","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\cartStyles.js":"12","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\CartItem\\CartItem.jsx":"13","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\CartItem\\cartItemStyles.js":"14","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Checkout\\Checkout.jsx":"15","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Checkout\\checkoutStyles.js":"16","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\PaymentForm.jsx":"17","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\AddressForm.jsx":"18","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\CustomTextField.jsx":"19","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Review.jsx":"20"},{"size":151,"mtime":1607030024144,"results":"21","hashOfConfig":"22"},{"size":3204,"mtime":1607538364739,"results":"23","hashOfConfig":"22"},{"size":1423,"mtime":1607118265199,"results":"24","hashOfConfig":"22"},{"size":1338,"mtime":1607118387406,"results":"25","hashOfConfig":"22"},{"size":370,"mtime":1607032036331,"results":"26","hashOfConfig":"22"},{"size":160,"mtime":1607122523125,"results":"27","hashOfConfig":"22"},{"size":1475,"mtime":1607274082007,"results":"28","hashOfConfig":"22"},{"size":1631,"mtime":1607034995230,"results":"29","hashOfConfig":"22"},{"size":298,"mtime":1607032103664,"results":"30","hashOfConfig":"22"},{"size":127,"mtime":1607104887999,"results":"31","hashOfConfig":"22"},{"size":2280,"mtime":1607280914727,"results":"32","hashOfConfig":"22"},{"size":597,"mtime":1607121593032,"results":"33","hashOfConfig":"22"},{"size":1438,"mtime":1607125005640,"results":"34","hashOfConfig":"22"},{"size":349,"mtime":1607124276619,"results":"35","hashOfConfig":"22"},{"size":3216,"mtime":1607538629885,"results":"36","hashOfConfig":"22"},{"size":1208,"mtime":1607277379519,"results":"37","hashOfConfig":"22"},{"size":2724,"mtime":1607542328755,"results":"38","hashOfConfig":"22"},{"size":4639,"mtime":1607289901317,"results":"39","hashOfConfig":"22"},{"size":584,"mtime":1607279257749,"results":"40","hashOfConfig":"22"},{"size":1044,"mtime":1607292048841,"results":"41","hashOfConfig":"22"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},"t2pl49",{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"44"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"68","messages":"69","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"74","usedDeprecatedRules":"44"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"81","usedDeprecatedRules":"44"},{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"44"},"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\index.js",[],["87","88"],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\App.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Products.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Product\\Product.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\Product\\productStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\index.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Navbar\\Navbar.jsx",["89","90"],"import React from 'react'\r\nimport { AppBar, Toolbar, IconButton, Badge, MenuItem, Menu, Typography } from '@material-ui/core';\r\nimport { ShoppingCart } from '@material-ui/icons';\r\nimport { Link, useLocation } from 'react-router-dom';\r\n\r\nimport logo from '../../assets/re_logo.jpg';\r\nimport useStyles from './navbarStyles';\r\n\r\nconst Navbar = ({ totalItems }) => {\r\n const classes = useStyles();\r\n const location = useLocation();\r\n\r\n \r\n return (\r\n <>\r\n <AppBar position=\"fixed\" className={classes.appBar} color=\"inherit\">\r\n <Toolbar>\r\n <Typography component={Link} to=\"/\" variant=\"h6\" className={classes.title} color=\"inherit\">\r\n <img src={logo} alt=\"Commerce.js\" height=\"25px\" className={classes.image} />\r\n Commerce.js\r\n </Typography>\r\n <div className={classes.grow} />\r\n { location.pathname === '/' && (\r\n <div className={classes.button}>\r\n <IconButton component={Link} to=\"/cart\" aria-label=\"Show cart items\" color=\"inherit\">\r\n <Badge badgeContent={totalItems} color=\"secondary\">\r\n <ShoppingCart/>\r\n </Badge>\r\n </IconButton>\r\n </div> )}\r\n </Toolbar>\r\n </AppBar>\r\n </>\r\n )\r\n}\r\n\r\nexport default Navbar\r\n","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Navbar\\navbarStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Products\\productsStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\lib\\commerce.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\Cart.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\cartStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\CartItem\\CartItem.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\Cart\\CartItem\\cartItemStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Checkout\\Checkout.jsx",["91"],"import React, { useState, useEffect } from 'react';\r\nimport { CssBaseline, Paper, Stepper, Step, StepLabel, Typography, CircularProgress, Divider, Button } from '@material-ui/core';\r\nimport { Link, useHistory } from 'react-router-dom';\r\n\r\nimport { commerce } from '../../../lib/commerce';\r\nimport AddressForm from '../AddressForm';\r\nimport PaymentForm from '../PaymentForm';\r\nimport useStyles from './checkoutStyles';\r\n\r\nconst steps = ['Shipping address', 'Payment details'];\r\n\r\nconst Checkout = ({ cart, onCaptureCheckout, order, error }) => {\r\n const [checkoutToken, setCheckoutToken] = useState(null);\r\n const [activeStep, setActiveStep] = useState(0);\r\n const [shippingData, setShippingData] = useState({});\r\n const classes = useStyles();\r\n const history = useHistory();\r\n\r\n const nextStep = () => setActiveStep((prevActiveStep) => prevActiveStep + 1);\r\n const backStep = () => setActiveStep((prevActiveStep) => prevActiveStep - 1);\r\n\r\n useEffect(() => {\r\n if (cart.id) {\r\n const generateToken = async () => {\r\n try {\r\n const token = await commerce.checkout.generateToken(cart.id, { type: 'cart' });\r\n\r\n setCheckoutToken(token);\r\n } catch {\r\n if (activeStep !== steps.length) history.push('/');\r\n }\r\n };\r\n\r\n generateToken();\r\n }\r\n }, [cart]);\r\n\r\n const test = (data) => {\r\n setShippingData(data);\r\n\r\n nextStep();\r\n };\r\n\r\n let Confirmation = () => (order.customer ? (\r\n <>\r\n <div>\r\n <Typography variant=\"h5\">Thank you for your purchase, {order.customer.firstname} {order.customer.lastname}!</Typography>\r\n <Divider className={classes.divider} />\r\n <Typography variant=\"subtitle2\">Order ref: {order.customer_reference}</Typography>\r\n </div>\r\n <br />\r\n <Button component={Link} variant=\"outlined\" type=\"button\" to=\"/\">Back to home</Button>\r\n </>\r\n ) : (\r\n <div className={classes.spinner}>\r\n <CircularProgress />\r\n </div>\r\n ));\r\n if (error) {\r\n Confirmation = () => (\r\n <>\r\n <Typography variant=\"h5\">Error: {error}</Typography>\r\n <br />\r\n <Button component={Link} variant=\"outlined\" type=\"button\" to=\"/\">Back to home</Button>\r\n </>\r\n );\r\n }\r\n const Form = () => (activeStep === 0\r\n ? <AddressForm checkoutToken={checkoutToken} nextStep={nextStep} setShippingData={setShippingData} test={test} />\r\n : <PaymentForm checkoutToken={checkoutToken} nextStep={nextStep} backStep={backStep} shippingData={shippingData} onCaptureCheckout={onCaptureCheckout} />);\r\n \r\n return (\r\n <>\r\n <CssBaseline />\r\n <div className={classes.toolbar} />\r\n <main className={classes.layout}>\r\n <Paper className={classes.paper}>\r\n <Typography variant=\"h4\" align=\"center\">Checkout</Typography>\r\n <Stepper activeStep={activeStep} className={classes.stepper}>\r\n {steps.map((label) => (\r\n <Step key={label}>\r\n <StepLabel>{label}</StepLabel>\r\n </Step>\r\n ))}\r\n </Stepper>\r\n {activeStep === steps.length ? <Confirmation /> : checkoutToken && <Form />}\r\n </Paper>\r\n </main>\r\n </>\r\n );\r\n};\r\nexport default Checkout;","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Checkout\\checkoutStyles.js",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\PaymentForm.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\AddressForm.jsx",["92","93"],"import React, { useState, useEffect } from 'react';\r\nimport { InputLabel, Select, MenuItem, Button, Grid, Typography } from '@material-ui/core';\r\nimport { useForm, FormProvider } from 'react-hook-form';\r\nimport { Link } from 'react-router-dom';\r\n\r\nimport { commerce } from '../../lib/commerce';\r\nimport FormInput from './CustomTextField';\r\n\r\nconst AddressForm = ({ checkoutToken, test }) => {\r\n const [shippingCountries, setShippingCountries] = useState([]);\r\n const [shippingCountry, setShippingCountry] = useState('');\r\n const [shippingSubdivisions, setShippingSubdivisions] = useState([]);\r\n const [shippingSubdivision, setShippingSubdivision] = useState('');\r\n const [shippingOptions, setShippingOptions] = useState([]);\r\n const [shippingOption, setShippingOption] = useState('');\r\n const methods = useForm();\r\n\r\n const fetchShippingCountries = async (checkoutTokenId) => {\r\n const { countries } = await commerce.services.localeListShippingCountries(checkoutTokenId);\r\n\r\n setShippingCountries(countries);\r\n setShippingCountry(Object.keys(countries)[0]);\r\n };\r\n\r\n const fetchSubdivisions = async (countryCode) => {\r\n const { subdivisions } = await commerce.services.localeListSubdivisions(countryCode);\r\n\r\n setShippingSubdivisions(subdivisions);\r\n setShippingSubdivision(Object.keys(subdivisions)[0]);\r\n };\r\n\r\n const fetchShippingOptions = async (checkoutTokenId, country, stateProvince = null) => {\r\n const options = await commerce.checkout.getShippingOptions(checkoutTokenId, { country, region: stateProvince });\r\n\r\n setShippingOptions(options);\r\n setShippingOption(options[0].id);\r\n };\r\n\r\n useEffect(() => {\r\n fetchShippingCountries(checkoutToken.id);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (shippingCountry) fetchSubdivisions(shippingCountry);\r\n }, [shippingCountry]);\r\n\r\n useEffect(() => {\r\n if (shippingSubdivision) fetchShippingOptions(checkoutToken.id, shippingCountry, shippingSubdivision);\r\n }, [shippingSubdivision]);\r\n\r\n return (\r\n <>\r\n <Typography variant=\"h6\" gutterBottom>Shipping address</Typography>\r\n <FormProvider {...methods}>\r\n <form onSubmit={methods.handleSubmit((data) => test({ ...data, shippingCountry, shippingSubdivision, shippingOption }))}>\r\n <Grid container spacing={3}>\r\n <FormInput name=\"firstName\" label=\"First name\" />\r\n <FormInput name=\"lastName\" label=\"Last name\" />\r\n <FormInput name=\"address1\" label=\"Address line 1\" />\r\n <FormInput name=\"email\" label=\"Email\" />\r\n <FormInput name=\"city\" label=\"City\" />\r\n <FormInput name=\"zip\" label=\"Zip / Postal code\" />\r\n <Grid item xs={12} sm={6}>\r\n <InputLabel>Shipping Country</InputLabel>\r\n <Select value={shippingCountry} fullWidth onChange={(e) => setShippingCountry(e.target.value)}>\r\n {Object.entries(shippingCountries).map(([code, name]) => ({ id: code, label: name })).map((item) => (\r\n <MenuItem key={item.id} value={item.id}>\r\n {item.label}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <InputLabel>Shipping Subdivision</InputLabel>\r\n <Select value={shippingSubdivision} fullWidth onChange={(e) => setShippingSubdivision(e.target.value)}>\r\n {Object.entries(shippingSubdivisions).map(([code, name]) => ({ id: code, label: name })).map((item) => (\r\n <MenuItem key={item.id} value={item.id}>\r\n {item.label}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <InputLabel>Shipping Options</InputLabel>\r\n <Select value={shippingOption} fullWidth onChange={(e) => setShippingOption(e.target.value)}>\r\n {shippingOptions.map((sO) => ({ id: sO.id, label: `${sO.description} - (${sO.price.formatted_with_symbol})` })).map((item) => (\r\n <MenuItem key={item.id} value={item.id}>\r\n {item.label}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n </Grid>\r\n </Grid>\r\n <br />\r\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\r\n <Button component={Link} variant=\"outlined\" to=\"/cart\">Back to Cart</Button>\r\n <Button type=\"submit\" variant=\"contained\" color=\"primary\">Next</Button>\r\n </div>\r\n </form>\r\n </FormProvider>\r\n </>\r\n );\r\n};\r\nexport default AddressForm;","C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\CustomTextField.jsx",[],"C:\\Users\\tdgui\\Documents\\GitHub\\re-commerce\\src\\components\\CheckoutForm\\Review.jsx",["94"],"import React from 'react'\r\nimport { Typography, List, ListItem, ListItemText} from '@material-ui/core';\r\n\r\nconst Review = ({ checkoutToken }) => {\r\n return (\r\n <>\r\n <Typography variant=\"h6\" gutterBottom>Order summary</Typography>\r\n <List disablePadding>\r\n {checkoutToken.live.line_items.map((product) => (\r\n <ListItem style={{padding: '10px 0'}} key={product.name}>\r\n <ListItemText primary={product.name} secondary={'Quantity: ${product.quantity}'} />\r\n <Typography variant=\"body2\">{product.line_total.formatted_with_symbol}</Typography>\r\n\r\n </ListItem> \r\n ))}\r\n <ListItem style={{padding: '10px 0'}}>\r\n <ListItemText primary=\"Total\" />\r\n <Typography variant=\"subtitle1\" style={{ fontWeight: 700 }}>\r\n {checkoutToken.live.subtotal.formatted_with_symbol}\r\n </Typography>\r\n </ListItem>\r\n </List> \r\n </>\r\n )\r\n}\r\n\r\nexport default Review\r\n",{"ruleId":"95","replacedBy":"96"},{"ruleId":"97","replacedBy":"98"},{"ruleId":"99","severity":1,"message":"100","line":2,"column":46,"nodeType":"101","messageId":"102","endLine":2,"endColumn":54},{"ruleId":"99","severity":1,"message":"103","line":2,"column":56,"nodeType":"101","messageId":"102","endLine":2,"endColumn":60},{"ruleId":"104","severity":1,"message":"105","line":36,"column":6,"nodeType":"106","endLine":36,"endColumn":12,"suggestions":"107"},{"ruleId":"104","severity":1,"message":"108","line":41,"column":6,"nodeType":"106","endLine":41,"endColumn":8,"suggestions":"109"},{"ruleId":"104","severity":1,"message":"110","line":49,"column":6,"nodeType":"106","endLine":49,"endColumn":27,"suggestions":"111"},{"ruleId":"112","severity":1,"message":"113","line":11,"column":65,"nodeType":"114","messageId":"115","endLine":11,"endColumn":96},"no-native-reassign",["116"],"no-negated-in-lhs",["117"],"no-unused-vars","'MenuItem' is defined but never used.","Identifier","unusedVar","'Menu' is defined but never used.","react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'activeStep' and 'history'. Either include them or remove the dependency array.","ArrayExpression",["118"],"React Hook useEffect has a missing dependency: 'checkoutToken.id'. Either include it or remove the dependency array.",["119"],"React Hook useEffect has missing dependencies: 'checkoutToken.id' and 'shippingCountry'. Either include them or remove the dependency array.",["120"],"no-template-curly-in-string","Unexpected template string expression.","Literal","unexpectedTemplateExpression","no-global-assign","no-unsafe-negation",{"desc":"121","fix":"122"},{"desc":"123","fix":"124"},{"desc":"125","fix":"126"},"Update the dependencies array to be: [activeStep, cart, history]",{"range":"127","text":"128"},"Update the dependencies array to be: [checkoutToken.id]",{"range":"129","text":"130"},"Update the dependencies array to be: [checkoutToken.id, shippingCountry, shippingSubdivision]",{"range":"131","text":"132"},[1316,1322],"[activeStep, cart, history]",[1708,1710],"[checkoutToken.id]",[1961,1982],"[checkoutToken.id, shippingCountry, shippingSubdivision]"]