Skip to content

Commit 6ed424d

Browse files
committed
Remove module.exports from directly mentioned in comments
1 parent 94aef98 commit 6ed424d

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

lib/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RubyVariables.WRAPPER(
2828
define(routes) {
2929
if (module) {
3030
// Some javascript processors (like vite/rolldown)
31-
// warn on using `module.exports` in an ESM module.
31+
// warn on using module dot exports in an ESM module.
3232
// This just obfuscates that assignment a little so
3333
// users don't get a warning they can't fix.
3434
const _mod = module;

lib/routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ RubyVariables.WRAPPER(
148148
define(routes) {
149149
if (module) {
150150
// Some javascript processors (like vite/rolldown)
151-
// warn on using `module.exports` in an ESM module.
151+
// warn on using module dot exports in an ESM module.
152152
// This just obfuscates that assignment a little so
153153
// users don't get a warning they can't fix.
154154
const _mod = module;

spec/js_routes/options_spec.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,7 @@
524524

525525
describe "module.exports usage" do
526526
it "doesn't include module.exports" do
527-
# We mention `module.exports` in the comments of routes.ts, just so it's clear
528-
# why the expression is so weird there.
529-
js_without_comments = generated_js.lines.map { it.gsub(/\/\/.*$/, "") }.join("\n")
530-
expect(js_without_comments).not_to include("module.exports")
527+
expect(generated_js).not_to include("module.exports")
531528
end
532529
end
533530

0 commit comments

Comments
 (0)