Kenneth-Sills / eslint-config-airbnb-typescript

Airbnb's ESLint config with TypeScript support
MIT License
22 stars 0 forks source link

fix!: correct the peer dependency requirement of the AirBnB React config #20

Closed Kenneth-Sills closed 2 months ago

Kenneth-Sills commented 2 months ago

This was meant to be the latest version, but the base and React configs appear to be out of sync and I mistakenly assumed they would be the same. As always, assumptions are the root of all evil.

While Airbnb <= 19 did not support ESLint 8, this was not specified in the project dependencies so conflict resolution would NOT prevent us from being installed alongside Airbnb 15. Subsequently, this is being marked as a breaking change since it could technically cause a working downstream project to cross major version boundaries.

Closes #19

Kenneth-Sills commented 2 months ago

Confirmed that the existing trunk does not install correctly with the React config:

Click to Open

```txt ❯ npm install -D @kesills/eslint-config-airbnb-typescript eslint-config-airbnb npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: eslint-config-airbnb@15.1.0 npm error Found: eslint@8.57.1 npm error node_modules/eslint npm error peer eslint@"^8.57.0" from @kesills/eslint-config-airbnb-typescript@19.0.0 npm error node_modules/@kesills/eslint-config-airbnb-typescript npm error dev @kesills/eslint-config-airbnb-typescript@"*" from the root project npm error peer eslint@">=8.40.0" from @stylistic/eslint-plugin@2.8.0 npm error node_modules/@stylistic/eslint-plugin npm error peer @stylistic/eslint-plugin@"^2.6.1" from @kesills/eslint-config-airbnb-typescript@19.0.0 npm error node_modules/@kesills/eslint-config-airbnb-typescript npm error dev @kesills/eslint-config-airbnb-typescript@"*" from the root project npm error 7 more (@typescript-eslint/eslint-plugin, ...) npm error npm error Could not resolve dependency: npm error peer eslint@"^3.19.0 || ^4.3.0" from eslint-config-airbnb@15.1.0 npm error node_modules/eslint-config-airbnb npm error dev eslint-config-airbnb@"*" from the root project npm error peerOptional eslint-config-airbnb@"^15.0.0" from @kesills/eslint-config-airbnb-typescript@19.0.0 npm error node_modules/@kesills/eslint-config-airbnb-typescript npm error dev @kesills/eslint-config-airbnb-typescript@"*" from the root project npm error npm error Conflicting peer dependency: eslint@4.19.1 npm error node_modules/eslint npm error peer eslint@"^3.19.0 || ^4.3.0" from eslint-config-airbnb@15.1.0 npm error node_modules/eslint-config-airbnb npm error dev eslint-config-airbnb@"*" from the root project npm error peerOptional eslint-config-airbnb@"^15.0.0" from @kesills/eslint-config-airbnb-typescript@19.0.0 npm error node_modules/@kesills/eslint-config-airbnb-typescript npm error dev @kesills/eslint-config-airbnb-typescript@"*" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error /home/kesills/.npm/_logs/2024-09-16T22_12_21_949Z-eresolve-report.txt npm error A complete log of this run can be found in: /home/kesills/.npm/_logs/2024-09-16T22_12_21_949Z-debug-0.log ```

Confirmed that this branch installs correctly:

Click to Open

```txt ❯ npm install -D "git@github.com:Kenneth-Sills/eslint-config-airbnb-typescript.git#kesills-19-aiwrong-airbnb-version" eslint-config-airbnb npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead added 280 packages, and audited 281 packages in 9s 115 packages are looking for funding run `npm fund` for details found 0 vulnerabilities ```

Creating a stub eslint.config.js and tsconfig.json, runs work as expected:

Click to Open

```txt ❯ npx eslint . ============= WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree. You may find that it works just fine, or you may not. SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.6.0 YOUR TYPESCRIPT VERSION: 5.6.2 Please only submit bug reports when using the officially supported version. ============= Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting. /home/kesills/Documents/tmp/bar/eslint.config.js 1:1 error '@eslint/eslintrc' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies ✖ 1 problem (1 error, 0 warnings) ``` (Yes, those are fine.)

github-actions[bot] commented 2 months ago

:tada: This issue has been resolved in version 20.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Kenneth-Sills commented 2 months ago

Both confirmations repeated post-release, looks good.