import { FlatCompat } from "@eslint/eslintrc";
import path from "path";
import { fileURLToPath } from "url";
import ts from "@typescript-eslint/eslint-plugin";
import js from "@eslint/js";
import parser from "@typescript-eslint/parser";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
    baseDirectory: __dirname
});

export default [
  js.configs.recommended,
    ...compat.extends("plugin:@typescript-eslint/recommended"),
    ...compat.extends("prettier"),
  {
    ignores: [ "jest.config.js", "node_modules/*" ],
    files: [ "**/*.ts" ],
    languageOptions: {
      parser: parser,
    },
    plugins: { "@typescript-eslint": ts },
  }
];
