module.exports = {
  env: {
    browser: true,
    es2021: true
  },
  extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:storybook/recommended"],
  parser: "@typescript-eslint/parser",
  parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module"
  },
  plugins: ["svelte3", "@typescript-eslint"],
  overrides: [{
    files: ["*.svelte"],
    processor: "svelte3/svelte3"
  }],
  rules: {
    "@typescript-eslint/no-unused-vars": ["warn", {
      argsIgnorePattern: "^_",
      varsIgnorePattern: "^_"
    }],
    "no-console": ["error", {
      allow: ["debug", "warn", "error"]
    }]
  },
  settings: {
    "svelte3/typescript": true,
    // load TypeScript as peer dependency
    "svelte3/ignore-warnings": w => w.code == "unused-export-let"
  },
  globals: {
    NodeJS: true
  }
};