this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial commit.

alice 4dc120ee

+168
+12
.editorconfig
··· 1 + # EditorConfig is awesome: https://EditorConfig.org 2 + 3 + # top-most EditorConfig file 4 + root = true 5 + 6 + [*] 7 + indent_style = space 8 + indent_size = 2 9 + end_of_line = lf 10 + charset = utf-8 11 + trim_trailing_whitespace = false 12 + insert_final_newline = true
+1
.env.example
··· 1 + # env variables
+2
.gitignore
··· 1 + node_modules 2 + .env
+1
.nvmrc
··· 1 + v22.9.0
+1
.prettierignore
··· 1 + pnpm-lock.yaml
+12
.prettierrc
··· 1 + { 2 + "trailingComma": "all", 3 + "tabWidth": 2, 4 + "semi": true, 5 + "singleQuote": true, 6 + "printWidth": 120, 7 + "experimentalTernaries": true, 8 + "plugins": ["@trivago/prettier-plugin-sort-imports"], 9 + "importOrder": ["^[./]"], 10 + "importOrderSeparation": true, 11 + "importOrderSortSpecifiers": true 12 + }
+21
LICENSE
··· 1 + MIT License 2 + 3 + Copyright (c) 2024 alice (aliceisjustplaying@gmail.com) 4 + 5 + Permission is hereby granted, free of charge, to any person obtaining a copy 6 + of this software and associated documentation files (the "Software"), to deal 7 + in the Software without restriction, including without limitation the rights 8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 + copies of the Software, and to permit persons to whom the Software is 10 + furnished to do so, subject to the following conditions: 11 + 12 + The above copyright notice and this permission notice shall be included in all 13 + copies or substantial portions of the Software. 14 + 15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 + SOFTWARE.
+14
README.md
··· 1 + # alice's highly opinionated Node.js + TypeScript + Bun + ESLint + Prettier + Pino starter repo (fall 2024 edition) 2 + 3 + This repo is a starting point for new projects. It includes a basic setup for a Node.js project with TypeScript, ESLint, Prettier, and Pino. 4 + 5 + ## Known issues 6 + 7 + ESLint will throw the following error when running `bun lint`: 8 + 9 + ``` 10 + 0:0 error Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser. 11 + The file was not found in any of the provided project(s): eslint.config.mjs 12 + ``` 13 + 14 + If you use this repo and find a way to fix this, please do open a PR, I've spent way too long on this already. It looks simple, but it's not. In the meantime I've simply made my peace with it.
bun.lockb

This is a binary file and will not be displayed.

+19
eslint.config.mjs
··· 1 + import eslint from '@eslint/js'; 2 + import tseslint from 'typescript-eslint'; 3 + 4 + export default tseslint.config( 5 + eslint.configs.recommended, 6 + ...tseslint.configs.strictTypeChecked, 7 + ...tseslint.configs.stylisticTypeChecked, 8 + { 9 + languageOptions: { 10 + parserOptions: { 11 + project: './tsconfig.json', 12 + }, 13 + }, 14 + rules: { 15 + '@typescript-eslint/no-non-null-assertion': 'off', 16 + '@typescript-eslint/restrict-template-expressions': 'off', 17 + }, 18 + }, 19 + );
+33
package.json
··· 1 + { 2 + "name": "name-goes-here", 3 + "version": "1.0.0", 4 + "description": "description-goes-here", 5 + "main": "src/index.ts", 6 + "type": "module", 7 + "scripts": { 8 + "start": "bunx tsx src/index.ts", 9 + "dev": "bunx --watch src/index.ts", 10 + "format": "bunx prettier --write .", 11 + "lint": "bunx eslint .", 12 + "lint:fix": "bunx eslint --fix ." 13 + }, 14 + "dependencies": { 15 + "dotenv": "^16.4.5", 16 + "pino": "^9.4.0", 17 + "pino-pretty": "^11.2.2" 18 + }, 19 + "devDependencies": { 20 + "@eslint/js": "^9.11.0", 21 + "@trivago/prettier-plugin-sort-imports": "^4.3.0", 22 + "@types/eslint__js": "^8.42.3", 23 + "@types/node": "^22.5.5", 24 + "eslint": "^9.11.0", 25 + "prettier": "^3.3.3", 26 + "tsx": "^4.19.1", 27 + "typescript": "^5.6.2", 28 + "typescript-eslint": "^8.6.0" 29 + }, 30 + "author": "alice", 31 + "license": "MIT", 32 + "packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c" 33 + }
+22
src/index.ts
··· 1 + import dotenv from 'dotenv'; 2 + 3 + import logger from './logger.js'; 4 + 5 + dotenv.config(); 6 + 7 + logger.info('Hello, World!'); 8 + 9 + function shutdown() { 10 + logger.info('Shutting down gracefully...'); 11 + 12 + // ... 13 + process.exit(0); 14 + 15 + setTimeout(() => { 16 + logger.error('Forcing shutdown.'); 17 + process.exit(1); 18 + }, 60000); 19 + } 20 + 21 + process.on('SIGINT', shutdown); 22 + process.on('SIGTERM', shutdown);
+19
src/logger.ts
··· 1 + import { pino } from 'pino'; 2 + 3 + const logger = pino({ 4 + level: process.env.LOG_LEVEL ?? 'info', 5 + transport: 6 + process.env.NODE_ENV !== 'production' ? 7 + { 8 + target: 'pino-pretty', 9 + options: { 10 + colorize: true, 11 + translateTime: 'SYS:standard', 12 + ignore: 'pid,hostname', 13 + }, 14 + } 15 + : undefined, 16 + timestamp: pino.stdTimeFunctions.isoTime, 17 + }); 18 + 19 + export default logger;
+11
tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "strict": true, 4 + "target": "ESNext", 5 + "module": "NodeNext", 6 + "moduleResolution": "NodeNext", 7 + "allowSyntheticDefaultImports": true, 8 + "esModuleInterop": true, 9 + "types": ["node"] 10 + } 11 + }