const path = require('path');

module.exports = {
  root: true,
  extends: '@react-native',
  parserOptions: {
    ecmaVersion: 2021,
    sourceType: 'module',
    requireConfigFile: false,
    ecmaFeatures: {
      jsx: true,
    },
    babelOptions: {
      configFile: path.resolve(__dirname, 'babel.config.js'),
    },
  },
  env: {
    'react-native/react-native': true,
    es2021: true,
    node: true,
  },
  overrides: [
    {
      files: ['*.js', '*.jsx'],
      parserOptions: {
        requireConfigFile: false,
        ecmaFeatures: {
          jsx: true,
        },
        babelOptions: {
          configFile: path.resolve(__dirname, 'babel.config.js'),
        },
      },
    },
  ],
};
