|
| 1 | +import { defineConfig } from "eslint/config"; |
| 2 | +import magentoCodingStandardEslintPlugin from "magento-coding-standard-eslint-plugin"; |
| 3 | +import path from "node:path"; |
| 4 | +import { fileURLToPath } from "node:url"; |
| 5 | +import js from "@eslint/js"; |
| 6 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 7 | + |
| 8 | +const __filename = fileURLToPath(import.meta.url); |
| 9 | +const __dirname = path.dirname(__filename); |
| 10 | +const compat = new FlatCompat({ |
| 11 | + baseDirectory: __dirname, |
| 12 | + recommendedConfig: js.configs.recommended, |
| 13 | + allConfig: js.configs.all |
| 14 | +}); |
| 15 | +export default defineConfig([{ |
| 16 | + plugins: { |
| 17 | + "magento-coding-standard-eslint-plugin": magentoCodingStandardEslintPlugin, // This is in flat config format (object) |
| 18 | + }, |
| 19 | + rules: { |
| 20 | + "magento-coding-standard-eslint-plugin/jquery-no-andSelf": "warn", |
| 21 | + "magento-coding-standard-eslint-plugin/jquery-no-bind-unbind": "warn", |
| 22 | + "magento-coding-standard-eslint-plugin/jquery-no-delegate-undelegate": "warn", |
| 23 | + "magento-coding-standard-eslint-plugin/jquery-no-deprecated-expr": "warn", |
| 24 | + "magento-coding-standard-eslint-plugin/jquery-no-event-shorthand": "warn", |
| 25 | + "magento-coding-standard-eslint-plugin/jquery-no-input-event-shorthand": "warn", |
| 26 | + "magento-coding-standard-eslint-plugin/jquery-no-misc-deprecated-functions": "warn", |
| 27 | + "magento-coding-standard-eslint-plugin/jquery-no-size": "warn", |
| 28 | + "magento-coding-standard-eslint-plugin/jquery-no-trim": "warn", |
| 29 | + }, |
| 30 | +}]); |
0 commit comments