Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
103 lines (101 loc) · 3.41 KB
/
Copy patheslint.config.mjs
File metadata and controls
103 lines (101 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import security from 'eslint-plugin-security';
import noUnsanitized from 'eslint-plugin-no-unsanitized';
export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{
ignores: [
'dist/**',
'coverage/**',
'node_modules/**',
'**/.vitepress/cache/**',
'public/**/*.min.js',
'vendor/**',
'bentopdf-pymupdf-wasm/**',
'libreoffice-wasm-package/**',
'bentopdf-airgap-bundle/**',
'public/pdfjs-viewer/**',
'public/pdfjs-annotation-viewer/**',
'public/coherentpdf.browser.min.js',
'public/libreoffice-wasm/**',
'public/workers/**',
],
},
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
security.configs.recommended,
noUnsanitized.configs.recommended,
{
rules: {
'no-unsanitized/method': 'warn',
'no-unsanitized/property': 'warn',
'security/detect-eval-with-expression': 'error',
'security/detect-new-buffer': 'error',
'security/detect-unsafe-regex': 'warn',
'security/detect-pseudoRandomBytes': 'error',
'security/detect-bidi-characters': 'error',
'security/detect-disable-mustache-escape': 'error',
'security/detect-possible-timing-attacks': 'off',
'security/detect-object-injection': 'off',
'security/detect-non-literal-fs-filename': 'off',
'security/detect-non-literal-regexp': 'off',
'security/detect-non-literal-require': 'off',
'security/detect-child-process': 'off',
'security/detect-no-csrf-before-method-override': 'off',
'security/detect-buffer-noassert': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unused-expressions': 'warn',
'no-redeclare': 'warn',
'no-constant-condition': 'warn',
'no-ex-assign': 'warn',
'no-empty': 'warn',
'no-case-declarations': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'no-func-assign': 'warn',
'no-fallthrough': 'warn',
'no-cond-assign': 'warn',
'no-irregular-whitespace': 'warn',
'no-prototype-builtins': 'warn',
'no-undef': 'warn',
'no-useless-escape': 'warn',
'no-unsafe-finally': 'warn',
'no-self-assign': 'warn',
'no-control-regex': 'warn',
'@typescript-eslint/no-require-imports': 'warn',
'getter-return': 'warn',
'no-constant-binary-expression': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'no-unused-private-class-members': 'warn',
'no-unreachable': 'warn',
'no-setter-return': 'warn',
'no-useless-catch': 'warn',
'valid-typeof': 'warn',
'no-sparse-arrays': 'warn',
'no-misleading-character-class': 'warn',
},
},
{
files: ['src/js/editcore/**/*.js'],
rules: {
'no-useless-assignment': 'off',
'security/detect-unsafe-regex': 'off',
'security/detect-object-injection': 'off',
'no-unsanitized/property': 'off',
'no-empty': 'off',
},
},
];