Skip to content

Commit

Permalink
linagora/lgs/openpaas/hublin#541 Use eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Hamerling committed Jan 9, 2018
1 parent 6afb9e1 commit 64dcdb8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 77 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
frontend/js/modules/modernizr.js
test/frontend/karma-include/*
frontend/components/*
tmp/
test/conf/**
frontend/js/janus.js
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "linagora-esn",
"rules": {
"arrow-parens": ["error", "as-needed"],
"consistent-this": ["warn", "self"]
}
}
15 changes: 0 additions & 15 deletions .jscsrc

This file was deleted.

39 changes: 0 additions & 39 deletions .jshintrc

This file was deleted.

24 changes: 5 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,26 @@

module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc',
ignores: []
},
eslint: {
all: {
src: [
'Gruntfile.js',
'tasks/**/*.js',
'test/**/**/*.js',
'backend/**/*.js',
'frontend/js/**/*.js',
'!frontend/js/janus.js',
'index.js'
]
}
},
jscs: {
options: {
config: '.jscsrc'
},
all: {
src: ['<%= jshint.all.src %>']
}
},
lint_pattern: {
options: {
rules: [
{ pattern: /(describe|it)\.only/, message: 'Must not use .only in tests' }
]
},
all: {
src: ['<%= jshint.all.src %>']
src: ['<%= eslint.all.src %>']
},
css: {
options: {
Expand Down Expand Up @@ -68,15 +55,14 @@ module.exports = function(grunt) {
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('@linagora/grunt-lint-pattern');
grunt.loadNpmTasks('grunt-jscs');
grunt.loadNpmTasks('grunt-mocha-cli');
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('linters', 'Check code for lint', ['jshint:all', 'jscs:all', 'lint_pattern']);
grunt.registerTask('linters', 'Check code for lint', ['eslint:all', 'lint_pattern']);
grunt.registerTask('test-unit-backend', 'Test backend code', ['mochacli:backend']);
grunt.registerTask('test-unit-frontend', 'Test frontend code', ['karma:unit']);
grunt.registerTask('test', ['test-unit-frontend', 'test-unit-backend']);
grunt.registerTask('test', ['linters', 'test-unit-frontend', 'test-unit-backend']);
grunt.registerTask('default', ['test']);
};
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"@linagora/grunt-lint-pattern": "0.1.4",
"chai": "3.5.0",
"chai-shallow-deep-equal": "1.4.6",
"eslint": "3.6.0",
"eslint-config-airbnb-base": "8.0.0",
"eslint-config-linagora-esn": "linagora/eslint-config-linagora-esn#v1.1.0",
"eslint-plugin-import": "1.16.0",
"grunt": "1.0.1",
"grunt-contrib-jshint": "1.1.0",
"grunt-jscs": "3.0.1",
"grunt-eslint": "19.0.0",
"grunt-karma": "2.0.0",
"grunt-mocha-cli": "3.0.0",
"jscs": "2.5.0",
"jshint": "2.9.5",
"karma": "1.7.0",
"karma-chrome-launcher": "2.0.0",
"karma-coverage": "1.1.1",
Expand Down

0 comments on commit 64dcdb8

Please sign in to comment.