-
Notifications
You must be signed in to change notification settings - Fork 45
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 arc formatter #43
Comments
Thanks for the heads up, @longlho. Can you share an example of how you're using dropbox/eslint-formatter-arcanist in your Arcanist configuration? |
DBX uses |
#79 adds more complete autofix support for our ESLint linter, so I'm going to close this issue. |
hmm I saw the PR but looks like it's just using eslint output directly which isn't correct due to encoding issue. See https://github.com/dropbox/eslint-formatter-arcanist/blob/master/tests/index.test.ts test for the test sample. |
I can work on resolving this issue, but I'm not too clear on how eslint formatters work as implemented in It sounds like While this is designed for: It's not clear to me how to consolidate the two here as the workflows don't match. One idea is to replace logic in Thoughts? |
so I think at a high level arc linters are basically just invoking shell cmds and capture |
For backwards compatibility, I think we'll need to split the the logic otherwise we will break existing setups that do not have |
I think this might be something we could handle with a configuration flag (instead of creating an entirely new linter class). |
^ Agree. I just updated my comment to reflect that. I think we can add a new flag like |
@longlho I am working locally to try and use
This warned:
So I updated my I am seeing this error: '[REPO_DIR]/client/node_modules/.bin/eslint' '--no-color' '--resolve-plugins-relative-to' './client' '--format' 'arcanist' '--config' './client/.eslintrc' '[REPO_DIR]/client/src/ui/flow/flowListItem.js'
STDOUT
(empty)
STDERR
There was a problem loading formatter: [REPO_DIR]/node_modules/eslint/lib/cli-engine/formatters/arcanist
Error: Cannot find module '[REPO_DIR]/node_modules/eslint/lib/cli-engine/formatters/arcanist'
Require stack:
- [REPO_DIR]/client/node_modules/eslint/lib/cli-engine/cli-engine.js
- [REPO_DIR]/client/node_modules/eslint/lib/eslint/eslint.js
- [REPO_DIR]/client/node_modules/eslint/lib/eslint/index.js
- [REPO_DIR]/client/node_modules/eslint/lib/cli.js
- [REPO_DIR]/client/node_modules/eslint/bin/eslint.js Are the install steps in the repo out of date? |
nope it works I just verified it ~/s/random ❯❯❯ npx eslint -f arcanist index.js
[{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":1,"name":"quotes","original":"\"@formatjs/intl-getcanonicallocales/polyfill\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-getcanonicallocales/polyfill'","severity":2},{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":2,"name":"quotes","original":"\"@formatjs/intl-locale/polyfill\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-locale/polyfill'","severity":2},{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":3,"name":"quotes","original":"\"@formatjs/intl-pluralrules/polyfill\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-pluralrules/polyfill'","severity":2},{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":4,"name":"quotes","original":"\"@formatjs/intl-pluralrules/locale-data/ko\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-pluralrules/locale-data/ko'","severity":2},{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":5,"name":"quotes","original":"\"@formatjs/intl-numberformat/polyfill\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-numberformat/polyfill'","severity":2},{"char":0,"code":"ESLint","description":"Expected 1 empty line after require statement not followed by another require.","line":7,"name":"import/newline-after-import","original":"","path":"/Users/long.ho/src/random/index.js","replacement":"\n","severity":2},{"char":9,"code":"ESLint","description":"Strings must use singlequote.","line":6,"name":"quotes","original":"\"@formatjs/intl-numberformat/locale-data/ko\"","path":"/Users/long.ho/src/random/index.js","replacement":"'@formatjs/intl-numberformat/locale-data/ko'","severity":2},{"char":1,"code":"ESLint","description":"Unexpected console statement.","line":7,"name":"no-console","original":null,"path":"/Users/long.ho/src/random/index.js","replacement":null,"severity":1},{"char":1,"code":"ESLint","description":"Expected indentation of 2 spaces but found 4.","line":8,"name":"indent","original":" ","path":"/Users/long.ho/src/random/index.js","replacement":" ","severity":2},{"char":1,"code":"ESLint","description":"Expected indentation of 4 spaces but found 8.","line":9,"name":"indent","original":" ","path":"/Users/long.ho/src/random/index.js","replacement":" ","severity":2},{"char":1,"code":"ESLint","description":"Expected indentation of 4 spaces but found 8.","line":10,"name":"indent","original":" ","path":"/Users/long.ho/src/random/index.js","replacement":" ","severity":2},{"char":1,"code":"ESLint","description":"Expected indentation of 4 spaces but found 8.","line":11,"name":"indent","original":" ","path":"/Users/long.ho/src/random/index.js","replacement":" ","severity":2},{"char":0,"code":"ESLint","description":"Missing trailing comma.","line":12,"name":"comma-dangle","original":"","path":"/Users/long.ho/src/random/index.js","replacement":",","severity":2},{"char":1,"code":"ESLint","description":"Expected indentation of 2 spaces but found 4.","line":12,"name":"indent","original":" ","path":"/Users/long.ho/src/random/index.js","replacement":" ","severity":2},{"char":0,"code":"ESLint","description":"Missing trailing comma.","line":13,"name":"comma-dangle","original":"","path":"/Users/long.ho/src/random/index.js","replacement":",","severity":2},{"char":0,"code":"ESLint","description":"Missing semicolon.","line":14,"name":"semi","original":"","path":"/Users/long.ho/src/random/index.js","replacement":";","severity":2}] something's up w/ how your eslint resolve its dep? |
Issue appears to be with |
yeah so fwiw we ship tools like this with all its dep in a single binary so it's hermetic :) |
Hi there,
We (Dropbox) also use ESLint with
arc
and I happened to stumble upon this repo. We just open-sourced https://github.com/dropbox/eslint-formatter-arcanist as well that deals w/ autofix and arc byte char issue so if you guys are interested feel free to take a look.The text was updated successfully, but these errors were encountered: