From f62c516d2ee411fb3156845005f18561111397fa Mon Sep 17 00:00:00 2001 From: Steve Polito Date: Fri, 19 Apr 2024 16:25:48 -0400 Subject: [PATCH] Lint Generator: Account for breaking changes in ESLint (#1192) The recent release of [ESLint v9.0.0][] made it so [flat config][] is the new default. Until we can update [thoughtbot/eslint-config][] to [support][] this version, we'll pin ESLint to `^8.9.0` in an effort to ship this next release of Suspenders. [ESLint v9.0.0]: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/ [flat config]: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/#flat-config-is-now-the-default-and-has-some-changes [thoughtbot/eslint-config]: https://github.com/thoughtbot/eslint-config [support]: https://github.com/thoughtbot/eslint-config/issues/10 --- lib/generators/suspenders/lint_generator.rb | 4 +++- test/generators/suspenders/lint_generator_test.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/generators/suspenders/lint_generator.rb b/lib/generators/suspenders/lint_generator.rb index abd00e0c6..20d2f791f 100644 --- a/lib/generators/suspenders/lint_generator.rb +++ b/lib/generators/suspenders/lint_generator.rb @@ -14,8 +14,10 @@ def check_package_json end end + # TODO: Remove eslint version pin once the follownig is solved + # https://github.com/thoughtbot/eslint-config/issues/10 def install_dependencies - run "yarn add stylelint eslint @thoughtbot/stylelint-config @thoughtbot/eslint-config npm-run-all prettier --dev" + run "yarn add stylelint eslint@^8.9.0 @thoughtbot/stylelint-config @thoughtbot/eslint-config npm-run-all prettier --dev" end def install_gems diff --git a/test/generators/suspenders/lint_generator_test.rb b/test/generators/suspenders/lint_generator_test.rb index de21ef204..e6364e84e 100644 --- a/test/generators/suspenders/lint_generator_test.rb +++ b/test/generators/suspenders/lint_generator_test.rb @@ -15,7 +15,7 @@ class LintGeneratorTest < Rails::Generators::TestCase capture(:stderr) do output = run_generator - assert_match(/yarn add stylelint eslint @thoughtbot\/stylelint-config @thoughtbot\/eslint-config npm-run-all prettier --dev/, output) + assert_match(/yarn add stylelint eslint@\^8\.9\.0 @thoughtbot\/stylelint-config @thoughtbot\/eslint-config npm-run-all prettier --dev/, output) end end