Skip to content

New configuration DSL and per-file magic comments #182

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

Merged
merged 11 commits into from
Jan 30, 2023

Conversation

jaredcwhite
Copy link
Member

This PR builds on top of #178 to provide a way to configure a project simply by adding config/ruby2js.rb to the project root. Example:

preset

filter :camelCase
filter :lit

eslevel 2022

equality_comparison

nullish_or

use_strict true

autoimport :FooBar, "@org/package/foobar.js"

include_method :class
include_method :call

In addition, you can now use a per-file magic comment to change some options such as which filters to use or the eslevel, or to disable one of the preset filters.

# ruby2js: preset, filters: camelCase

# ruby2js: preset, eslevel: 2022

# ruby2js: preset, disable_filters: return

@jaredcwhite jaredcwhite merged commit 18c4bc8 into create-preset-option Jan 30, 2023
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.

1 participant