0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Move client linting to Ghost-Admin

no issue
- remove client-related lint config
- add `lint-all` task that uses subgrunt to also run client's lint task
This commit is contained in:
Kevin Ansfield 2016-05-31 14:40:20 +01:00
parent 9262dcd1c6
commit 1c0cbffa5b

View file

@ -98,15 +98,6 @@ var _ = require('lodash'),
jshintrc: true jshintrc: true
}, },
client: [
'core/client/**/*.js',
'!core/client/node_modules/**/*.js',
'!core/client/bower_components/**/*.js',
'!core/client/tmp/**/*.js',
'!core/client/dist/**/*.js',
'!core/client/vendor/**/*.js'
],
server: [ server: [
'*.js', '*.js',
'!config*.js', // note: i added this, do we want this linted? '!config*.js', // note: i added this, do we want this linted?
@ -123,36 +114,6 @@ var _ = require('lodash'),
config: true config: true
}, },
client: {
options: {
config: 'core/client/.jscsrc'
},
files: {
src: [
'core/client/**/*.js',
'!core/client/node_modules/**/*.js',
'!core/client/bower_components/**/*.js',
'!core/client/tests/**/*.js',
'!core/client/tmp/**/*.js',
'!core/client/dist/**/*.js',
'!core/client/vendor/**/*.js'
]
}
},
client_tests: {
options: {
config: 'core/client/tests/.jscsrc'
},
files: {
src: [
'core/client/tests/**/*.js'
]
}
},
server: { server: {
files: { files: {
src: [ src: [
@ -306,10 +267,6 @@ var _ = require('lodash'),
csscombfix: { csscombfix: {
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c core/client/app/styles/csscomb.json -v core/client/app/styles') command: path.resolve(cwd + '/node_modules/.bin/csscomb -c core/client/app/styles/csscomb.json -v core/client/app/styles')
},
csscomblint: {
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c core/client/app/styles/csscomb.json -lv core/client/app/styles')
} }
}, },
@ -385,6 +342,14 @@ var _ = require('lodash'),
'core/shared/ghost-url.min.js': 'core/shared/ghost-url.js' 'core/shared/ghost-url.min.js': 'core/shared/ghost-url.js'
} }
} }
},
// ### grunt-subgrunt
// Run grunt tasks in submodule Gruntfiles
subgrunt: {
lint: {
'core/client': 'lint'
}
} }
}; };
@ -531,7 +496,7 @@ var _ = require('lodash'),
} else if (process.env.TEST_SUITE === 'client') { } else if (process.env.TEST_SUITE === 'client') {
grunt.task.run(['init', 'test-client']); grunt.task.run(['init', 'test-client']);
} else if (process.env.TEST_SUITE === 'lint') { } else if (process.env.TEST_SUITE === 'lint') {
grunt.task.run(['shell:ember:init', 'lint']); grunt.task.run(['lint']);
} else { } else {
grunt.task.run(['validate-all']); grunt.task.run(['validate-all']);
} }
@ -560,8 +525,12 @@ var _ = require('lodash'),
// ### Lint // ### Lint
// //
// `grunt lint` will run the linter and the code style checker so you can make sure your code is pretty // `grunt lint` will run the linter and the code style checker so you can make sure your code is pretty
grunt.registerTask('lint', 'Run the code style checks and linter', grunt.registerTask('lint', 'Run the code style checks and linter for server',
['jshint', 'jscs', 'shell:csscomblint'] ['jshint', 'jscs']
);
grunt.registerTask('lint-all', 'Run the code style checks and linter for server and client',
['lint', 'subgrunt:lint']
); );
// ### test-setup *(utility)( // ### test-setup *(utility)(