[
https://issues.apache.org/jira/browse/TINKERPOP-2716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503052#comment-17503052
]
ASF GitHub Bot commented on TINKERPOP-2716:
-------------------------------------------
tkolanko opened a new pull request #1582:
URL: https://github.com/apache/tinkerpop/pull/1582
@jorgebay @krlawrence
Here is the PR which implements eslint+prettier. Note that only the prettier
rules are enabled to enforce code stanards for things like single quotes vs
double quotes, spaces vs tabs etc etc
I tried turning on the airbnb config but this projects current code base is
highly divergent from the airbnb style guide:
```
✨ Summary of failing ESLint rules
errors 14 warnings 0 rule: yoda
errors 51 warnings 0 rule: vars-on-top
errors 39 warnings 0 rule: strict
errors 8 warnings 0 rule: spaced-comment
errors 33 warnings 0 rule: prettier/prettier
errors 35 warnings 0 rule: prefer-template
errors 5 warnings 0 rule: prefer-spread
errors 4 warnings 0 rule: prefer-object-spread
errors 23 warnings 0 rule: prefer-destructuring
errors 8 warnings 0 rule: prefer-const
errors 193 warnings 0 rule: prefer-arrow-callback
errors 22 warnings 0 rule: one-var
errors 59 warnings 0 rule: object-shorthand
errors 4 warnings 0 rule: no-void
errors 66 warnings 0 rule: no-var
errors 4 warnings 0 rule: no-useless-escape
errors 3 warnings 0 rule: no-useless-constructor
errors 89 warnings 0 rule: no-use-before-define
errors 16 warnings 0 rule: no-unused-vars
errors 48 warnings 0 rule: no-unused-expressions
errors 1 warnings 0 rule: no-unneeded-ternary
errors 253 warnings 0 rule: no-underscore-dangle
errors 1 warnings 0 rule: no-undef-init
errors 198 warnings 0 rule: no-undef
errors 23 warnings 0 rule: no-shadow
errors 13 warnings 0 rule: no-sequences
errors 3 warnings 0 rule: no-return-assign
errors 6 warnings 0 rule: no-restricted-syntax
errors 2 warnings 0 rule: no-restricted-globals
errors 17 warnings 0 rule: no-redeclare
errors 5 warnings 0 rule: no-prototype-builtins
errors 45 warnings 0 rule: no-plusplus
errors 31 warnings 0 rule: no-param-reassign
errors 7 warnings 0 rule: no-nested-ternary
errors 10 warnings 0 rule: no-multi-assign
errors 1 warnings 0 rule: no-empty
errors 11 warnings 0 rule: no-else-return
errors 0 warnings 2 rule: no-console
errors 11 warnings 0 rule: no-cond-assign
errors 1 warnings 0 rule: no-buffer-constructor
errors 18 warnings 0 rule: no-bitwise
errors 19 warnings 0 rule: new-cap
errors 8 warnings 0 rule: max-classes-per-file
errors 1 warnings 0 rule: lines-between-class-members
errors 28 warnings 0 rule: lines-around-directive
errors 1 warnings 0 rule: import/no-useless-path-segments
errors 10 warnings 0 rule: import/newline-after-import
errors 2 warnings 0 rule: import/extensions
errors 1 warnings 0 rule: getter-return
errors 0 warnings 211 rule: func-names
errors 2 warnings 0 rule: eqeqeq
errors 49 warnings 0 rule: dot-notation
errors 2 warnings 0 rule: default-case
errors 7 warnings 0 rule: consistent-return
errors 50 warnings 0 rule: class-methods-use-this
errors 6 warnings 0 rule: camelcase
errors 210 warnings 0 rule: block-scoped-var
errors 10 warnings 0 rule: arrow-body-style
🔥 2000 problems in total (1787 errors, 213 warnings)
```
I'm not sure the best way to deal with the errors:
1. We could enable airbnb then fix all errors
2. We could enable airbnb but turn off all failing rules, then over time
enable a rule and fix all errors related to the rule
3. We could enable airbnb, turn off all failing rules and leave things as is
Some of the fixes will involve quite a bit, for example
`no-underscore-dangle` will also require changes to the tests since some tests
override internal objects prefixed with a _.
Let me know if you want to continue forward with just code stlying as a PR,
it may be better to do everything in one shot but that is going to take a large
effort
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
> Enable eslint for gremlin-javascript project
> --------------------------------------------
>
> Key: TINKERPOP-2716
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2716
> Project: TinkerPop
> Issue Type: Improvement
> Components: javascript
> Affects Versions: 3.5.2
> Reporter: Tom Kolanko
> Priority: Minor
>
> The gremlin-javascript project has no linter set so it's easy for code to be
> formatted differently depending on the editor used to save the changes
> From https://github.com/apache/tinkerpop/pull/1539#discussion_r818682368 we
> can implement eslint + airbnb's config to have a standard which editors would
> be able to pick up
--
This message was sent by Atlassian Jira
(v8.20.1#820001)