express-generator-typescript 2.4.23 → 2.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{project-files-auth/eslint.config.js → project-files/eslint.config.mjs} +14 -11
- package/lib/project-files/package.json +2 -2
- package/lib/project-files/tsconfig.json +0 -1
- package/lib/{project-files/eslint.config.js → project-files-auth/eslint.config.mjs} +15 -12
- package/lib/project-files-auth/package.json +2 -2
- package/lib/project-files-auth/src/routes/middleware/adminMw.ts +2 -5
- package/lib/project-files-auth/tsconfig.json +0 -1
- package/package.json +1 -1
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
4
|
+
import nodePlugin from 'eslint-plugin-n';
|
|
3
5
|
|
|
4
|
-
const eslint = require('@eslint/js');
|
|
5
|
-
const tseslint = require('typescript-eslint');
|
|
6
|
-
const stylisticTs = require('@stylistic/eslint-plugin-ts');
|
|
7
|
-
const nodePlugin = require('eslint-plugin-n');
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
module.exports = tseslint.config(
|
|
7
|
+
export default tseslint.config(
|
|
11
8
|
eslint.configs.recommended,
|
|
12
9
|
nodePlugin.configs['flat/recommended-script'],
|
|
13
10
|
...tseslint.configs.strictTypeChecked,
|
|
14
11
|
...tseslint.configs.stylisticTypeChecked,
|
|
12
|
+
{
|
|
13
|
+
ignores: [
|
|
14
|
+
'**/node_modules/*',
|
|
15
|
+
'**/*.mjs',
|
|
16
|
+
'**/*.js',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
15
19
|
{
|
|
16
20
|
languageOptions: {
|
|
17
21
|
parserOptions: {
|
|
@@ -25,9 +29,8 @@ module.exports = tseslint.config(
|
|
|
25
29
|
'@stylistic/ts': stylisticTs,
|
|
26
30
|
}
|
|
27
31
|
},
|
|
32
|
+
{ files: ['**/*.ts'] },
|
|
28
33
|
{
|
|
29
|
-
files: ['**/*.ts'],
|
|
30
|
-
ignores: ['**/*.js'],
|
|
31
34
|
rules: {
|
|
32
35
|
'@typescript-eslint/explicit-member-accessibility': 'warn',
|
|
33
36
|
'@typescript-eslint/no-misused-promises': 0,
|
|
@@ -51,5 +54,5 @@ module.exports = tseslint.config(
|
|
|
51
54
|
'n/no-missing-import': 0,
|
|
52
55
|
'n/no-unpublished-import': 0
|
|
53
56
|
},
|
|
54
|
-
}
|
|
57
|
+
},
|
|
55
58
|
)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"build": "npx ts-node ./scripts/build.ts",
|
|
6
6
|
"dev": "NODE_ENV=development npx ts-node ./src",
|
|
7
7
|
"dev:hot": "nodemon --exec \"npm run dev\" --watch ./src -e ts",
|
|
8
|
-
"lint": "npx eslint ./src
|
|
9
|
-
"lint:tests": "npx eslint ./spec
|
|
8
|
+
"lint": "npx eslint ./src",
|
|
9
|
+
"lint:tests": "npx eslint ./spec",
|
|
10
10
|
"start": "NODE_ENV=production node -r ./preload.js ./dist",
|
|
11
11
|
"test": "NODE_ENV=test npx ts-node ./spec",
|
|
12
12
|
"test:hot": "nodemon --exec \"npm run test\" --watch ./src --watch ./spec -e ts"
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
import stylisticTs from '@stylistic/eslint-plugin-ts';
|
|
4
|
+
import nodePlugin from 'eslint-plugin-n';
|
|
3
5
|
|
|
4
|
-
const eslint = require('@eslint/js');
|
|
5
|
-
const tseslint = require('typescript-eslint');
|
|
6
|
-
const stylisticTs = require('@stylistic/eslint-plugin-ts');
|
|
7
|
-
const nodePlugin = require('eslint-plugin-n');
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
module.exports = tseslint.config(
|
|
7
|
+
export default tseslint.config(
|
|
11
8
|
eslint.configs.recommended,
|
|
12
9
|
nodePlugin.configs['flat/recommended-script'],
|
|
13
10
|
...tseslint.configs.strictTypeChecked,
|
|
14
11
|
...tseslint.configs.stylisticTypeChecked,
|
|
12
|
+
{
|
|
13
|
+
ignores: [
|
|
14
|
+
'**/node_modules/*',
|
|
15
|
+
'**/*.mjs',
|
|
16
|
+
'**/*.js',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
15
19
|
{
|
|
16
20
|
languageOptions: {
|
|
17
21
|
parserOptions: {
|
|
@@ -25,9 +29,8 @@ module.exports = tseslint.config(
|
|
|
25
29
|
'@stylistic/ts': stylisticTs,
|
|
26
30
|
}
|
|
27
31
|
},
|
|
32
|
+
{ files: ['**/*.ts'] },
|
|
28
33
|
{
|
|
29
|
-
files: ['**/*.ts'],
|
|
30
|
-
ignores: ['**/*.js'],
|
|
31
34
|
rules: {
|
|
32
35
|
'@typescript-eslint/explicit-member-accessibility': 'warn',
|
|
33
36
|
'@typescript-eslint/no-misused-promises': 0,
|
|
@@ -51,5 +54,5 @@ module.exports = tseslint.config(
|
|
|
51
54
|
'n/no-missing-import': 0,
|
|
52
55
|
'n/no-unpublished-import': 0
|
|
53
56
|
},
|
|
54
|
-
}
|
|
55
|
-
)
|
|
57
|
+
},
|
|
58
|
+
)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
"build": "npx ts-node ./scripts/build.ts",
|
|
6
6
|
"dev": "NODE_ENV=development npx ts-node ./src",
|
|
7
7
|
"dev:hot": "nodemon --exec \"npm run dev\" --watch ./src -e ts",
|
|
8
|
-
"lint": "npx eslint ./src
|
|
9
|
-
"lint:tests": "npx eslint ./spec
|
|
8
|
+
"lint": "npx eslint ./src",
|
|
9
|
+
"lint:tests": "npx eslint ./spec",
|
|
10
10
|
"start": "NODE_ENV=production node -r ./preload.js ./dist",
|
|
11
11
|
"test": "NODE_ENV=test npx ts-node ./spec",
|
|
12
12
|
"test:hot": "nodemon --exec \"npm run test\" --watch ./src --watch ./spec -e ts"
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Middleware to verify user logged in and is an an admin.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
import { NextFunction } from 'express';
|
|
6
2
|
import { JwtPayload } from 'jsonwebtoken';
|
|
7
3
|
|
|
@@ -38,9 +34,10 @@ async function adminMw(
|
|
|
38
34
|
return next();
|
|
39
35
|
// Return an unauth error if user is not an admin
|
|
40
36
|
} else {
|
|
41
|
-
|
|
37
|
+
res
|
|
42
38
|
.status(HttpStatusCodes.UNAUTHORIZED)
|
|
43
39
|
.json({ error: USER_UNAUTHORIZED_ERR });
|
|
40
|
+
return;
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-generator-typescript",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.25",
|
|
4
4
|
"description": "Generate new Express applications similar to express-generate which but sets it up to use TypeScript instead",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"express-generator-typescript": "node bin/cli.js",
|