Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-giguere authored Feb 19, 2023
0 parents commit 1a9d92d
Show file tree
Hide file tree
Showing 16 changed files with 5,498 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
ij_visual_guides = 120

[*.{ts,js,json}]
indent_style = space
indent_size = 2
max_line_length = 120

[*.{js,ts}]
quote_type = single
44 changes: 44 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
root: true,
ignorePatterns: ['**/node_modules', '.yarn'],
env: {
commonjs: true,
es2020: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
allowExpressions: true,
},
],
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-namespace': 'warn',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'no-use-before-define': 'off',
'no-case-declarations': 'warn',
'no-async-promise-executor': 'warn',
'no-useless-escape': 'warn',
'no-fallthrough': 'warn',
'no-redeclare': 'warn',
'no-empty': 'warn',
'no-irregular-whitespace': 'warn',
'no-duplicate-imports': 'error',
},
};
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# JetBrains
.idea

# Yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/versions
!.yarn/sdks
yarn-debug.log
yarn-error.log
.pnp.*
node_modules

# Build folder
dist
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"printWidth": 120
}
12 changes: 12 additions & 0 deletions .run/Run unit tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run unit tests" type="JavaScriptTestRunnerJest">
<config-file value="$PROJECT_DIR$/test/unit/jest.config.ts" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="yarn:package.json:jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
7 changes: 7 additions & 0 deletions .run/Start.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Start" type="NodeJSConfigurationType" path-to-js-file="dist/index.js" working-dir="$PROJECT_DIR$">
<method v="2">
<option name="TypeScript.Before.Run" enabled="true" FAIL_ON_ERROR="true" CONFIG_PATH="$PROJECT_DIR$/tsconfig.json" />
</method>
</configuration>
</component>
807 changes: 807 additions & 0 deletions .yarn/releases/yarn-3.3.0.cjs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nodeLinker: pnp
pnpMode: loose
yarnPath: .yarn/releases/yarn-3.3.0.cjs
enableTelemetry: false
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @pascal-giguere/starter-node

Pascal's starter Node project using:
- Node 18
- TypeScript 4
- Yarn 3 (with PnP)
- Prettier 2
- ESLint 8
- Jest 29

Original repository: https://github.com/pascal-giguere/starter-node
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@pascal-giguere/starter-node",
"version": "1.0.0",
"author": "Pascal Giguère",
"repository": "https://github.com/pascal-giguere/starter-node",
"private": true,
"license": "UNLICENSED",
"packageManager": "[email protected]",
"engines": {
"node": ">=18",
"npm": "please-use-yarn",
"yarn": "3.3.0"
},
"main": "dist/index.js",
"devDependencies": {
"@types/jest": "^29.2.3",
"@types/node": "^18.11.10",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"jest": "^29.3.1",
"prettier": "^2.8.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.9.3"
}
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Hello world!');
8 changes: 8 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"types": ["node", "jest"],
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true
}
}
3 changes: 3 additions & 0 deletions test/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
it('basic test', async () => {
expect(true).toBeTruthy();
});
15 changes: 15 additions & 0 deletions test/unit/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
roots: ['<rootDir>', '<rootDir>/../../src'],
testMatch: ['**/*.test.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: 'test/tsconfig.json',
diagnostics: false,
},
],
},
testEnvironment: 'node',
};
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"types": ["node"],
"moduleResolution": "node",
"lib": ["esnext"],
"allowJs": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"outDir": "dist"
},
"include": ["src"],
"exclude": [".yarn"]
}
Loading

0 comments on commit 1a9d92d

Please sign in to comment.