{
  "env": {
    "browser": true,
    "jquery": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 2018
  },
  "plugins": ["compat"],
  "rules": {
    "compat/compat": "error"
  },
  "overrides": [
    {
      "files": [
        "src/js/bootstrapper/*.js"
      ],
      "rules": {
        "no-console": "off"
      }
    },
    {
      "files": ["*.ts", "*.tsx"],
      "parser": "@typescript-eslint/parser",
      "plugins": ["@typescript-eslint", "@angular-eslint/eslint-plugin"],
      "parserOptions": {
        "createDefaultProgram": true
      },
      "rules": {
        "@angular-eslint/component-class-suffix": "error",
        "@angular-eslint/contextual-lifecycle": "error",
        "@angular-eslint/directive-class-suffix": "error",
        "@angular-eslint/no-conflicting-lifecycle": "error",
        "@angular-eslint/no-host-metadata-property": "error",
        "@angular-eslint/no-input-rename": "error",
        "@angular-eslint/no-inputs-metadata-property": "error",
        "@angular-eslint/no-output-native": "error",
        "@angular-eslint/no-output-rename": "error",
        "@angular-eslint/no-outputs-metadata-property": "error",
        "@angular-eslint/use-lifecycle-interface": "warn",
        "@angular-eslint/use-pipe-transform-interface": "error",

        "no-console": "off",
        "no-restricted-syntax": "off",
        // Prevent TypeScript-specific constructs from being erroneously flagged as unused
        "no-unused-vars": "off",
        "@typescript-eslint/no-unused-vars": "error",
        // Require a specific member delimiter style for interfaces and type literals
        // Default Semicolon style
        "@typescript-eslint/member-delimiter-style": "error",
        "@typescript-eslint/ban-ts-comment": "error",
        "quote-props": ["error", "as-needed"]
      }
    },
    {
      "files": ["*.spec.ts"],
      "parser": "@typescript-eslint/parser",
      "plugins": ["@typescript-eslint"],
      "rules": {
        // allow ts-comments in unit tests
        "@typescript-eslint/ban-ts-comment": "off"
      }
    },
    {
      "files": ["*.component.html"],
      "parser": "@angular-eslint/template-parser",
      "plugins": ["@angular-eslint/eslint-plugin-template"],
      "extends": ["plugin:@angular-eslint/template/recommended"],
      "rules": {
        "indent": "off", // this rule throws an error in eslint itself
        "max-len": "off"
      }
    },
    {
      "files": ["src/js/enketo/widgets/*.js"],
      "rules": {
        "no-inner-declarations": "off"
      }
    }
  ]
}
