Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/setup stylelint #46

Merged
merged 4 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Poule-Poule frontend app

## Architecture

```sh
.
└── src/
Expand All @@ -15,21 +16,27 @@
## How to contribute

### Quick start

```sh
yarn install
yarn start
```

### Lint and format code before committing

Normally, the code is automatically linted and formatted before commits.

```sh
yarn lint
yarn lint:style
yarn format
```

### Tests

```sh
yarn test
```

By default, only test suites based on files changed since the last commit are run.
To force `jest` to run every test suites, use the `--watchAll` option.
11 changes: 10 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "react-scripts build",
"test": "react-scripts test",
"lint": "eslint \"src/**/*.{ts,tsx}\" --max-warnings 0",
"lint:style": "stylelint \"src/**/*.scss\"",
"format": "prettier \"src/**/*.{ts,tsx,scss}\" --write"
},
"dependencies": {
Expand Down Expand Up @@ -34,6 +35,9 @@
"node-sass": "^4.13.0",
"prettier": "^1.19.1",
"react-scripts": "3.2.0",
"stylelint": "^12.0.0",
"stylelint-config-recommended-scss": "^4.1.0",
"stylelint-scss": "^3.13.0",
"typescript": "3.7.2"
},
"husky": {
Expand All @@ -47,7 +51,12 @@
"eslint --max-warnings 0",
"git add"
],
"src/**/*.{scss,md}": [
"src/**/*.scss": [
"prettier --write",
"stylelint --fix",
"git add"
],
"src/**/*.md": [
"prettier --write",
"git add"
]
Expand Down
8 changes: 4 additions & 4 deletions client/src/containers/Settings/Settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
}

&__Field {
label + label {
margin-top: $spacing-small;
}

& + & {
display: flex;
flex-wrap: wrap;
Expand All @@ -21,10 +25,6 @@
}
}

label + label {
margin-top: $spacing-small;
}

[type='number'] {
margin-right: $spacing-small;
}
Expand Down
9 changes: 2 additions & 7 deletions client/src/styles/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
box-sizing: border-box;
}

/* Remove default padding */
/* Remove default padding and list styles.*/
ul,
ol {
padding: 0;
list-style: none;
}

/* Remove default margin */
Expand Down Expand Up @@ -37,12 +38,6 @@ body {
line-height: 1.5;
}

/* Remove list styles on ul and ol elements */
ul,
ol {
list-style: none;
}

/* a elements get default styles */
a {
text-decoration-skip-ink: auto;
Expand Down
3 changes: 3 additions & 0 deletions client/stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: 'stylelint-config-recommended-scss'
}
Loading