v2.0.0
⚠️ 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
andember-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
babel-eslint
to complete 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
💡 eslint can fix almost all new rules for you: eslint . --fix
Feature
Allow decorators (#45)
This small change allows to parse correctly the symbol @
for decorators.
I thought it would be useful to enable it as more and more of ours apps/add-ons run with Ember 3.12.
Documentation
Add a note for babel-eslint
(#47)
Add a note in the README
to recommend installing babel-eslint
for Ember projects:
# with npm
npm install --save-dev babel-eslint
# or with yarn
yarn add babel-eslint --dev