-
Notifications
You must be signed in to change notification settings - Fork 65
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
configure prettier & eslint #57
Conversation
These seems to be an error when installing the dependencies.
Deleting the node_modules folder and the package-lock.json did not work. I used the containerized dev environment, where "npm install --legacy-peer-deps" is called to install the dependencies. Could that be the reason or did I miss a step? |
6623a18
to
3984a80
Compare
i forgot to remove |
c3dda84
to
538f78c
Compare
just updated the dangling comma rule since it was complaining about them in imports as well. |
Got a similar issue for eslint. Got over it by bumping the react-script to 4.0.3 and downgrading eslint to 7.11.0. Now it's complaining about the config. I would guess that I have to bump react-script to version 5.0.0 in order for it to work with eslint 8.10.0. Will try that tomorrow :) |
Hmm, I'm going to test the stuff in the container and get back to you. Doesn't seem fair that you have to debug my PR. Should I close this PR and open a new one when it all works properly? |
It's fine :D The problem is mostly caused by old dependencies. You can just continue to work in this pr :) Upgrading the version to react-scripts 5.0.0 worked. But now we have this issue in fomantic-ui: fomantic/Fomantic-UI#2027 |
Somebody opened up a pr, but it never got merged. But we could link to the pr git repo instead of the npm package. |
I'm fiddling about with the dependencies, splitting deps from devDeps and getting the lint and builds to work properly. Once I've got that up and running I'll have to test if everything still works as expected. |
8c5386d
to
9a4a60d
Compare
I managed to get it going by removing the I wasn't sure that the users would appreciate a CDN dependency, but I noticed that there's also a unpkg dependency to I'm looking at patching it it via |
I fixed the fomantic-ui-css issue using patch-package. |
I updated the prettier config to match the current code style as good as I could, but as far as I can tell the style isn't 100% in line everywhere. With the current configuration the new style will be applied whenever a file is changed with |
Installation of the dependencies and the changes that were needed in the dockerfiles works 👍 I had this issue here facebook/create-react-app#11779 I think formatting the codebase in one commit, would be a good enough solution. git blame does not work directly, but I still see in the history, who made the actual change. |
I'm seeing it too now. There's some funky stuff going on with the routing. Once logged in it's directing from root to login and back again on every hard refresh. I'm going to continue to chip away at it until I can get the
I guess that's an option, but the inline-git-blame will show the formatting commit by default. I'm not sure how important it is to keep this information at this point though. I'm with you on formatting it in one go though. |
b0b152a
to
8342c4f
Compare
223ca74
to
d8579bd
Compare
Kudos, SonarCloud Quality Gate passed! |
Looks good 👍 |
I've added configs for prettier & eslint with a ts integration, along with husky and lint-staged.
In addition to extending 'eslint:recommended, react/recommendedand @typescript-eslint/recommended I've included most rules available in the eslint-typescript as warnings. I'm fairly sure we don't need all of them. My thought is that we can disable them by process of elimination or set ones we find important to
error
level.I've also added devDependencies for
eslint-filtered-fix
andeslint-nibbl
which allows you to fix eslint rules by rule, instead of fixing everything fixable at once.I haven't run prettier over the src directory in this MR since I don't want the entire git history being overwritten due to formatting changes. I think there's a way to format it which lets us keep the line history somehow.