remove harcoded module
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
@@ -204,7 +204,7 @@ module.exports = {
|
||||
if (specifier.emitProp && !specifier.emitComponent) {
|
||||
const replacement = `import { ${getNamedImportValue(
|
||||
specifier,
|
||||
)} } from '@material-ui/core/${specifier.componentValue}';`;
|
||||
)} } from '${node.source.value}/${specifier.componentValue}';`;
|
||||
replacements.push(replacement);
|
||||
}
|
||||
|
||||
@@ -213,9 +213,9 @@ module.exports = {
|
||||
replacements.push(
|
||||
`import ${
|
||||
specifier.componentAlias ?? specifier.componentValue
|
||||
}, { ${getNamedImportValue(
|
||||
specifier,
|
||||
)} } from '@material-ui/core/${specifier.componentValue}';`,
|
||||
}, { ${getNamedImportValue(specifier)} } from '${
|
||||
node.source.value
|
||||
}/${specifier.componentValue}';`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,5 +154,12 @@ import { styled, withStyles, alpha, duration } from '@material-ui/core/styles';`
|
||||
errors: [{ messageId: 'topLevelImport' }],
|
||||
output: `import { styled as s } from '@material-ui/core/styles';`,
|
||||
},
|
||||
{
|
||||
code: `import { TreeItem, TreeItemProps, TreeView, AlertProps } from '@material-ui/lab';`,
|
||||
errors: [{ messageId: 'topLevelImport' }],
|
||||
output: `import TreeItem, { TreeItemProps } from '@material-ui/lab/TreeItem';
|
||||
import TreeView from '@material-ui/lab/TreeView';
|
||||
import { AlertProps } from '@material-ui/lab/Alert';`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user