|
| 1 | +"use strict"; |
| 2 | + |
| 3 | +const { |
| 4 | + defineConfig, |
| 5 | + globalIgnores, |
| 6 | +} = require("eslint/config"); |
| 7 | + |
| 8 | +const globals = require("globals"); |
| 9 | +const html = require("eslint-plugin-html"); |
| 10 | +const phpMarkup = require("eslint-plugin-php-markup"); |
| 11 | +const js = require("@eslint/js"); |
| 12 | + |
| 13 | +const { |
| 14 | + FlatCompat, |
| 15 | +} = require("@eslint/eslintrc"); |
| 16 | + |
| 17 | +const compat = new FlatCompat({ |
| 18 | + baseDirectory: __dirname, |
| 19 | + recommendedConfig: js.configs.recommended, |
| 20 | + allConfig: js.configs.all |
| 21 | +}); |
| 22 | + |
| 23 | +module.exports = defineConfig([{ |
| 24 | + languageOptions: { |
| 25 | + globals: { |
| 26 | + ...globals.browser, |
| 27 | + }, |
| 28 | + }, |
| 29 | + |
| 30 | + extends: compat.extends("google"), |
| 31 | + |
| 32 | + plugins: { |
| 33 | + html, |
| 34 | + "php-markup": phpMarkup, |
| 35 | + }, |
| 36 | + |
| 37 | + "rules": { |
| 38 | + "no-invalid-this": "off", |
| 39 | + "camelcase": "off", |
| 40 | + "comma-dangle": "off", |
| 41 | + "guard-for-in": "off", |
| 42 | + "max-len": "off", |
| 43 | + |
| 44 | + "new-cap": ["error", { |
| 45 | + capIsNewExceptions: ["Error", "Warning", "Debug", "Polygon_calcArea", "Play", "Stop", "Panzoom"], |
| 46 | + newIsCapExceptionPattern: "^Asset..", |
| 47 | + }], |
| 48 | + |
| 49 | + "no-array-constructor": "off", |
| 50 | + |
| 51 | + "no-unused-vars": ["error", { |
| 52 | + "vars": "local", |
| 53 | + "args": "none", |
| 54 | + "ignoreRestSiblings": false, |
| 55 | + }], |
| 56 | + |
| 57 | + "no-var": "off", |
| 58 | + "prefer-rest-params": "off", |
| 59 | + "quotes": "off", |
| 60 | + "require-jsdoc": "off", |
| 61 | + "spaced-comment": "off", |
| 62 | + }, |
| 63 | + |
| 64 | + "settings": { |
| 65 | + "php/php-extensions": [".php"], |
| 66 | + |
| 67 | + "php/markup-replacement": { |
| 68 | + "php": "", |
| 69 | + "=": "0", |
| 70 | + }, |
| 71 | + |
| 72 | + "php/keep-eol": false, |
| 73 | + "php/remove-whitespace": false, |
| 74 | + "php/remove-empty-line": false, |
| 75 | + "php/remove-php-lint": false, |
| 76 | + }, |
| 77 | +}, { |
| 78 | + files: ["**/*.*php"], |
| 79 | + |
| 80 | + "rules": { |
| 81 | + "eol-last": "off", |
| 82 | + "indent": "off", |
| 83 | + }, |
| 84 | +}, globalIgnores([ |
| 85 | + "**/*.min.js", |
| 86 | + "web/api/lib", |
| 87 | + "web/includes/csrf/", |
| 88 | + "web/js/videojs.zoomrotate.js", |
| 89 | + "web/js/video-stream.js", |
| 90 | + "web/js/video-rtc.js", |
| 91 | + "web/js/fontfaceobserver.standalone.js", |
| 92 | + "web/skins/classic/js/bootstrap-4.5.0.js", |
| 93 | + "web/skins/classic/js/bootstrap.bundle.min.js", |
| 94 | + "web/skins/classic/js/bootstrap-table-1.23.5", |
| 95 | + "web/skins/classic/js/chosen", |
| 96 | + "web/skins/classic/js/dateTimePicker", |
| 97 | + "web/skins/classic/js/jquery-*.js", |
| 98 | + "web/skins/classic/js/jquery-ui-*", |
| 99 | + "web/skins/classic/js/jquery.js", |
| 100 | + "web/skins/classic/js/moment.js", |
| 101 | + "web/skins/classic/js/video.js", |
| 102 | + "web/skins/classic/assets", |
| 103 | + "web/js/janus.js", |
| 104 | + "web/js/ajaxQueue.js", |
| 105 | + "web/js/hls-1.5.20/", |
| 106 | + "web/js/noUiSlider-15.8.1/", |
| 107 | + "web/js/dms.js", |
| 108 | + "web/skins/classic/includes/export_functions.php", |
| 109 | + "web/skins/classic/views/events.php", |
| 110 | +])]); |
0 commit comments