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

Update to follow ember last changes and split ember in 3 configs (JS-190) #48

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

GreatWizard
Copy link
Contributor

@GreatWizard GreatWizard commented Feb 6, 2020

⚠️ Breaking change

Update ember configs in order to be compliant with recent ember version (#48)

Our previous dependencies wasn't updated to follow new code from ember 3.12~3.15.

  • Update dependencies
  • Slim down config to ember-cli generated one
  • split configs into 3 : ember, ember-addon and ember-test in order to make them more simple
  • Adapt ember/no-jquery from "error" to "warn" in order to not add pressure on the legacy

Impacts of the update

New .eslintrc.js files
  • For your application:
// my-app/.eslintrc.js
module.exports = {
  root: true,
  extends: ['peopledoc/ember']
}
  • For your addon:
// my-addon/.eslintrc.js
module.exports = {
  root: true,
  extends: ['peopledoc/ember-addon']
}
  • For your tests in ember application/addon:
// my-app/tests/.eslintrc.js
module.exports = {
  root: true,
  extends: ['peopledoc/ember-test']
}
withFeature is not globally accepted anymore

If you were using ember-feature-flag and the old withFeature helper, please consider update your code by using:

import { enableFeature } from 'ember-feature-flags/test-support';

Source: https://github.com/kategengler/ember-feature-flags#test-helpers

New warning:
  • Do not use jQuery (ember/no-jquery)

Warn every usage of jquery, that can help in order to detect legacy code.

New errors:
  • import is duplicated (no-duplicate-imports)
// Before
import Service from '@ember/service'
import { inject as service } from '@ember/service'

// After
import Service, { inject as service } from '@ember/service'
  • Expected blank line between object properties (ember-suave/lines-between-object-properties)
// Before
{
 a: {},
 b: {}
}

// After
{
 a: {},

 b: {}
}
  • Expected blank line before this statement (padding-line-between-statements)

See https://eslint.org/docs/rules/padding-line-between-statements

// Before
      if (user.get('id')) {
        context.type = 'employee'
        context.userId = user.get('id')
      }
      if (user.get('language')) {
        context.userLanguage = user.get('language')
      }

// After
      if (user.get('id')) {
        context.type = 'employee'
        context.userId = user.get('id')
      }

      if (user.get('language')) {
        context.userLanguage = user.get('language')
      }
  • import/no-relative-parent-imports

See https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-relative-parent-imports.md

💡 eslint can fix almost all new rules for you: eslint . --fix

@GreatWizard GreatWizard requested a review from a team as a code owner February 6, 2020 11:24
@GreatWizard GreatWizard force-pushed the ember-3-15 branch 23 times, most recently from 020d3e6 to 802d136 Compare February 7, 2020 09:17
@GreatWizard GreatWizard changed the title WIP: update config, deps and doc to be compliant with 3.15/octane WIP: update to follow ember 3.15 last changes and split ember in 3 configs Feb 7, 2020
@GreatWizard GreatWizard force-pushed the ember-3-15 branch 5 times, most recently from 04da934 to 28ff6a4 Compare February 7, 2020 09:57
@GreatWizard GreatWizard changed the title WIP: update to follow ember 3.15 last changes and split ember in 3 configs Update to follow ember 3.15 last changes and split ember in 3 configs Feb 7, 2020
@GreatWizard GreatWizard changed the title Update to follow ember 3.15 last changes and split ember in 3 configs Update to follow ember 3.15 last changes and split ember in 3 configs (JS-190) Feb 7, 2020
@GreatWizard GreatWizard changed the title Update to follow ember 3.15 last changes and split ember in 3 configs (JS-190) Update to follow ember last changes and split ember in 3 configs (JS-190) Feb 7, 2020
@GreatWizard GreatWizard merged commit 606b752 into master Feb 10, 2020
@GreatWizard GreatWizard deleted the ember-3-15 branch February 10, 2020 08:58
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.

2 participants