Skip to content

Commit

Permalink
Adds Stylelint for sass linting (#2346)
Browse files Browse the repository at this point in the history
This PR adds stylelint and prettier standard configs with some exceptions for sass.
  • Loading branch information
belcherj committed Oct 2, 2020
1 parent e805fd6 commit 318f1b5
Show file tree
Hide file tree
Showing 28 changed files with 1,590 additions and 202 deletions.
10 changes: 10 additions & 0 deletions .stylelintrc
@@ -0,0 +1,10 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"plugins": ["stylelint-prettier", "stylelint-scss"],
"rules": {
"prettier/prettier": true,
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true,
"no-descending-specificity": null
}
}
9 changes: 8 additions & 1 deletion Makefile
Expand Up @@ -164,5 +164,12 @@ format:
@npx prettier --ignore-path .gitignore --write "**/*.{js,jsx,json,sass,ts,tsx}"

.PHONY: lint
lint:
lint: lint-js lint-scss

.PHONY: lint-scss
lint-scss:
@npx stylelint --ignore-path .gitignore "**/*.scss" --syntax scss

.PHONY: lint-js
lint-js:
@npx eslint --ignore-path .gitignore "**/*.{js,jsx,ts,tsx}"
2 changes: 1 addition & 1 deletion lib/app-layout/style.scss
Expand Up @@ -11,7 +11,7 @@
transition: width 0.2s ease-in-out, opacity 0.2s ease-in-out;
}
.app-layout__note-column {
border-left-width: 0px;
border-left-width: 0;
transition: border-left-width 0.2s;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/auth/style.scss
Expand Up @@ -67,7 +67,7 @@
color: $studio-white;
font-weight: 500;
margin: 16px auto 8px;
padding: 0px 15px 2px;
padding: 0 15px 2px;
}

a.login__forgot {
Expand Down Expand Up @@ -126,7 +126,7 @@
font-size: 16px;
font-weight: 500;
height: 40px;
padding: 0px 15px 2px;
padding: 0 15px 2px;
margin: 50px auto 10px;
max-width: 320px;
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions lib/components/dev-badge/style.scss
@@ -1,12 +1,12 @@
.dev-badge {
position: absolute;
opacity: .8;
opacity: 0.8;
z-index: 1;
right: 12px;
bottom: 12px;
padding: 2px 4px;
background: $studio-gray-5;
color: $studio-gray-80;
font-size: .75rem;
font-size: 0.75rem;
line-height: 1;
}
2 changes: 1 addition & 1 deletion lib/components/tab-panels/style.scss
Expand Up @@ -11,7 +11,7 @@
margin: 0 0.5em;
border-top: 2px solid transparent;
border-bottom: 2px solid transparent;
padding: 0.75em 0.75em;
padding: 0.75em;
color: $studio-gray-80;
text-transform: capitalize;
border-radius: 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/components/tag-chip/style.scss
Expand Up @@ -2,7 +2,7 @@
cursor: pointer;
flex: none;
margin: 2px 8px 6px 0;
padding: 1px 14px 3px 14px;
padding: 1px 14px 3px;
border-radius: 14px;
line-height: 1.25em;
white-space: nowrap;
Expand Down
1 change: 0 additions & 1 deletion lib/controls/checkbox/style.scss
@@ -1,6 +1,5 @@
.checkbox-control {
-webkit-touch-callout: none;

width: 16px;
height: 16px;
position: relative;
Expand Down
1 change: 0 additions & 1 deletion lib/controls/toggle/style.scss
Expand Up @@ -6,7 +6,6 @@ $toggle-control-knob-size: $toggle-control-height - $toggle-control-knob-margin

.toggle-control {
-webkit-touch-callout: none;

position: relative;
display: inline-block;
width: $toggle-control-width;
Expand Down
4 changes: 2 additions & 2 deletions lib/dialog-renderer/style.scss
Expand Up @@ -7,12 +7,12 @@
display: flex;
justify-content: center;
align-items: center;
background: rgba($studio-white, .75);
background: rgba($studio-white, 0.75);
}

.theme-dark {
.dialog-renderer__overlay {
background: rgba($studio-gray-100, .75);
background: rgba($studio-gray-100, 0.75);
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/dialogs/about/style.scss
Expand Up @@ -5,6 +5,7 @@

// For overriding theme settings.
// TODO: Improve theme management so this isn't necessary

background: $studio-simplenote-blue-50 !important;
color: $studio-white !important;
a {
Expand Down
2 changes: 1 addition & 1 deletion lib/dialogs/import/source-importer/executor/style.scss
Expand Up @@ -15,7 +15,7 @@
}

.source-importer-executor__error {
margin-bottom: .75em;
margin-bottom: 0.75em;
color: $studio-red-40;
line-height: 1.3;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/dialogs/keybindings/style.scss
Expand Up @@ -5,7 +5,7 @@
}

.dialog-content {
padding: 10px 20px 20px 20px;
padding: 10px 20px 20px;
}

ul {
Expand Down
2 changes: 1 addition & 1 deletion lib/dialogs/settings/style.scss
@@ -1,7 +1,7 @@
.settings {
max-width: 630px;

input[type="radio"] {
input[type='radio'] {
cursor: pointer;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/navigation-bar/style.scss
Expand Up @@ -46,7 +46,7 @@
flex: none;
justify-content: flex-start;
align-items: center;
padding: 0 20px 20px 20px;
padding: 0 20px 20px;
color: $studio-gray-80;
}

Expand All @@ -55,7 +55,7 @@
flex: none;
justify-content: flex-start;
align-items: center;
padding: 0 20px 0 20px;
padding: 0 20px;
color: $studio-gray-80;
}

Expand Down
11 changes: 3 additions & 8 deletions lib/note-detail/style.scss
Expand Up @@ -82,6 +82,8 @@
}

.note-detail-markdown {
@import '../node_modules/highlight.js/scss/solarized-light.scss';

overflow: visible;
-webkit-overflow-scrolling: touch;

Expand All @@ -95,6 +97,7 @@
}

a {
cursor: pointer;
overflow-wrap: break-word;
word-wrap: break-word;
}
Expand All @@ -103,10 +106,6 @@
max-width: 100%;
height: auto;
}
}

.note-detail-markdown {
@import '../node_modules/highlight.js/scss/solarized-light.scss';

h1,
h2,
Expand All @@ -131,10 +130,6 @@
border-top: 1px solid $studio-gray-5;
}

a {
cursor: pointer;
}

blockquote {
font-style: italic;
border-left: 4px solid $studio-gray-5;
Expand Down
5 changes: 1 addition & 4 deletions lib/note-list/style.scss
Expand Up @@ -99,14 +99,11 @@
}

.note-list-item-pinner {
color: transparent;
height: 16px;
width: 16px;
}

.note-list-item-pinner {
color: transparent;
}

.note-list-item-pinner:hover,
.note-list-item-pinner.note-list-item-pinned {
color: $studio-simplenote-blue-50;
Expand Down
32 changes: 15 additions & 17 deletions lib/note-toolbar/style.scss
Expand Up @@ -43,6 +43,21 @@
}

.note-toolbar-trashed {
display: flex;
align-items: center;
padding: 0 16px;
justify-content: flex-end;
width: 100%;

.note-toolbar__button {
margin: 0 0 0 16px;
}

.basic-button,
.button-primary {
border-width: 2px;
}

.note-toolbar__column-left {
display: none;

Expand Down Expand Up @@ -90,23 +105,6 @@
}
}

.note-toolbar-trashed {
display: flex;
align-items: center;
padding: 0 16px;
justify-content: flex-end;
width: 100%;

.note-toolbar__button {
margin: 0 0 0 16px;
}

.basic-button,
.button-primary {
border-width: 2px;
}
}

.note-toolbar-placeholder {
display: block;
height: $toolbar-height;
Expand Down
2 changes: 1 addition & 1 deletion lib/revision-selector/style.scss
@@ -1,6 +1,6 @@
.revision-selector {
background: $studio-simplenote-blue-50;
padding: 10px 20px 20px 20px;
padding: 10px 20px 20px;
color: $studio-white;
z-index: 1000;
height: 114px;
Expand Down
2 changes: 0 additions & 2 deletions lib/tag-list/style.scss
Expand Up @@ -56,8 +56,6 @@
padding-bottom: 0;
overflow-y: auto;
margin: 0;
padding-top: 0;
padding-bottom: 0;

svg {
cursor: pointer;
Expand Down

0 comments on commit 318f1b5

Please sign in to comment.