Skip to content

Commit

Permalink
Lint Generator: Account for breaking changes in ESLint (#1192)
Browse files Browse the repository at this point in the history
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]: thoughtbot/eslint-config#10
  • Loading branch information
stevepolitodesign authored Apr 19, 2024
1 parent 5b133e7 commit f62c516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/generators/suspenders/lint_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/generators/suspenders/lint_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f62c516

Please sign in to comment.