lots of TypeScript errors

Ouverte
#69 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
react-native, typescript
Domaine
build-system

Piste de recherche

Reproduisez l’échec avec yarn web, en séparant le conflit du plugin ESLint des diagnostics TypeScript. Examinez les fichiers node_modules/javascript-obfuscator/src/... signalés ainsi que tsconfig ou jsconfig ; le travail est terminé lorsque les erreurs de dépendances n’apparaissent plus lors de la compilation.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
...
Langage dominant
TypeScript
Étoiles
211
Forks
103
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de javascript-obfuscator/react-native-obfuscating-transformer

Toutes les issues de javascript-obfuscator/react-native-obfuscating-transformer

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.