JS: Remove invalid syntax from test

TS decorators may not appear on functions and enums
This commit is contained in:
Asger F
2025-02-11 15:24:16 +01:00
parent 426a871405
commit 287753187e
2 changed files with 3 additions and 11 deletions

View File

@@ -1,7 +1,5 @@
#select
| Babelrc/importPragma.jsx:2:1:2:27 | import ... react'; | Unused import q. |
| decorated.ts:1:1:1:126 | import ... where'; | Unused import actionHandler. |
| decorated.ts:4:10:4:12 | fun | Unused function fun. |
| eval.js:10:9:10:24 | not_used_by_eval | Unused variable not_used_by_eval. |
| eval.js:19:9:19:24 | not_used_by_eval | Unused variable not_used_by_eval. |
| externs.js:5:5:5:13 | iAmUnused | Unused variable iAmUnused. |

View File

@@ -1,13 +1,7 @@
import {actionHandler, actionHandlerFactory, actionHandlerFactoryProvider, actionHandlerFactoryProviderKind} from 'somewhere'; // OK - imports used as decorators
@actionHandler
function fun() {} // OK - decorator might use the function
import { actionHandlerFactory, actionHandlerFactoryProvider } from 'somewhere'; // OK - imports used as decorators
@actionHandlerFactory
class Class {} // OK - decorator might use the class
class Class { } // OK - decorator might use the class
@actionHandlerFactoryProvider
export class ExportedClass {} // OK - decorator might use the class
@actionHandlerFactoryProviderKind
enum Enum { plain } // OK - decorator might use the enum
export class ExportedClass { } // OK - decorator might use the class