diff --git a/__tests__/index-test.js b/__tests__/index-test.js index f8bbe538..fcd45e0c 100644 --- a/__tests__/index-test.js +++ b/__tests__/index-test.js @@ -38,3 +38,12 @@ test('schemas', (t) => { t.end(); }); + +test('plugin referentially equal to prevent flat config issues', (t) => { + const keys = Object.keys(plugin.flatConfigs); + for (let i = 0; i < keys.length; i += 1) { + const config = plugin.flatConfigs[keys[i]]; + t.equal(plugin, config.plugins['jsx-a11y'], `${config.name}'s plugin reference is referentially equal to the top-level export`); + } + t.end(); +}); diff --git a/src/index.js b/src/index.js index 2fa185fa..980081e6 100644 --- a/src/index.js +++ b/src/index.js @@ -317,4 +317,4 @@ const flatConfigs = { strict: createConfig(strictRules, 'strict'), }; -module.exports = { ...jsxA11y, configs, flatConfigs }; +module.exports = Object.assign(jsxA11y, { configs, flatConfigs });