Skip to content
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

feat!: support ESLint v8 #374

Merged
merged 4 commits into from
Nov 16, 2021
Merged

Conversation

diescake
Copy link
Contributor

@diescake diescake commented Oct 28, 2021

依存ライブラリを諸々アップデートして eslint-config-smarthr を ESLint v8 に対応させたい!

やったこと

  • 3626b17 CIのdockerのバージョンが残念な感じになっていたので修正 & アップデート
  • 1d03189 👆はrenovateのPRが原因だったので対象をnpmに限定して対策
  • c2624a8 依存ライブラリのバージョンを一斉age
  • 7032222 Jestがpackage.jsonのexportsを参照してくれない問題があるため、moduleNameMapperを書いて暫定対処
$ yarn test でこんなエラーが発生していた。
[diescake:eslint-config-smarthr]$ yarn test
yarn run v1.22.10
$ jest
 FAIL  test/run.test.js
  fixtures
    ✕ should match the snapshot (596 ms)

  ● fixtures › should match the snapshot

    Failed to load plugin '@typescript-eslint' declared in '--config » ./configs/typescript.js': Cannot find module 'eslint/use-at-your-own-risk' from 'node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js'

    Require stack:
      node_modules/@typescript-eslint/eslint-plugin/dist/rules/brace-style.js
      node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js
      node_modules/@typescript-eslint/eslint-plugin/dist/index.js
      node_modules/@eslint/eslintrc/dist/eslintrc.cjs
      node_modules/eslint/lib/cli-engine/cli-engine.js
      node_modules/eslint/lib/eslint/eslint.js
      node_modules/eslint/lib/eslint/index.js
      node_modules/eslint/lib/api.js
      test/lib/runLint.js
      test/run.test.js

    Referenced from: /Users/diescake/workspace/eslint-config-smarthr/configs/typescript.js

      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)
      at node_modules/@typescript-eslint/eslint-plugin/src/util/getESLintCoreRule.ts:47:11
      at Object.<anonymous> (node_modules/@typescript-eslint/eslint-plugin/src/rules/brace-style.ts:10:35)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        1.216 s, estimated 2 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

TODO

@diescake diescake marked this pull request as ready for review October 28, 2021 12:06
@diescake diescake requested a review from a team as a code owner October 28, 2021 12:06
@diescake diescake requested review from nabeliwo and negiandleek and removed request for a team, nabeliwo and negiandleek October 28, 2021 12:06
@diescake diescake self-assigned this Oct 28, 2021
@diescake diescake marked this pull request as draft October 28, 2021 13:59
@diescake diescake changed the title [WIP] chore: remove the node v10 build and add the v14 build on CircleCI chore: remove the node v10 build and add the v14 build on CircleCI Oct 28, 2021
@diescake diescake changed the title chore: remove the node v10 build and add the v14 build on CircleCI chore: support ESLint v8 Oct 28, 2021
@diescake diescake changed the title chore: support ESLint v8 [WIP] chore: support ESLint v8 Nov 2, 2021
@diescake diescake marked this pull request as ready for review November 2, 2021 11:51
@koba04
Copy link
Collaborator

koba04 commented Nov 11, 2021

Jest hasn't supported the exports field yet, so we have to use a workaround some thing like this.
jestjs/jest#9771

  "jest": {
    "moduleNameMapper": {
       "eslint/use-at-your-own-risk": "eslint/lib/unsupported-api.js"
    }
  }

I've found that eslint-plugin-jest does the same workaround.
jest-community/eslint-plugin-jest#940

@diescake diescake force-pushed the migrate-eslint-to-v8 branch 2 times, most recently from b83c7e6 to a4ec035 Compare November 11, 2021 14:56
@diescake diescake changed the title [WIP] chore: support ESLint v8 feat: support ESLint v8 Nov 11, 2021
prevent unexpected updates of node versions in config.yml
- Jest hasn't supported the exports field yet, so we have to use a workaround some thing like this.
  - jestjs/jest#9771
@diescake diescake changed the title feat: support ESLint v8 chore!: support ESLint v8 Nov 11, 2021
@diescake diescake changed the title chore!: support ESLint v8 feat!: support ESLint v8 Nov 11, 2021
@diescake diescake requested review from a team, yt-ymmt and MRTAFU and removed request for a team November 11, 2021 15:04
@diescake diescake mentioned this pull request Nov 11, 2021
1 task
Copy link
Contributor

@yt-ymmt yt-ymmt left a comment

Choose a reason for hiding this comment

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

:igyo: :lgtm:

@diescake
Copy link
Contributor Author

@yt-ymmt あざます!!

1-approve いただけたのでマージします〜

@diescake diescake merged commit 8394bd6 into kufu:master Nov 16, 2021
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