// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

{
  "root": true,
  "ignorePatterns": ["projects/**/*"],
  "overrides": [
    {
      "files": ["*.ts"],
      "parser": "@typescript-eslint/parser",
      "parserOptions": {
        "project": ["tsconfig.json"],
        "createDefaultProgram": true
      },
      "extends": [
        "plugin:@angular-eslint/recommended",
        "plugin:@angular-eslint/template/process-inline-templates",
        "plugin:rxjs/recommended"
      ],
      "rules": {
        "@angular-eslint/component-selector": [
          "error",
          {
            "type": "element",
            "prefix": "texera",
            "style": "kebab-case"
          }
        ],
        "@angular-eslint/directive-selector": [
          "error",
          {
            "type": "attribute",
            "prefix": "texera",
            "style": "camelCase"
          }
        ],
        "@angular-eslint/prefer-standalone": "off",
        "@angular-eslint/prefer-inject": "off",
        "@typescript-eslint/consistent-type-definitions": "off",
        "@typescript-eslint/dot-notation": "off",
        "@typescript-eslint/explicit-member-accessibility": [
          "off",
          {
            "accessibility": "explicit"
          }
        ],
        "brace-style": ["error", "1tbs"],
        "dot-notation": "off",
        "id-blacklist": "off",
        "id-match": "off",
        "indent": "off",
        "no-empty-function": "off",
        "no-shadow": "off",
        "no-underscore-dangle": "off",
        "no-unused-expressions": "error",
        "quotes": ["error", "double", { "avoidEscape": true }],
        "rxjs-angular/prefer-takeuntil": [
          "error",
          {
            "alias": ["untilDestroyed"],
            "checkComplete": true,
            "checkDecorators": ["Component"],
            "checkDestroy": false
          }
        ],
        "rxjs/no-unsafe-takeuntil": [
          "error",
          {
            "alias": ["untilDestroyed"]
          }
        ],
        "rxjs/no-nested-subscribe": "off",
        "rxjs/no-sharereplay": "off",
        "rxjs/no-unsafe-subject-next": "off",
        "rxjs/no-index": "error",
        "rxjs/no-internal": "error",
        "rxjs/no-compat": "error"
      },
      "plugins": ["rxjs-angular"]
    },
    {
      "files": ["*.html"],
      "extends": ["plugin:@angular-eslint/template/recommended"],
      "rules": {
        "@angular-eslint/template/prefer-control-flow": "off"
      }
    },
    {
      "files": ["*.html"],
      "excludedFiles": ["*inline-template-*.component.html"],
      "extends": [],
      "rules": {
        "@angular-eslint/template/prefer-control-flow": "off"
      }
    }
  ]
}
