-
Notifications
You must be signed in to change notification settings - Fork 25
chore: migrate to ESLint flat config and pnpm #279
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
base: v2
Are you sure you want to change the base?
Conversation
BREAKING CHANGE: The minimum Node.js engine requirement has been bumped from >=14 to >=18.6.0 to match tap's minimum engine requirement. This ensures compatibility with our test suite. - Update tap from 16.3.10 to 21.1.0 - Update various dev dependencies - Clean up linting rules and improve code quality
This stack of pull requests is managed by Graphite. Learn more about stacking. |
engine to 18.6.0
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a license policy violation?This package is not allowed per your license policy. Review the package's license to ensure compliance. Find a package that does not violate your license policy or adjust your policy to allow this package's license. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
- Changed test assertions in `parse.test.ts` and `typeEvaluate.test.ts` from `t.matchSnapshot` to `t.same` for improved clarity and consistency in output comparison. - Removed unused snapshot files from `tap-snapshots/test/` to clean up the repository. - Updated the test command in `package.json` to remove coverage report generation for simplicity.
- Modified the test command in `package.json` to use `tap run` for improved execution. - Added configuration options for coverage reporting and incomplete coverage handling in the `tap` section of `package.json`.
- Replaced instances of `TAP` with a derived `Test` type for improved type safety and clarity in `typeEvaluateCompare.test.ts` and `typeEvaluateObjects.test.ts`. - This change enhances the maintainability of the test code by ensuring consistent type usage across test cases.
- Removed the deprecated "lts/-1" version from the Node.js version matrix in the GitHub Actions workflow configuration. - This change ensures that the CI pipeline tests against the latest supported Node.js versions.
- Removed `package-lock.json` and added `pnpm-lock.yaml` for better dependency management with pnpm. - Updated `package.json` to specify the pnpm version and ensure compatibility with the new lockfile. - Modified CI configuration to use pnpm for installing dependencies and running scripts, enhancing the build process.
- Replaced the `prettify-check` command with `lint` in the GitHub Actions workflow to ensure code quality checks are performed during the CI process.
…onfig include - Added `@microsoft/api-extractor` as a development dependency in `package.json` for improved API documentation generation. - Updated `tsconfig.json` to include TypeScript files in the `src` directory for better type checking and compilation.
engine to 18.6.0| cache: pnpm | ||
| - uses: pnpm/action-setup@v2 | ||
| with: | ||
| version: 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.json says that we're using PNPM v9 🤔

Motivation
This PR updates the project's linting setup to use ESLint's modern "Flat Config" system (
eslint.config.mjs) and standardizes onpnpmas the package manager. This provides a more explicit and potentially more maintainable configuration structure, aligns with the direction of the ESLint ecosystem, and ensures consistent dependency management.This is the foundational change in a series of PRs aimed at refactoring and improving the codebase.
Key Changes:
ESLint Flat Config Migration:
.eslintrc.jsand.eslintignorefiles.eslint.config.mjsfile usingtseslint.config().eslint.configs.recommended,eslintPluginPrettierRecommended,tseslint.configs.recommended).@typescript-eslint/no-explicit-any: 'off',no-console: 'error', basic unused vars handling).ignoresarray in the config to specify files/directories to exclude from linting (replacing.eslintignore).Switch to pnpm:
package-lock.jsonwithpnpm-lock.yaml..github/workflows/test.yml) to usepnpmfor installing dependencies and running scripts (pnpm install,pnpm run lint,pnpm test,pnpm run build).pnpm/action-setupto the CI workflow for efficient pnpm caching.Dependency Cleanup:
eslint-config-sanityandeslint-plugin-simple-import-sortas linting configuration is now handled directly or via standard recommended sets. (More specific import linting will be added in a subsequent PR).Script Updates:
lintscript (eslint .) topackage.json.lintscript instead of the previousprettify-check..gitignoreUpdate:.tapto ignore tap test snapshot/output directories.Impact
pnpmfor dependency management.pnpm.