web_plsql 0.5.0 → 0.6.0
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/README.md +123 -110
- package/examples/server_apex.js +28 -0
- package/examples/server_sample.js +30 -0
- package/examples/sql/{doc_table.sql → doctable.sql} +1 -1
- package/examples/sql/install.sql +6 -9
- package/examples/sql/sample_package.sql +27 -0
- package/examples/sql/sample_package_body.sql +245 -0
- package/examples/static/sample.css +11 -10
- package/package.json +90 -83
- package/src/cgi.js +127 -0
- package/src/error.js +24 -0
- package/src/errorPage.js +296 -0
- package/src/file.js +77 -0
- package/src/handlerLogger.js +21 -0
- package/src/handlerMetrics.js +46 -0
- package/src/handlerPlSql.js +65 -0
- package/src/handlerUpload.js +32 -0
- package/src/index.js +17 -0
- package/src/oracle.js +80 -0
- package/src/parsePage.js +193 -0
- package/src/procedure.js +260 -0
- package/src/procedureError.js +40 -0
- package/src/procedureNamed.js +233 -0
- package/src/procedureSanitize.js +215 -0
- package/src/procedureVariable.js +57 -0
- package/src/request.js +103 -0
- package/src/{requestError.ts → requestError.js} +8 -4
- package/src/sendResponse.js +104 -0
- package/src/server.js +106 -0
- package/src/shutdown.js +53 -0
- package/src/stream.js +28 -0
- package/src/trace.js +74 -0
- package/src/tty.js +48 -0
- package/src/types.js +146 -0
- package/src/upload.js +92 -0
- package/src/version.js +23 -0
- package/types/cgi.d.ts +4 -0
- package/types/error.d.ts +1 -0
- package/types/errorPage.d.ts +10 -0
- package/types/file.d.ts +5 -0
- package/types/handlerLogger.d.ts +2 -0
- package/types/handlerMetrics.d.ts +4 -0
- package/types/handlerPlSql.d.ts +8 -0
- package/types/handlerUpload.d.ts +7 -0
- package/types/index.d.ts +10 -0
- package/types/oracle.d.ts +5 -0
- package/types/parsePage.d.ts +3 -0
- package/types/procedure.d.ts +10 -0
- package/types/procedureError.d.ts +23 -0
- package/types/procedureNamed.d.ts +14 -0
- package/types/procedureSanitize.d.ts +14 -0
- package/types/procedureVariable.d.ts +9 -0
- package/types/request.d.ts +7 -0
- package/types/requestError.d.ts +8 -0
- package/types/sendResponse.d.ts +4 -0
- package/types/server.d.ts +7 -0
- package/types/shutdown.d.ts +2 -0
- package/types/stream.d.ts +1 -0
- package/types/trace.d.ts +5 -0
- package/types/tty.d.ts +4 -0
- package/types/types.d.ts +251 -0
- package/types/upload.d.ts +5 -0
- package/types/version.d.ts +7 -0
- package/.editorconfig +0 -8
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -347
- package/CHANGELOG.md +0 -127
- package/examples/apex.js +0 -70
- package/examples/credentials.js +0 -22
- package/examples/oracledb_example.js +0 -30
- package/examples/sample.js +0 -101
- package/examples/sql/sample.pkb +0 -223
- package/examples/sql/sample.pks +0 -24
- package/jest.config.js +0 -204
- package/src/cgi.ts +0 -95
- package/src/config.ts +0 -97
- package/src/errorPage.ts +0 -286
- package/src/fileUpload.ts +0 -126
- package/src/index.ts +0 -65
- package/src/page.ts +0 -275
- package/src/procedure.ts +0 -360
- package/src/procedureError.ts +0 -27
- package/src/request.ts +0 -139
- package/src/stream.ts +0 -26
- package/src/trace.ts +0 -194
- package/test/.eslintrc.json +0 -5
- package/test/__tests__/cgi.ts +0 -96
- package/test/__tests__/config.ts +0 -41
- package/test/__tests__/errorPage.ts +0 -101
- package/test/__tests__/oracledb_mock.ts +0 -98
- package/test/__tests__/server.ts +0 -495
- package/test/__tests__/stream.ts +0 -21
- package/test/mock/oracledb.ts +0 -85
- package/test/static/static.html +0 -1
- package/tsconfig.json +0 -24
- package/tsconfig.src.json +0 -23
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('oracledb').BindParameter} BindParameter
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {'basic' | 'debug'} errorStyleType
|
|
6
|
+
*/
|
|
7
|
+
export const z$errorStyleType: any;
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {object} configStaticType
|
|
10
|
+
* @property {string} route - The Static route path.
|
|
11
|
+
* @property {string} directoryPath - The Static directory.
|
|
12
|
+
*/
|
|
13
|
+
export const z$configStaticType: any;
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {object} configPlSqlHandlerType
|
|
16
|
+
* @property {string} defaultPage - The default page.
|
|
17
|
+
* @property {string} [pathAlias] - The path alias.
|
|
18
|
+
* @property {string} [pathAliasProcedure] - The path alias.
|
|
19
|
+
* @property {string} documentTable - The document table.
|
|
20
|
+
* @property {string[]} [exclusionList] - The exclusion list.
|
|
21
|
+
* @property {string} [requestValidationFunction] - The request validation function.
|
|
22
|
+
* @property {Record<string, string>} [cgi] - The additional CGI.
|
|
23
|
+
* @property {errorStyleType} errorStyle - The error style.
|
|
24
|
+
*/
|
|
25
|
+
export const z$configPlSqlHandlerType: any;
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {object} configPlSqlConfigType
|
|
28
|
+
* @property {string} route - The PL/SQL route path.
|
|
29
|
+
* @property {string} user - The Oracle username.
|
|
30
|
+
* @property {string} password - The Oracle password.
|
|
31
|
+
* @property {string} connectString - The Oracle connect string.
|
|
32
|
+
*/
|
|
33
|
+
export const z$configPlSqlConfigType: any;
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {configPlSqlHandlerType & configPlSqlConfigType} configPlSqlType
|
|
36
|
+
*/
|
|
37
|
+
export const z$configPlSqlType: any;
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {object} configType
|
|
40
|
+
* @property {number} port - The server port number.
|
|
41
|
+
* @property {configStaticType[]} routeStatic - The static routes.
|
|
42
|
+
* @property {configPlSqlType[]} routePlSql - The PL/SQL routes.
|
|
43
|
+
* @property {string} loggerFilename - name of the request logger filename or '' if not required.
|
|
44
|
+
* @property {boolean} monitorConsole - Enable console status monitor.
|
|
45
|
+
*/
|
|
46
|
+
export const z$configType: any;
|
|
47
|
+
export type BindParameter = import("oracledb").BindParameter;
|
|
48
|
+
export type errorStyleType = "basic" | "debug";
|
|
49
|
+
export type configStaticType = {
|
|
50
|
+
/**
|
|
51
|
+
* - The Static route path.
|
|
52
|
+
*/
|
|
53
|
+
route: string;
|
|
54
|
+
/**
|
|
55
|
+
* - The Static directory.
|
|
56
|
+
*/
|
|
57
|
+
directoryPath: string;
|
|
58
|
+
};
|
|
59
|
+
export type configPlSqlHandlerType = {
|
|
60
|
+
/**
|
|
61
|
+
* - The default page.
|
|
62
|
+
*/
|
|
63
|
+
defaultPage: string;
|
|
64
|
+
/**
|
|
65
|
+
* - The path alias.
|
|
66
|
+
*/
|
|
67
|
+
pathAlias?: string;
|
|
68
|
+
/**
|
|
69
|
+
* - The path alias.
|
|
70
|
+
*/
|
|
71
|
+
pathAliasProcedure?: string;
|
|
72
|
+
/**
|
|
73
|
+
* - The document table.
|
|
74
|
+
*/
|
|
75
|
+
documentTable: string;
|
|
76
|
+
/**
|
|
77
|
+
* - The exclusion list.
|
|
78
|
+
*/
|
|
79
|
+
exclusionList?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* - The request validation function.
|
|
82
|
+
*/
|
|
83
|
+
requestValidationFunction?: string;
|
|
84
|
+
/**
|
|
85
|
+
* - The additional CGI.
|
|
86
|
+
*/
|
|
87
|
+
cgi?: Record<string, string>;
|
|
88
|
+
/**
|
|
89
|
+
* - The error style.
|
|
90
|
+
*/
|
|
91
|
+
errorStyle: errorStyleType;
|
|
92
|
+
};
|
|
93
|
+
export type configPlSqlConfigType = {
|
|
94
|
+
/**
|
|
95
|
+
* - The PL/SQL route path.
|
|
96
|
+
*/
|
|
97
|
+
route: string;
|
|
98
|
+
/**
|
|
99
|
+
* - The Oracle username.
|
|
100
|
+
*/
|
|
101
|
+
user: string;
|
|
102
|
+
/**
|
|
103
|
+
* - The Oracle password.
|
|
104
|
+
*/
|
|
105
|
+
password: string;
|
|
106
|
+
/**
|
|
107
|
+
* - The Oracle connect string.
|
|
108
|
+
*/
|
|
109
|
+
connectString: string;
|
|
110
|
+
};
|
|
111
|
+
export type configPlSqlType = configPlSqlHandlerType & configPlSqlConfigType;
|
|
112
|
+
export type configType = {
|
|
113
|
+
/**
|
|
114
|
+
* - The server port number.
|
|
115
|
+
*/
|
|
116
|
+
port: number;
|
|
117
|
+
/**
|
|
118
|
+
* - The static routes.
|
|
119
|
+
*/
|
|
120
|
+
routeStatic: configStaticType[];
|
|
121
|
+
/**
|
|
122
|
+
* - The PL/SQL routes.
|
|
123
|
+
*/
|
|
124
|
+
routePlSql: configPlSqlType[];
|
|
125
|
+
/**
|
|
126
|
+
* - name of the request logger filename or '' if not required.
|
|
127
|
+
*/
|
|
128
|
+
loggerFilename: string;
|
|
129
|
+
/**
|
|
130
|
+
* - Enable console status monitor.
|
|
131
|
+
*/
|
|
132
|
+
monitorConsole: boolean;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Environment variables as string key-value pairs
|
|
136
|
+
*/
|
|
137
|
+
export type environmentType = Record<string, string>;
|
|
138
|
+
/**
|
|
139
|
+
* Oracle database bind parameter configuration
|
|
140
|
+
*/
|
|
141
|
+
export type BindParameterConfig = Record<string, BindParameter>;
|
|
142
|
+
/**
|
|
143
|
+
* Arguments object with string or string array values
|
|
144
|
+
*/
|
|
145
|
+
export type argObjType = Record<string, string | string[]>;
|
|
146
|
+
/**
|
|
147
|
+
* File upload metadata
|
|
148
|
+
*/
|
|
149
|
+
export type fileUploadType = {
|
|
150
|
+
/**
|
|
151
|
+
* - The field value.
|
|
152
|
+
*/
|
|
153
|
+
fieldname: string;
|
|
154
|
+
/**
|
|
155
|
+
* - The filename.
|
|
156
|
+
*/
|
|
157
|
+
originalname: string;
|
|
158
|
+
/**
|
|
159
|
+
* - The encoding.
|
|
160
|
+
*/
|
|
161
|
+
encoding: string;
|
|
162
|
+
/**
|
|
163
|
+
* - The mimetype.
|
|
164
|
+
*/
|
|
165
|
+
mimetype: string;
|
|
166
|
+
/**
|
|
167
|
+
* - The filename.
|
|
168
|
+
*/
|
|
169
|
+
filename: string;
|
|
170
|
+
/**
|
|
171
|
+
* - The path.
|
|
172
|
+
*/
|
|
173
|
+
path: string;
|
|
174
|
+
/**
|
|
175
|
+
* - The size.
|
|
176
|
+
*/
|
|
177
|
+
size: number;
|
|
178
|
+
};
|
|
179
|
+
export type cookieType = {
|
|
180
|
+
/**
|
|
181
|
+
* - The name of the cookie.
|
|
182
|
+
*/
|
|
183
|
+
name: string;
|
|
184
|
+
/**
|
|
185
|
+
* - The value of the cookie.
|
|
186
|
+
*/
|
|
187
|
+
value: string;
|
|
188
|
+
/**
|
|
189
|
+
* - The path of the cookie.
|
|
190
|
+
*/
|
|
191
|
+
path?: string;
|
|
192
|
+
/**
|
|
193
|
+
* - The domain of the cookie.
|
|
194
|
+
*/
|
|
195
|
+
domain?: string;
|
|
196
|
+
/**
|
|
197
|
+
* - The secure flag.
|
|
198
|
+
*/
|
|
199
|
+
secure?: string;
|
|
200
|
+
/**
|
|
201
|
+
* - The expiration date.
|
|
202
|
+
*/
|
|
203
|
+
expires?: Date;
|
|
204
|
+
/**
|
|
205
|
+
* - The httpOnly flag.
|
|
206
|
+
*/
|
|
207
|
+
httpOnly?: boolean;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* - The page.
|
|
211
|
+
*/
|
|
212
|
+
export type pageType = {
|
|
213
|
+
/**
|
|
214
|
+
* - The body of the page.
|
|
215
|
+
*/
|
|
216
|
+
body: string;
|
|
217
|
+
/**
|
|
218
|
+
* - The head of the page.
|
|
219
|
+
*/
|
|
220
|
+
head: {
|
|
221
|
+
cookies: cookieType[];
|
|
222
|
+
contentType?: string;
|
|
223
|
+
contentLength?: number;
|
|
224
|
+
statusCode?: number;
|
|
225
|
+
statusDescription?: string;
|
|
226
|
+
redirectLocation?: string;
|
|
227
|
+
otherHeaders: Record<string, string>;
|
|
228
|
+
server?: string;
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* - The file.
|
|
232
|
+
*/
|
|
233
|
+
file: {
|
|
234
|
+
fileType: string | null;
|
|
235
|
+
fileSize: number | null;
|
|
236
|
+
fileBlob: Buffer | null;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* - The metrics.
|
|
241
|
+
*/
|
|
242
|
+
export type metricsType = {
|
|
243
|
+
/**
|
|
244
|
+
* - The total number of requests.
|
|
245
|
+
*/
|
|
246
|
+
totalRequests: number;
|
|
247
|
+
/**
|
|
248
|
+
* - The number of requests in the last second.
|
|
249
|
+
*/
|
|
250
|
+
requestsInLastInterval: number;
|
|
251
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function getFiles(req: Request): fileUploadType[];
|
|
2
|
+
export function uploadFile(file: fileUploadType, doctable: string, databaseConnection: Connection): Promise<void>;
|
|
3
|
+
export type Request = import("express").Request;
|
|
4
|
+
export type Connection = import("oracledb").Connection;
|
|
5
|
+
export type fileUploadType = import("./types.js").fileUploadType;
|
package/.editorconfig
DELETED
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
project: './tsconfig.json'
|
|
5
|
-
},
|
|
6
|
-
extends: [
|
|
7
|
-
"eslint:recommended",
|
|
8
|
-
'plugin:@typescript-eslint/recommended',
|
|
9
|
-
],
|
|
10
|
-
env: {
|
|
11
|
-
es6: true,
|
|
12
|
-
node: true
|
|
13
|
-
},
|
|
14
|
-
rules: {
|
|
15
|
-
// Possible Errors
|
|
16
|
-
"for-direction": "error",
|
|
17
|
-
"no-await-in-loop": "error",
|
|
18
|
-
"no-console": "off",
|
|
19
|
-
"no-debugger": "warn",
|
|
20
|
-
"no-extra-boolean-cast": "warn",
|
|
21
|
-
"no-extra-parens": "off",
|
|
22
|
-
"no-unsafe-finally": "error",
|
|
23
|
-
"no-prototype-builtins": "off",
|
|
24
|
-
"no-template-curly-in-string": "error",
|
|
25
|
-
"valid-jsdoc": ["warn", {
|
|
26
|
-
"prefer": {
|
|
27
|
-
"return": "returns",
|
|
28
|
-
"argument": "param",
|
|
29
|
-
"arg": "param",
|
|
30
|
-
"constructor": "class",
|
|
31
|
-
"virtual": "abstract"
|
|
32
|
-
},
|
|
33
|
-
"preferType": {
|
|
34
|
-
"Boolean": "boolean",
|
|
35
|
-
"Number": "number",
|
|
36
|
-
"String": "string",
|
|
37
|
-
"object": "Object",
|
|
38
|
-
"array": "Array",
|
|
39
|
-
"date": "Date"
|
|
40
|
-
},
|
|
41
|
-
"matchDescription": ".+",
|
|
42
|
-
"requireParamDescription": true,
|
|
43
|
-
"requireReturnDescription": true,
|
|
44
|
-
"requireReturn": false,
|
|
45
|
-
"requireReturnType": true
|
|
46
|
-
}],
|
|
47
|
-
|
|
48
|
-
// Best Practices
|
|
49
|
-
"array-callback-return": "warn",
|
|
50
|
-
"class-methods-use-this": "warn",
|
|
51
|
-
"complexity": ["warn", 30],
|
|
52
|
-
"consistent-return": "warn",
|
|
53
|
-
"curly": ["error", "all"],
|
|
54
|
-
"default-case": "error",
|
|
55
|
-
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": "^[a-zA-Z]+(_[a-zA-Z]+)+$"}],
|
|
56
|
-
"eqeqeq": "error",
|
|
57
|
-
"guard-for-in": "off",
|
|
58
|
-
"no-alert": "off",
|
|
59
|
-
"no-caller": "error",
|
|
60
|
-
"no-case-declarations": "error",
|
|
61
|
-
"no-div-regex": "error",
|
|
62
|
-
"no-else-return": "warn",
|
|
63
|
-
"no-empty-pattern": "warn",
|
|
64
|
-
"no-eq-null": "error",
|
|
65
|
-
"no-eval": "error",
|
|
66
|
-
"no-extend-native": "error",
|
|
67
|
-
"no-extra-bind": "error",
|
|
68
|
-
"no-extra-label": "warn",
|
|
69
|
-
"no-fallthrough": "warn",
|
|
70
|
-
"no-floating-decimal": "error",
|
|
71
|
-
"no-implicit-coercion": ["warn", {"boolean": true, "number": true, "string": true}],
|
|
72
|
-
"no-implicit-globals": "warn",
|
|
73
|
-
"no-implied-eval": "error",
|
|
74
|
-
"no-iterator": "error",
|
|
75
|
-
"no-labels": ["error", {"allowLoop": false, "allowSwitch": false}],
|
|
76
|
-
"no-lone-blocks": "warn",
|
|
77
|
-
"no-loop-func": "error",
|
|
78
|
-
"no-magic-numbers": "off",
|
|
79
|
-
"no-multi-spaces": ["warn", {"ignoreEOLComments": true}],
|
|
80
|
-
"no-multi-str": "error",
|
|
81
|
-
"no-native-reassign": "error",
|
|
82
|
-
"no-new": "error",
|
|
83
|
-
"no-new-func": "error",
|
|
84
|
-
"no-new-wrappers": "error",
|
|
85
|
-
"no-octal-escape": "error",
|
|
86
|
-
"no-octal": "error",
|
|
87
|
-
"no-process-env": "off",
|
|
88
|
-
"no-proto": "error",
|
|
89
|
-
"no-redeclare": "error",
|
|
90
|
-
"no-return-assign": "error",
|
|
91
|
-
"no-script-url": "error",
|
|
92
|
-
"no-self-assign": "error",
|
|
93
|
-
"no-self-compare": "error",
|
|
94
|
-
"no-sequences": "error",
|
|
95
|
-
"no-throw-literal": "error",
|
|
96
|
-
"no-unmodified-loop-condition": "warn",
|
|
97
|
-
"no-unused-expressions": "error",
|
|
98
|
-
"no-unused-labels": "error",
|
|
99
|
-
"no-useless-call": "error",
|
|
100
|
-
"no-useless-concat": "warn",
|
|
101
|
-
"no-useless-return": "warn",
|
|
102
|
-
"no-void": "error",
|
|
103
|
-
"no-warning-comments": "off",
|
|
104
|
-
"no-with": "error",
|
|
105
|
-
"radix": "error",
|
|
106
|
-
"vars-on-top": "error",
|
|
107
|
-
"wrap-iife": ["error", "outside"],
|
|
108
|
-
"yoda": ["error", "never", {"exceptRange": true}],
|
|
109
|
-
|
|
110
|
-
// Strict Mode
|
|
111
|
-
"strict": ["error", "global"],
|
|
112
|
-
|
|
113
|
-
// Variables
|
|
114
|
-
"no-catch-shadow": "error",
|
|
115
|
-
"no-delete-var": "error",
|
|
116
|
-
"no-label-var": "error",
|
|
117
|
-
"no-shadow-restricted-names": "error",
|
|
118
|
-
"no-shadow": ["warn", {"builtinGlobals": false}],
|
|
119
|
-
"no-undef": "error",
|
|
120
|
-
"no-undef-init": "error",
|
|
121
|
-
"no-undefined": "warn",
|
|
122
|
-
"no-unused-vars": ["warn", {"vars": "all", "args": "after-used"}],
|
|
123
|
-
"no-use-before-define": ["error", "nofunc"],
|
|
124
|
-
|
|
125
|
-
// Node.js and CommonJS
|
|
126
|
-
"global-require": "warn",
|
|
127
|
-
"handle-callback-err": "warn",
|
|
128
|
-
"no-buffer-constructor": "warn",
|
|
129
|
-
"no-new-require": "warn",
|
|
130
|
-
"no-path-concat": "warn",
|
|
131
|
-
|
|
132
|
-
// Stylistic Issues
|
|
133
|
-
"array-bracket-newline": "off",
|
|
134
|
-
"array-bracket-spacing": ["warn", "never"],
|
|
135
|
-
"block-spacing": ["warn", "never"],
|
|
136
|
-
"brace-style": ["warn", "1tbs"],
|
|
137
|
-
"camelcase": "warn",
|
|
138
|
-
"comma-spacing": ["warn", {"before": false, "after": true}],
|
|
139
|
-
"comma-style": ["warn", "last"],
|
|
140
|
-
"computed-property-spacing": ["warn", "never"],
|
|
141
|
-
"consistent-this": ["warn", "that"],
|
|
142
|
-
"eol-last": "warn",
|
|
143
|
-
"func-call-spacing": ["warn", "never"],
|
|
144
|
-
"func-names": "off",
|
|
145
|
-
"func-style": "off",
|
|
146
|
-
"function-paren-newline": ["warn", "multiline"],
|
|
147
|
-
"id-blacklist": "off",
|
|
148
|
-
"id-length": "off",
|
|
149
|
-
"id-match": "off",
|
|
150
|
-
"indent": ["warn", "tab", {"SwitchCase": 1}],
|
|
151
|
-
"jsx-quotes": "off",
|
|
152
|
-
"key-spacing": ["warn", {"beforeColon": false, "afterColon": true}],
|
|
153
|
-
"keyword-spacing": ["error", {"before": true, "after": true, "overrides": {}}],
|
|
154
|
-
"linebreak-style": "off",
|
|
155
|
-
"lines-around-comment": "off",
|
|
156
|
-
"max-depth": ["warn", 10],
|
|
157
|
-
"max-len": ["warn", 500],
|
|
158
|
-
"max-lines": ["warn", 1000],
|
|
159
|
-
"max-nested-callbacks": ["warn", 10],
|
|
160
|
-
"max-params": ["warn", 10],
|
|
161
|
-
"max-statements": ["warn", 150],
|
|
162
|
-
"max-statements-per-line": ["warn", {"max": 2}],
|
|
163
|
-
"new-cap": "warn",
|
|
164
|
-
"new-parens": "warn",
|
|
165
|
-
"newline-per-chained-call": "off",
|
|
166
|
-
"no-array-constructor": "warn",
|
|
167
|
-
"no-bitwise": "warn",
|
|
168
|
-
"no-continue": "warn",
|
|
169
|
-
"no-inline-comments": "off",
|
|
170
|
-
"no-lonely-if": "off",
|
|
171
|
-
"no-mixed-spaces-and-tabs": "warn",
|
|
172
|
-
"no-multiple-empty-lines": "off",
|
|
173
|
-
"no-multi-assign": "off",
|
|
174
|
-
"no-negated-condition": "off",
|
|
175
|
-
"no-nested-ternary": "warn",
|
|
176
|
-
"no-new-object": "warn",
|
|
177
|
-
"no-plusplus": "off",
|
|
178
|
-
"no-restricted-syntax": ["warn", "WithStatement"],
|
|
179
|
-
"no-ternary": "off",
|
|
180
|
-
"no-trailing-spaces": "warn",
|
|
181
|
-
"no-underscore-dangle": "off",
|
|
182
|
-
"no-unneeded-ternary": "warn",
|
|
183
|
-
"no-whitespace-before-property": "warn",
|
|
184
|
-
"object-curly-newline": "off",
|
|
185
|
-
"object-curly-spacing": ["warn", "never"],
|
|
186
|
-
"one-var-declaration-per-line": "off",
|
|
187
|
-
"operator-assignment": "off",
|
|
188
|
-
"operator-linebreak": ["warn", "after", {"overrides": {"?": "ignore", ":": "ignore"}}],
|
|
189
|
-
"padded-blocks": "off",
|
|
190
|
-
"padding-line-between-statements": "off",
|
|
191
|
-
"quote-props": ["warn", "consistent"],
|
|
192
|
-
"quotes": ["warn", "single", "avoid-escape"],
|
|
193
|
-
"require-jsdoc": "off",
|
|
194
|
-
"semi": ["warn", "always"],
|
|
195
|
-
"semi-spacing": ["warn", {"before": false, "after": true}],
|
|
196
|
-
"semi-style": ["error", "last"],
|
|
197
|
-
"sort-imports": "off",
|
|
198
|
-
"sort-vars": "off",
|
|
199
|
-
"space-before-blocks": "warn",
|
|
200
|
-
"space-before-function-paren": ["warn", {"anonymous": "always", "named": "never"}],
|
|
201
|
-
"spaced-comment": ["off", "always"],
|
|
202
|
-
"switch-colon-spacing": ["error", {"after": true, "before": false}],
|
|
203
|
-
"unicode-bom": ["error", "never"],
|
|
204
|
-
"wrap-regex": "off",
|
|
205
|
-
|
|
206
|
-
// ECMAScript 6
|
|
207
|
-
"arrow-body-style": ["warn", "as-needed"],
|
|
208
|
-
"arrow-parens": ["warn", "as-needed"],
|
|
209
|
-
"arrow-spacing": ["warn", {"before": true, "after": true}],
|
|
210
|
-
"constructor-super": "error",
|
|
211
|
-
"generator-star-spacing": ["warn", {"before": true, "after": false}],
|
|
212
|
-
"no-class-assign": "error",
|
|
213
|
-
"no-confusing-arrow": "error",
|
|
214
|
-
"no-const-assign": "error",
|
|
215
|
-
"no-dupe-class-members": "error",
|
|
216
|
-
"no-duplicate-imports": "error",
|
|
217
|
-
"no-new-symbol": "error",
|
|
218
|
-
"no-this-before-super": "error",
|
|
219
|
-
"no-useless-constructor": "error",
|
|
220
|
-
"no-useless-computed-key": "warn",
|
|
221
|
-
"no-useless-rename": "warn",
|
|
222
|
-
"no-var": "error",
|
|
223
|
-
"object-shorthand": "off",
|
|
224
|
-
"prefer-arrow-callback": "off",
|
|
225
|
-
"prefer-const": "warn",
|
|
226
|
-
"prefer-reflect": "off",
|
|
227
|
-
"prefer-rest-params": "off",
|
|
228
|
-
"prefer-spread": "off",
|
|
229
|
-
"prefer-template": "off",
|
|
230
|
-
"require-yield": "error",
|
|
231
|
-
"template-curly-spacing": "error",
|
|
232
|
-
"yield-star-spacing": "error",
|
|
233
|
-
|
|
234
|
-
// typescript
|
|
235
|
-
'@typescript-eslint/array-type': ['warn', {'default': 'generic'}],
|
|
236
|
-
'@typescript-eslint/ban-ts-comment': ['warn',
|
|
237
|
-
{
|
|
238
|
-
'ts-expect-error': false,
|
|
239
|
-
'ts-ignore': true,
|
|
240
|
-
'ts-nocheck': true,
|
|
241
|
-
'ts-check': false
|
|
242
|
-
}
|
|
243
|
-
],
|
|
244
|
-
'camelcase': 'off',
|
|
245
|
-
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
246
|
-
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
247
|
-
'indent': 'off',
|
|
248
|
-
'@typescript-eslint/indent': ['warn', 'tab', {'SwitchCase': 1}],
|
|
249
|
-
'@typescript-eslint/member-delimiter-style': ['warn',
|
|
250
|
-
{
|
|
251
|
-
singleline: {
|
|
252
|
-
delimiter: 'semi',
|
|
253
|
-
requireLast: false
|
|
254
|
-
},
|
|
255
|
-
multiline: {
|
|
256
|
-
delimiter: 'semi',
|
|
257
|
-
requireLast: true
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
],
|
|
261
|
-
'@typescript-eslint/naming-convention': [
|
|
262
|
-
'error',
|
|
263
|
-
{
|
|
264
|
-
selector: 'variable',
|
|
265
|
-
modifiers: ['const'],
|
|
266
|
-
format: ['camelCase', 'UPPER_CASE'],
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
selector: 'variable',
|
|
270
|
-
format: ['camelCase'],
|
|
271
|
-
leadingUnderscore: 'allow',
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
selector: 'function',
|
|
275
|
-
format: ['camelCase'],
|
|
276
|
-
leadingUnderscore: 'allow',
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
selector: 'parameter',
|
|
280
|
-
format: ['camelCase'],
|
|
281
|
-
leadingUnderscore: 'allow',
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
selector: ['property', 'typeProperty'],
|
|
285
|
-
format: null,
|
|
286
|
-
},
|
|
287
|
-
/*
|
|
288
|
-
{
|
|
289
|
-
selector: 'parameterProperty',
|
|
290
|
-
format: ['camelCase'],
|
|
291
|
-
},
|
|
292
|
-
*/
|
|
293
|
-
{
|
|
294
|
-
selector: 'class',
|
|
295
|
-
format: ['PascalCase'],
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
selector: 'method',
|
|
299
|
-
format: ['camelCase'],
|
|
300
|
-
leadingUnderscore: 'allow',
|
|
301
|
-
},
|
|
302
|
-
/*
|
|
303
|
-
{
|
|
304
|
-
selector: 'accessor',
|
|
305
|
-
format: ['camelCase'],
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
selector: 'enumMember',
|
|
309
|
-
format: ['camelCase'],
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
selector: 'interface',
|
|
313
|
-
format: ['camelCase'],
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
selector: 'typeAlias',
|
|
317
|
-
format: ['camelCase'],
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
selector: 'enum',
|
|
321
|
-
format: ['camelCase'],
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
selector: 'typeParameter',
|
|
325
|
-
format: ['camelCase'],
|
|
326
|
-
},
|
|
327
|
-
*/
|
|
328
|
-
],
|
|
329
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
330
|
-
'@typescript-eslint/no-extraneous-class': 'warn',
|
|
331
|
-
'@typescript-eslint/no-inferrable-types': 'off',
|
|
332
|
-
'no-unused-vars': 'off',
|
|
333
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
334
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
|
|
335
|
-
'@typescript-eslint/no-useless-constructor': 'warn',
|
|
336
|
-
'@typescript-eslint/no-this-alias': [
|
|
337
|
-
'warn',
|
|
338
|
-
{
|
|
339
|
-
allowDestructuring: true,
|
|
340
|
-
allowedNames: ['that']
|
|
341
|
-
}
|
|
342
|
-
],
|
|
343
|
-
'@typescript-eslint/no-use-before-define': 'off',
|
|
344
|
-
'@typescript-eslint/prefer-interface': 'off',
|
|
345
|
-
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
346
|
-
}
|
|
347
|
-
};
|