Skip to content

Update Linters#491

Merged
justin808 merged 19 commits intomasterfrom
gscarv13/update-linters
Mar 1, 2022
Merged

Update Linters#491
justin808 merged 19 commits intomasterfrom
gscarv13/update-linters

Conversation

@gscarv13
Copy link
Copy Markdown
Contributor

@gscarv13 gscarv13 commented Jan 5, 2022

This PR contains:

  • Updated ESLint and its configurations
  • Updated rubocop and its configurations
  • Updated Babel
  • Add Prettier

This change is Reviewable

@gscarv13 gscarv13 force-pushed the gscarv13/update-linters branch from c663148 to 4af57cc Compare January 6, 2022 16:24
@gscarv13 gscarv13 force-pushed the gscarv13/update-linters branch from 4af57cc to 831033c Compare January 6, 2022 17:58
@gscarv13 gscarv13 marked this pull request as ready for review January 7, 2022 21:04
@Judahmeek Judahmeek requested a review from justin808 January 10, 2022 19:37
Copy link
Copy Markdown
Contributor

@Judahmeek Judahmeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of work was done there! Hopefully, my suggestions won't be too difficult to implement.

Reviewed 110 of 110 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @gscarv13 and @justin808)


.eslintrc, line 7 at r1 (raw file):

  - plugin:jsx-a11y/recommended
  - prettier

Let's add - prettier/react like the RoR & RoR Pro repos have.


.rubocop.yml, line 7 at r1 (raw file):

  - rubocop-performance
  - rubocop-rspec

Let's add rubocop-rails


Gemfile, line 109 at r1 (raw file):

end

gem "rubocop-performance", "~> 1.13"

This should be moved up to be with the other rubocop gems


client/app/bundles/comments/components/CommentBox/CommentBox.jsx, line 7 at r1 (raw file):

import _ from 'lodash';
import { injectIntl, intlShape } from 'react-intl';
import BaseComponent from '../../../../libs/components/BaseComponent.jsx';

This isn't as readable as before.

Let's try using the eslint-plugin-import webpack resolver

Although that's going to have to be configured to use config/webpack/development somehow. You & I might need to pair on this.


client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx, line 1 at r1 (raw file):

// eslint-disable-next-line max-classes-per-file

Probably best to actually follow this rule & split out any extra classes into their own file.


client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx, line 14 at r1 (raw file):

import CommentForm from '../CommentBox/CommentForm/CommentForm.jsx';
import CommentList from '../CommentBox/CommentList/CommentList.jsx';

I think we can avoid having to add the jsx file extension by adding jsx to the import/extensions configuration for eslint-plugin-imports.

Actually, I think adding prettier/react to the .eslintrc will resolve this issue.

Copy link
Copy Markdown
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally OK. We need to separate auto-fixes from configuration changes. I did not review everything.

Also, we can't be spending all our time on such updates. They don't add that much business value.

Reviewed all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @gscarv13)


.eslintignore, line 6 at r1 (raw file):

client/app/libs/i18n/translations.js
client/app/libs/i18n/default.js
postcss.config.js

why is this excluded?

@justin808
Copy link
Copy Markdown
Member

@Judahmeek @gscarv13 close this or update?

@justin808
Copy link
Copy Markdown
Member

@gscarv13 any update on this?

@gscarv13
Copy link
Copy Markdown
Contributor Author

@gscarv13 any update on this?

I'll be working on this

Copy link
Copy Markdown
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Ready for merge?

Reviewed 41 of 41 files at r2, all commit messages.
Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @gscarv13)

Copy link
Copy Markdown
Member

@justin808 justin808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @gscarv13)

Copy link
Copy Markdown
Contributor Author

@gscarv13 gscarv13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @Judahmeek don't need me to fix anything then yes

Reviewable status: all files reviewed, 7 unresolved discussions (waiting on @gscarv13 and @Judahmeek)


.eslintrc, line 7 at r1 (raw file):

Previously, Judahmeek (Judah Meek) wrote…

Let's add - prettier/react like the RoR & RoR Pro repos have.

prettier/react has been merged into prettier in eslint-config-prettier 8.0.0 which is the version currently being used here.
more info: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21

Should we downgrade eslint-config-prettier?


Gemfile, line 109 at r1 (raw file):

Previously, Judahmeek (Judah Meek) wrote…

This should be moved up to be with the other rubocop gems

Done.

@justin808 justin808 merged commit 7feaf74 into master Mar 1, 2022
@justin808 justin808 deleted the gscarv13/update-linters branch March 1, 2022 08:07
@justin808
Copy link
Copy Markdown
Member

Thanks @gscarv13!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants