Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] ensure stable plugin reference with flat configs
The previous use of spread meant that ```ts import jsxA11y from 'eslint-plugin-jsx-a11y'; jsxA11y !== jsxA11y.flatConfigs.recommended.plugins['jsx-a11y'] ``` This is a problem because if someone does something like this ```js import jsxA11y from 'eslint-plugin-jsx-a11y'; export default [ { plugins: { 'jsx-a11y': jsxA11y } }, jsxA11y.flatConfigs.recommended, ]; ``` then ESLint will crash with the error `Config "jsx-a11y/recommended": Key "plugins": Cannot redefine plugin "jsx-a11y".` This PR fixes that by using `Object.assign` to mutate the `jsxA11y` object and maintain referential equality.
- Loading branch information