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

ESLint - Reviewdog output missing file names #1721

Open
djthornton1212 opened this issue Apr 22, 2024 · 0 comments
Open

ESLint - Reviewdog output missing file names #1721

djthornton1212 opened this issue Apr 22, 2024 · 0 comments

Comments

@djthornton1212
Copy link

Stack:

OS: macOS Sonoma/Ubuntu22.04.4
Reviewdog: 0.17.4
ESLint: 8.57.0
eslint-formatter-rdjson: 1.0.6

Issue

I've been working on this for some time now and feel I need to reach out for assistance. Hopefully it's something simple I'm over looking.

I'm working on a CI workflow designed to accept various linters, one such being ESLint. I've been able to successfully submit eslint outputs to reviewdog via the -f=eslint & -f=rdjson (w/ eslint-formatter-rdjson) options just fine. I even get back the expected linting errors. The problem is that neither return file names, just the line, error, message, rule:

 2:1   error    Missing JSDoc comment        require-jsdoc
68:20  error    Missing JSDoc comment        require-jsdoc
68:20  warning  Unexpected unnamed function  func-names
68:47  warning  Unexpected unnamed function  func-names
68:92  error    Missing semicolon            semi
{"ruleId":"require-jsdoc","severity":2,"message":"Missing JSDoc comment.","line":2,"column":1,"nodeType":"FunctionDeclaration","messageId":"missingJSDocComment","endLine":642,"endColumn":2}
{"ruleId":"require-jsdoc","severity":2,"message":"Missing JSDoc comment.","line":68,"column":20,"nodeType":"FunctionExpression","messageId":"missingJSDocComment","endLine":68,"endColumn":92}
{"ruleId":"func-names","severity":1,"message":"Unexpected unnamed function.","line":68,"column":20,"nodeType":"FunctionExpression","messageId":"unnamed","endLine":68,"endColumn":29}
{"ruleId":"func-names","severity":1,"message":"Unexpected unnamed function.","line":68,"column":47,"nodeType":"FunctionExpression","messageId":"unnamed","endLine":68,"endColumn":56}
{"ruleId":"semi","severity":2,"message":"Missing semicolon.","line":68,"column":92,"nodeType":"VariableDeclaration","messageId":"missingSemi","endLine":69,"endColumn":1,"fix":{"range":[2197,2197],"text":";"}}

I've tried using the -efm option, but get basically the same outcome (just more of it):

-efm="%-P%f" \
-efm="%s%#%l:%c %# %trror  %m" \
-efm="%s%#%l:%c %# %tarning  %m" \
-efm="%-Q" \
-efm="%-G%.%#"

** Note I'm using -reporter=local

Expected Results

I expect to get if not the same then similar results that I see when using the errorformat-playground (seen here). Basically I need the file names returned with the results.

I should mention that this works as expected w/ eslint-compact, but that's not going to be a sustainable option given ESLint's recent changes.

/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.js: line 2, col 1, Error - Missing JSDoc comment. (require-jsdoc)
/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.js: line 68, col 20, Error - Missing JSDoc comment. (require-jsdoc)
/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.js: line 68, col 20, Warning - Unexpected unnamed function. (func-names)
/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.js: line 68, col 47, Warning - Unexpected unnamed function. (func-names)
/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.js: line 68, col 92, Error - Missing semicolon. (semi)
/Users/dthornton/code/test/action-testing/src/util/ws/action_cable.test.js: line 6, col 27, Error - Missing semicolon. (semi)

I want to continue using stylish if possible given the recent reduction in formats with ESLint, but not sure where to go from here. Any help would be appreciated.

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

No branches or pull requests

1 participant