-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feature/emulsify linting setup #111
Conversation
… for dependency issues
.eslintrc
Outdated
@@ -0,0 +1,22 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments here:
- The config file name should be
.estlintrc.json
. From Eslint docs:
ESLint supports configuration files in several formats:
JavaScript - use .eslintrc.js and export an object containing your configuration.
...
JSON - use .eslintrc.json to define the configuration structure. ESLint's JSON files also allow JavaScript-style comments.
Deprecated - use .eslintrc, which can be either JSON or YAML.
- When we run
npm run lint
from the project root then ESlint finds./web/.eslintrc.json
. We need to discuss whether it makes sense to have an additional.eslintrc.json
file at the project root.
This prevents parent directories from being searched for config files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that things generally are looking pretty good, or at least something that we can start off with. I did a few more changes though:
- Fixed style linting paths (lint:css) paths in package.json
- Installed
stylelint-prettier
package. I noticed that we had not yet taken into account running prettier rules for css files. We had only disabled formating related rules, but not installed or configured a package which runs prettier as a stylelint rule;stylelint-prettier
does exactly that.
Now, at this point someone should probably test that the linting setup works as desired:
- Eslint runs in a way that formatting related rules are handled by prettier
- Stylelint runs in away that formatting related rules are handled by prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me, I think this is a great starting point. Made one small suggestion.
.eslintrc.json
Outdated
"globals": { | ||
"expect": true, | ||
"it": true, | ||
"describe": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding expect/it/describe as globals, we could instead add jest to env: "env": { "jest": true }
https://wunder.atlassian.net/browse/PSW-1
.rc
with JSON syntax..stylelintrc
-file is located in the Webpack folder, and there possibly is a practical reason for that. But at this point, as we don't even have Webpack on the repo, I just added the stylelint file to the root of the project.