/* eslint-disable import/extensions */
/**
 * ESLint config for projects using @shopify/shop-minis-react
 * @fileoverview Recommended ESLint configuration for Shop Minis apps
 *
 * This config uses ESLint flat config format (supported in ESLint 8.57+)
 */

// Import the plugin directly so consumers don't need to install it separately
const shopMinisPlugin = require('./index.cjs')

module.exports = {
  files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
  languageOptions: {
    parser: require('@typescript-eslint/parser'),
    ecmaVersion: 'latest',
    sourceType: 'module',
    parserOptions: {
      ecmaFeatures: {
        jsx: true,
      },
    },
  },
  plugins: {
    'shop-minis': shopMinisPlugin,
  },
  rules: {
    'shop-minis/no-internal-imports': 'error',
    'shop-minis/prefer-sdk-components': 'warn',
    'shop-minis/validate-manifest': 'error',
  },
}
