Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
switch from jshint/jscs to eslint
Browse files Browse the repository at this point in the history
no issue
- drop `jshint`, `jscs`, and `ember-suave` dependencies
- remove `grunt` related linting dependencies and tasks
- remove linting build from Travis so that linting can be performed as part of the normal test suite (refs TryGhost/Ghost#7427)
- add `ember-cli-eslint` and `eslint-plugin-ember-suave` dependencies
- configure `eslint` to match our previous coding style
- update config to run eslint tests as part of the normal test run
- add `npm run lint` command to only run linter tests
  • Loading branch information
kevinansfield committed Nov 14, 2016
1 parent cd1fe4a commit 2265ee2
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 185 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: [
'eslint:recommended',
'plugin:ember-suave/recommended'
],
env: {
browser: true
},
rules: {
indent: ['error', 4],
'space-before-function-paren': ['error', {anonymous: 'ignore', named: 'never'}],
'object-curly-spacing': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
'key-spacing': ['error', {mode: 'minimum'}],
'keyword-spacing': ['error', {overrides: {
'catch': {'after': true}
}}],
'ember-suave/require-access-in-comments': 'off'
},
globals: {
moment: false,
validator: false
}
};
14 changes: 0 additions & 14 deletions .jscsrc

This file was deleted.

36 changes: 0 additions & 36 deletions .jshintrc

This file was deleted.

7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ env:
global:
- GITHUB_OAUTH_KEY=003a44d58f12089d0c0261338298af3813330949

matrix:
include:
- node_js: "4"
env: TEST_SUITE=lint

branches:
except:
- /^greenkeeper-.+$/
Expand Down Expand Up @@ -43,4 +38,4 @@ before_script:
- export DISPLAY=:99; sh -e /etc/init.d/xvfb start; sleep 3;

script:
- if [ "$TEST_SUITE" == "lint" ]; then grunt lint; else npm test; fi
- if [ "$TEST_SUITE" == "lint" ]; then npm run lint; else npm test; fi
51 changes: 0 additions & 51 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,53 +35,6 @@ module.exports = function(grunt) {
}
},

jshint: {
options: {
jshintrc: true,
ignores: [
'node_modules/**',
'bower_components/**',
'tmp/**',
'dist/**',
'vendor/**'
]
},

all: ['**/*.js']
},

jscs: {
app: {
options: {
config: '.jscsrc',
excludeFiles: [
'node_modules/**',
'bower_components/**',
'tests/**',
'tmp/**',
'dist/**',
'vendor/**'
]
},

files: {
src: ['**/*.js']
}
},

tests: {
options: {
config: 'tests/.jscsrc'
},

files: {
src: [
'tests/**/*.js'
]
}
}
},

// ### grunt-bg-shell
// Used to run ember-cli watch in the background
bgShell: {
Expand Down Expand Up @@ -146,10 +99,6 @@ module.exports = function(grunt) {
['shell:npm-install', 'shell:bower-install']
);

grunt.registerTask('lint', 'Run the code style checks and linter',
['jshint', 'jscs', 'shell:csscomblint']
);

// ### Build About Page *(Utility Task)*
// Builds the github contributors partial template used on the about page,
// and downloads the avatar for each of the users.
Expand Down
1 change: 0 additions & 1 deletion app/authenticators/oauth2-ghost.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
import Oauth2Authenticator from './oauth2';
import RSVP from 'rsvp';
import run from 'ember-runloop';
Expand Down
6 changes: 6 additions & 0 deletions app/mirage/factories/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
rules: {
'brace-style': 'off',
'camelcase': 'off'
}
};
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "ghost-admin",
"dependencies": {
"Faker": "3.1.0",
"devicejs": "0.2.7",
"ember": "2.9.0",
"ember-cli-shims": "0.1.3",
Expand All @@ -10,8 +11,8 @@
"google-caja": "6005.0.0",
"jquery-file-upload": "9.12.3",
"jquery-ui": "1.11.4",
"jqueryui-touch-punch": "furf/jquery-ui-touch-punch#4bc009145202d9c7483ba85f3a236a8f3470354d",
"jquery.simulate.drag-sortable": "0.1.0",
"jqueryui-touch-punch": "furf/jquery-ui-touch-punch#4bc009145202d9c7483ba85f3a236a8f3470354d",
"keymaster": "1.6.3",
"lodash": "3.7.0",
"normalize.css": "3.0.3",
Expand Down
3 changes: 1 addition & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* jscs:disable */
/* eslint-disable */
/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app'),
Expand Down Expand Up @@ -86,7 +86,6 @@ module.exports = function (defaults) {
compress: mythCompress,
outputFile: isProduction ? 'ghost.min.css' : 'ghost.css'
},
hinting: false,
fingerprint: disabled,
nodeAssets: {
'blueimp-md5': {
Expand Down
4 changes: 0 additions & 4 deletions lib/.jshintrc

This file was deleted.

11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember test"
"test": "ember test",
"lint": "ember test --launch phantomjs -f 'ESLint'"
},
"engines": {
"node": "~0.12.0 || ^4.2.0"
Expand All @@ -42,10 +43,10 @@
"ember-cli-content-security-policy": "0.5.0",
"ember-cli-dependency-checker": "1.3.0",
"ember-cli-deprecation-workflow": "0.2.3",
"ember-cli-eslint": "3.0.0",
"ember-cli-fastclick": "1.3.0",
"ember-cli-htmlbars": "1.1.0",
"ember-cli-htmlbars-inline-precompile": "0.3.6",
"ember-cli-jshint": "2.0.1",
"ember-cli-mirage": "0.1.14",
"ember-cli-mocha": "0.11.0",
"ember-cli-node-assets": "0.1.4",
Expand All @@ -69,19 +70,17 @@
"ember-simple-auth": "1.1.0",
"ember-sinon": "0.5.1",
"ember-sortable": "1.9.0",
"ember-suave": "4.0.1",
"ember-watson": "0.8.3",
"ember-wormhole": "0.5.1",
"emberx-file-input": "1.1.0",
"eslint-plugin-ember-suave": "1.0.0",
"fs-extra": "1.0.0",
"ghost-editor": "0.1.4",
"glob": "7.1.1",
"grunt": "1.0.1",
"grunt-bg-shell": "2.3.3",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-jshint": "1.0.0",
"grunt-contrib-watch": "1.0.0",
"grunt-jscs": "3.0.1",
"grunt-shell": "1.3.1",
"jquery-deparam": "0.5.2",
"liquid-fire": "0.26.4",
Expand All @@ -106,9 +105,7 @@
"grunt",
"grunt-bg-shell",
"grunt-contrib-clean",
"grunt-contrib-jshint",
"grunt-contrib-watch",
"grunt-jscs",
"grunt-shell"
]
}
Expand Down
11 changes: 11 additions & 0 deletions tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
env: {
'embertest': true,
'mocha': true
},
globals: {
server: false,
expect: false,
fileUpload: false
}
};
4 changes: 0 additions & 4 deletions tests/.jscsrc

This file was deleted.

59 changes: 0 additions & 59 deletions tests/.jshintrc

This file was deleted.

0 comments on commit 2265ee2

Please sign in to comment.