for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
function getSimpleType(type) {
switch (type) {
case 'ExportDefaultSpecifier':
return 'default';
default:
return 'named';
}
module.exports = (declarations, resolve) => {
resolve
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.
const exps = [];
declarations.forEach(node => {
const specifiers = node.specifiers || [];
specifiers.forEach(specifier => {
exps.push({
type: getSimpleType(specifier.type),
name: specifier.local.name,
exportedName: (specifier.exported || specifier.local).name,
});
return exps;
};
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.