Skip to content

Update dependencies including ESlint 9 upgrade #19

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YasharF
Copy link

@YasharF YasharF commented Mar 7, 2025

Breaking Change
Upgraded eslint to v9: Migrated configurations to eslint.config.js and set up the structure (index.js) so eslint.config.js can be used for linting this project and its consumers.

Upgrades
Upgraded husky to the latest version: Configured husky hook to run npm test in addition to lint-staged.
Upgraded other dependencies to their latest versions.

Improvements
Enhanced lint-staged configurations:

  • Fix lint issues when possible that could be fixed with eslint --fix
  • Use prettier to update code style if needed instead of just checking for issues.
  • Continue to check for potential lint issues after running prettier in case if there are conflicting code style rules.

TO DO (Draft until done)

  • Documentation update on how to use this new version and how to migrate existing consumers

Testing and validation:

  1. npm test and npm run lint within this project pass.
  2. I have tested my updated fork by a fork of samsam. I am waiting for Remove dependency on the deprecated lodash.get samsam#254 before pushing my samsam updates to github. The output of the npm run lint in samsam is as follows. Two new errors have surfaced for no-unused-vars, but upon review of samsam, I noticed that there are unused variables present which were being missed by the prior eslint and configs.
~/samsam/lib/create-matcher.js
    4:61  warning  Unused eslint-disable directive (no problems were reported from 'no-use-before-define')
   26:69  warning  Unused eslint-disable directive (no problems were reported from 'no-use-before-define')
  223:18  error    'e' is defined but never used                                                            no-unused-vars

~/samsam/lib/deep-equal-benchmark.js
  39:17  warning  Unused eslint-disable directive (no problems were reported from 'no-undef')
  42:17  warning  Unused eslint-disable directive (no problems were reported from 'no-undef')
  44:17  warning  Unused eslint-disable directive (no problems were reported from 'no-undef')

~/samsam/lib/deep-equal.test.js
  836:13  warning  Unused eslint-disable directive (no problems were reported from 'mocha/no-setup-in-describe')

~/samsam/lib/is-element.js
  23:14  error  'e' is defined but never used  no-unused-vars

~/samsam/lib/iterable-to-string.js
  32:5  warning  Unused eslint-disable directive (no problems were reported from '@sinonjs/no-prototype-methods/no-prototype-methods')
  51:5  warning  Unused eslint-disable directive (no problems were reported from '@sinonjs/no-prototype-methods/no-prototype-methods')

~/samsam/lib/match.js
  9:53  warning  Unused eslint-disable directive (no problems were reported from 'no-use-before-define')

~/samsam/lib/match.test.js
  272:13  warning  Unused eslint-disable directive (no problems were reported from 'mocha/no-setup-in-describe')

✖ 12 problems (2 errors, 10 warnings)
  0 errors and 10 warnings potentially fixable with the `--fix` option.

Copy link

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

Package New capabilities Transitives Size Publisher
npm/eslint-plugin-compat@4.2.06.0.2 Transitive: environment +18 37.6 MB amilajack
npm/eslint-plugin-jsdoc@48.2.350.6.3 Transitive: environment +23 4.54 MB gajus
npm/eslint-plugin-mocha@10.4.310.5.0 None +5 1.41 MB lo1tuma
npm/eslint@8.57.09.21.0 Transitive: eval, shell, unsafe +84 6.09 MB
npm/husky@7.0.49.1.7 None 0 4.04 kB typicode
npm/lint-staged@15.2.215.4.3 Transitive: environment, filesystem, shell +54 2.27 MB okonet
npm/prettier@3.2.53.5.3 None 0 0 B

View full report↗︎

@YasharF
Copy link
Author

YasharF commented Mar 7, 2025

I can take a stab at upgrading sinonjs modules that consume eslint-config for further validation, if you don't have any overall issues with the changes and just need further validation and testing.

@YasharF YasharF marked this pull request as draft March 27, 2025 19:18
@YasharF
Copy link
Author

YasharF commented Mar 27, 2025

I changed the status to draft as I need to update the documentation on using this new version and how to migrate existing consumers. I will try to do that in the next few weeks.

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.

1 participant