Skip to content

Commit 318f1b5

Browse files
authored
Adds Stylelint for sass linting (#2346)
This PR adds stylelint and prettier standard configs with some exceptions for sass.
1 parent e805fd6 commit 318f1b5

File tree

28 files changed

+1590
-202
lines changed

28 files changed

+1590
-202
lines changed

.stylelintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
3+
"plugins": ["stylelint-prettier", "stylelint-scss"],
4+
"rules": {
5+
"prettier/prettier": true,
6+
"at-rule-no-unknown": null,
7+
"scss/at-rule-no-unknown": true,
8+
"no-descending-specificity": null
9+
}
10+
}

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,12 @@ format:
164164
@npx prettier --ignore-path .gitignore --write "**/*.{js,jsx,json,sass,ts,tsx}"
165165

166166
.PHONY: lint
167-
lint:
167+
lint: lint-js lint-scss
168+
169+
.PHONY: lint-scss
170+
lint-scss:
171+
@npx stylelint --ignore-path .gitignore "**/*.scss" --syntax scss
172+
173+
.PHONY: lint-js
174+
lint-js:
168175
@npx eslint --ignore-path .gitignore "**/*.{js,jsx,ts,tsx}"

lib/app-layout/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
transition: width 0.2s ease-in-out, opacity 0.2s ease-in-out;
1212
}
1313
.app-layout__note-column {
14-
border-left-width: 0px;
14+
border-left-width: 0;
1515
transition: border-left-width 0.2s;
1616
}
1717

lib/auth/style.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
color: $studio-white;
6868
font-weight: 500;
6969
margin: 16px auto 8px;
70-
padding: 0px 15px 2px;
70+
padding: 0 15px 2px;
7171
}
7272

7373
a.login__forgot {
@@ -126,7 +126,7 @@
126126
font-size: 16px;
127127
font-weight: 500;
128128
height: 40px;
129-
padding: 0px 15px 2px;
129+
padding: 0 15px 2px;
130130
margin: 50px auto 10px;
131131
max-width: 320px;
132132
text-align: center;

lib/components/dev-badge/style.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.dev-badge {
22
position: absolute;
3-
opacity: .8;
3+
opacity: 0.8;
44
z-index: 1;
55
right: 12px;
66
bottom: 12px;
77
padding: 2px 4px;
88
background: $studio-gray-5;
99
color: $studio-gray-80;
10-
font-size: .75rem;
10+
font-size: 0.75rem;
1111
line-height: 1;
1212
}

lib/components/tab-panels/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
margin: 0 0.5em;
1212
border-top: 2px solid transparent;
1313
border-bottom: 2px solid transparent;
14-
padding: 0.75em 0.75em;
14+
padding: 0.75em;
1515
color: $studio-gray-80;
1616
text-transform: capitalize;
1717
border-radius: 0;

lib/components/tag-chip/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cursor: pointer;
33
flex: none;
44
margin: 2px 8px 6px 0;
5-
padding: 1px 14px 3px 14px;
5+
padding: 1px 14px 3px;
66
border-radius: 14px;
77
line-height: 1.25em;
88
white-space: nowrap;

lib/controls/checkbox/style.scss

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.checkbox-control {
22
-webkit-touch-callout: none;
3-
43
width: 16px;
54
height: 16px;
65
position: relative;

lib/controls/toggle/style.scss

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ $toggle-control-knob-size: $toggle-control-height - $toggle-control-knob-margin
66

77
.toggle-control {
88
-webkit-touch-callout: none;
9-
109
position: relative;
1110
display: inline-block;
1211
width: $toggle-control-width;

lib/dialog-renderer/style.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
display: flex;
88
justify-content: center;
99
align-items: center;
10-
background: rgba($studio-white, .75);
10+
background: rgba($studio-white, 0.75);
1111
}
1212

1313
.theme-dark {
1414
.dialog-renderer__overlay {
15-
background: rgba($studio-gray-100, .75);
15+
background: rgba($studio-gray-100, 0.75);
1616
}
1717
}
1818

lib/dialogs/about/style.scss

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
// For overriding theme settings.
77
// TODO: Improve theme management so this isn't necessary
8+
89
background: $studio-simplenote-blue-50 !important;
910
color: $studio-white !important;
1011
a {

lib/dialogs/import/source-importer/executor/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
.source-importer-executor__error {
18-
margin-bottom: .75em;
18+
margin-bottom: 0.75em;
1919
color: $studio-red-40;
2020
line-height: 1.3;
2121
}

lib/dialogs/keybindings/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
.dialog-content {
8-
padding: 10px 20px 20px 20px;
8+
padding: 10px 20px 20px;
99
}
1010

1111
ul {

lib/dialogs/settings/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.settings {
22
max-width: 630px;
33

4-
input[type="radio"] {
4+
input[type='radio'] {
55
cursor: pointer;
66
}
77

lib/navigation-bar/style.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
flex: none;
4747
justify-content: flex-start;
4848
align-items: center;
49-
padding: 0 20px 20px 20px;
49+
padding: 0 20px 20px;
5050
color: $studio-gray-80;
5151
}
5252

@@ -55,7 +55,7 @@
5555
flex: none;
5656
justify-content: flex-start;
5757
align-items: center;
58-
padding: 0 20px 0 20px;
58+
padding: 0 20px;
5959
color: $studio-gray-80;
6060
}
6161

lib/note-detail/style.scss

+3-8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
}
8383

8484
.note-detail-markdown {
85+
@import '../node_modules/highlight.js/scss/solarized-light.scss';
86+
8587
overflow: visible;
8688
-webkit-overflow-scrolling: touch;
8789

@@ -95,6 +97,7 @@
9597
}
9698

9799
a {
100+
cursor: pointer;
98101
overflow-wrap: break-word;
99102
word-wrap: break-word;
100103
}
@@ -103,10 +106,6 @@
103106
max-width: 100%;
104107
height: auto;
105108
}
106-
}
107-
108-
.note-detail-markdown {
109-
@import '../node_modules/highlight.js/scss/solarized-light.scss';
110109

111110
h1,
112111
h2,
@@ -131,10 +130,6 @@
131130
border-top: 1px solid $studio-gray-5;
132131
}
133132

134-
a {
135-
cursor: pointer;
136-
}
137-
138133
blockquote {
139134
font-style: italic;
140135
border-left: 4px solid $studio-gray-5;

lib/note-list/style.scss

+1-4
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,11 @@
9999
}
100100

101101
.note-list-item-pinner {
102+
color: transparent;
102103
height: 16px;
103104
width: 16px;
104105
}
105106

106-
.note-list-item-pinner {
107-
color: transparent;
108-
}
109-
110107
.note-list-item-pinner:hover,
111108
.note-list-item-pinner.note-list-item-pinned {
112109
color: $studio-simplenote-blue-50;

lib/note-toolbar/style.scss

+15-17
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@
4343
}
4444

4545
.note-toolbar-trashed {
46+
display: flex;
47+
align-items: center;
48+
padding: 0 16px;
49+
justify-content: flex-end;
50+
width: 100%;
51+
52+
.note-toolbar__button {
53+
margin: 0 0 0 16px;
54+
}
55+
56+
.basic-button,
57+
.button-primary {
58+
border-width: 2px;
59+
}
60+
4661
.note-toolbar__column-left {
4762
display: none;
4863

@@ -90,23 +105,6 @@
90105
}
91106
}
92107

93-
.note-toolbar-trashed {
94-
display: flex;
95-
align-items: center;
96-
padding: 0 16px;
97-
justify-content: flex-end;
98-
width: 100%;
99-
100-
.note-toolbar__button {
101-
margin: 0 0 0 16px;
102-
}
103-
104-
.basic-button,
105-
.button-primary {
106-
border-width: 2px;
107-
}
108-
}
109-
110108
.note-toolbar-placeholder {
111109
display: block;
112110
height: $toolbar-height;

lib/revision-selector/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.revision-selector {
22
background: $studio-simplenote-blue-50;
3-
padding: 10px 20px 20px 20px;
3+
padding: 10px 20px 20px;
44
color: $studio-white;
55
z-index: 1000;
66
height: 114px;

lib/tag-list/style.scss

-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656
padding-bottom: 0;
5757
overflow-y: auto;
5858
margin: 0;
59-
padding-top: 0;
60-
padding-bottom: 0;
6159

6260
svg {
6361
cursor: pointer;

0 commit comments

Comments
 (0)