prettierrc
This commit is contained in:
		
							parent
							
								
									797dfb02aa
								
							
						
					
					
						commit
						217dad6d69
					
				
							
								
								
									
										16
									
								
								.prettierrc.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								.prettierrc.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					/* 
 | 
				
			||||||
 | 
					对 VSCode Prettier 有效;建议一直要有本配置文件,否则不同版本的 Prettier 的默认配置会不同,例如 TrailingComma
 | 
				
			||||||
 | 
					对 VSCode Prettier Standard 无效,似乎是集成了不能修改的配置。
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					module.exports = {
 | 
				
			||||||
 | 
					  printWidth: 160, // default 80
 | 
				
			||||||
 | 
					  tabWidth: 2, // default 2
 | 
				
			||||||
 | 
					  useTabs: false,
 | 
				
			||||||
 | 
					  semi: false, // default true
 | 
				
			||||||
 | 
					  singleQuote: true, // default false
 | 
				
			||||||
 | 
					  trailingComma: 'es5', // none (default in v 1.*), es5 (default in v2.0.0), all
 | 
				
			||||||
 | 
					  bracketSpacing: true, // default true
 | 
				
			||||||
 | 
					  jsxBracketSameLine: false, // default false
 | 
				
			||||||
 | 
					  arrowParens: 'always', // avoid (default in v1.9.0), always (default since v2.0.0)
 | 
				
			||||||
 | 
					  quoteProps: 'as-needed', // as-needed (default), consistent, preserve
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										14
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								index.js
									
									
									
									
									
								
							@ -21,22 +21,22 @@ prettyStdOut.pipe(process.stdout)
 | 
				
			|||||||
var logger = function (option) {
 | 
					var logger = function (option) {
 | 
				
			||||||
  option = option || {}
 | 
					  option = option || {}
 | 
				
			||||||
  return bunyan.createLogger({
 | 
					  return bunyan.createLogger({
 | 
				
			||||||
    name: "log", 
 | 
					    name: 'log',
 | 
				
			||||||
    src: false,
 | 
					    src: false,
 | 
				
			||||||
    streams: [
 | 
					    streams: [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        level: 'info',
 | 
					        level: 'info',
 | 
				
			||||||
        stream: prettyStdOut
 | 
					        stream: prettyStdOut,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        level: 'info',
 | 
					        level: 'info',
 | 
				
			||||||
        type: 'rotating-file',
 | 
					        type: 'rotating-file',
 | 
				
			||||||
        path: path.join(option.root || 'data.log/', '/', option.file || 'info.log'),
 | 
					        path: path.join(option.root || 'data.log/', '/', option.file || 'info.log'),
 | 
				
			||||||
        period: '1d',   // daily rotation
 | 
					        period: '1d', // daily rotation
 | 
				
			||||||
        count: 30       // keep 30 days
 | 
					        count: 30, // keep 30 days
 | 
				
			||||||
      }
 | 
					      },
 | 
				
			||||||
    ]
 | 
					    ],
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports=logger // trace, debug, info, warn, error, fatal
 | 
					module.exports = logger // trace, debug, info, warn, error, fatal
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,5 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "so.base",
 | 
					  "name": "logger",
 | 
				
			||||||
  "version": "0.1.0",
 | 
					  "version": "0.1.0",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user