Commit 53ca775
[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.1 parent d32edac commit 53ca775
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
0 commit comments