Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit 8ce9d72

Browse files
t-kellyt-kelly
t-kelly
authored andcommitted
Add linting to @shopify/theme-cart
1 parent 552b63e commit 8ce9d72

File tree

9 files changed

+100
-84
lines changed

9 files changed

+100
-84
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
dist/
33
packages/**/rollup.config.js
4+
jest.config.js

.eslintrc

-17
This file was deleted.

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:shopify/prettier',
5+
'plugin:es5/no-es2015',
6+
'plugin:es5/no-es2016'
7+
],
8+
env: {
9+
browser: true
10+
},
11+
parserOptions: {
12+
sourceType: 'module'
13+
},
14+
rules: {
15+
'es5/no-modules': 'off'
16+
}
17+
};

jest.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2-
preset: "jest-puppeteer",
3-
setupTestFrameworkScriptFile: "expect-puppeteer"
2+
preset: 'jest-puppeteer',
3+
setupTestFrameworkScriptFile: 'expect-puppeteer',
4+
testPathIgnorePatterns: ['.eslintrc.js']
45
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"bootstrap": "yarn && lerna bootstrap",
1010
"build": "lerna run build",
1111
"publish": "lerna publish",
12-
"lint": "yarn eslint packages/theme-a11y"
12+
"lint": "yarn eslint packages/theme-a11y packages/theme-cart"
1313
},
1414
"repository": "https://github.com/Shopify/theme-scripts",
1515
"keywords": [

packages/theme-cart/.eslintrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
globals: {
3+
Promise: true
4+
}
5+
};

packages/theme-cart/__fixtures__/cart-populated.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"properties": null,
1414
"quantity": 1,
1515
"variant_id": 38558517710,
16-
"key": "38558517710:fe217df576fefe94bff27eff2010a09a",
16+
"key": "123456:123456",
1717
"title": "Ratio Eight - Nickel / 110 Volts",
1818
"price": 58000,
1919
"original_price": 58000,
@@ -29,14 +29,12 @@
2929
"product_id": 10270178382,
3030
"gift_card": false,
3131
"url": "/products/ratio-eight?variant=38558517710",
32-
"image":
33-
"https://cdn.shopify.com/s/files/1/1906/1399/products/InSitu-5_8fd16703-2540-4b02-bc89-b950053d533f.png?v=1492799854",
32+
"image": "https://cdn.shopify.com/s/files/1/1906/1399/products/InSitu-5_8fd16703-2540-4b02-bc89-b950053d533f.png?v=1492799854",
3433
"handle": "ratio-eight",
3534
"requires_shipping": true,
3635
"product_type": "",
3736
"product_title": "Ratio Eight",
38-
"product_description":
39-
"\nThis is a demonstration store. You can purchase products like this from the real Ratio online store.\nTechnically speaking.\nModel: Eight Warranty: 10 years Capacity: Brews up to 40oz (eight 5oz cups) Dimensions: 13.5\" deep x 9\" wide x 14\" tall\nRatio Eight changes everything with precision brewing technique, top-quality construction, and a design that will elevate any environment for years to come. Each machine is hand assembled and tested in Portland, Oregon. That Eight has a powerful 1600 watt heating element in 110 (US & Canada) or 220 volt. Eight's carafe holds Chemex paper filters or Able Kone stainless steel filter.\nExpected to ship: 2-3 weeksFree shipping | 10 years warranty",
37+
"product_description": "\nThis is a demonstration store. You can purchase products like this from the real Ratio online store.\nTechnically speaking.\nModel: Eight Warranty: 10 years Capacity: Brews up to 40oz (eight 5oz cups) Dimensions: 13.5\" deep x 9\" wide x 14\" tall\nRatio Eight changes everything with precision brewing technique, top-quality construction, and a design that will elevate any environment for years to come. Each machine is hand assembled and tested in Portland, Oregon. That Eight has a powerful 1600 watt heating element in 110 (US & Canada) or 220 volt. Eight's carafe holds Chemex paper filters or Able Kone stainless steel filter.\nExpected to ship: 2-3 weeksFree shipping | 10 years warranty",
4038
"variant_title": "Nickel / 110 Volts",
4139
"variant_options": ["Nickel", "110 Volts"]
4240
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'plugin:shopify/esnext',
5+
'plugin:shopify/node',
6+
'plugin:shopify/prettier'
7+
],
8+
env: {
9+
browser: true,
10+
jest: true
11+
},
12+
globals: {
13+
page: true
14+
},
15+
rules: {
16+
'shopify/strict-component-boundaries': 'off'
17+
}
18+
};

0 commit comments

Comments
 (0)