Validates the compiler configuration options.
Rule Details
Section titled “Rule Details”React Compiler accepts various configuration options to control its behavior. This rule validates that your configuration uses correct option names and value types, preventing silent failures from typos or incorrect settings.
Invalid
Section titled “Invalid”Examples of incorrect code for this rule:
// ❌ Unknown option namemodule.exports = { plugins: [ ['babel-plugin-react-compiler', { compileMode: 'all' // Typo: should be compilationMode }] ]};
// ❌ Invalid option valuemodule.exports = { plugins: [ ['babel-plugin-react-compiler', { compilationMode: 'everything' // Invalid: use 'all' or 'infer' }] ]};Examples of correct code for this rule:
// ✅ Valid compiler configurationmodule.exports = { plugins: [ ['babel-plugin-react-compiler', { compilationMode: 'infer', panicThreshold: 'critical_errors' }] ]};Troubleshooting
Section titled “Troubleshooting”Configuration not working as expected
Section titled “Configuration not working as expected”Your compiler configuration might have typos or incorrect values:
// ❌ Wrong: Common configuration mistakesmodule.exports = { plugins: [ ['babel-plugin-react-compiler', { // Typo in option name compilationMod: 'all', // Wrong value type panicThreshold: true, // Unknown option optimizationLevel: 'max' }] ]};Check the configuration documentation for valid options:
// ✅ Better: Valid configurationmodule.exports = { plugins: [ ['babel-plugin-react-compiler', { compilationMode: 'all', // or 'infer' panicThreshold: 'none', // or 'critical_errors', 'all_errors' // Only use documented options }] ]};