Skip to content

Commit f23a338

Browse files
committed
rename variables to be more descriptive in import specifiers handling
1 parent 67c4b45 commit f23a338

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

rules/import-style.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -247,24 +247,24 @@ const create = context => {
247247
let importedNames = [];
248248
if (node.type === 'ImportDeclaration') {
249249
importedNames = node.specifiers
250-
.filter(s => s.type === 'ImportSpecifier' || s.type === 'ImportDefaultSpecifier')
251-
.map(s => ({
252-
localName: s.local.name,
253-
importedName: s.type === 'ImportDefaultSpecifier' ? 'default' : s.imported.name,
250+
.filter(specifier => specifier.type === 'ImportSpecifier' || specifier.type === 'ImportDefaultSpecifier')
251+
.map(specifier => ({
252+
localName: specifier.local.name,
253+
importedName: specifier.type === 'ImportDefaultSpecifier' ? 'default' : specifier.imported.name,
254254
}));
255255
} else if (node.type === 'VariableDeclarator' && node.id.type === 'ObjectPattern') {
256256
importedNames = node.id.properties
257-
.map(p => {
258-
if (p.type === 'RestElement') {
257+
.map(property => {
258+
if (property.type === 'RestElement') {
259259
return {
260-
localName: p.argument.name,
260+
localName: property.argument.name,
261261
importedName: undefined,
262262
};
263263
}
264264

265265
return {
266-
localName: p.value.name,
267-
importedName: p.key.name,
266+
localName: property.value.name,
267+
importedName: property.key.name,
268268
};
269269
});
270270
}

0 commit comments

Comments
 (0)