Releases: peopledoc/eslint-config-peopledoc
v4.0.0
Breaking
Add compatibility with ESLint 8 (#118)
Use @babel/eslint-parser
instead of archived babel-eslint
repo for Ember projects
- remove
babel-eslint
from your dependencies - run
yarn add eslint @babel/core @babel/eslint-parser @babel/plugin-proposal-decorators -D
Please check your .eslintrc.js
file, it should start like this
module.exports = {
root: true,
plugins: ['ember'],
extends: ['peopledoc/ember' /*, ... */], // or `peopledoc/ember-addon` in case you are in an addon
...
Replace eslint-plugin-node by eslint-plugin-n
eslint-plugin-node
was not maintained⚠️ if you useplugins: ["node"],
plugin in your ESLint config (like.eslintrc.js
) you have to replace it byplugins: ["n"],
- same if you had some rules like
node/some-rule
, they becomen/some-rule
- same if you had some rules like
Remove eslint-plugin-ember-suave rules (#118)
It was added some years ago but it is not relevant anymore, repo is not really maintained and we can stick with ember/recommended
rules for Ember projects
eslint-disable ember-suave/
in your project you will have to remove them
CI
New workflow to auto-update list of contributors (#94)
Reuse organisation's workflow to run tag & publish (#92)
Chore
Refine information in package.json
(#93)
Relax prefer-destructuring rule (#89)
Build
Update eslint-plugin-ember to 10.5.7 (#118)
Needed for ESLint 8 compatibility
Upgrade eslint-plugin-prettier to 4.0.0 (#85 )
Drops support for
- Node < 12 (this repo already only compatible with Node >= 12)
- Versions 5 and 6 of eslint (as far as i know we use 7+ on all / most of our projects)
- prettier <2.0 (we already have prettier 2.0 in dependencies)
Upgrade eslint-plugin-ember from 10.6.0 to 10.6.1 (#119)
Upgrade eslint-plugin-ember from 10.5.9 to 10.6.0 (#116)
Upgrade prettier from 2.6.1 to 2.6.2 (#115)
Upgrade prettier from 2.6.0 to 2.6.1 (#113)
Upgrade minimist from 1.2.5 to 1.2.6 (#114)
Upgrade prettier from 2.5.1 to 2.6.0 (#112)
Upgrade eslint-config-prettier from 8.4.0 to 8.5.0 (#109)
Upgrade prettier from 2.4.1 to 2.5.1 (#100)
Upgrade eslint-config-prettier from 8.3.0 to 8.4.0 (#104)
Upgrade eslint-plugin-ember from 10.5.8 to 10.5.9 (#102)
Upgrade eslint-plugin-qunit from 7.0.0 to 7.2.0 (#101)
Upgrade eslint-plugin-ember from 10.5.7 to 10.5.8 (#98)
Upgrade eslint-plugin-qunit from 6.2.0 to 7.0.0 (#91)
Update eslint-plugin-ember from 10.5.5 to 10.5.7 (#90)
Update eslint-plugin-ember from 10.5.4 to 10.5.5 (#88)
Update prettier from 2.4.0 to 2.4.1 (#87)
Update prettier from 2.3.2 to 2.4.0 (#86)
Update eslint-plugin-ember from 10.5.3 to 10.5.4 (#84)
v3.0.2
v3.0.1
v3.0.0
Breaking changes
- Remove
ember-test
configuration not needed anymore in our addon with dummy app (#70) - Remove
prettier-eslint-cli
from dependency (#70)
Features
- Define an ember-core configuration file for both addon and app (#70)
- Update the configurations to follow recent ember changes (#70)
- Upgrade eslint-plugin-ember/node and remove extends workaround (#52)
- New rule: spaces arround arrow for arrow functions (#60)
- New rule: space before function parenthesis (#59)
Fix
- fix path to base config in prettier.js (#61)
Build
- bump path-parse from 1.0.6 to 1.0.7 (#80)
- bump lodash from 4.17.19 to 4.17.21 (#76)
- bump hosted-git-info from 2.8.8 to 2.8.9 (#77)
- bump eslint-plugin-prettier from 3.3.1 to 3.4.0 (#74)
- bump y18n from 4.0.0 to 4.0.1 (#73)
- bump prettier-eslint-cli from 5.0.0 to 5.0.1 (#71)
- bump eslint-plugin-prettier from 3.1.4 to 3.3.1 (#66)
- add dependabot config (#64)
v2.0.2
Fix
Don't force empty lines between single line class members (#54)
A small patch to fix annoying lint errors due to the config of the rule lines-between-class-members.
With the current config of this rule, we are not allowed to write something like this:
class Foo {
bar = true
fizz = false
buzz = true
}
Instead, we have to write this:
class Foo {
bar = true
fizz = false
buzz = true
}
Which is a little bit annoying.
This PR update the config for this rule to don't force an empty line between class members that are in one single line.
Example:
class Foo {
bar = true
fizz = false
buzz = true // new line is not mandatory here
toString() { // New line is mandatory here
return `bar: ${this.bar}, fizz: ${this.fizz}, buzz: ${this.buzz}`
}
}
v2.0.1
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