import pluginJs from '@eslint/js';
import pluginReact from 'eslint-plugin-react';
import globals from 'globals';

export default [
  { files: ['backend/views/src/**/*.{js,mjs,cjs,jsx}'] },
  { ignores: ['assets', '*.config.js'] },
  { languageOptions: { globals: { ...globals.browser, CPBW: 'readonly', wp: 'readonly' } } },
  pluginJs.configs.recommended,
  pluginReact.configs.flat.recommended,
  {
    settings: {
      react: {
        version: 'detect',
      },
    },

    rules: {
      'react/react-in-jsx-scope': 'off',
      'react/prop-types': 'off',
      'no-console': 'warn',
    },
  },
];
