Skip to content

chore: upgrade eslint configuration #897

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

Merged
merged 62 commits into from
Feb 24, 2025
Merged

chore: upgrade eslint configuration #897

merged 62 commits into from
Feb 24, 2025

Conversation

achou11
Copy link
Member

@achou11 achou11 commented Dec 18, 2024

  • Upgrades eslint to v9 and install other necessary eslint modules for writing the configuration
  • Upgrades other eslint plugins to latest compatible versions
  • Removes rules related to React Native (via @react-native/eslint-config) due to compat issues with the typescript eslint plugin it uses internally.
  • applies very trivial fixes that could be automated by the eslint check (i.e. with its --fix) flag. EDIT: applies fixes to relevant and easy-to-address issues
  • updates the relevant npm script
  • introduces more granular application of rules based on kind of file or directory (e.g. separate rules for backend vs frontend, rules specific for tooling files)

Remaining items (can be done as follow-ups):

  • decide whether or not not having rules specific to React Native for now is a blocker. Can spend some time attempting to get it working but would be okay with doing as a follow-up. EDIT: addressed via ad35fdc

  • adjust the react configuration to omit non-applicable rules (e.g. no need for dom)

@awana-lockfile-bot
Copy link

awana-lockfile-bot bot commented Jan 21, 2025

package-lock.json changes

Summary

Status Count
ADDED 59
UPDATED 236
DOWNGRADED 27
REMOVED 73
Click to toggle table visibility
Name Status Previous Current
@aashutoshrathi/word-wrap REMOVED 1.2.6 -
@ampproject/remapping UPDATED 2.2.0 2.3.0
@babel/eslint-parser REMOVED 7.26.5 -
@babel/highlight UPDATED 7.25.7 7.25.9
@babel/plugin-syntax-class-static-block ADDED - 7.14.5
@babel/plugin-syntax-private-property-in-object ADDED - 7.14.5
@babel/plugin-transform-runtime UPDATED 7.25.9 7.26.8
@babel/plugin-transform-typescript UPDATED 7.26.5 7.26.8
@babel/preset-flow UPDATED 7.23.3 7.25.9
@babel/register UPDATED 7.23.7 7.25.9
@babel/traverse--for-generate-function-map UPDATED 7.26.5 7.26.8
@emnapi/core ADDED - 1.3.1
@emnapi/runtime ADDED - 1.3.1
@emnapi/wasi-threads ADDED - 1.0.1
@eslint-community/eslint-utils UPDATED 4.4.0 4.4.1
@eslint-react/ast ADDED - 1.27.0
@eslint-react/core ADDED - 1.27.0
@eslint-react/eff ADDED - 1.27.0
@eslint-react/eslint-plugin ADDED - 1.27.0
@eslint-react/jsx ADDED - 1.27.0
@eslint-react/shared ADDED - 1.27.0
@eslint-react/var ADDED - 1.27.0
@eslint/compat ADDED - 1.2.7
@eslint/config-array ADDED - 0.19.2
@eslint/core ADDED - 0.12.0
@eslint/eslintrc UPDATED 2.1.2 3.3.0
@eslint/js UPDATED 8.47.0 9.21.0
@eslint/object-schema ADDED - 2.1.6
@eslint/plugin-kit ADDED - 0.2.7
@expo/config-plugins UPDATED 9.0.14 9.0.15
@expo/config-types UPDATED 52.0.3 52.0.4
@expo/config UPDATED 10.0.8 10.0.9
@expo/fingerprint ADDED - 0.11.7
@expo/prebuild-config UPDATED 8.0.25 8.0.26
@expo/vector-icons UPDATED 14.0.0 14.0.4
@faker-js/faker UPDATED 9.3.0 9.4.0
@humanfs/core ADDED - 0.19.1
@humanfs/node ADDED - 0.16.6
@humanwhocodes/config-array REMOVED 0.11.10 -
@humanwhocodes/object-schema REMOVED 1.2.1 -
@humanwhocodes/retry ADDED - 0.4.2
@hyperswarm/secret-stream UPDATED 6.6.4 6.7.1
@jest/create-cache-key-function UPDATED 29.6.3 29.7.0
@jest/types UPDATED 26.6.2 29.6.3
@jridgewell/gen-mapping UPDATED 0.1.1 0.3.8
@jridgewell/resolve-uri UPDATED 3.1.0 3.1.2
@jridgewell/source-map UPDATED 0.3.5 0.3.6
@napi-rs/wasm-runtime ADDED - 0.2.6
@nicolo-ribaudo/eslint-scope-5-internals REMOVED 5.1.1-v1 -
@node-rs/crc32-android-arm-eabi ADDED - 1.10.6
@node-rs/crc32-android-arm64 ADDED - 1.10.6
@node-rs/crc32-darwin-arm64 ADDED - 1.10.6
@node-rs/crc32-darwin-x64 UPDATED 1.10.4 1.10.6
@node-rs/crc32-freebsd-x64 ADDED - 1.10.6
@node-rs/crc32-linux-arm-gnueabihf ADDED - 1.10.6
@node-rs/crc32-linux-arm64-gnu ADDED - 1.10.6
@node-rs/crc32-linux-arm64-musl ADDED - 1.10.6
@node-rs/crc32-linux-x64-gnu ADDED - 1.10.6
@node-rs/crc32-linux-x64-musl ADDED - 1.10.6
@node-rs/crc32-wasm32-wasi ADDED - 1.10.6
@node-rs/crc32-win32-arm64-msvc ADDED - 1.10.6
@node-rs/crc32-win32-ia32-msvc ADDED - 1.10.6
@node-rs/crc32-win32-x64-msvc ADDED - 1.10.6
@node-rs/crc32 UPDATED 1.10.4 1.10.6
@npmcli/agent UPDATED 2.2.1 2.2.2
@react-native-community/cli-debugger-ui REMOVED 12.3.6 -
@react-native-community/cli-server-api REMOVED 12.3.6 -
@react-native-community/cli-tools REMOVED 12.3.6 -
@react-native/eslint-config REMOVED 0.76.6 -
@react-native/eslint-plugin REMOVED 0.76.6 -
@react-native/normalize-colors UPDATED 0.76.6 0.76.7
@sinclair/typebox UPDATED 0.27.8 0.33.22
@tanstack/eslint-plugin-query UPDATED 5.51.15 5.66.1
@tybys/wasm-util ADDED - 0.9.0
@types/b4a UPDATED 1.6.3 1.6.4
@types/babel__core UPDATED 7.20.1 7.20.5
@types/babel__generator UPDATED 7.6.4 7.6.8
@types/babel__template UPDATED 7.4.1 7.4.4
@types/babel__traverse UPDATED 7.20.1 7.20.6
@types/better-sqlite3 UPDATED 7.6.6 7.6.12
@types/hammerjs UPDATED 2.0.41 2.0.46
@types/hoist-non-react-statics UPDATED 3.3.1 3.3.6
@types/istanbul-lib-coverage UPDATED 2.0.4 2.0.6
@types/istanbul-lib-report UPDATED 3.0.0 3.0.3
@types/istanbul-reports UPDATED 3.0.1 3.0.4
@types/json-schema UPDATED 7.0.11 7.0.15
@types/lodash UPDATED 4.14.199 4.17.15
@types/ms UPDATED 0.7.34 2.1.0
@types/prop-types UPDATED 15.7.5 15.7.14
@types/react-native UPDATED 0.70.6 0.70.19
@types/stack-utils UPDATED 2.0.1 2.0.3
@types/streamx UPDATED 2.9.3 2.9.5
@types/yargs-parser UPDATED 21.0.0 21.0.3
@types/yargs UPDATED 15.0.14 17.0.33
@typescript-eslint/eslint-plugin UPDATED 5.62.0 8.25.0
@typescript-eslint/parser UPDATED 5.62.0 8.25.0
@typescript-eslint/scope-manager UPDATED 5.62.0 8.25.0
@typescript-eslint/type-utils UPDATED 5.62.0 8.25.0
@typescript-eslint/types UPDATED 5.62.0 8.25.0
@typescript-eslint/typescript-estree UPDATED 5.62.0 8.25.0
@typescript-eslint/utils UPDATED 5.62.0 8.25.0
@typescript-eslint/visitor-keys UPDATED 5.62.0 8.25.0
@wdio/cli DOWNGRADED 9.9.0 9.8.0
@wdio/config DOWNGRADED 9.9.0 9.7.3
@wdio/utils DOWNGRADED 9.9.0 9.7.3
ansi-styles UPDATED 4.3.0 5.2.0
anymatch UPDATED 3.1.2 3.1.3
appdirsjs REMOVED 1.2.7 -
argparse UPDATED 1.0.10 2.0.1
array-buffer-byte-length REMOVED 1.0.1 -
array-includes REMOVED 3.1.5 -
array.prototype.flatmap REMOVED 1.3.0 -
arraybuffer.prototype.slice REMOVED 1.0.3 -
ast-types DOWNGRADED 0.15.2 0.13.4
b4a UPDATED 1.6.6 1.6.7
babel-preset-current-node-syntax UPDATED 1.0.1 1.1.0
babel-preset-expo UPDATED 12.0.6 12.0.7
bare-events UPDATED 2.4.2 2.5.4
base-x UPDATED 3.0.9 3.0.10
big-integer UPDATED 1.6.51 1.6.52
birecord ADDED - 0.1.1
bplist-creator DOWNGRADED 0.1.0 0.0.7
bplist-parser UPDATED 0.3.1 0.3.2
bytes UPDATED 3.0.0 3.1.2
call-bind-apply-helpers ADDED - 1.0.1
call-bind UPDATED 1.0.7 1.0.8
call-bound ADDED - 1.0.3
caniuse-lite UPDATED 1.0.30001692 1.0.30001699
chalk UPDATED 4.1.2 5.4.1
chownr UPDATED 1.1.4 2.0.0
ci-info UPDATED 2.0.0 3.9.0
cjs-module-lexer UPDATED 1.2.3 1.4.3
cli-cursor UPDATED 3.1.0 5.0.0
cli-width UPDATED 3.0.0 4.1.0
compact-encoding UPDATED 2.15.0 2.16.0
compare-versions ADDED - 6.1.1
compression UPDATED 1.7.4 1.8.0
crc-native UPDATED 1.0.11 1.1.6
cross-fetch UPDATED 3.1.8 3.2.0
csstype UPDATED 3.1.1 3.1.3
data-view-buffer REMOVED 1.0.1 -
data-view-byte-length REMOVED 1.0.1 -
data-view-byte-offset REMOVED 1.0.0 -
debounceify UPDATED 1.0.0 1.1.0
decamelize UPDATED 1.2.0 6.0.0
decimal.js UPDATED 10.4.3 10.5.0
decompress-response DOWNGRADED 6.0.0 3.3.0
detect-libc DOWNGRADED 2.0.2 1.0.3
doctrine REMOVED 3.0.0 -
domutils UPDATED 3.1.0 3.2.2
dotenv-expand DOWNGRADED 11.0.7 10.0.0
dotenv UPDATED 16.4.5 16.4.7
drizzle-orm UPDATED 0.30.8 0.30.10
dunder-proto ADDED - 1.0.1
duplexify UPDATED 4.1.2 4.1.3
electron-to-chromium UPDATED 1.5.80 1.5.97
emoji-regex UPDATED 8.0.0 9.2.2
enhanced-resolve UPDATED 5.18.0 5.18.1
errorhandler REMOVED 1.5.1 -
es-abstract REMOVED 1.23.3 -
es-define-property UPDATED 1.0.0 1.0.1
es-object-atoms UPDATED 1.0.0 1.1.1
es-set-tostringtag REMOVED 2.0.3 -
es-shim-unscopables REMOVED 1.0.0 -
es-to-primitive REMOVED 1.2.1 -
escape-string-regexp UPDATED 1.0.5 4.0.0
eslint-config-prettier REMOVED 9.1.0 -
eslint-plugin-eslint-comments REMOVED 3.2.0 -
eslint-plugin-ft-flow REMOVED 2.0.3 -
eslint-plugin-jest UPDATED 27.9.0 28.11.0
eslint-plugin-react-debug ADDED - 1.27.0
eslint-plugin-react-dom ADDED - 1.27.0
eslint-plugin-react-hooks-extra ADDED - 1.27.0
eslint-plugin-react-hooks REMOVED 4.6.2 -
eslint-plugin-react-naming-convention ADDED - 1.27.0
eslint-plugin-react-native UPDATED 4.0.0 5.0.0
eslint-plugin-react-web-api ADDED - 1.27.0
eslint-plugin-react-x ADDED - 1.27.0
eslint-plugin-react REMOVED 7.31.10 -
eslint-scope UPDATED 5.1.1 8.2.0
eslint-visitor-keys UPDATED 2.1.0 3.4.3
eslint UPDATED 8.47.0 9.21.0
espree UPDATED 9.6.1 10.3.0
esquery UPDATED 1.5.0 1.6.0
estree-walker ADDED - 2.0.2
expect-webdriverio DOWNGRADED 5.1.0 5.0.5
expo-asset UPDATED 11.0.2 11.0.3
exponential-backoff UPDATED 3.1.1 3.1.2
fast-glob UPDATED 3.3.2 3.3.3
fastify UPDATED 4.28.1 4.29.0
fastq UPDATED 1.17.1 1.19.0
figures UPDATED 3.2.0 6.1.0
file-entry-cache UPDATED 6.0.1 8.0.0
flat-cache UPDATED 3.0.4 4.0.1
flat-tree UPDATED 1.9.0 1.12.1
flatted UPDATED 3.2.7 3.3.2
flow-parser UPDATED 0.206.0 0.260.0
for-each UPDATED 0.3.3 0.3.5
foreground-child UPDATED 3.1.1 3.3.0
form-data UPDATED 3.0.2 4.0.1
fs-minipass UPDATED 2.1.0 3.0.3
fs-native-extensions UPDATED 1.2.3 1.3.3
function.prototype.name REMOVED 1.1.6 -
functions-have-names REMOVED 1.2.3 -
get-intrinsic UPDATED 1.2.4 1.2.7
get-port UPDATED 3.2.0 7.1.0
get-proto ADDED - 1.0.1
get-symbol-description REMOVED 1.0.2 -
glob-parent UPDATED 5.1.2 6.0.2
globals UPDATED 11.12.0 16.0.0
globalthis UPDATED 1.0.3 1.0.4
gopd UPDATED 1.0.1 1.2.0
has-bigints REMOVED 1.0.2 -
has-proto REMOVED 1.0.3 -
has-symbols UPDATED 1.0.3 1.1.0
has REMOVED 1.0.3 -
hermes-estree DOWNGRADED 0.24.0 0.23.1
hermes-parser DOWNGRADED 0.24.0 0.23.1
hosted-git-info DOWNGRADED 7.0.2 4.1.0
human-signals UPDATED 2.1.0 8.0.0
hyperbee UPDATED 2.17.0 2.21.3
hypercore-errors UPDATED 1.3.0 1.4.0
hypercore-id-encoding REMOVED 1.3.0 -
hypercore DOWNGRADED 10.37.22 10.17.0
hypertrace REMOVED 1.4.2 -
iconv-lite DOWNGRADED 0.6.3 0.4.24
ignore UPDATED 5.3.1 5.3.2
image-size UPDATED 1.1.1 1.2.0
import-fresh UPDATED 3.3.0 3.3.1
inquirer UPDATED 7.3.3 11.1.0
internal-slot REMOVED 1.0.7 -
is-arguments UPDATED 1.1.1 1.2.0
is-array-buffer REMOVED 3.0.4 -
is-bigint REMOVED 1.0.4 -
is-boolean-object REMOVED 1.1.2 -
is-core-module UPDATED 2.13.1 2.16.1
is-data-view REMOVED 1.0.1 -
is-date-object REMOVED 1.0.5 -
is-fullwidth-code-point UPDATED 3.0.0 4.0.0
is-generator-function UPDATED 1.0.10 1.1.0
is-immutable-type ADDED - 5.0.1
is-negative-zero REMOVED 2.0.3 -
is-number-object REMOVED 1.0.7 -
is-regex UPDATED 1.1.4 1.2.1
is-shared-array-buffer REMOVED 1.0.3 -
is-stream UPDATED 3.0.0 4.0.1
is-string REMOVED 1.0.7 -
is-symbol REMOVED 1.0.4 -
is-typed-array UPDATED 1.1.13 1.1.15
is-weakref REMOVED 1.0.2 -
is-wsl UPDATED 1.1.0 2.2.0
isarray UPDATED 1.0.0 2.0.5
istanbul-lib-coverage UPDATED 3.2.0 3.2.2
js-yaml UPDATED 3.14.1 4.1.0
jsesc UPDATED 3.0.2 3.1.0
json-buffer UPDATED 3.0.0 3.0.1
json-stable-stringify UPDATED 1.1.1 1.2.1
jsx-ast-utils REMOVED 3.3.3 -
keyv UPDATED 3.1.0 4.5.4
ky UPDATED 1.7.2 1.7.4
long UPDATED 5.2.3 5.3.0
lru-cache DOWNGRADED 6.0.0 5.1.1
make-fetch-happen UPDATED 13.0.0 13.0.1
math-intrinsics ADDED - 1.1.0
metro-config UPDATED 0.81.0 0.81.1
metro-runtime UPDATED 0.81.0 0.81.1
mime-db UPDATED 1.52.0 1.53.0
mime UPDATED 2.6.0 4.0.6
mimic-fn UPDATED 2.1.0 4.0.0
mimic-response DOWNGRADED 3.1.0 1.0.1
minipass-fetch UPDATED 3.0.4 3.0.5
mirror-drive UPDATED 1.3.0 1.4.0
mute-stream UPDATED 0.0.8 1.0.0
napi-build-utils UPDATED 1.0.2 2.0.0
napi-macros REMOVED 2.2.2 -
natural-compare-lite REMOVED 1.4.0 -
nocache REMOVED 3.0.4 -
node-abi UPDATED 3.51.0 3.74.0
node-gyp-build UPDATED 4.6.1 4.8.4
noise-handshake UPDATED 3.0.3 3.1.0
nopt UPDATED 7.2.0 7.2.1
npm-run-path UPDATED 5.3.0 6.0.0
nwsapi UPDATED 2.2.13 2.2.16
object-inspect UPDATED 1.13.1 1.13.4
object-is UPDATED 1.1.5 1.1.6
object.assign UPDATED 4.1.5 4.1.7
object.entries REMOVED 1.1.5 -
object.fromentries REMOVED 2.0.5 -
object.hasown REMOVED 1.1.1 -
object.values REMOVED 1.1.5 -
on-finished DOWNGRADED 2.4.1 2.3.0
onetime UPDATED 5.1.2 7.0.0
open UPDATED 6.4.0 7.4.2
optionator UPDATED 0.9.3 0.9.4
ora DOWNGRADED 5.4.1 3.4.0
p-defer UPDATED 4.0.0 4.0.1
p-limit UPDATED 2.3.0 3.1.0
p-timeout UPDATED 4.1.0 6.1.4
parse-json UPDATED 4.0.0 5.2.0
parse5 UPDATED 7.1.2 7.2.1
path-key UPDATED 2.0.1 3.1.1
picomatch UPDATED 2.3.1 4.0.2
pino UPDATED 9.5.0 9.6.0
plist UPDATED 3.0.6 3.1.0
possible-typed-array-names UPDATED 1.0.0 1.1.0
prebuild-install UPDATED 7.1.1 7.1.3
pretty-format UPDATED 26.6.2 29.7.0
pretty-ms UPDATED 9.1.0 9.2.0
process-warning DOWNGRADED 4.0.0 3.0.0
promise DOWNGRADED 8.3.0 7.3.1
protomux UPDATED 3.5.1 3.10.1
psl UPDATED 1.9.0 1.15.0
pump UPDATED 3.0.0 3.0.2
punycode UPDATED 2.1.1 2.3.1
quickbit-native UPDATED 2.2.0 2.3.5
rache ADDED - 1.0.0
random-access-file UPDATED 4.0.4 4.1.2
random-access-storage UPDATED 3.0.1 3.0.2
react-freeze UPDATED 1.0.3 1.0.4
read-pkg-up UPDATED 7.0.1 10.1.0
read-pkg UPDATED 5.2.0 8.1.0
readable-stream DOWNGRADED 4.5.2 3.6.2
readdirp UPDATED 3.6.0 4.1.1
ready-resource UPDATED 1.0.0 1.1.1
regenerator-runtime UPDATED 0.13.11 0.14.1
regexp.prototype.flags REMOVED 1.5.2 -
resolve UPDATED 1.22.8 1.22.10
restore-cursor UPDATED 3.1.0 5.1.0
rtl-detect UPDATED 1.0.4 1.1.2
run-async UPDATED 2.4.1 3.0.0
rxjs UPDATED 6.6.7 7.8.1
safe-array-concat REMOVED 1.1.2 -
safe-buffer UPDATED 5.1.2 5.2.1
safe-regex-test UPDATED 1.0.3 1.1.0
sax UPDATED 1.3.0 1.4.1
scheduler UPDATED 0.23.2 0.24.0-canary-efb381bbf-20230505
send UPDATED 0.18.0 0.19.1
serve-static UPDATED 1.15.0 1.16.2
set-function-name REMOVED 2.0.2 -
shell-quote UPDATED 1.7.4 1.8.2
side-channel REMOVED 1.0.4 -
signal-exit UPDATED 3.0.7 4.1.0
simdle-native UPDATED 1.2.0 1.3.5
sodium-native ADDED - 4.3.1
sodium-secretstream UPDATED 1.1.0 1.1.1
source-map-support UPDATED 0.5.13 0.5.21
spdx-license-ids UPDATED 3.0.20 3.0.21
sprintf-js UPDATED 1.0.3 1.1.3
statuses DOWNGRADED 2.0.1 1.5.0
stream-buffers UPDATED 2.2.0 3.0.3
stream-shift UPDATED 1.0.1 1.0.3
string-natural-compare REMOVED 3.0.1 -
string-ts ADDED - 2.2.1
string-width UPDATED 4.2.3 5.1.2
string.prototype.matchall REMOVED 4.0.7 -
string.prototype.trim REMOVED 1.2.9 -
string.prototype.trimend REMOVED 1.0.8 -
string.prototype.trimstart REMOVED 1.0.8 -
strip-ansi UPDATED 6.0.1 7.1.0
strip-final-newline UPDATED 2.0.0 4.0.0
sudo-prompt DOWNGRADED 9.2.1 8.2.5
svgo UPDATED 3.0.2 3.3.2
tar-fs UPDATED 2.1.1 3.0.8
tar-stream UPDATED 2.2.0 3.1.7
terser UPDATED 5.37.0 5.38.2
text-decoder UPDATED 1.1.1 1.2.3
throttle-debounce UPDATED 5.0.0 5.0.2
tmp UPDATED 0.0.33 0.2.3
ts-api-utils UPDATED 1.3.0 2.0.1
ts-declaration-location ADDED - 1.0.5
ts-pattern ADDED - 5.6.2
tsutils REMOVED 3.21.0 -
typed-array-buffer REMOVED 1.0.2 -
typed-array-byte-length REMOVED 1.0.1 -
typed-array-byte-offset REMOVED 1.0.2 -
typed-array-length REMOVED 1.0.6 -
typescript-eslint ADDED - 8.25.0
ua-parser-js DOWNGRADED 1.0.35 0.7.40
unbox-primitive REMOVED 1.0.2 -
undici UPDATED 6.21.0 6.21.1
update-browserslist-db UPDATED 1.1.1 1.1.2
uuid UPDATED 3.4.0 10.0.0
varint UPDATED 5.0.2 6.0.0
webidl-conversions UPDATED 5.0.0 7.0.0
which-boxed-primitive REMOVED 1.0.2 -
which-runtime ADDED - 1.2.1
which-typed-array UPDATED 1.1.15 1.1.18
word-wrap ADDED - 1.2.5
ws UPDATED 7.5.10 8.18.0
xache UPDATED 1.2.0 1.2.1
xcode UPDATED 2.1.0 3.0.1
xmlbuilder DOWNGRADED 15.1.1 14.0.0
yallist DOWNGRADED 4.0.0 3.1.1
yargs-parser DOWNGRADED 21.1.1 20.2.9
z32 UPDATED 1.0.1 1.1.0

@achou11 achou11 changed the title WIP: chore: upgrade eslint configuration chore: upgrade eslint configuration Jan 21, 2025
@achou11 achou11 marked this pull request as ready for review January 21, 2025 22:41
@achou11 achou11 requested a review from ErikSin January 21, 2025 23:08
Copy link
Contributor

@ErikSin ErikSin left a comment

Choose a reason for hiding this comment

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

Im glad that we are using the new eslint architecture. There are a lot of new rules introduced by the premade/recommended configs. Running eslint introduced 99 problems (but a bitch aint one 😆 ) - 71 error and 28 warnings.

I think we should using these recommended configs but Im wondering if it should be the job of this PR to solve the new errors associated with it?

Copy link
Member Author

@achou11 achou11 left a comment

Choose a reason for hiding this comment

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

I think we should using these recommended configs but Im wondering if it should be the job of this PR to solve the new errors associated with it?

I'm in favor of addressing the issues as follow-ups, mostly because we haven't made an effort to address the issues prior to this PR anyways. I've added the automatic fixes in this PR but if the issues don't fall under that category, I think it's safer to have dedicated PRs to address them.

I'm mostly interested in keeping this PR's scope to updating the tooling and configuration. I think decisions around things like the following are better served as follow-ups:

  • deciding which rules to enable/disable
  • incorporating CI checks
  • addressing the actual issues

@@ -1,7 +1,7 @@
{
"name": "mapeo-mobile-node-next",
"version": "1.0.0",
"lockfileVersion": 2,
"lockfileVersion": 3,
Copy link
Member Author

@achou11 achou11 Jan 28, 2025

Choose a reason for hiding this comment

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

just noting that the massive diff in this file (aside from removing eslint) is due to the lockfile version changing. I think this is desirable in our case, as v3 is associated for npm v9 and later, which aligns with the versions of node that matter to us (18 + 20)

https://docs.npmjs.com/cli/v11/configuring-npm/package-lock-json#lockfileversion

not really sure why the lockfile version changed in this PR versus other PRs where we updated backend deps though 🤔

@@ -2,8 +2,8 @@ import {useEffect, useState} from 'react';
import {Duration} from 'luxon';

export const useFormattedTimeSince = (start: Date | null, interval: number) => {
const [currentTime, setCurrentTime] = useState(new Date());
let startDate = start ? new Date(start) : new Date();
const [currentTime, setCurrentTime] = useState(() => new Date());
Copy link
Member

Choose a reason for hiding this comment

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

Which rule complained about this? These are the kind of rules in eslint that bug me a bit. Yes it saves an unnecessary new Date() on each render, but that is a pico-optimization.

Copy link
Member Author

@achou11 achou11 Feb 14, 2025

Choose a reason for hiding this comment

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

https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization

yes it's a minor optimization but it's the unfortunate reality of how react works. i'd rather enforce consistency on this rather than relying on everyone to have a deep enough knowledge about this potentially consequential limitation in React

@achou11
Copy link
Member Author

achou11 commented Feb 14, 2025

did an initial pass on adjusting rules that are unanimously less helpful and addressing the resulting errors and warnings in 6f4b608.

Kind of wish I did a stacked PR so that changes in the app code could be easier to see. happy to move things around if desirable.

couple of observations:

  • not sure about turning off the unused variables rule entirely. while potentially annoying in terms of prototyping, i was able to catch a bug with it enabled. my original adjustment to the rule was to allow unusued variables if prefixed with underscores, which is a common practice. i'd personally be happier with keeping a rule like that in place.

  • not sure about turning off the no explicit any rule entirely. i found a couple of bugs because of it being used too freely without any context as to why. i'd prefer that people use the eslint disable comment to ignore the rule if they really need to use it, as it communicates proper intent.

while the bugs found so far are relatively minor, nothing stops us from introducing major bugs with these rules being disabled down the line. i'd rather put in the early foundations to mitigate those cases, even if they present some inconveniences in the development experience

@ErikSin
Copy link
Contributor

ErikSin commented Feb 19, 2025

To be discussed tomorrow.

I agree with Andrew about the No unused vars, and I find it useful to keep unnecessary code out.

The only one I dont agree with is@eslint-react/hooks-extra/no-direct-set-state-in-use-effect. I think we as a team are good at catching when useState is being used unnecessary and there are more cases then now when do have to use it in a useEffect.

Otherwise the rest of the rules seem good for me.

@achou11
Copy link
Member Author

achou11 commented Feb 19, 2025

The only one I dont agree with is@eslint-react/hooks-extra/no-direct-set-state-in-use-effect. I think we as a team are good at catching when useState is being used unnecessary and there are more cases then now when do have to use it in a useEffect.

Yeah agreed, i don't find this rule super helpful although I kind of understand the reasoning. Will disable it 👍

@achou11
Copy link
Member Author

achou11 commented Feb 20, 2025

Based on conversations, I made a couple of revisions:

  • re-enabled no unused vars rule (1793981)

  • re-enabled no unused styles rule (59eb8e9)

@achou11 achou11 merged commit ae87f94 into develop Feb 24, 2025
7 checks passed
@achou11 achou11 deleted the ac/upgrade-eslint branch February 24, 2025 21:22
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.

3 participants