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

Bug: Converting circular structure to JSON when running eslint #134

Closed
1 task done
cthacker-udel opened this issue Dec 19, 2023 · 2 comments
Closed
1 task done
Labels

Comments

@cthacker-udel
Copy link

What version of eslint-plugin-security are you using?

2.0.0 and 2.1.0

ESLint Environment

Node version: 20.9.0
npm version: 10.1.0
Local ESLint version: 8.56.0
Global ESLint version: 8.56.0
Operating System: Windows

What parser are you using?

@typescript-eslint/parser

What did you do?

Configuration

NextJS application, running npm run lint command which runs next lint.

Next version 14.0.4

npm run lint
next lint

Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property 'security' -> object with constructor 'Object'
    |     property 'configs' -> object with constructor 'Object'
    |     property 'recommended' -> object with constructor 'Object'
    --- property 'plugins' closes the circle
Referenced from: C:\Users\cthacker\Desktop\Projects\Project1\.eslintrc.js

Raw Eslint Log:

Referenced from: C:\Users\cthacker\Desktop\Projects\Project1\.eslintrc.js
    at JSON.stringify (<anonymous>)
    at C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2156:45
    at Array.map (<anonymous>)
    at ConfigValidator.formatErrors (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2147:23)
    at ConfigValidator.validateConfigSchema (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2177:84)
    at ConfigArrayFactory._normalizeConfigData (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3019:19)
    at ConfigArrayFactory._loadExtendedPluginConfig (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3239:25)
    at ConfigArrayFactory._loadExtends (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3154:29)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Users\cthacker\Desktop\Projects\Project1\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3095:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
Uncaught exception received.

I had to downgrade eslint-plugin-security down to version 1.7.0 in order to fix bug.

What did you expect to happen?

Successfully lint files with known errors, and display those errors in the console.

What actually happened?

Eslint crashed due to this circular bug listed above.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@aladdin-add
Copy link
Contributor

Duplicate of #131

@aladdin-add aladdin-add marked this as a duplicate of #131 Dec 20, 2023
@cthacker-udel

This comment was marked as resolved.

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

No branches or pull requests

2 participants