Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #309 from Turbo87/eslint
Browse files Browse the repository at this point in the history
Replace `ember-cli-eslint` with ESLint
  • Loading branch information
Turbo87 authored Dec 10, 2018
2 parents 151f94b + 84664e0 commit 22b36db
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 288 deletions.
20 changes: 20 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
45 changes: 42 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,49 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
plugins: [
'ember'
],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
env: {
'browser': true
browser: true
},
rules: {
}
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
],
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
})
}
]
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/bower_components

# misc
/.eslintcache
/.sass-cache
/connect.lock
/coverage/*
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ install:
- yarn install --no-lockfile

script:
- yarn lint
- yarn ember try:one $EMBER_TRY_SCENARIO test

before_deploy:
Expand Down
2 changes: 0 additions & 2 deletions blueprints/ember-cli-mocha/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var EOL = require('os').EOL;

module.exports = {
name: 'ember-cli-mocha',

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"scripts": {
"build": "ember build",
"changelog": "lerna-changelog",
"lint": "eslint . --cache",
"start": "ember server",
"test": "ember try:each"
},
Expand All @@ -43,14 +44,16 @@
"ember-cli-babel": "^7.1.2",
"ember-cli-chai": "^0.5.0",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-eslint": "^4.0.0",
"ember-cli-htmlbars": "^3.0.0",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-load-initializers": "^2.0.0",
"ember-resolver": "^5.0.1",
"ember-source": "~3.6.0",
"eslint": "^5.10.0",
"eslint-plugin-ember": "^6.0.1",
"eslint-plugin-node": "^8.0.0",
"lerna-changelog": "^0.8.0",
"loader.js": "^4.2.3"
},
Expand Down
8 changes: 2 additions & 6 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import Ember from 'ember';
import Application from '@ember/application';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;

Ember.MODEL_FACTORY_INJECTIONS = true;

App = Ember.Application.extend({
let App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Expand Down
4 changes: 2 additions & 2 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Ember from 'ember';
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = Ember.Router.extend({
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(environment) {
}

if (environment === 'production') {

// here be dragons
}

return ENV;
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/destroy-app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ember from 'ember';
import { run } from '@ember/runloop';

export default function destroyApp(application) {
Ember.run(application, 'destroy');
run(application, 'destroy');
}
10 changes: 6 additions & 4 deletions tests/helpers/start-app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Ember from 'ember';
import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop';

import Application from '../../app';
import config from '../../config/environment';

export default function startApp(attrs) {
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
let attributes = merge({}, config.APP);
attributes = merge(attributes, attrs); // use defaults, but you can override;

return Ember.run(() => {
return run(() => {
let application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
Expand Down
Loading

0 comments on commit 22b36db

Please sign in to comment.