mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
fix: add strict types to build scripts and remove all any usage
Replace all implicit and explicit any types in build scripts with proper TypeScript Compiler API types (Decorator, ClassDeclaration, MethodDeclaration, Identifier, SourceFile, etc.). Add PackageJson and InjectableClassEntry interfaces. Fix return types, null checks, and type assertions throughout all transformer scripts.
This commit is contained in:
@@ -23,7 +23,7 @@ export const EMIT_PATH = resolve(ROOT, 'injectable-classes.json');
|
||||
*/
|
||||
export function extractInjectables() {
|
||||
return (ctx: TransformationContext) => {
|
||||
return (tsSourceFile) => {
|
||||
return (tsSourceFile: any) => {
|
||||
if (tsSourceFile.fileName.indexOf('src/@awesome-cordova-plugins/plugins') > -1) {
|
||||
visitEachChild(
|
||||
tsSourceFile,
|
||||
@@ -36,7 +36,7 @@ export function extractInjectables() {
|
||||
if (isInjectable) {
|
||||
injectableClasses.push({
|
||||
file: tsSourceFile.path,
|
||||
className: (node as ClassDeclaration).name.text,
|
||||
className: (node as ClassDeclaration).name!.text,
|
||||
dirName: tsSourceFile.path.split(/[\\\/]+/).reverse()[1],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user