Repository: ember-cli/ember-cli
Pull request #7529 (2018-01-01 17:41:48)

Backport & fixup linting changes.
As discussed in a recent ember-cli team meeting, this backports the linting changes added in https://github.com/ember-cli/ember-cli/pull/7452 and https://github.com/ember-cli/ember-cli/pull/7451 to beta branch.

It also fixes an issue where `index.js` in subdirectories is incorrectly marked as a "node file" (due to eslint/eslint#9740).  For apps, we avoid adding `index.js` (or `tests/dummy/config/**/*.js`) to the list of overrides which side-steps the entire issue. For addons, we add `excludedFiles` to ensure that `app/` and `addon/` are _never_ matched by the node file overrides.


Patch:
diff --git a/blueprints/addon/files/.travis.yml b/blueprints/addon/files/.travis.yml
index 6971fe52f..dad9720ff 100644
--- a/blueprints/addon/files/.travis.yml
+++ b/blueprints/addon/files/.travis.yml
@@ -49,6 +49,7 @@ install:
   - npm --version
 <% } %>
 script:
+  - <% if (yarn) { %>yarn lint:js<% } else { %>npm run lint:js<% } %>
   # Usually, it's ok to finish the test scenario without reverting
   #  to the addon's original dependency state, skipping "cleanup".
   - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
diff --git a/blueprints/addon/index.js b/blueprints/addon/index.js
index fab616769..4c3704e95 100644
--- a/blueprints/addon/index.js
+++ b/blueprints/addon/index.js
@@ -62,9 +62,15 @@ module.exports = {
     // add `ember-disable-prototype-extensions` to addons by default
     contents.devDependencies['ember-disable-prototype-extensions'] = '^1.1.2';
 
+    // add `eslint-plugin-node` to addons by default
+    contents.devDependencies['eslint-plugin-node'] = '^5.2.1';
+
     // use `ember-try` as test script in addons by default
     contents.scripts.test = 'ember try:each';
 
+    // add addon specific directories to lint:js script
+    contents.scripts['lint:js'] = 'eslint ./*.js addon addon-test-support app config lib server test-support tests';
+
     contents['ember-addon'] = contents['ember-addon'] || {};
     contents['ember-addon'].configPath = 'tests/dummy/config';
 
@@ -121,6 +127,7 @@ module.exports = {
       year: date.getFullYear(),
       yarn: options.yarn,
       welcome: options.welcome,
+      blueprint: 'addon',
     };
   },
 
diff --git a/blueprints/app/files/.eslintrc.js b/blueprints/app/files/.eslintrc.js
index 9e95299e0..9a0b8badb 100644
--- a/blueprints/app/files/.eslintrc.js
+++ b/blueprints/app/files/.eslintrc.js
@@ -8,7 +8,7 @@ module.exports = {
     'ember'
   ],
   extends: [
-    'eslint:recommended', 
+    'eslint:recommended',
     'plugin:ember/recommended'
   ],
   env: {
@@ -19,13 +19,17 @@ module.exports = {
   overrides: [
     // node files
     {
-      files: [
-        'index.js',
+      files: [<% if (blueprint !== 'app') { %>
+        'index.js',<% } %>
         'testem.js',
         'ember-cli-build.js',
-        'config/**/*.js',
-        'tests/dummy/config/**/*.js'
-      ],
+        'config/**/*.js'<% if (blueprint !== 'app') { %>,
+        'tests/dummy/config/**/*.js'<% } %>
+      ],<% if (blueprint !== 'app') { %>
+      excludedFiles: [
+        'app/**',
+        'addon/**'
+      ],<% } %>
       parserOptions: {
         sourceType: 'script',
         ecmaVersion: 2015
@@ -33,7 +37,11 @@ module.exports = {
       env: {
         browser: false,
         node: true
-      }
+      }<% if (blueprint !== 'app') { %>,
+      plugins: ['node'],
+      rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
+        // add your custom rules and overrides for node files here
+      })<% } %>
     },
 
     // test files
diff --git a/blueprints/app/files/.travis.yml b/blueprints/app/files/.travis.yml
index 75eef5779..24bfe322e 100644
--- a/blueprints/app/files/.travis.yml
+++ b/blueprints/app/files/.travis.yml
@@ -21,13 +21,14 @@ env:
     # See https://git.io/vdao3 for details.
     - JOBS=1
 
-before_install:<% if (yarn) { %>
+before_install:<% if (!yarn) { %>
+  - npm config set spin false<% } else { %>
   - curl -o- -L https://yarnpkg.com/install.sh | bash
   - export PATH=$HOME/.yarn/bin:$PATH
 
 install:
-  - yarn install --non-interactive
+  - yarn install --non-interactive<% } %>
 
 script:
-  - yarn test<% } else { %>
-  - npm config set spin false<% } %>
+  - <% if (yarn) { %>yarn lint:js<% } else { %>npm run lint:js<% } %>
+  - <% if (yarn) { %>yarn<% } else { %>npm<% } %> test
diff --git a/blueprints/app/files/package.json b/blueprints/app/files/package.json
index 431c05005..ef2edb601 100644
--- a/blueprints/app/files/package.json
+++ b/blueprints/app/files/package.json
@@ -12,6 +12,7 @@
   "repository": "",
   "scripts": {
     "build": "ember build",
+    "lint:js": "eslint ./*.js app config lib server tests",
     "start": "ember serve",
     "test": "ember test"
   },
diff --git a/blueprints/app/index.js b/blueprints/app/index.js
index 9918676a9..9e8060e64 100644
--- a/blueprints/app/index.js
+++ b/blueprints/app/index.js
@@ -27,6 +27,7 @@ module.exports = {
       emberCLIVersion: require('../../package').version,
       yarn: options.yarn,
       welcome: options.welcome,
+      blueprint: 'app',
     };
   },
 };


Test patch:
diff --git a/tests/acceptance/new-test.js b/tests/acceptance/new-test.js
index e2457a6dc..d0dc14ecb 100644
--- a/tests/acceptance/new-test.js
+++ b/tests/acceptance/new-test.js
@@ -366,6 +366,16 @@ describe('Acceptance: ember new', function() {
   }));
 
   describe('verify fixtures', function() {
+    function checkPackageJson(fixtureName) {
+      let currentVersion = require('../../package').version;
+      let fixturePath = path.join(__dirname, '../fixtures', fixtureName, 'package.json');
+      let fixtureContents = fs.readFileSync(fixturePath, { encoding: 'utf-8' })
+        .replace("<%= emberCLIVersion %>", currentVersion);
+
+      expect(file('package.json'))
+        .to.equal(fixtureContents);
+    }
+
     it('app + npm + !welcome', co.wrap(function *() {
       yield ember([
         'new',
@@ -376,14 +386,18 @@ describe('Acceptance: ember new', function() {
         '--no-welcome',
       ]);
 
+      let fixturePath = 'app/npm';
       [
         'app/templates/application.hbs',
         '.travis.yml',
         'README.md',
+        '.eslintrc.js',
       ].forEach(filePath => {
         expect(file(filePath))
-          .to.equal(file(path.join(__dirname, '../fixtures/app/npm', filePath)));
+          .to.equal(file(path.join(__dirname, '../fixtures', fixturePath, filePath)));
       });
+
+      checkPackageJson(fixturePath);
     }));
 
     it('app + yarn + welcome', co.wrap(function *() {
@@ -396,14 +410,18 @@ describe('Acceptance: ember new', function() {
         '--yarn',
       ]);
 
+      let fixturePath = 'app/yarn';
       [
         'app/templates/application.hbs',
         '.travis.yml',
         'README.md',
+        '.eslintrc.js',
       ].forEach(filePath => {
         expect(file(filePath))
-          .to.equal(file(path.join(__dirname, '../fixtures/app/yarn', filePath)));
+          .to.equal(file(path.join(__dirname, '../fixtures', fixturePath, filePath)));
       });
+
+      checkPackageJson(fixturePath);
     }));
 
     it('addon + npm + !welcome', co.wrap(function *() {
@@ -415,15 +433,19 @@ describe('Acceptance: ember new', function() {
         '--skip-git',
       ]);
 
+      let fixturePath = 'addon/npm';
       [
         'config/ember-try.js',
         'tests/dummy/app/templates/application.hbs',
         '.travis.yml',
         'README.md',
+        '.eslintrc.js',
       ].forEach(filePath => {
         expect(file(filePath))
-          .to.equal(file(path.join(__dirname, '../fixtures/addon/npm', filePath)));
+          .to.equal(file(path.join(__dirname, '../fixtures', fixturePath, filePath)));
       });
+
+      checkPackageJson(fixturePath);
     }));
 
     it('addon + yarn + welcome', co.wrap(function *() {
@@ -437,15 +459,19 @@ describe('Acceptance: ember new', function() {
         '--welcome',
       ]);
 
+      let fixturePath = 'addon/yarn';
       [
         'config/ember-try.js',
         'tests/dummy/app/templates/application.hbs',
         '.travis.yml',
         'README.md',
+        '.eslintrc.js',
       ].forEach(filePath => {
         expect(file(filePath))
-          .to.equal(file(path.join(__dirname, '../fixtures/addon/yarn', filePath)));
+          .to.equal(file(path.join(__dirname, '../fixtures', fixturePath, filePath)));
       });
+
+      checkPackageJson(fixturePath);
     }));
   });
 
diff --git a/tests/fixtures/addon/npm/.eslintrc.js b/tests/fixtures/addon/npm/.eslintrc.js
new file mode 100644
index 000000000..1c65e6db0
--- /dev/null
+++ b/tests/fixtures/addon/npm/.eslintrc.js
@@ -0,0 +1,56 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    ecmaVersion: 2017,
+    sourceType: 'module'
+  },
+  plugins: [
+    'ember'
+  ],
+  extends: [
+    'eslint:recommended',
+    'plugin:ember/recommended'
+  ],
+  env: {
+    browser: true
+  },
+  rules: {
+  },
+  overrides: [
+    // node files
+    {
+      files: [
+        'index.js',
+        'testem.js',
+        'ember-cli-build.js',
+        'config/**/*.js',
+        'tests/dummy/config/**/*.js'
+      ],
+      excludedFiles: [
+        'app/**',
+        'addon/**'
+      ],
+      parserOptions: {
+        sourceType: 'script',
+        ecmaVersion: 2015
+      },
+      env: {
+        browser: false,
+        node: true
+      },
+      plugins: ['node'],
+      rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
+        // add your custom rules and overrides for node files here
+      })
+    },
+
+    // test files
+    {
+      files: ['tests/**/*.js'],
+      excludedFiles: ['tests/dummy/**/*.js'],
+      env: {
+        embertest: true
+      }
+    }
+  ]
+};
diff --git a/tests/fixtures/addon/npm/.travis.yml b/tests/fixtures/addon/npm/.travis.yml
index 38b4be764..5b24d5f1d 100644
--- a/tests/fixtures/addon/npm/.travis.yml
+++ b/tests/fixtures/addon/npm/.travis.yml
@@ -40,6 +40,7 @@ before_install:
   - npm --version
 
 script:
+  - npm run lint:js
   # Usually, it's ok to finish the test scenario without reverting
   #  to the addon's original dependency state, skipping "cleanup".
   - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
diff --git a/tests/fixtures/addon/npm/package.json b/tests/fixtures/addon/npm/package.json
new file mode 100644
index 000000000..44b4beef8
--- /dev/null
+++ b/tests/fixtures/addon/npm/package.json
@@ -0,0 +1,52 @@
+{
+  "name": "foo",
+  "version": "0.0.0",
+  "description": "The default blueprint for ember-cli addons.",
+  "keywords": [
+    "ember-addon"
+  ],
+  "license": "MIT",
+  "author": "",
+  "directories": {
+    "doc": "doc",
+    "test": "tests"
+  },
+  "repository": "",
+  "scripts": {
+    "build": "ember build",
+    "lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
+    "start": "ember serve",
+    "test": "ember try:each"
+  },
+  "dependencies": {
+    "ember-cli-babel": "^6.6.0"
+  },
+  "devDependencies": {
+    "broccoli-asset-rev": "^2.4.5",
+    "ember-ajax": "^3.0.0",
+    "ember-cli": "~<%= emberCLIVersion %>",
+    "ember-cli-dependency-checker": "^2.0.0",
+    "ember-cli-eslint": "^4.2.1",
+    "ember-cli-htmlbars": "^2.0.1",
+    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
+    "ember-cli-inject-live-reload": "^1.4.1",
+    "ember-cli-qunit": "^4.1.1",
+    "ember-cli-shims": "^1.2.0",
+    "ember-cli-sri": "^2.1.0",
+    "ember-cli-uglify": "^2.0.0",
+    "ember-disable-prototype-extensions": "^1.1.2",
+    "ember-export-application-global": "^2.0.0",
+    "ember-load-initializers": "^1.0.0",
+    "ember-resolver": "^4.0.0",
+    "ember-source": "~2.18.0-beta.3",
+    "eslint-plugin-ember": "^5.0.0",
+    "eslint-plugin-node": "^5.2.1",
+    "loader.js": "^4.2.3"
+  },
+  "engines": {
+    "node": "^4.5 || 6.* || >= 7.*"
+  },
+  "ember-addon": {
+    "configPath": "tests/dummy/config"
+  }
+}
diff --git a/tests/fixtures/addon/yarn/.eslintrc.js b/tests/fixtures/addon/yarn/.eslintrc.js
new file mode 100644
index 000000000..1c65e6db0
--- /dev/null
+++ b/tests/fixtures/addon/yarn/.eslintrc.js
@@ -0,0 +1,56 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    ecmaVersion: 2017,
+    sourceType: 'module'
+  },
+  plugins: [
+    'ember'
+  ],
+  extends: [
+    'eslint:recommended',
+    'plugin:ember/recommended'
+  ],
+  env: {
+    browser: true
+  },
+  rules: {
+  },
+  overrides: [
+    // node files
+    {
+      files: [
+        'index.js',
+        'testem.js',
+        'ember-cli-build.js',
+        'config/**/*.js',
+        'tests/dummy/config/**/*.js'
+      ],
+      excludedFiles: [
+        'app/**',
+        'addon/**'
+      ],
+      parserOptions: {
+        sourceType: 'script',
+        ecmaVersion: 2015
+      },
+      env: {
+        browser: false,
+        node: true
+      },
+      plugins: ['node'],
+      rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
+        // add your custom rules and overrides for node files here
+      })
+    },
+
+    // test files
+    {
+      files: ['tests/**/*.js'],
+      excludedFiles: ['tests/dummy/**/*.js'],
+      env: {
+        embertest: true
+      }
+    }
+  ]
+};
diff --git a/tests/fixtures/addon/yarn/.travis.yml b/tests/fixtures/addon/yarn/.travis.yml
index 9f30c1837..d44b7772a 100644
--- a/tests/fixtures/addon/yarn/.travis.yml
+++ b/tests/fixtures/addon/yarn/.travis.yml
@@ -41,6 +41,7 @@ install:
   - yarn install --no-lockfile --non-interactive
 
 script:
+  - yarn lint:js
   # Usually, it's ok to finish the test scenario without reverting
   #  to the addon's original dependency state, skipping "cleanup".
   - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
diff --git a/tests/fixtures/addon/yarn/package.json b/tests/fixtures/addon/yarn/package.json
new file mode 100644
index 000000000..b5f916d5d
--- /dev/null
+++ b/tests/fixtures/addon/yarn/package.json
@@ -0,0 +1,53 @@
+{
+  "name": "foo",
+  "version": "0.0.0",
+  "description": "The default blueprint for ember-cli addons.",
+  "keywords": [
+    "ember-addon"
+  ],
+  "license": "MIT",
+  "author": "",
+  "directories": {
+    "doc": "doc",
+    "test": "tests"
+  },
+  "repository": "",
+  "scripts": {
+    "build": "ember build",
+    "lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
+    "start": "ember serve",
+    "test": "ember try:each"
+  },
+  "dependencies": {
+    "ember-cli-babel": "^6.6.0"
+  },
+  "devDependencies": {
+    "broccoli-asset-rev": "^2.4.5",
+    "ember-ajax": "^3.0.0",
+    "ember-cli": "~<%= emberCLIVersion %>",
+    "ember-cli-dependency-checker": "^2.0.0",
+    "ember-cli-eslint": "^4.2.1",
+    "ember-cli-htmlbars": "^2.0.1",
+    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
+    "ember-cli-inject-live-reload": "^1.4.1",
+    "ember-cli-qunit": "^4.1.1",
+    "ember-cli-shims": "^1.2.0",
+    "ember-cli-sri": "^2.1.0",
+    "ember-cli-uglify": "^2.0.0",
+    "ember-disable-prototype-extensions": "^1.1.2",
+    "ember-export-application-global": "^2.0.0",
+    "ember-load-initializers": "^1.0.0",
+    "ember-resolver": "^4.0.0",
+    "ember-source": "~2.18.0-beta.3",
+    "ember-welcome-page": "^3.0.0",
+    "eslint-plugin-ember": "^5.0.0",
+    "eslint-plugin-node": "^5.2.1",
+    "loader.js": "^4.2.3"
+  },
+  "engines": {
+    "node": "^4.5 || 6.* || >= 7.*"
+  },
+  "ember-addon": {
+    "configPath": "tests/dummy/config"
+  }
+}
diff --git a/tests/fixtures/app/npm/.eslintrc.js b/tests/fixtures/app/npm/.eslintrc.js
new file mode 100644
index 000000000..1f7a6c0bd
--- /dev/null
+++ b/tests/fixtures/app/npm/.eslintrc.js
@@ -0,0 +1,46 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    ecmaVersion: 2017,
+    sourceType: 'module'
+  },
+  plugins: [
+    'ember'
+  ],
+  extends: [
+    'eslint:recommended',
+    'plugin:ember/recommended'
+  ],
+  env: {
+    browser: true
+  },
+  rules: {
+  },
+  overrides: [
+    // node files
+    {
+      files: [
+        'testem.js',
+        'ember-cli-build.js',
+        'config/**/*.js'
+      ],
+      parserOptions: {
+        sourceType: 'script',
+        ecmaVersion: 2015
+      },
+      env: {
+        browser: false,
+        node: true
+      }
+    },
+
+    // test files
+    {
+      files: ['tests/**/*.js'],
+      excludedFiles: ['tests/dummy/**/*.js'],
+      env: {
+        embertest: true
+      }
+    }
+  ]
+};
diff --git a/tests/fixtures/app/npm/.travis.yml b/tests/fixtures/app/npm/.travis.yml
index 7a6dc7128..54dcdb2ab 100644
--- a/tests/fixtures/app/npm/.travis.yml
+++ b/tests/fixtures/app/npm/.travis.yml
@@ -20,3 +20,7 @@ env:
 
 before_install:
   - npm config set spin false
+
+script:
+  - npm run lint:js
+  - npm test
diff --git a/tests/fixtures/app/npm/package.json b/tests/fixtures/app/npm/package.json
new file mode 100644
index 000000000..82fe8addd
--- /dev/null
+++ b/tests/fixtures/app/npm/package.json
@@ -0,0 +1,45 @@
+{
+  "name": "foo",
+  "version": "0.0.0",
+  "private": true,
+  "description": "Small description for foo goes here",
+  "license": "MIT",
+  "author": "",
+  "directories": {
+    "doc": "doc",
+    "test": "tests"
+  },
+  "repository": "",
+  "scripts": {
+    "build": "ember build",
+    "lint:js": "eslint ./*.js app config lib server tests",
+    "start": "ember serve",
+    "test": "ember test"
+  },
+  "devDependencies": {
+    "broccoli-asset-rev": "^2.4.5",
+    "ember-ajax": "^3.0.0",
+    "ember-cli": "~<%= emberCLIVersion %>",
+    "ember-cli-app-version": "^3.0.0",
+    "ember-cli-babel": "^6.6.0",
+    "ember-cli-dependency-checker": "^2.0.0",
+    "ember-cli-eslint": "^4.2.1",
+    "ember-cli-htmlbars": "^2.0.1",
+    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
+    "ember-cli-inject-live-reload": "^1.4.1",
+    "ember-cli-qunit": "^4.1.1",
+    "ember-cli-shims": "^1.2.0",
+    "ember-cli-sri": "^2.1.0",
+    "ember-cli-uglify": "^2.0.0",
+    "ember-data": "~2.18.0-beta.1",
+    "ember-export-application-global": "^2.0.0",
+    "ember-load-initializers": "^1.0.0",
+    "ember-resolver": "^4.0.0",
+    "ember-source": "~2.18.0-beta.3",
+    "eslint-plugin-ember": "^5.0.0",
+    "loader.js": "^4.2.3"
+  },
+  "engines": {
+    "node": "^4.5 || 6.* || >= 7.*"
+  }
+}
diff --git a/tests/fixtures/app/yarn/.eslintrc.js b/tests/fixtures/app/yarn/.eslintrc.js
new file mode 100644
index 000000000..1f7a6c0bd
--- /dev/null
+++ b/tests/fixtures/app/yarn/.eslintrc.js
@@ -0,0 +1,46 @@
+module.exports = {
+  root: true,
+  parserOptions: {
+    ecmaVersion: 2017,
+    sourceType: 'module'
+  },
+  plugins: [
+    'ember'
+  ],
+  extends: [
+    'eslint:recommended',
+    'plugin:ember/recommended'
+  ],
+  env: {
+    browser: true
+  },
+  rules: {
+  },
+  overrides: [
+    // node files
+    {
+      files: [
+        'testem.js',
+        'ember-cli-build.js',
+        'config/**/*.js'
+      ],
+      parserOptions: {
+        sourceType: 'script',
+        ecmaVersion: 2015
+      },
+      env: {
+        browser: false,
+        node: true
+      }
+    },
+
+    // test files
+    {
+      files: ['tests/**/*.js'],
+      excludedFiles: ['tests/dummy/**/*.js'],
+      env: {
+        embertest: true
+      }
+    }
+  ]
+};
diff --git a/tests/fixtures/app/yarn/.travis.yml b/tests/fixtures/app/yarn/.travis.yml
index 224eafc8b..68a25a16e 100644
--- a/tests/fixtures/app/yarn/.travis.yml
+++ b/tests/fixtures/app/yarn/.travis.yml
@@ -25,4 +25,5 @@ install:
   - yarn install --non-interactive
 
 script:
+  - yarn lint:js
   - yarn test
diff --git a/tests/fixtures/app/yarn/package.json b/tests/fixtures/app/yarn/package.json
new file mode 100644
index 000000000..c894b1a92
--- /dev/null
+++ b/tests/fixtures/app/yarn/package.json
@@ -0,0 +1,46 @@
+{
+  "name": "foo",
+  "version": "0.0.0",
+  "private": true,
+  "description": "Small description for foo goes here",
+  "license": "MIT",
+  "author": "",
+  "directories": {
+    "doc": "doc",
+    "test": "tests"
+  },
+  "repository": "",
+  "scripts": {
+    "build": "ember build",
+    "lint:js": "eslint ./*.js app config lib server tests",
+    "start": "ember serve",
+    "test": "ember test"
+  },
+  "devDependencies": {
+    "broccoli-asset-rev": "^2.4.5",
+    "ember-ajax": "^3.0.0",
+    "ember-cli": "~<%= emberCLIVersion %>",
+    "ember-cli-app-version": "^3.0.0",
+    "ember-cli-babel": "^6.6.0",
+    "ember-cli-dependency-checker": "^2.0.0",
+    "ember-cli-eslint": "^4.2.1",
+    "ember-cli-htmlbars": "^2.0.1",
+    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
+    "ember-cli-inject-live-reload": "^1.4.1",
+    "ember-cli-qunit": "^4.1.1",
+    "ember-cli-shims": "^1.2.0",
+    "ember-cli-sri": "^2.1.0",
+    "ember-cli-uglify": "^2.0.0",
+    "ember-data": "~2.18.0-beta.1",
+    "ember-export-application-global": "^2.0.0",
+    "ember-load-initializers": "^1.0.0",
+    "ember-resolver": "^4.0.0",
+    "ember-source": "~2.18.0-beta.3",
+    "ember-welcome-page": "^3.0.0",
+    "eslint-plugin-ember": "^5.0.0",
+    "loader.js": "^4.2.3"
+  },
+  "engines": {
+    "node": "^4.5 || 6.* || >= 7.*"
+  }
+}
diff --git a/tests/unit/blueprints/addon-test.js b/tests/unit/blueprints/addon-test.js
index 51f4c6b5b..771e0adae 100644
--- a/tests/unit/blueprints/addon-test.js
+++ b/tests/unit/blueprints/addon-test.js
@@ -70,11 +70,13 @@ describe('blueprint - addon', function() {
     "ember-addon"\n\
   ],\n\
   "scripts": {\n\
+    "lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",\n\
     "test": "ember try:each"\n\
   },\n\
   "dependencies": {},\n\
   "devDependencies": {\n\
-    "ember-disable-prototype-extensions": "^1.1.2"\n\
+    "ember-disable-prototype-extensions": "^1.1.2",\n\
+    "eslint-plugin-node": "^5.2.1"\n\
   },\n\
   "ember-addon": {\n\
     "configPath": "tests/dummy/config"\n\
@@ -169,6 +171,7 @@ describe('blueprint - addon', function() {
 
         let json = JSON.parse(output);
         delete json.devDependencies['ember-disable-prototype-extensions'];
+        delete json.devDependencies['eslint-plugin-node'];
         expect(json.dependencies).to.deep.equal({ a: "1", b: "1" });
         expect(json.devDependencies).to.deep.equal({ a: "1", b: "1" });
       });