bitburner-official / bitburner-src

Bitburner source code.
Other
810 stars 267 forks source link

.eslintrc: duplicate `extends` key disables most of the lint rules #474

Open SamB opened 1 year ago

SamB commented 1 year ago

It looks like .eslintrc enables a healthy chunk of rules here: https://github.com/bitburner-official/bitburner-src/blob/751fe82f9255cb114207a54ad502101d13f2642e/.eslintrc.js#L7-L12 Unfortunately, this is overridden by the duplicate key further down in the file: https://github.com/bitburner-official/bitburner-src/blob/751fe82f9255cb114207a54ad502101d13f2642e/.eslintrc.js#L23

The no-dupe-keys rule would catch this, except:

  1. You have not set up eslint to actually lint .eslintrc.
  2. That rule isn't enabled: it's included in the eslint:recommended config that never actually got pulled in due to the duplicate key.

(It is somewhat unfortunate that JavaScript allows duplicate literal keys in object literals in the first place.)

I would submit a PR, but unfortunately the obvious fix leaves you with 3K+ warnings and errors to sort out one way or another, and while I expect you'd want to turn off (or configure) some of the relevant rules because of this, there may also be significant amounts of code that you would actually want to change as a result, so I'm not going to attempt to provide a warning-free pull request for this.

d0sboots commented 1 year ago

Probably the right thing to do is to delete the duplicate key, and comment out the formerly ignored rules with an explanation. Then we can look at enabling them individually (or a subset of what they're made up of) in smaller chunks.

Hoekstraa commented 1 year ago

@Snarling, does #501 close this issue, or is further work needed?

Snarling commented 1 year ago

More work still needed on this one.

Alpheus commented 3 days ago

Bump. Opened up new PR to make progress on this.