lots of TypeScript errors

未关闭
#69 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
react-native, typescript
领域
build-system

调研方向

使用 yarn web 重现失败,并将 ESLint 插件冲突与 TypeScript 诊断分开处理。检查报告中的 node_modules/javascript-obfuscator/src/... 文件以及 tsconfig 或 jsconfig;编译期间不再出现依赖项错误即表示完成。

由索引模型根据 Issue 内容生成。

描述

I'm experiencing many TypeScript errors (I cropped the cmd output).
As pointed out in https://github.com/microsoft/TypeScript/issues/40426 , you can not disable type checking on *.ts files from packages in node_modules, only on *.d.ts files.
Can the files be changed from *.ts files to *.d.ts files?

C:\project>yarn web
override webpack with config-overrides.js
(node:8468) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:8468) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
Failed to compile.

[eslint] Plugin "react" was conflicted between ".eslintrc.js » @react-native-community/eslint-config" and "BaseConfig » C:\project\node_modules\react-scripts\node_modules\eslint-config-react-app\base.js".
ERROR in [eslint] Plugin "react" was conflicted between ".eslintrc.js » @react-native-community/eslint-config" and "BaseConfig » C:\project\node_modules\react-scripts\node_modules\eslint-config-react-app\base.js".

webpack compiled with 1 error
ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/AbstractCalleeDataExtractor.ts:9:23
TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.
     7 |
     8 | @injectable()
  >  9 | export abstract class AbstractCalleeDataExtractor implements ICalleeDataExtractor {
       |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    10 |     /**
    11 |      * @param {Node[]} blockScopeBody
    12 |      * @param {Node} callee

ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts:13:14
TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.
    11 |
    12 | @injectable()
  > 13 | export class FunctionDeclarationCalleeDataExtractor extends AbstractCalleeDataExtractor {
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    14 |     /**
    15 |      * @param {NodeGuards[]} blockScopeBody
    16 |      * @param {Identifier} callee

ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionDeclarationCalleeDataExtractor.ts:49:67
TS18047: 'node.id' is possibly 'null'.
    47 |         estraverse.traverse(targetNode, {
    48 |             enter: (node: ESTree.Node): any => {
  > 49 |                 if (NodeGuards.isFunctionDeclarationNode(node) && node.id.name === name) {
       |                                                                   ^^^^^^^
    50 |                     calleeBlockStatement = node.body;
    51 |
    52 |                     return estraverse.VisitorOption.Break;

ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts:13:14
TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.
    11 |
    12 | @injectable()
  > 13 | export class FunctionExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor {
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    14 |     /**
    15 |      * @param {NodeGuards[]} blockScopeBody
    16 |      * @param {Identifier} callee

ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/FunctionExpressionCalleeDataExtractor.ts:30:43
TS2339: Property 'body' does not exist on type 'never'.
  The intersection 'Identifier & FunctionExpression' was reduced to 'never' because property 'type' has conflicting types in some constituents.
    28 |
    29 |         if (NodeGuards.isFunctionExpressionNode(callee)) {
  > 30 |             calleeBlockStatement = callee.body;
       |                                           ^^^^
    31 |         }
    32 |
    33 |         if (!calleeBlockStatement) {

ERROR in node_modules/javascript-obfuscator/src/analyzers/stack-trace-analyzer/callee-data-extractors/ObjectExpressionCalleeDataExtractor.ts:15:14
TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.
    13 |
    14 | @injectable()
  > 15 | export class ObjectExpressionCalleeDataExtractor extends AbstractCalleeDataExtractor {
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    16 |     /**
    17 |      * @param {NodeGuards[]} blockScopeBody
    18 |      * @param {MemberExpression} callee
...
主要语言
TypeScript
星标
211
派生
103
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

javascript-obfuscator/react-native-obfuscating-transformer 的其他 Issue

查看 javascript-obfuscator/react-native-obfuscating-transformer 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。