add noUnusedLocals to tsconfig

This commit is contained in:
Bowen Tan 2021-09-01 10:58:09 +08:00
parent fd3f27a9e9
commit 3563b0af25
2 changed files with 3 additions and 7 deletions

View File

@ -1,7 +1,6 @@
import { createTrait } from '@meta-ui/core';
import { Static, Type } from '@sinclair/typebox';
import { TraitImplementation } from '../../registry';
import { stateStore } from '../../store';
const HasInitializedMap = new Map<string, boolean>();
@ -17,7 +16,6 @@ const useStateTrait: TraitImplementation<{
if (!hasInitialized) {
mergeState({ [key]: initialValue });
const upperCaseKey = capitalizeFirstLetter(key);
const methods = {
setValue({ key, value }: KeyValue) {
mergeState({ [key]: value });
@ -35,10 +33,6 @@ const useStateTrait: TraitImplementation<{
};
};
function capitalizeFirstLetter(str: string) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
const KeyPropertySchema = Type.String();
const InitialValuePropertySchema = Type.Any();

View File

@ -13,7 +13,9 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react",
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["./src"]
}