Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error linting typescript file #4

Closed
alisnic opened this issue Jan 26, 2024 · 5 comments · Fixed by #10
Closed

Error linting typescript file #4

alisnic opened this issue Jan 26, 2024 · 5 comments · Fixed by #10

Comments

@alisnic
Copy link
Contributor

alisnic commented Jan 26, 2024

ESLint: 8.56.0

SyntaxError: Unexpected token, expected "," (2:10)
Occurred while linting /Users/andreilisnic/Work/<redacted>/client/instagram-client.ts:9
Rule: "@quave/meteor-quave/no-sync-mongo-methods-on-server"
    at constructor (/Users/andreilisnic/Work/<redacted>/node_modules/@babel/parser/lib/index.js:356:19)
    at FlowParserMixin.raise (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:3223:19)
    at FlowParserMixin.unexpected (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:3253:16)
    at FlowParserMixin.expect (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:3585:28)
    at FlowParserMixin.flowParseTypeParameterDeclaration (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4366:14)
    at FlowParserMixin.flowParseObjectTypeMethodish (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4467:34)
    at FlowParserMixin.flowParseObjectTypeProperty (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4645:27)
    at FlowParserMixin.flowParseObjectType (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4573:36)
    at FlowParserMixin.flowParseInterfaceish (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4256:22)
    at FlowParserMixin.flowParseInterface (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:4275:10)

Source that reproduces the problem:

// instagram-client.ts
const InstagramClient = {
  checkInterval: 1000
};

Also I have typescript-eslint enabled as a parser in config:

  parser: '@typescript-eslint/parser',
  parserOptions: {
    // This version is set in tsconfig.json
    ecmaVersion: 2018,
    parser: '@typescript-eslint/parser',
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
    // "project": "./tsconfig.json",
    allowImportExportEverywhere: true,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
      experimentalObjectRestSpread: true
    }
  },
@renanccastro
Copy link
Contributor

We are probably not using the parser config from eslint while using the walker. I will address this ASAP

@renanccastro renanccastro linked a pull request Apr 27, 2024 that will close this issue
@alisnic
Copy link
Contributor Author

alisnic commented May 20, 2024

@renanccastro didn't help, same error in 1.5.0:

SyntaxError: Unexpected token ','. (60:1)
Occurred while linting /Users/andreilisnic/Work/planable-app/client/instagram-client.ts:1
Rule: "@quave/meteor-quave/no-sync-mongo-methods-on-server"
    at constructor (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:356:19)
    at FlowParserMixin.raise (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:3223:19)
    at FlowParserMixin.parseExprListItem (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:12000:14)
    at FlowParserMixin.parseCallExpressionArguments (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:11054:22)
    at FlowParserMixin.parseCoverCallAndAsyncArrowHead (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:10964:29)
    at FlowParserMixin.parseSubscript (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:10899:19)
    at FlowParserMixin.parseSubscript (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:5858:18)
    at FlowParserMixin.parseSubscripts (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:10870:19)
    at FlowParserMixin.parseSubscripts (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:5824:18)
    at FlowParserMixin.parseExprSubscripts (/Users/andreilisnic/Work/planable-app/node_modules/@babel/parser/lib/index.js:10861:17)

@matheusccastroo
Copy link
Contributor

@alisnic Are you trying with the latest version of the plugin? I have it running on a TS project here without an issue.

@alisnic
Copy link
Contributor Author

alisnic commented May 21, 2024

I'm using version 1.5.0, here's an excerpt from package-lock:

    "@quave/eslint-plugin-meteor-quave": {
      "version": "1.5.0",
      "resolved": "https://registry.npmjs.org/@quave/eslint-plugin-meteor-quave/-/eslint-plugin-meteor-quave-1.5.0.tgz",
      "integrity": "sha512-RMazDlXZkDiQd8UlnzBawpDRmHydUZSrpojmVYz0BAqYn727Yprs2j8WIqeJv+M4l+QH1je55ZHdg1OZjjEEIg==",

Any pointers on how I can debug this issue?

@alisnic
Copy link
Contributor Author

alisnic commented May 21, 2024

The problem seems be with *.ts files in client folder in project root. if I move the file outside this folder everything seems to be working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants