javascript-obfuscator 4.2.0 → 5.0.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/.eslintrc.js CHANGED
@@ -1,336 +1,292 @@
1
1
  module.exports = {
2
- "env": {
3
- "browser": true,
4
- "es6": true,
5
- "node": true
2
+ env: {
3
+ browser: true,
4
+ es6: true,
5
+ node: true
6
6
  },
7
- "parser": "@typescript-eslint/parser",
8
- "parserOptions": {
9
- "project": "src/tsconfig.node.json",
10
- "sourceType": "module"
7
+ parser: '@typescript-eslint/parser',
8
+ parserOptions: {
9
+ project: 'src/tsconfig.node.json',
10
+ sourceType: 'module'
11
11
  },
12
- "plugins": [
13
- "@typescript-eslint",
14
- "import",
15
- "jsdoc",
16
- "prefer-arrow",
17
- "unicorn"
18
- ],
19
- "rules": {
20
- "@typescript-eslint/adjacent-overload-signatures": "error",
21
- "@typescript-eslint/array-type": [
22
- "error",
12
+ plugins: ['@typescript-eslint', 'import', 'jsdoc', 'prefer-arrow', 'unicorn', 'prettier'],
13
+ extends: ['prettier'],
14
+ rules: {
15
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
16
+ '@typescript-eslint/array-type': [
17
+ 'error',
23
18
  {
24
- "default": "array"
19
+ default: 'array'
25
20
  }
26
21
  ],
27
- "@typescript-eslint/await-thenable": "error",
28
- "@typescript-eslint/ban-ts-comment": "error",
29
- "@typescript-eslint/ban-types": "off",
30
- "@typescript-eslint/brace-style": [
31
- "error",
32
- "1tbs",
22
+ '@typescript-eslint/await-thenable': 'error',
23
+ '@typescript-eslint/ban-ts-comment': 'error',
24
+ '@typescript-eslint/ban-types': 'off',
25
+ '@typescript-eslint/brace-style': 'off',
26
+ '@typescript-eslint/camelcase': 'off',
27
+ '@typescript-eslint/comma-spacing': 'error',
28
+ '@typescript-eslint/consistent-type-assertions': [
29
+ 'error',
33
30
  {
34
- "allowSingleLine": true
31
+ assertionStyle: 'angle-bracket'
35
32
  }
36
33
  ],
37
- "@typescript-eslint/camelcase": "off",
38
- "@typescript-eslint/comma-spacing": "error",
39
- "@typescript-eslint/consistent-type-assertions": [
40
- "error",
34
+ '@typescript-eslint/consistent-type-definitions': 'error',
35
+ '@typescript-eslint/default-param-last': 'error',
36
+ '@typescript-eslint/explicit-function-return-type': 'error',
37
+ '@typescript-eslint/explicit-member-accessibility': [
38
+ 'error',
41
39
  {
42
- "assertionStyle": "angle-bracket"
40
+ accessibility: 'explicit'
43
41
  }
44
42
  ],
45
- "@typescript-eslint/consistent-type-definitions": "error",
46
- "@typescript-eslint/default-param-last": "error",
47
- "@typescript-eslint/explicit-function-return-type": "error",
48
- "@typescript-eslint/explicit-member-accessibility": [
49
- "error",
43
+ '@typescript-eslint/explicit-module-boundary-types': 'error',
44
+ '@typescript-eslint/func-call-spacing': 'error',
45
+ '@typescript-eslint/indent': ['off', 4],
46
+ '@typescript-eslint/member-delimiter-style': [
47
+ 'error',
50
48
  {
51
- "accessibility": "explicit"
52
- }
53
- ],
54
- "@typescript-eslint/explicit-module-boundary-types": "error",
55
- "@typescript-eslint/func-call-spacing": "error",
56
- "@typescript-eslint/indent": [
57
- "off",
58
- 4
59
- ],
60
- "@typescript-eslint/member-delimiter-style": [
61
- "error",
62
- {
63
- "multiline": {
64
- "delimiter": "semi",
65
- "requireLast": true
49
+ multiline: {
50
+ delimiter: 'semi',
51
+ requireLast: true
66
52
  },
67
- "singleline": {
68
- "delimiter": "semi",
69
- "requireLast": false
53
+ singleline: {
54
+ delimiter: 'semi',
55
+ requireLast: false
70
56
  }
71
57
  }
72
58
  ],
73
- "@typescript-eslint/member-ordering": "error",
74
- "@typescript-eslint/naming-convention": [
75
- "error",
59
+ '@typescript-eslint/member-ordering': 'error',
60
+ '@typescript-eslint/naming-convention': [
61
+ 'error',
76
62
  {
77
- "selector": "default",
78
- "format": ["camelCase", "PascalCase"]
63
+ selector: 'default',
64
+ format: ['camelCase', 'PascalCase']
79
65
  },
80
66
  {
81
- "selector": "variable",
82
- "format": ["camelCase", "PascalCase", "UPPER_CASE"]
67
+ selector: 'variable',
68
+ format: ['camelCase', 'PascalCase', 'UPPER_CASE']
83
69
  },
84
70
  {
85
- "selector": "function",
86
- "format": ["camelCase", "PascalCase"]
71
+ selector: 'function',
72
+ format: ['camelCase', 'PascalCase']
87
73
  },
88
74
  {
89
- "selector": "class",
90
- "format": ["PascalCase"]
75
+ selector: 'class',
76
+ format: ['PascalCase']
91
77
  },
92
78
  {
93
- "selector": "interface",
94
- "format": ["PascalCase"],
95
- "prefix": ["I"]
79
+ selector: 'interface',
80
+ format: ['PascalCase'],
81
+ prefix: ['I']
96
82
  },
97
83
  {
98
- "selector": "typeAlias",
99
- "format": ["PascalCase"],
100
- "prefix": ["T"]
84
+ selector: 'typeAlias',
85
+ format: ['PascalCase'],
86
+ prefix: ['T']
101
87
  },
102
88
  {
103
- "selector": "typeParameter",
104
- "format": ["PascalCase"]
89
+ selector: 'typeParameter',
90
+ format: ['PascalCase']
105
91
  },
106
92
  {
107
- "selector": "enum",
108
- "format": ["PascalCase"]
93
+ selector: 'enum',
94
+ format: ['PascalCase']
109
95
  },
110
96
  {
111
- "selector": "enumMember",
112
- "format": null
97
+ selector: 'enumMember',
98
+ format: null
113
99
  },
114
100
  {
115
- "selector": "property",
116
- "format": ["camelCase", "PascalCase", "snake_case"]
101
+ selector: 'property',
102
+ format: ['camelCase', 'PascalCase', 'snake_case']
117
103
  }
118
104
  ],
119
- "@typescript-eslint/no-empty-function": "off",
120
- "@typescript-eslint/no-empty-interface": "error",
121
- "@typescript-eslint/no-explicit-any": "off",
122
- "@typescript-eslint/no-extra-parens": "off",
123
- "@typescript-eslint/no-floating-promises": "error",
124
- "@typescript-eslint/no-for-in-array": "error",
125
- "@typescript-eslint/no-inferrable-types": "off",
126
- "@typescript-eslint/no-magic-numbers": "off",
127
- "@typescript-eslint/no-misused-new": "error",
128
- "@typescript-eslint/no-namespace": "error",
129
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
130
- "@typescript-eslint/no-non-null-assertion": "error",
131
- "@typescript-eslint/no-param-reassign": "off",
132
- "@typescript-eslint/parameter-properties": "error",
133
- "@typescript-eslint/no-require-imports": "off",
134
- "@typescript-eslint/no-shadow": "error",
135
- "@typescript-eslint/no-this-alias": "error",
136
- "@typescript-eslint/no-unnecessary-qualifier": "error",
137
- "@typescript-eslint/no-unnecessary-type-arguments": "error",
138
- "@typescript-eslint/no-unnecessary-type-assertion": "error",
139
- "@typescript-eslint/no-unused-expressions": "error",
140
- "@typescript-eslint/no-use-before-define": "off",
141
- "@typescript-eslint/no-var-requires": "error",
142
- "@typescript-eslint/prefer-for-of": "error",
143
- "@typescript-eslint/prefer-function-type": "error",
144
- "@typescript-eslint/prefer-namespace-keyword": "error",
145
- "@typescript-eslint/prefer-nullish-coalescing": "error",
146
- "@typescript-eslint/prefer-optional-chain": "error",
147
- "@typescript-eslint/prefer-readonly": "error",
148
- "@typescript-eslint/promise-function-async": "error",
149
- "@typescript-eslint/quotes": [
150
- "error",
151
- "single"
152
- ],
153
- "@typescript-eslint/require-array-sort-compare": "error",
154
- "@typescript-eslint/restrict-plus-operands": "error",
155
- "@typescript-eslint/semi": [
156
- "error",
157
- "always"
158
- ],
159
- "@typescript-eslint/space-before-function-paren": "error",
160
- "@typescript-eslint/strict-boolean-expressions": "off",
161
- "@typescript-eslint/triple-slash-reference": "error",
162
- "@typescript-eslint/type-annotation-spacing": "error",
163
- "@typescript-eslint/typedef": "error",
164
- "@typescript-eslint/unified-signatures": "error",
165
- "arrow-body-style": "off",
166
- "arrow-parens": [
167
- "off",
168
- "as-needed"
169
- ],
170
- "brace-style": "off",
171
- "capitalized-comments": "off",
172
- "comma-dangle": "off",
173
- "comma-spacing": "off",
174
- "complexity": [
175
- "error",
105
+ '@typescript-eslint/no-empty-function': 'off',
106
+ '@typescript-eslint/no-empty-interface': 'error',
107
+ '@typescript-eslint/no-explicit-any': 'off',
108
+ '@typescript-eslint/no-extra-parens': 'off',
109
+ '@typescript-eslint/no-floating-promises': 'error',
110
+ '@typescript-eslint/no-for-in-array': 'error',
111
+ '@typescript-eslint/no-inferrable-types': 'off',
112
+ '@typescript-eslint/no-magic-numbers': 'off',
113
+ '@typescript-eslint/no-misused-new': 'error',
114
+ '@typescript-eslint/no-namespace': 'error',
115
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
116
+ '@typescript-eslint/no-non-null-assertion': 'off',
117
+ '@typescript-eslint/no-param-reassign': 'off',
118
+ '@typescript-eslint/parameter-properties': 'error',
119
+ '@typescript-eslint/no-require-imports': 'off',
120
+ '@typescript-eslint/no-shadow': 'error',
121
+ '@typescript-eslint/no-this-alias': 'error',
122
+ '@typescript-eslint/no-unnecessary-qualifier': 'error',
123
+ '@typescript-eslint/no-unnecessary-type-arguments': 'error',
124
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
125
+ '@typescript-eslint/no-unused-expressions': 'error',
126
+ '@typescript-eslint/no-use-before-define': 'off',
127
+ '@typescript-eslint/no-var-requires': 'error',
128
+ '@typescript-eslint/prefer-for-of': 'error',
129
+ '@typescript-eslint/prefer-function-type': 'error',
130
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
131
+ '@typescript-eslint/prefer-nullish-coalescing': 'error',
132
+ '@typescript-eslint/prefer-optional-chain': 'error',
133
+ '@typescript-eslint/prefer-readonly': 'error',
134
+ '@typescript-eslint/promise-function-async': 'error',
135
+ '@typescript-eslint/quotes': ['error', 'single', { avoidEscape: true }],
136
+ '@typescript-eslint/require-array-sort-compare': 'error',
137
+ '@typescript-eslint/restrict-plus-operands': 'error',
138
+ '@typescript-eslint/semi': ['error', 'always'],
139
+ '@typescript-eslint/space-before-function-paren': 'off',
140
+ '@typescript-eslint/strict-boolean-expressions': 'off',
141
+ '@typescript-eslint/triple-slash-reference': 'error',
142
+ '@typescript-eslint/type-annotation-spacing': 'error',
143
+ '@typescript-eslint/typedef': 'error',
144
+ '@typescript-eslint/unified-signatures': 'error',
145
+ 'arrow-body-style': 'off',
146
+ 'arrow-parens': ['off', 'as-needed'],
147
+ 'brace-style': 'off',
148
+ 'capitalized-comments': 'off',
149
+ 'comma-dangle': 'off',
150
+ 'comma-spacing': 'off',
151
+ 'complexity': [
152
+ 'error',
176
153
  {
177
- "max": 10
154
+ max: 10
178
155
  }
179
156
  ],
180
- "constructor-super": "error",
181
- "curly": "error",
182
- "default-case": "off",
183
- "dot-notation": "error",
184
- "eol-last": "error",
185
- "eqeqeq": [
186
- "error",
187
- "smart"
188
- ],
189
- "func-call-spacing": "off",
190
- "guard-for-in": "error",
191
- "id-blacklist": "off",
192
- "id-match": "off",
193
- "import/export": "error",
194
- "import/first": "error",
195
- "import/newline-after-import": "error",
196
- "import/no-absolute-path": "error",
197
- "import/no-cycle": "error",
198
- "import/no-default-export": "error",
199
- "import/no-deprecated": "error",
200
- "import/no-extraneous-dependencies": "error",
201
- "import/no-internal-modules": "error",
202
- "import/no-mutable-exports": "error",
203
- "import/no-unassigned-import": "off",
204
- "import/no-useless-path-segments": "error",
205
- "import/order": "off",
206
- "indent": "off",
207
- "jsdoc/no-types": "off",
208
- "linebreak-style": "off",
209
- "max-classes-per-file": [
210
- "error",
211
- 1
212
- ],
213
- "max-len": "off",
214
- "max-lines": [
215
- "error",
216
- 500
217
- ],
218
- "new-parens": "error",
219
- "newline-per-chained-call": "off",
220
- "no-bitwise": "off",
221
- "no-caller": "error",
222
- "no-cond-assign": "error",
223
- "no-console": [
224
- "error",
157
+ 'constructor-super': 'error',
158
+ 'curly': 'error',
159
+ 'default-case': 'off',
160
+ 'dot-notation': 'error',
161
+ 'eol-last': 'error',
162
+ 'eqeqeq': ['error', 'smart'],
163
+ 'func-call-spacing': 'off',
164
+ 'guard-for-in': 'error',
165
+ 'id-blacklist': 'off',
166
+ 'id-match': 'off',
167
+ 'import/export': 'error',
168
+ 'import/first': 'error',
169
+ 'import/newline-after-import': 'error',
170
+ 'import/no-absolute-path': 'error',
171
+ 'import/no-cycle': 'error',
172
+ 'import/no-default-export': 'error',
173
+ 'import/no-deprecated': 'error',
174
+ 'import/no-extraneous-dependencies': 'error',
175
+ 'import/no-internal-modules': 'error',
176
+ 'import/no-mutable-exports': 'error',
177
+ 'import/no-unassigned-import': 'off',
178
+ 'import/no-useless-path-segments': 'error',
179
+ 'import/order': 'off',
180
+ 'indent': 'off',
181
+ 'jsdoc/no-types': 'off',
182
+ 'linebreak-style': 'off',
183
+ 'max-classes-per-file': ['error', 1],
184
+ 'max-len': 'off',
185
+ 'max-lines': ['error', { max: 500, skipComments: true }],
186
+ 'new-parens': 'error',
187
+ 'newline-per-chained-call': 'off',
188
+ 'no-bitwise': 'off',
189
+ 'no-caller': 'error',
190
+ 'no-cond-assign': 'error',
191
+ 'no-console': [
192
+ 'error',
225
193
  {
226
- "allow": [
227
- "log",
228
- "warn",
229
- "dir",
230
- "timeLog",
231
- "assert",
232
- "clear",
233
- "count",
234
- "countReset",
235
- "group",
236
- "groupEnd",
237
- "table",
238
- "dirxml",
239
- "error",
240
- "groupCollapsed",
241
- "Console",
242
- "profile",
243
- "profileEnd",
244
- "timeStamp",
245
- "context"
194
+ allow: [
195
+ 'log',
196
+ 'warn',
197
+ 'dir',
198
+ 'timeLog',
199
+ 'assert',
200
+ 'clear',
201
+ 'count',
202
+ 'countReset',
203
+ 'group',
204
+ 'groupEnd',
205
+ 'table',
206
+ 'dirxml',
207
+ 'error',
208
+ 'groupCollapsed',
209
+ 'Console',
210
+ 'profile',
211
+ 'profileEnd',
212
+ 'timeStamp',
213
+ 'context'
246
214
  ]
247
215
  }
248
216
  ],
249
- "no-constant-condition": "error",
250
- "no-control-regex": "off",
251
- "no-debugger": "error",
252
- "no-duplicate-case": "error",
253
- "no-duplicate-imports": "error",
254
- "no-empty": "off",
255
- "no-eval": "off",
256
- "no-extra-bind": "error",
257
- "no-extra-parens": "off",
258
- "no-extra-semi": "error",
259
- "no-fallthrough": "error",
260
- "no-invalid-regexp": "error",
261
- "no-invalid-this": "off",
262
- "no-irregular-whitespace": "error",
263
- "no-magic-numbers": "off",
264
- "no-multi-str": "error",
265
- "no-multiple-empty-lines": "error",
266
- "no-new-wrappers": "error",
267
- "no-null/no-null": "off",
268
- "no-octal": "error",
269
- "no-octal-escape": "error",
270
- "no-redeclare": "error",
271
- "no-regex-spaces": "error",
272
- "no-restricted-syntax": [
273
- "error",
274
- "ForInStatement"
275
- ],
276
- "no-return-await": "error",
277
- "no-sequences": "error",
278
- "no-shadow": "off",
279
- "no-sparse-arrays": "error",
280
- "no-template-curly-in-string": "error",
281
- "no-throw-literal": "error",
282
- "no-trailing-spaces": [
283
- "error",
217
+ 'no-constant-condition': 'error',
218
+ 'no-control-regex': 'off',
219
+ 'no-debugger': 'error',
220
+ 'no-duplicate-case': 'error',
221
+ 'no-duplicate-imports': 'error',
222
+ 'no-empty': 'off',
223
+ 'no-eval': 'off',
224
+ 'no-extra-bind': 'error',
225
+ 'no-extra-parens': 'off',
226
+ 'no-extra-semi': 'error',
227
+ 'no-fallthrough': 'error',
228
+ 'no-invalid-regexp': 'error',
229
+ 'no-invalid-this': 'off',
230
+ 'no-irregular-whitespace': 'error',
231
+ 'no-magic-numbers': 'off',
232
+ 'no-multi-str': 'error',
233
+ 'no-multiple-empty-lines': 'error',
234
+ 'no-new-wrappers': 'error',
235
+ 'no-null/no-null': 'off',
236
+ 'no-octal': 'error',
237
+ 'no-octal-escape': 'error',
238
+ 'no-redeclare': 'error',
239
+ 'no-regex-spaces': 'error',
240
+ 'no-restricted-syntax': ['error', 'ForInStatement'],
241
+ 'no-return-await': 'error',
242
+ 'no-sequences': 'error',
243
+ 'no-shadow': 'off',
244
+ 'no-sparse-arrays': 'error',
245
+ 'no-template-curly-in-string': 'error',
246
+ 'no-throw-literal': 'error',
247
+ 'no-trailing-spaces': [
248
+ 'error',
284
249
  {
285
- "skipBlankLines": true
250
+ skipBlankLines: true
286
251
  }
287
252
  ],
288
- "no-undef-init": "error",
289
- "no-underscore-dangle": "off",
290
- "no-unsafe-finally": "error",
291
- "no-unused-expressions": "off",
292
- "no-unused-labels": "error",
293
- "no-var": "error",
294
- "no-void": "error",
295
- "object-shorthand": "off",
296
- "one-var": [
297
- "error",
298
- "never"
299
- ],
300
- "padding-line-between-statements": [
301
- "error",
253
+ 'no-undef-init': 'error',
254
+ 'no-underscore-dangle': 'off',
255
+ 'no-unsafe-finally': 'error',
256
+ 'no-unused-expressions': 'off',
257
+ 'no-unused-labels': 'error',
258
+ 'no-var': 'error',
259
+ 'no-void': 'error',
260
+ 'object-shorthand': 'off',
261
+ 'one-var': ['error', 'never'],
262
+ 'padding-line-between-statements': [
263
+ 'error',
302
264
  {
303
- "blankLine": "always",
304
- "prev": "*",
305
- "next": "return"
265
+ blankLine: 'always',
266
+ prev: '*',
267
+ next: 'return'
306
268
  }
307
269
  ],
308
- "prefer-arrow/prefer-arrow-functions": "off",
309
- "prefer-const": "error",
310
- "prefer-object-spread": "error",
311
- "prefer-template": "error",
312
- "quote-props": [
313
- "error",
314
- "as-needed"
315
- ],
316
- "quotes": "off",
317
- "radix": "error",
318
- "space-before-function-paren": "off",
319
- "spaced-comment": "error",
320
- "space-in-parens": [
321
- "error",
322
- "never"
323
- ],
324
- "unicorn/catch-error-name": [
325
- "error",
270
+ 'prefer-arrow/prefer-arrow-functions': 'off',
271
+ 'prefer-const': 'error',
272
+ 'prefer-object-spread': 'error',
273
+ 'prefer-template': 'error',
274
+ 'quote-props': ['off', 'as-needed'],
275
+ 'quotes': 'off',
276
+ 'radix': 'error',
277
+ 'space-before-function-paren': 'off',
278
+ 'spaced-comment': 'error',
279
+ 'space-in-parens': ['error', 'never'],
280
+ 'unicorn/catch-error-name': [
281
+ 'error',
326
282
  {
327
- "name": "error"
283
+ name: 'error'
328
284
  }
329
285
  ],
330
- "unicorn/no-nested-ternary": "error",
331
- "unicorn/no-unreadable-array-destructuring": "error",
332
- "unicorn/numeric-separators-style": [
333
- "error",
286
+ 'unicorn/no-nested-ternary': 'off',
287
+ 'unicorn/no-unreadable-array-destructuring': 'error',
288
+ 'unicorn/numeric-separators-style': [
289
+ 'error',
334
290
  {
335
291
  number: {
336
292
  minimumDigits: 7,
@@ -338,15 +294,15 @@ module.exports = {
338
294
  }
339
295
  }
340
296
  ],
341
- "unicorn/prefer-array-find": "error",
342
- "unicorn/prefer-includes": "error",
343
- "unicorn/prefer-optional-catch-binding": "error",
344
- "unicorn/prefer-starts-ends-with": "error",
345
- "unicorn/prefer-set-has": "error",
346
- "unicorn/prefer-string-slice": "error",
347
- "unicorn/prefer-string-trim-start-end": "error",
348
- "use-isnan": "error",
349
- "valid-typeof": "error",
350
- "yoda": "error"
297
+ 'unicorn/prefer-array-find': 'error',
298
+ 'unicorn/prefer-includes': 'error',
299
+ 'unicorn/prefer-optional-catch-binding': 'error',
300
+ 'unicorn/prefer-starts-ends-with': 'error',
301
+ 'unicorn/prefer-set-has': 'error',
302
+ 'unicorn/prefer-string-slice': 'error',
303
+ 'unicorn/prefer-string-trim-start-end': 'error',
304
+ 'use-isnan': 'error',
305
+ 'valid-typeof': 'error',
306
+ 'yoda': 'error'
351
307
  }
352
308
  };