Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Reorganize imports and add eslint rules #87

Merged
merged 2 commits into from
Oct 5, 2017
Merged

Reorganize imports and add eslint rules #87

merged 2 commits into from
Oct 5, 2017

Conversation

saturninoabril
Copy link
Member

Summary

Sort/order imports by the following groupings separated by empty line:

  • jquery (retain on top to remind that this should remove whenever possible)
  • built-in modules
  • react/redux and related modules
  • other dependency modules
  • dev dependency modules
  • mattermost modules (marked/mattermost-redux)
  • non-npm dependency modules
  • local imports ["actions", "dispatcher", "reducers", "selectors", "store", "stores"]
  • local imports ["client", "config", "plugins", "routes"]
  • local imports ["utils", "tests"]
  • local imports ["fonts", "i18n", "images", "sass"]
  • local imports ["components"]
  • parentImports, starts with "../"
  • siblingImports, starts with "./"

Sorting is done automatically via script: https://github.com/saturninoabril/mm-sort-imports

Add ESLint rules:

"import/no-unresolved": 2,
"import/order": ["error", {"newlines-between": "always-and-inside-groups", "groups": ["builtin", "external", ["internal", "parent"], "sibling", "index"]}],

Other minor changes:

  • Add Mattermost copyright when not provided
  • Remove/fix unresolved/unused modules
  • move const declaration after all import statements

Note:

  • Imports sort/order is not implemented to ./root.jsx

Ticket Link

none

Checklist

  • Touches critical sections of the codebase (imports)

@saturninoabril saturninoabril added the 2: Dev Review Requires review by a core commiter label Oct 1, 2017
@jwilander
Copy link
Member

Let's wait until after 4.3 code complete to merge this

@jwilander jwilander added this to the v4.4.0 milestone Oct 2, 2017
@saturninoabril
Copy link
Member Author

done rebase and fixed conflicts

@saturninoabril saturninoabril merged commit c41de17 into mattermost:master Oct 5, 2017
@lindalumitchell lindalumitchell added the Tests/Not Needed Does not require new release tests label Oct 16, 2017
@saturninoabril saturninoabril deleted the eslint-imports branch October 20, 2017 10:29
@jasonblais jasonblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Nov 1, 2017
hmhealey pushed a commit that referenced this pull request Aug 28, 2020
Ability to retry failed file uploads
hmhealey pushed a commit that referenced this pull request Mar 17, 2021
Ability to retry failed file uploads
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2: Dev Review Requires review by a core commiter Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants