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

JSON output docs.url includes [object Object] #3473

Closed
3 tasks done
ybiquitous opened this issue Jun 1, 2021 · 2 comments · Fixed by #3475
Closed
3 tasks done

JSON output docs.url includes [object Object] #3473

ybiquitous opened this issue Jun 1, 2021 · 2 comments · Fixed by #3475
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@ybiquitous
Copy link
Contributor

ybiquitous commented Jun 1, 2021

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "extends": "plugin:@typescript-eslint/recommended"
}
const x = "";

Run the following command:

$ ./node_modules/.bin/eslint . -f json-with-metadata | jq .

Expected Result

(The following are excerpts.)

{
  // ...
  "docs": {
    // ...
    "url": "https://github.com/typescript-eslint/typescript-eslint/blob/v4.26.0/packages/eslint-plugin/docs/rules/unified-signatures.md"
  },
  // ...
}

The JSON output should include v4.26.0 in the docs.url fields.

Actual Result

{
  // ...
  "docs": {
    // ...
    "url": "https://github.com/typescript-eslint/typescript-eslint/blob/v[object Object]/packages/eslint-plugin/docs/rules/unified-signatures.md"
  },
  // ...
}

But the actual JSON output includes v[object Object] in the docs.url fields.

Additional Info

Perhaps, the following code seems to have a problem:

const version: string = require('../../package.json');

Is this correct? ⬇️

-const version: string = require('../../package.json');
+const version: string = require('../../package.json').version;

Versions

package version
@typescript-eslint/eslint-plugin 4.26.0
@typescript-eslint/parser 4.26.0
TypeScript 4.3.2
ESLint 7.27.0
node 16.2.0
@ybiquitous ybiquitous added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 1, 2021
@bradzacher
Copy link
Member

definitely looks like it's the problem!

@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels Jun 1, 2021
bradzacher added a commit that referenced this issue Jun 1, 2021
@ybiquitous
Copy link
Contributor Author

@bradzacher Thank you for the quick fix! 😊

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants