File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
18
18
- [ ` no-unused-modules ` ] : provide more meaningful error message when no .eslintrc is present ([ #3116 ] , thanks [ @michaelfaith ] )
19
19
- configs: added missing name attribute for eslint config inspector ([ #3151 ] , thanks [ @NishargShah ] )
20
20
- [ ` order ` ] : ensure arcane imports do not cause undefined behavior ([ #3128 ] , thanks [ @Xunnamius ] )
21
+ - [ ` order ` ] : resolve undefined property access issue when using ` named ` ordering ([ #3166 ] , thanks [ @Xunnamius ] )
21
22
22
23
### Changed
23
24
- [ Docs] [ ` extensions ` ] , [ ` order ` ] : improve documentation ([ #3106 ] , thanks [ @Xunnamius ] )
@@ -1173,6 +1174,7 @@ for info on changes for earlier releases.
1173
1174
1174
1175
[ `memo-parser` ] : ./memo-parser/README.md
1175
1176
1177
+ [ #3166 ] : https://github.com/import-js/eslint-plugin-import/pull/3166
1176
1178
[ #3151 ] : https://github.com/import-js/eslint-plugin-import/pull/3151
1177
1179
[ #3138 ] : https://github.com/import-js/eslint-plugin-import/pull/3138
1178
1180
[ #3129 ] : https://github.com/import-js/eslint-plugin-import/pull/3129
Original file line number Diff line number Diff line change @@ -1219,7 +1219,9 @@ module.exports = {
1219
1219
if ( node . right . type === 'ObjectExpression' ) {
1220
1220
for ( let i = 0 ; i < node . right . properties . length ; i ++ ) {
1221
1221
if (
1222
- node . right . properties [ i ] . key . type !== 'Identifier'
1222
+ ! node . right . properties [ i ] . key
1223
+ || node . right . properties [ i ] . key . type !== 'Identifier'
1224
+ || ! node . right . properties [ i ] . value
1223
1225
|| node . right . properties [ i ] . value . type !== 'Identifier'
1224
1226
) {
1225
1227
return ;
Original file line number Diff line number Diff line change @@ -3944,6 +3944,18 @@ context('TypeScript', function () {
3944
3944
} ,
3945
3945
] ,
3946
3946
} ) ,
3947
+ // Ensure the rule doesn't choke and die when right-hand-side AssignmentExpression properties lack a "key" attribute (e.g. SpreadElement)
3948
+ test ( {
3949
+ code : `
3950
+ // https://prettier.io/docs/en/options.html
3951
+
3952
+ module.exports = {
3953
+ ...require('@xxxx/.prettierrc.js'),
3954
+ };
3955
+ ` ,
3956
+ ...parserConfig ,
3957
+ options : [ { named : { enabled : true } } ] ,
3958
+ } ) ,
3947
3959
// Option: sortTypesGroup: true and newlines-between-types: 'always-and-inside-groups' and consolidateIslands: 'inside-groups'
3948
3960
test ( {
3949
3961
code : `
You can’t perform that action at this time.
0 commit comments