Page MenuHomePhabricator

[linter] Use eslint to lint the javascript files
ClosedPublic

Authored by Fabien on Dec 20 2022, 10:55.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC720673f17077: [linter] Use eslint to lint the javascript files
Summary

This needs to be installed globally just like prettier.

Only applies to cashtab for now as this is where the config file resides.

Depends on D12923, D12924 and D12925 for the test plan.

Test Plan
arc lint --everything

Check there is no eslint error

Diff Detail

Repository
rABC Bitcoin ABC
Branch
linter_eslint
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 21662
Build 42964: Build Diff
Build 42963: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Dec 20 2022, 10:55
bytesofman added a subscriber: bytesofman.

Mb something else I am missing here or perhaps it's just that I haven't run this before locally on my machine.

Here's my workflow:

git checkout master
git pull
arc patch 12926
npm i -g eslint
arc lint --everything

Computer fan fired up, sounded very busy for about 4 minutes. Eventually get a lot of output with lint changes / edits to non-Cashtab files:

On branch arcpatch-D12926
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   ../../src/crypto/muhash.h
        modified:   ../../src/crypto/ripemd160.cpp
        modified:   ../../src/crypto/sha1.cpp
        modified:   ../../src/crypto/sha256_avx2.cpp
        modified:   ../../src/crypto/sha256_sse41.cpp
        modified:   ../../src/prevector.h
        modified:   ../../src/qt/bitcoin.h
        modified:   ../../src/qt/bitcoingui.cpp
        modified:   ../../src/qt/bitcoingui.h
        modified:   ../../src/radix.h
        modified:   ../../src/rcu.h
        modified:   ../../src/support/lockedpool.h
        modified:   ../../src/sync.h
        modified:   ../../src/test/checkqueue_tests.cpp
        modified:   ../../src/threadsafety.h

no changes added to commit (use "git add" and/or "git commit -a")

Is this expected behavior?

This revision now requires changes to proceed.Dec 20 2022, 17:57
Fabien requested review of this revision.Dec 20 2022, 18:35

no it's not and it's unrelated to this diff (your changes are on cpp files)

no it's not and it's unrelated to this diff (your changes are on cpp files)

OK, after getting on the correct version of clang-format, output is OKAY No lint messages.

This revision is now accepted and ready to land.Dec 21 2022, 12:26