Skip to content

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