Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion template/react/eslint.config.js.tt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export default [
...importPlugin.flatConfigs.recommended,
...importPlugin.flatConfigs.react,
rules: {
"react/prop-types": "off",
"import/order": [
"error",
{
Expand Down
24 changes: 19 additions & 5 deletions test/e2e_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@
class E2eTest < Minitest::Test
COMPILED_TEMPLATE = E2eHelpers.compiled_template_path

JS_ESLINT = {
"INERTIA_STARTER_KIT" => "0",
"INERTIA_TS" => "0",
"INERTIA_TAILWIND" => "0",
"INERTIA_ESLINT" => "1",
"INERTIA_SSR" => "0",
"INERTIA_SYSTEM_TESTS" => "0"
}.freeze

# Test configurations: [name, env_vars]
# 5 configs covering the key code paths (~3 min total).
# Extended configs for pre-release matrix runs are in matrix_test.rb.
CONFIGS = {
# ─── Starter Kit (all options forced on) ─────────────────────────
Expand Down Expand Up @@ -55,6 +63,9 @@ class E2eTest < Minitest::Test
"INERTIA_TEAMS" => "1"
},
# ─── Foundation (individual options) ─────────────────────────────
"react_js_eslint" => JS_ESLINT.merge("INERTIA_FRAMEWORK" => "react"),
"vue_js_eslint" => JS_ESLINT.merge("INERTIA_FRAMEWORK" => "vue"),
"svelte_js_eslint" => JS_ESLINT.merge("INERTIA_FRAMEWORK" => "svelte"),
"vue_minimal" => {
"INERTIA_FRAMEWORK" => "vue",
"INERTIA_STARTER_KIT" => "0",
Expand Down Expand Up @@ -139,6 +150,12 @@ def assert_core_files(app_path, env)
assert File.exist?(File.join(app_path, "Procfile.dev")), "Missing Procfile.dev"
assert File.exist?(File.join(app_path, "bin/dev")), "Missing bin/dev"

if env["INERTIA_STARTER_KIT"] == "1" || env["INERTIA_ESLINT"] == "1"
%w[eslint.config.js .prettierrc .prettierignore].each do |file|
assert File.file?(File.join(app_path, file)), "Missing #{file}"
end
end

gemfile = File.read(File.join(app_path, "Gemfile"))
assert gemfile.include?("inertia_rails"), "Gemfile missing inertia_rails"
vite_gem = env.fetch("INERTIA_VITE", "rails_vite")
Expand Down Expand Up @@ -279,7 +296,6 @@ def assert_builds_pass(app_path, name, env)
assert st.success?, "vite build --ssr failed for #{name}:\n#{tail("#{out}\n#{err}")}"
end

# Run npm scripts only if they exist in package.json
pkg = JSON.parse(File.read(File.join(app_path, "package.json")))
scripts = pkg.fetch("scripts", {})

Expand All @@ -288,12 +304,10 @@ def assert_builds_pass(app_path, name, env)
assert st.success?, "npm run check failed for #{name}:\n#{tail("#{out}\n#{err}")}"
end

if scripts.key?("lint")
if is_starter_kit || env["INERTIA_ESLINT"] == "1"
out, err, st = run_in_app(app_path, "npm run lint")
assert st.success?, "npm run lint failed for #{name}:\n#{tail("#{out}\n#{err}")}"
end

if scripts.key?("format")
out, err, st = run_in_app(app_path, "npm run format")
assert st.success?, "npm run format failed for #{name}:\n#{tail("#{out}\n#{err}")}"
end
Expand Down
Loading