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

Add all remaining templates folders to import/order #58462

Merged
merged 12 commits into from May 13, 2024
Merged

Conversation

lfryemason
Copy link
Contributor

In order to improve code cleanliness slightly, we are rolling out an eslint rule to the entire repo that ensure .js, .jsx, .ts and .tsx files have imports automatically sorted.

We are rolling this out incrementally to prevent errors and decrease PR size. This PR removes a subset of folders from the rule exclusions.

FLUP of #57247

For PR reviewers: please double check that all comments in imports are appropriately moved with the line they are talking about.

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@lfryemason lfryemason requested review from Hamms and a team May 7, 2024 22:36
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

Found a couple of nitpicks; not bad, given the scope of this changeset!

apps/src/templates/rubrics/RubricContainer.jsx Outdated Show resolved Hide resolved
@@ -445,4 +445,3 @@ tr.introjs-showElement > th {
z-index: 1;
opacity: 0;
}
/*# sourceMappingURL=introjs.css.map */
Copy link
Contributor

Choose a reason for hiding this comment

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

It's back! 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uuuugh, haven't merged my fix yet

@lfryemason lfryemason requested a review from a team as a code owner May 8, 2024 17:00
@lfryemason lfryemason requested a review from Hamms May 8, 2024 19:05
apps/src/templates/VersionHistory.jsx Outdated Show resolved Hide resolved
apps/src/templates/projects/projectsRedux.js Outdated Show resolved Hide resolved
apps/src/templates/rubrics/RubricContainer.jsx Outdated Show resolved Hide resolved
apps/src/templates/rubrics/introjs.scss Outdated Show resolved Hide resolved
@lfryemason lfryemason requested a review from Hamms May 10, 2024 16:59
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

A couple comment nits, but for the most part this LGTM!

import PropTypes from 'prop-types';
import style from './rubrics.module.scss';
import i18n from '@cdo/locale';
// Disabling import/order rule for this file because product tour imports are grouped.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: stray comment

import {DELETE_SUCCESS} from './deleteDialog/deleteProjectDialogRedux';
import {channels as channelsApi} from '../../clientApi';
import LibraryClientApi from '@cdo/apps/code-studio/components/libraries/LibraryClientApi';
// Disabling import order due to circular dependencies errors from build.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would still like to see some more specificity here about what exactly the circular dependency is. One purpose for comments like this is to help future developers identify when the exception to the norm we've introduced could be removed.

// Disabling import order due to circular dependencies errors from build.
import {DELETE_SUCCESS} from './deleteDialog/deleteProjectDialogRedux'; /* eslint-disable-line import/order */
import {channels as channelsApi} from '../../clientApi'; /* eslint-disable-line import/order */
import LibraryClientApi from '@cdo/apps/code-studio/components/libraries/LibraryClientApi'; /* eslint-disable-line import/order */
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason you're disabling these line-by-line rather than as a block?

@@ -1,12 +1,18 @@
import PropTypes from 'prop-types';
import React from 'react';
import VersionRow from './VersionRow';

// Disabling import order due to circular dependencies errors from build.
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, I'd like to see some more details in this comment, and I'm curious why we're disabling the rule line-by-line rather than as a group.

# Conflicts:
#	apps/src/templates/sessions/LockoutPanel.jsx
@lfryemason lfryemason merged commit 5d7b3ee into staging May 13, 2024
2 checks passed
@lfryemason lfryemason deleted the lfm/eslint-10 branch May 13, 2024 16:11
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.

None yet

2 participants