Skip to content

Commit

Permalink
Switch from eslint & jscs to just eslint
Browse files Browse the repository at this point in the history
- Copy most of the config from ember-cli
- Update package.json engines & travis.yml tested nodes
- Apply eslint rules
  • Loading branch information
kategengler committed Feb 24, 2017
1 parent f4a435e commit 0eb4c63
Show file tree
Hide file tree
Showing 38 changed files with 328 additions and 490 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*{.,-}min.js
**/test/fixtures/*
135 changes: 68 additions & 67 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
},
extends: 'eslint:recommended',
env: {
browser: false,
Expand All @@ -8,90 +11,88 @@ module.exports = {
globals: {
},
rules: {
// JSHint "expr"
/*** Possible Errors ***/

'no-console': 0,
'no-template-curly-in-string': 2,
'no-unsafe-negation': 2,

/*** Best Practices ***/

'curly': 2,
'eqeqeq': 2,
'guard-for-in': 0,
'no-caller': 2,
'no-eq-null': 2,
'no-eval': 2,
'no-multi-spaces': [2, {
'exceptions': {
'ObjectExpression': true,
'Property': true,
},
}],
'no-new': 0,
'no-unused-expressions': [2, {
allowShortCircuit: true,
allowTernary: true,
}],
'wrap-iife': 0,
'yoda': 2,

// JSHint "proto", disabled due to warnings
'no-proto': 0,
/*** Strict Mode ***/

// JSHint "strict"
'strict': [2, 'global'],

// JSHint "indent", disabled due to warnings
'indent': [2, 2, {
'SwitchCase': 1,
'VariableDeclarator': { 'var': 2, 'let': 2, 'const': 3 }
}],

// JSHint "camelcase"
camelcase: 2,

// JSHint "boss"
'no-cond-assign': [2, 'except-parens'],
/*** Variables ***/

// JSHint "curly"
curly: 2,

// JSHint "latedef"
'no-undef': 2,
'no-unused-vars': 2,
'no-use-before-define': [2, 'nofunc'],

// JSHint "debug", disabled already in .jshintrc
'no-debugger': 0,

// JSHint "eqeqeq"
eqeqeq: 2,

// JSHint "evil"
'no-eval': 2,

// JSHint "forin", disabled already in .jshintrc
'guard-for-in': 0,

// JSHint "immed", disabled already in .jshintrc
'wrap-iife': 0,
/*** Stylistic Issues ***/

// JSHint "laxbreak"
'array-bracket-spacing': 2,
'block-spacing': 2,
'brace-style': [2, '1tbs', {
'allowSingleLine': true,
}],
'camelcase': 2,
'comma-dangle': 0,
'comma-spacing': 2,
'comma-style': 2,
'eol-last': 2,
'func-call-spacing': 2,
'indent': [2, 2, {
'SwitchCase': 1,
'VariableDeclarator': { 'var': 2, 'let': 2, 'const': 3 }
}],
'key-spacing': 2,
'keyword-spacing': 2,
'linebreak-style': [2, 'unix'],

// JSHint "newcap
'new-cap': [2, {
properties: false,
}],

// JSHint "noarg"
'no-caller': 2,

// JSHint "noempty", JSCS "disallowEmptyBlocks"
'no-empty': 2,

// JSHint "quotmark", disabled due to warnings
quotes: [0, 'single'],

// JSHint "nonew", disabled already in .jshintrc
'no-new': 0,

// JSHint "plusplus", disabled already in .jshintrc
'new-parens': 2,
'no-array-constructor': 2,
'no-bitwise': 2,
'no-lonely-if': 2,
'no-mixed-operators': 2,
'no-plusplus': 0,

// JSHint "undef"
'no-undef': 2,

// JSHint "unused"
'no-unused-vars': 2,

// JSHint "sub", disabled due to warnings
'dot-notation': 0,

// JSHint "trailing"
'no-trailing-spaces': 2,

// JSHint "eqnull"
'no-eq-null': 2,

'no-console': 0,
'comma-dangle': 0,
'no-unneeded-ternary': 2,
'no-whitespace-before-property': 2,
'object-curly-spacing': [2, 'always'],
'semi-spacing': 2,
'semi': 2,
'space-before-blocks': 2,
'space-before-function-paren': [2, 'never'],
'space-in-parens': 2,
'space-infix-ops': 2,
'space-unary-ops': 2,
'quotes': [2, 'single', {
'allowTemplateLiterals': true,
}],
'semi': [2, 'always'],
'wrap-regex': 2
},
};
44 changes: 0 additions & 44 deletions .jscsrc

This file was deleted.

32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ bower.json
ember-cli-build.js
testem.js
all-commands.sh
lint-test.js
testem.json
upload-coverage.sh
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
language: node_js
node_js:
- "0.12"
- "4.2"
- "4"
- "7"
# - "6" - The test that includes coverage runs with 6

sudo: false
Expand All @@ -19,8 +19,6 @@ matrix:
include:
- node_js: "6"
env: NPM_SCRIPT=client-test
- node_js: "6"
env: NPM_SCRIPT=jscs
- node_js: "6"
env: NPM_SCRIPT=lint
- node_js: "6"
Expand Down
3 changes: 0 additions & 3 deletions lib/.jshintrc

This file was deleted.

12 changes: 6 additions & 6 deletions lib/commands/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

module.exports = {
try: require('./try'),
try: require('./try'),
'try:testall': require('./testall'),
'try:reset': require('./reset'),
'try:each': require('./try-each'),
'try:one': require('./try-one'),
'try:ember': require('./try-ember'),
'try:config': require('./config')
'try:reset': require('./reset'),
'try:each': require('./try-each'),
'try:one': require('./try-one'),
'try:ember': require('./try-ember'),
'try:config': require('./config')
};
2 changes: 1 addition & 1 deletion lib/commands/try-each.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var debug = require('debug')('ember-try:commands:try-each');

module.exports = {
name: 'try:each',
description: 'Runs each of the dependency scenarios specified in config with the specified command. The command defaults to `ember test`' ,
description: 'Runs each of the dependency scenarios specified in config with the specified command. The command defaults to `ember test`',
works: 'insideProject',

availableOptions: [
Expand Down
20 changes: 10 additions & 10 deletions lib/dependency-manager-adapters/bower.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

var CoreObject = require('core-object');
var fs = require('fs-extra');
var RSVP = require('rsvp');
var path = require('path');
var extend = require('extend');
var debug = require('debug')('ember-try:dependency-manager-adapter:bower');
var rimraf = RSVP.denodeify(require('rimraf'));
var resolve = RSVP.denodeify(require('resolve'));
var CoreObject = require('core-object');
var fs = require('fs-extra');
var RSVP = require('rsvp');
var path = require('path');
var extend = require('extend');
var debug = require('debug')('ember-try:dependency-manager-adapter:bower');
var rimraf = RSVP.denodeify(require('rimraf'));
var resolve = RSVP.denodeify(require('resolve'));
var findEmberPath = require('../utils/find-ember-path');

module.exports = CoreObject.extend({
Expand All @@ -34,7 +34,7 @@ module.exports = CoreObject.extend({
if (depSet[this.configKey]) {
return depSet[this.configKey];
}
return {dependencies: depSet.dependencies, devDependencies: depSet.devDependencies, resolutions: depSet.resolutions};
return { dependencies: depSet.dependencies, devDependencies: depSet.devDependencies, resolutions: depSet.resolutions };
},
_writeBowerFileWithDepSetChanges: function(depSet) {
var adapter = this;
Expand Down Expand Up @@ -117,7 +117,7 @@ module.exports = CoreObject.extend({
})
.then(function(bowerPath) {
debug('Run bower install using bower at %s', bowerPath);
return adapter.run('node', [].concat([bowerPath, 'install', '--config.interactive=false'], options), {cwd: adapter.cwd});
return adapter.run('node', [].concat([bowerPath, 'install', '--config.interactive=false'], options), { cwd: adapter.cwd });
});
},
_bowerJSONForDependencySet: function(bowerJSON, depSet) {
Expand Down
Loading

0 comments on commit 0eb4c63

Please sign in to comment.