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

Allow config to blacklist packages from sort #34

Merged
merged 2 commits into from
Sep 11, 2018

Conversation

sandersky
Copy link
Contributor

@sandersky sandersky commented Sep 11, 2018

Overview

Does this PR close an existing issue?

Yes

Summary

Provide a general summary of the issue addressed in the title above

Issue Number(s)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have evaluated if the README.md documentation needs to be updated
  • I have evaluated if DocBlock headers needed to be added or updated
  • I have verified that lint and tests pass locally with my changes
  • If a fork of a dependent package had to be made to address the issue this PR closes:
    • I noted in the fork's README.md the reason the fork was created
    • I have opened an upstream issue detailing what was deficient about the dependency
    • I have opened an upstream PR addressing this deficiency
    • I have opened an issue in this repository to track this PR and schedule the removal of the usage of the fork

Semver

This project uses semver, please check the scope of this PR:

  • #none#
  • #patch#
  • #minor#
  • #major#

CHANGELOG

  • Added ignore configuration for sort-import-declarations to ignore certain packages such as polyfills.

@sandersky sandersky requested review from a team as code owners September 11, 2018 12:26
@sandersky
Copy link
Contributor Author

@cstolli @sophypal I'm not sure how quickly Ciena engineers look at open source contributions or who to ping if need be on PR's so I'm tagging you both.

@sophypal
Copy link
Member

@sandersky Just throwing out some questions to better understand the requirements. Is it required to have polyfills at the top? I was confused because I thought import order doesn't matter.

@sandersky
Copy link
Contributor Author

sandersky commented Sep 11, 2018

@sophypal imports are hoisted to the top in the transpiled code but if you have something like the following:

import {fetchUsers} from 'awesome-api'
import 'fetch-polyfil'

awesome-api may operate on the assumption that window.fetch is defined as soon as it is loaded, which would happen before the polyfill loads. An example of how this might happen would be:

awesome-api

const {fetch} = window

export const fetchUsers = fetch.bind(null, '/users')

@sophypal
Copy link
Member

@sandersky Thanks. I guess we never run into that here because polyfills are loaded before Ember's loader comes into play but that ultimately depends on how its shimmed and imported. Seeing as how this plugin isnt specific to Ember and you originally wrote it, I'll approve.

@sophypal sophypal merged commit f4259e3 into ciena-blueplanet:master Sep 11, 2018
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.

Ability to ignore certain packages in sort order
2 participants