mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	Add minimal code style to node-red-node (jscs)
Optional grunt task - grunt style
This commit is contained in:
		
							
								
								
									
										11
									
								
								.jscsrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								.jscsrc
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| { | ||||
|     "fileExtensions": [ ".js", "jscs" ], | ||||
|     "excludeFiles": [ "node_modules/**" ], | ||||
|     "validateIndentation": 4, | ||||
|     "requireCurlyBraces": true, | ||||
|     "disallowMixedSpacesAndTabs": true, | ||||
|     "disallowMultipleSpaces": {"allowEOLComments": true}, | ||||
|     //"requireSemicolons": true, | ||||
|     //"validateParameterSeparator": ", ", | ||||
|     "requireSpaceAfterKeywords": ["do","for","if","else","switch","case","try","while"] | ||||
| } | ||||
							
								
								
									
										15
									
								
								Gruntfile.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								Gruntfile.js
									
									
									
									
									
								
							| @@ -59,8 +59,15 @@ module.exports = function(grunt) { | ||||
|         inlinelint: { | ||||
|             html: ['*/*/*.html'], | ||||
|             options: { | ||||
|                 jshintrc:".jshintrc", | ||||
|                 "reporter": require('jshint-stylish') | ||||
|                 jshintrc: ".jshintrc", | ||||
|                 reporter: require('jshint-stylish') | ||||
|             } | ||||
|         }, | ||||
|         jscs: { | ||||
|             src: "*/*/*.js", | ||||
|             options: { | ||||
|                 config: ".jscsrc", | ||||
|                 reporter: "inline" | ||||
|             } | ||||
|         } | ||||
|     }); | ||||
| @@ -68,6 +75,8 @@ module.exports = function(grunt) { | ||||
|     grunt.loadNpmTasks('grunt-simple-mocha'); | ||||
|     grunt.loadNpmTasks('grunt-contrib-jshint'); | ||||
|     grunt.loadNpmTasks('grunt-lint-inline'); | ||||
|     grunt.loadNpmTasks('grunt-jscs'); | ||||
|  | ||||
|     grunt.registerTask('default', ['jshint:all', 'inlinelint', 'simplemocha:all'] ); | ||||
|     grunt.registerTask('default', ['jshint:all', 'inlinelint', 'simplemocha:all']); | ||||
|     grunt.registerTask('style', ['jscs']); | ||||
| }; | ||||
|   | ||||
| @@ -21,6 +21,7 @@ | ||||
|         "grunt-simple-mocha": "0.4.0", | ||||
|         "grunt-contrib-jshint": "0.11.0", | ||||
|         "grunt-lint-inline": "0.4.3", | ||||
|         "grunt-jscs": "0.8.*", | ||||
|         "jshint-stylish": "1.0.1", | ||||
|         "mocha": "2.1.0", | ||||
|         "should": "4.6.5", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user