Skip to content

Commit 5ddd03d

Browse files
committed
repo setup
0 parents  commit 5ddd03d

10 files changed

+1299
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintrc.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true
6+
},
7+
extends: ['prettier', 'prettier/@typescript-eslint'],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: [
11+
'./src/tsconfig.json',
12+
'./src/bp/ui-*/tsconfig.json',
13+
'./src/bp/admin/ui/tsconfig.json',
14+
'./modules/tsconfig*.eslint.json',
15+
'./build/module-builder/tsconfig.json'
16+
],
17+
tsconfigRootDir: __dirname,
18+
sourceType: 'module'
19+
},
20+
ignorePatterns: ['**/index.d.ts', '**/global.d.ts', '**/*.scss.d.ts', '**/*.test.ts', '*.js'],
21+
plugins: ['eslint-plugin-import', 'eslint-plugin-jsdoc', '@typescript-eslint'],
22+
rules: {
23+
'@typescript-eslint/consistent-type-definitions': 'error',
24+
'@typescript-eslint/member-delimiter-style': [
25+
'error',
26+
{
27+
multiline: {
28+
delimiter: 'none',
29+
requireLast: true
30+
},
31+
singleline: {
32+
delimiter: 'semi',
33+
requireLast: false
34+
}
35+
}
36+
],
37+
'@typescript-eslint/no-floating-promises': 'error',
38+
'@typescript-eslint/prefer-namespace-keyword': 'error',
39+
'@typescript-eslint/quotes': [
40+
'error',
41+
'single',
42+
{
43+
avoidEscape: true
44+
}
45+
],
46+
'@typescript-eslint/semi': ['error', 'never'],
47+
'@typescript-eslint/type-annotation-spacing': 'error',
48+
'brace-style': ['error', '1tbs'],
49+
curly: 'error',
50+
'eol-last': 'error',
51+
eqeqeq: ['error', 'smart'],
52+
'import/order': [
53+
'warn',
54+
{
55+
groups: [['builtin', 'external'], 'parent', 'index', 'sibling'],
56+
// TODO: Eventually enable this in the future for consistency
57+
// 'newlines-between': 'always',
58+
alphabetize: {
59+
order: 'asc',
60+
caseInsensitive: true
61+
},
62+
pathGroups: [
63+
{
64+
pattern: '~/**',
65+
group: 'external',
66+
position: 'after'
67+
}
68+
],
69+
pathGroupsExcludedImportTypes: ['builtin']
70+
}
71+
],
72+
'jsdoc/check-alignment': 'error',
73+
'linebreak-style': ['error', 'unix'],
74+
'no-console': [
75+
'warn',
76+
{
77+
allow: [
78+
'warn',
79+
'dir',
80+
'time',
81+
'timeEnd',
82+
'timeLog',
83+
'trace',
84+
'assert',
85+
'clear',
86+
'count',
87+
'countReset',
88+
'group',
89+
'groupEnd',
90+
'table',
91+
'debug',
92+
'info',
93+
'dirxml',
94+
'error',
95+
'groupCollapsed',
96+
'Console',
97+
'profile',
98+
'profileEnd',
99+
'timeStamp',
100+
'context'
101+
]
102+
}
103+
],
104+
'no-duplicate-imports': 'error',
105+
'no-return-await': 'error',
106+
'no-trailing-spaces': 'error',
107+
'no-var': 'error',
108+
'object-shorthand': 'error',
109+
'prefer-const': 'warn'
110+
}
111+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"semi": false,
6+
"bracketSpacing": true,
7+
"requirePragma": false
8+
}

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"editor.tabSize": 2,
4+
"editor.formatOnSave": true,
5+
"files.eol": "\n",
6+
"editor.defaultFormatter": "esbenp.prettier-vscode",
7+
"eslint.nodePath": "./node_modules",
8+
"editor.codeActionsOnSave": {
9+
"source.fixAll": true
10+
}
11+
}

api.rest

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
@baseUrl = http://localhost:4000
3+
4+
GET {{baseUrl}}
5+
6+
###

package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "bp-messaging",
3+
"version": "1.0.0",
4+
"main": "index.ts",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "tsc --build",
8+
"start": "node dist/index.js",
9+
"dev": "ts-node-dev src/index.ts"
10+
},
11+
"devDependencies": {
12+
"@types/node": "^15.0.0",
13+
"cross-env": "^7.0.3",
14+
"rimraf": "^3.0.2",
15+
"ts-node-dev": "^1.1.6",
16+
"typescript": "^4.2.4"
17+
},
18+
"dependencies": {
19+
"@types/express": "^4.17.11",
20+
"express": "^4.17.1"
21+
}
22+
}

src/index.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import express from 'express'
2+
3+
const app = express()
4+
const port = 4000
5+
6+
app.get('/', (req, res) => {
7+
res.send('This is the messaging server!')
8+
})
9+
10+
app.listen(port, () => {
11+
console.log(`Server is listening on ${port}`)
12+
})

tsconfig.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"esModuleInterop": true,
5+
"target": "es2019",
6+
"moduleResolution": "node",
7+
"sourceMap": true,
8+
"incremental": true,
9+
"tsBuildInfoFile": "dist/.tsbuildinfo",
10+
"outDir": "dist",
11+
"rootDir": "src"
12+
},
13+
"exclude": ["node_modules"]
14+
}

0 commit comments

Comments
 (0)