Search code examples
javascriptember.jsember-clieslint

Why is Ember-Cli 3.14 throwing an ESLint No-New-Mixin error


I have three custom mixins that no longer work in Ember-Cli 3.14 (I had to step back down to 3.13.2). All I get is an Ember error saying no-new-mixins for each of the mixins. While the WebUI compiles and is hosted, the WebUI that is accessible no longer works properly. The errors appear to be thrown by ESLint.

Has anyone else had this problem with Ember 3.14?

https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-new-mixins.md

I am hesitant to ignore a rule just because it does not get along with a new version of Ember, but works in others. So, I am checking with SO first.


Solution

  • It looks like the Ember team has decided to move away from mixins going forward so this linting rule was added in that release to alert developers of this decision. Here's an RFC discussing a plan to move away from them.

    It looks like you can suppress this particular error by modifying your eslint.rc file like so:

    module.exports = {
      plugins: [
        'ember'
      ],
      extends: [
        'eslint:recommended'
      ],
      rules: {
        'ember/no-new-mixins': 'off'
      }
    }
    

    I'm not sure if this will override all rules or just that particular one so you might want to look into that a bit more. More info can be found in the README.