Skip to content

Add linter (and formatter through eslint), config and ci action step#452

Merged
CoveMB merged 18 commits intoOpenZeppelin:masterfrom
CoveMB:master
Feb 24, 2025
Merged

Add linter (and formatter through eslint), config and ci action step#452
CoveMB merged 18 commits intoOpenZeppelin:masterfrom
CoveMB:master

Conversation

@CoveMB
Copy link
Contributor

@CoveMB CoveMB commented Feb 21, 2025

Add eslint and required packages.
Add recommended eslint configuration (including prettier and unicorn) for various files type (similarly to what is found in openzeppelin-upgrades).
Make changes so that the current codebase complies with added lint rules.
Add lint step in CI action.
Run linter with --fix to adjust prettier rules.

Fixes #429
Fixes #446

@socket-security
Copy link

socket-security bot commented Feb 21, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/helper-validator-identifier@7.25.9 None 0 48.3 kB nicolo-ribaudo
npm/@eslint-community/eslint-utils@4.4.1 None +1 410 kB eslint-community-bot
npm/@eslint-community/regexpp@4.12.1 None 0 473 kB eslint-community-bot
npm/@eslint/config-array@0.19.2 Transitive: environment +1 357 kB eslintbot, openjsfoundation
npm/@eslint/core@0.12.0 None 0 65.1 kB eslintbot
npm/@eslint/eslintrc@3.3.0 None +1 79.3 kB
npm/@eslint/js@9.21.0 None 0 14.9 kB eslintbot, openjsfoundation
npm/@eslint/object-schema@2.1.6 None 0 57 kB eslintbot, openjsfoundation
npm/@eslint/plugin-kit@0.2.7 None 0 77.3 kB eslintbot
npm/@humanfs/core@0.19.1 None 0 72.7 kB nzakas
npm/@humanfs/node@0.16.6 None +1 89.5 kB nzakas
npm/@humanwhocodes/module-importer@1.0.1 unsafe 0 21.2 kB nzakas
npm/@humanwhocodes/retry@0.4.2 None 0 65 kB nzakas
npm/@pkgr/core@0.1.1 None 0 8.54 kB jounqin
npm/@types/json-schema@7.0.15 None 0 31.7 kB types
npm/@types/normalize-package-data@2.4.4 None 0 5.81 kB types
npm/@typescript-eslint/eslint-plugin@8.24.1 None 0 2.86 MB bradzacher, jameshenry
npm/@typescript-eslint/parser@8.24.1 None 0 19 kB bradzacher, jameshenry
npm/@typescript-eslint/scope-manager@8.24.1 None 0 624 kB jameshenry
npm/@typescript-eslint/type-utils@8.24.1 None 0 126 kB bradzacher, jameshenry
npm/@typescript-eslint/types@8.24.1 None 0 175 kB bradzacher, jameshenry
npm/@typescript-eslint/typescript-estree@8.24.1 Transitive: environment +1 1.03 MB bradzacher, jameshenry
npm/@typescript-eslint/utils@8.24.1 None 0 283 kB bradzacher, jameshenry
npm/@typescript-eslint/visitor-keys@8.24.1 None 0 19.4 kB bradzacher, jameshenry
npm/acorn-jsx@5.3.2 None 0 24.4 kB rreverser
npm/ajv@6.12.6 eval 0 929 kB esp
npm/ava@6.2.0 Transitive: environment, filesystem, network, shell, unsafe +101 7.01 MB novemberborn
npm/builtin-modules@4.0.0 None 0 3.78 kB sindresorhus
npm/callsites@3.1.0 None 0 6.33 kB sindresorhus
npm/clean-regexp@1.0.0 None 0 8.54 kB samverschueren
npm/core-js-compat@3.40.0 None 0 768 kB zloirock
npm/cross-spawn@7.0.6 environment, filesystem, shell 0 16.1 kB satazor
npm/electron-to-chromium@1.5.102 🔁 npm/electron-to-chromium@1.5.103 None 0 157 kB kilianvalkhof
npm/eslint-config-prettier@10.0.1 None 0 59.4 kB jounqin, lydell, thorn0
npm/eslint-plugin-prettier@5.2.3 None 0 34.5 kB bpscott, jounqin, lydell, ...3 more
npm/eslint-plugin-unicorn@57.0.0 None +1 923 kB fisker, sindresorhus
npm/eslint-scope@8.2.0 None 0 152 kB eslintbot
npm/eslint-visitor-keys@4.2.0 None 0 36.1 kB eslintbot
npm/eslint@9.21.0 None 0 0 B
npm/esquery@1.6.0 None +1 1.07 MB michaelficarra
npm/esrecurse@4.3.0 None 0 13.5 kB michaelficarra
npm/fast-json-stable-stringify@2.1.0 None 0 17 kB esp
npm/file-entry-cache@8.0.0 filesystem 0 16 kB jaredwray
npm/flat-cache@4.0.1 filesystem 0 29.3 kB jaredwray
npm/flatted@3.3.3 None 0 31.5 kB webreflection
npm/glob-parent@6.0.2 None 0 7.72 kB phated
npm/globals@14.0.0 None 0 117 kB sindresorhus
npm/graphemer@1.4.0 None 0 812 kB mattpauldavies
npm/hosted-git-info@7.0.2 None 0 26.6 kB npm-cli-ops
npm/import-fresh@3.3.0 🔁 npm/import-fresh@3.3.1 None 0 4.87 kB sindresorhus
npm/index-to-position@0.1.2 None 0 4.01 kB sindresorhus
npm/is-builtin-module@4.0.0 None 0 3.94 kB sindresorhus
npm/js-tokens@4.0.0 None 0 15.1 kB lydell
npm/jsesc@3.1.0 None 0 32.3 kB mathias
npm/json-buffer@3.0.1 None 0 5.4 kB dominictarr
npm/json-schema-traverse@0.4.1 None 0 19.6 kB esp
npm/json-stable-stringify-without-jsonify@1.0.1 None 0 14.2 kB samn
npm/keyv@4.5.4 None 0 27.8 kB jaredwray
npm/levn@0.4.1 None +1 46.1 kB gkz
npm/lodash.merge@4.6.2 None 0 54.1 kB jdalton
npm/min-indent@1.0.1 None 0 2.97 kB thejameskyle
npm/natural-compare@1.4.0 None 0 5.65 kB megawac
npm/normalize-package-data@6.0.2 None 0 28.2 kB npm-cli-ops
npm/optionator@0.9.4 None 0 50.2 kB gkz
npm/parent-module@1.0.1 None 0 3.92 kB sindresorhus
npm/parse-json@8.1.0 🔁 npm/parse-json@5.2.0 None 0 9.52 kB sindresorhus
npm/pluralize@8.0.0 None 0 17.7 kB blakeembrey
npm/prelude-ls@1.2.1 None 0 36.7 kB gkz
npm/prettier-linter-helpers@1.0.0 None 0 9.58 kB bpscott
npm/prettier@3.5.1 None 0 7.88 MB prettier-bot
npm/punycode@2.3.1 None 0 33.5 kB google-wombot
npm/read-package-up@11.0.0 None 0 6.28 kB sindresorhus
npm/read-pkg@9.0.1 None 0 6.92 kB sindresorhus
npm/regexp-tree@0.1.27 None 0 314 kB dmitrysoshnikov
npm/regjsparser@0.12.0 None +1 105 kB jviereck
npm/resolve-from@4.0.0 filesystem, unsafe 0 4.64 kB sindresorhus
npm/rimraf@5.0.10 environment, filesystem Transitive: shell +16 2.32 MB isaacs
npm/shebang-command@2.0.0 None 0 2.56 kB kevva
npm/spdx-correct@3.2.0 None 0 23.4 kB kemitchell
npm/spdx-exceptions@2.5.0 None 0 3.47 kB kemitchell
npm/spdx-expression-parse@3.0.1 None 0 11.8 kB kemitchell
npm/spdx-license-ids@3.0.21 None 0 12.9 kB kemitchell, shinnn
npm/strip-indent@4.0.0 None 0 3.64 kB sindresorhus
npm/synckit@0.9.2 environment 0 59.8 kB jounqin
npm/ts-api-utils@2.0.1 None 0 354 kB joshuakgoldberg
npm/type-fest@4.35.0 None 0 420 kB sindresorhus
npm/typescript-eslint@8.24.1 None 0 103 kB jameshenry
npm/unicorn-magic@0.1.0 None 0 3.45 kB sindresorhus
npm/update-browserslist-db@1.1.1 🔁 npm/update-browserslist-db@1.1.2 None 0 14.8 kB ai
npm/uri-js@4.4.1 None 0 470 kB garycourt
npm/validate-npm-package-license@3.0.4 None 0 16.6 kB kemitchell

🚮 Removed packages: npm/@rollup/plugin-alias@5.1.1, npm/@rollup/plugin-commonjs@28.0.2, npm/@rollup/plugin-json@6.1.0, npm/@rollup/plugin-node-resolve@16.0.0, npm/@rollup/plugin-replace@6.0.2, npm/@rollup/plugin-typescript@12.1.2, npm/@types/file-saver@2.0.7, npm/@types/resize-observer-browser@0.1.11, npm/autoprefixer@10.4.20, npm/file-saver@2.0.5, npm/highlight.js@11.11.1, npm/highlightjs-cairo@0.4.0, npm/highlightjs-solidity@2.0.6, npm/path-browserify@1.0.1, npm/postcss-load-config@6.0.1, npm/postcss@8.5.3, npm/rollup-plugin-livereload@2.0.5, npm/rollup-plugin-styles@4.0.0, npm/rollup-plugin-svelte@7.2.2, npm/rollup-plugin-terser@7.0.2, npm/rollup@4.34.8, npm/sirv-cli@3.0.1, npm/svelte-check@3.8.6, npm/svelte-preprocess@5.1.4, npm/svelte@3.59.2, npm/tailwindcss@3.4.17, npm/tippy.js@6.3.7, npm/util@0.12.5

View full report↗︎

@socket-security
Copy link

socket-security bot commented Feb 21, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@ericglau
Copy link
Member

@SocketSecurity ignore npm/ws@7.4.6
Unrelated to this PR, see #421 (comment)

@ericglau
Copy link
Member

@SocketSecurity ignore npm/undici@5.28.4

Unrelated to this PR, see #430 (comment)

Copy link
Member

@ericglau ericglau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great, thanks @CoveMB! Can you add some content under the Development section of README.md on how to run lint and lint --fix?

Copy link
Member

@ericglau ericglau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Co-authored-by: Eric Lau <ericglau@outlook.com>
@CoveMB CoveMB enabled auto-merge (squash) February 21, 2025 21:06
@CoveMB CoveMB disabled auto-merge February 21, 2025 21:51
@CoveMB CoveMB merged commit 72a1f47 into OpenZeppelin:master Feb 24, 2025
10 checks passed
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

Successfully merging this pull request may close these issues.

Add TS linter rule when import not used as value Add TypeScript linter

2 participants