There is flag noUnusedLocals in tsconfig if it is set to true then it will give
an error if local variable is declared but never used
e.g.
const createKeyboard = (modelID: number) => {
const defaultModelID = 23;
return { type: "keyboard", modelID };
};
Here variable defaultModelID is declared but never used in code so we get error.
No comments:
Post a Comment