Skip to content

Commit 8f8d607

Browse files
authored
Merge pull request #454 from Shopify/examples-lint
🎨 [Lint] Cleaning up /examples
2 parents 8c89d7d + 71b5215 commit 8f8d607

File tree

39 files changed

+204
-193
lines changed

39 files changed

+204
-193
lines changed

examples/.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
/* eslint-env node */
12
module.exports = {
23
extends: ['plugin:shopify/esnext', 'plugin:shopify/webpack', 'plugin:shopify/prettier'],
34
globals: {},
45
rules: {
56
'shopify/jsx-no-complex-expressions': 'off',
67
'eslint-comments/no-unlimited-disable': 0,
7-
'import/no-default-export': ['error'],
8+
// 'import/no-default-export': ['error'],
89
'lines-around-comment': [
910
'error',
1011
{
@@ -16,11 +17,13 @@ module.exports = {
1617
'no-negated-condition': 'off',
1718
// We are intentionally keeping `TODO` comments until a stable release
1819
'no-warning-comments': 'off',
20+
'import/no-cycle': 'off',
1921
// TODO: Disabling for now, but we will want to re-enable in the future.
2022
'import/no-default-export': 'off',
21-
'import/no-cycle': 'off',
2223
},
2324
env: {
2425
browser: true,
2526
},
27+
// Required, else eslint will look at the parent config
28+
root: true,
2629
};

examples/.stylelintrc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
21
{
32
"extends": [
43
"stylelint-config-shopify/prettier"
54
],
65
"rules": {
7-
'shopify/content-no-strings': true,
8-
'scss/at-if-no-null': null,
6+
"shopify/content-no-strings": true,
7+
"scss/at-if-no-null": null,
98
"scss/partial-no-import": null,
109
"color-no-hex": null,
1110
"comment-empty-line-before": null,
1211
"scss/double-slash-comment-empty-line-before": null,
13-
'declaration-block-no-redundant-longhand-properties': [
12+
"declaration-block-no-redundant-longhand-properties": [
1413
true,
1514
{
16-
ignoreShorthands: ['/^grid.*/'],
15+
ignoreShorthands: ["/^grid.*/"],
1716
},
1817
],
1918
"declaration-property-value-blacklist": null,

examples/src/components/Block/variants.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159

160160
///
161161
/// Collidable
162+
// stylelint-disable-next-line no-duplicate-selectors
162163
.Block--typeStripes {
163164
// should be a native Draggable class name
164165
&.isColliding {

examples/src/components/Brand/Brand.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
}
6060

6161
// --- Interaction
62+
// stylelint-disable-next-line no-duplicate-selectors
6263
.Brand {
6364
&:hover {
6465
@include logo-animation;
6566
}
6667

68+
// stylelint-disable-next-line no-duplicate-selectors
6769
&:active {
6870
.Wave--colorMask,
6971
.Wave--colorPurple,

examples/src/components/Button/Button.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
color: get-color(coal, dark);
1616
background-color: white;
1717
border: 0.4rem solid get-color(coal, dark);
18-
transition:
19-
color get-duration() get-easing(),
20-
background-color get-duration() get-easing(),
18+
transition: color get-duration() get-easing(), background-color get-duration() get-easing(),
2119
border-color get-duration() get-easing();
2220

2321
@media screen and (min-width: get-breakpoint(tablet)) {

examples/src/components/Main/Main.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
}
2020

2121
@media screen and (min-width: get-breakpoint(desktop)) {
22-
padding:
23-
get-spacing(fat)
24-
get-spacing(fattest)
25-
get-spacing(fat)
26-
$main-padding-left-desktop;
22+
padding: get-spacing(fat) get-spacing(fattest) get-spacing(fat) $main-padding-left-desktop;
2723
}
2824
}
2925

examples/src/components/Page/Page.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ body {
3434

3535
&::before {
3636
top: 0;
37-
box-shadow: 0 #{-(get-spacing(fattest))} 0 get-spacing(fattest) get-color(coal, dark);
37+
box-shadow: 0 -#{get-spacing(fattest)} 0 get-spacing(fattest) get-color(coal, dark);
3838
}
3939

4040
&::after {

examples/src/components/PaperStack/PaperStack.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
///
7171
/// Layout
72-
.PaperStackItem:nth-child(1n+2) {
72+
.PaperStackItem:nth-child(1n + 2) {
7373
.PaperStackContent::after {
7474
content: '';
7575
position: absolute;
@@ -93,6 +93,7 @@
9393
}
9494
}
9595

96+
// stylelint-disable-next-line no-duplicate-selectors
9697
.PaperStackItem {
9798
@for $i from 1 through $paper-stack-item-count {
9899
&:nth-child(#{$i}) {

examples/src/components/PaperStack/props.scss

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ $paper-stack-item-count: 4;
99
///
1010
/// Size calc functions
1111
@function paper-stack-height($height, $spacing) {
12-
@return $height - (
13-
($spacing / 2) * ($paper-stack-item-count - 1)
14-
);
12+
@return $height - (($spacing / 2) * ($paper-stack-item-count - 1));
1513
}
1614

1715
///
@@ -79,18 +77,10 @@ $paper-stack-shadow: (
7977

8078
$paper-stack: (
8179
height: (
82-
base: paper-stack-height(
83-
paper-stack-item(height),
84-
paper-stack-item(spacing)
85-
),
86-
tablet: paper-stack-height(
87-
paper-stack-item(height, tablet),
88-
paper-stack-item(spacing, tablet)
89-
),
90-
desktop: paper-stack-height(
91-
paper-stack-item(height, desktop),
92-
paper-stack-item(spacing, desktop)
93-
),
80+
base: paper-stack-height(paper-stack-item(height), paper-stack-item(spacing)),
81+
tablet: paper-stack-height(paper-stack-item(height, tablet), paper-stack-item(spacing, tablet)),
82+
desktop:
83+
paper-stack-height(paper-stack-item(height, desktop), paper-stack-item(spacing, desktop)),
9484
),
9585
);
9686

@@ -101,10 +91,8 @@ $paper-stack: (
10191
///
10292
/// Mixins
10393
@mixin paper-stack-item-offset($breakpoint: $threads-default-value) {
104-
$adjusted-top-offset: -(
105-
(paper-stack-item(width, $breakpoint) / $paper-stack-item-count) +
106-
(paper-stack-item(spacing, $breakpoint) / 2)
107-
);
94+
$adjusted-top-offset: -((paper-stack-item(width, $breakpoint) / $paper-stack-item-count) +
95+
(paper-stack-item(spacing, $breakpoint) / 2));
10896

10997
@for $i from 1 through $paper-stack-item-count {
11098
&:nth-child(#{$i}),

examples/src/components/PaperStack/variants.scss

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
color: get-color(coal, dark);
2424
background-color: white;
2525
border-color: currentColor;
26-
transition:
27-
color get-duration(fast) get-easing(),
28-
background-color get-duration(fast) get-easing(),
29-
transform get-duration() get-easing();
26+
transition: color get-duration(fast) get-easing(),
27+
background-color get-duration(fast) get-easing(), transform get-duration() get-easing();
3028
}
3129

3230
// interaction
@@ -37,9 +35,7 @@
3735
transform: paper-stack-item(transform) translateY(get-spacing(tightest));
3836

3937
&::after {
40-
transform: translateY(
41-
-(get-spacing(tightest))
42-
);
38+
transform: translateY(-(get-spacing(tightest)));
4339
}
4440
}
4541
}

0 commit comments

Comments
 (0)