93 lines
3.1 KiB
JavaScript
93 lines
3.1 KiB
JavaScript
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',
|
|
},
|
|
},
|
|
];
|