Skip to content

Releases: peopledoc/eslint-config-peopledoc

v4.0.0

20 May 15:14
59dfd53
Compare
Choose a tag to compare

Breaking

Add compatibility with ESLint 8 (#118)

Use @babel/eslint-parser instead of archived babel-eslint repo for Ember projects

⚠️ If your project use Ember, you need to

  • 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 use plugins: ["node"], plugin in your ESLint config (like .eslintrc.js) you have to replace it by plugins: ["n"],
    • same if you had some rules like node/some-rule, they become n/some-rule

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

⚠️ if you have some 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

19 Aug 15:55
4085e6a
Compare
Choose a tag to compare

Fix

  • ember-addon: detect blueprints in subfolders (#82)

v3.0.1

19 Aug 15:55
3ca0260
Compare
Choose a tag to compare

Fix

  • fix exposed files defined in the package.json #81

core.js and ember-core.js are needed in order to be extended by the others configuration.

v3.0.0

19 Aug 14:28
95efb87
Compare
Choose a tag to compare

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

04 Aug 15:25
0677b70
Compare
Choose a tag to compare

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

06 Apr 08:21
8e0293c
Compare
Choose a tag to compare

Fix

Add missing ember-recommended configuration in Ember.js and ember-test (#51)

Adds useful rules, previously disabled by mistake, like:

  • ember/no-arrow-function-computed-properties
  • ember/require-return-from-computed
  • ember/avoid-leaking-state-in-ember-objects
  • ...

v2.0.0

10 Feb 09:01
2736d0d
Compare
Choose a tag to compare

⚠️ 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

⚠️ You need to install 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

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

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

Build

Add CODEOWNERS (#46)

v1.7.2

21 Oct 16:19
c627eb2
Compare
Choose a tag to compare

Config

Disable camelcase rule in testem.js (#43)

Testem configuration is using snake_case everywhere... so this little changes is here to disable camelcase rules for testem.js file.

v1.7.1

02 Aug 15:23
31911e4
Compare
Choose a tag to compare

Bugfixes

Rule node/no-unpublished-import should not be enabled for private packages #42

v1.7.0

18 Jul 10:22
Compare
Choose a tag to compare

Features

Add node rules from eslint-plugin-node for standard JS files (not ember app / tests files)