mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	adding JSON5 support
This commit is contained in:
		| @@ -785,6 +785,11 @@ JSON: | ||||
|   - .jshintrc | ||||
|   - composer.lock | ||||
|  | ||||
| JSON5: | ||||
|   type: data | ||||
|   lexer: JavaScript | ||||
|   primary_extension: .json5 | ||||
|  | ||||
| Jade: | ||||
|   group: HTML | ||||
|   type: markup | ||||
|   | ||||
							
								
								
									
										29
									
								
								samples/JSON5/example.json5
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								samples/JSON5/example.json5
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| /* | ||||
|  * The following is a contrived example, but it illustrates most of the features: | ||||
|  */ | ||||
|  | ||||
| { | ||||
|     foo: 'bar', | ||||
|     while: true, | ||||
|  | ||||
|     this: 'is a \ | ||||
| multi-line string', | ||||
|  | ||||
|     // this is an inline comment | ||||
|     here: 'is another', // inline comment | ||||
|  | ||||
|     /* this is a block comment | ||||
|        that continues on another line */ | ||||
|  | ||||
|     hex: 0xDEADbeef, | ||||
|     half: .5, | ||||
|     delta: +10, | ||||
|     to: Infinity,   // and beyond! | ||||
|  | ||||
|     finally: 'a trailing comma', | ||||
|     oh: [ | ||||
|         "we shouldn't forget", | ||||
|         'arrays can have', | ||||
|         'trailing commas too', | ||||
|     ], | ||||
| } | ||||
							
								
								
									
										28
									
								
								samples/JSON5/package.json5
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								samples/JSON5/package.json5
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| // This file is written in JSON5 syntax, naturally, but npm needs a regular | ||||
| // JSON file, so compile via `npm run build`. Be sure to keep both in sync! | ||||
|  | ||||
| { | ||||
|     name: 'json5', | ||||
|     version: '0.2.0', | ||||
|     description: 'JSON for the ES5 era.', | ||||
|     keywords: ['json', 'es5'], | ||||
|     author: 'Aseem Kishore <aseem.kishore@gmail.com>', | ||||
|     contributors: [ | ||||
|         'Max Nanasy <max.nanasy@gmail.com>', | ||||
|     ], | ||||
|     main: 'lib/json5.js', | ||||
|     bin: 'lib/cli.js', | ||||
|     dependencies: {}, | ||||
|     devDependencies: { | ||||
|         mocha: '~1.0.3', | ||||
|     }, | ||||
|     scripts: { | ||||
|         build: './lib/cli.js -c package.json5', | ||||
|         test: 'mocha --ui exports --reporter spec', | ||||
|     }, | ||||
|     homepage: 'http://json5.org/', | ||||
|     repository: { | ||||
|         type: 'git', | ||||
|         url: 'https://github.com/aseemk/json5.git', | ||||
|     }, | ||||
| } | ||||
		Reference in New Issue
	
	Block a user