import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [
  {
    files: ["src/**/*.ts"],
    ignores: ["src/tests/**/*", "src/__generated__/**/*", "src/taxRates.ts"],
    languageOptions: {
      parser: tsParser,
      parserOptions: { project: "./tsconfig.json" }
    },
    plugins: { "@typescript-eslint": tsPlugin },
    rules: {
      "@typescript-eslint/no-explicit-any": "error",
      "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
      "@typescript-eslint/naming-convention": [
        "error",
        { selector: "function", format: ["camelCase"] },
        { selector: "variable", format: ["camelCase", "UPPER_CASE"] },
        { selector: "typeLike", format: ["PascalCase"] }
      ],
      "max-len": ["error", { code: 140, ignoreStrings: true, ignoreTemplateLiterals: true }],
      "no-console": "error",
      "semi": ["error", "always"],
      "indent": ["error", 2, { "SwitchCase": 1 }],
      "prefer-const": "error"
    }
  }
];
