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
Settings are ignored using CLIEngine #4402
Comments
Thanks for the issue! If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. |
This is on eslint 1.9.0. |
Have you tried this: var cli = new CLIEngine({
baseConfig: {
plugins: [ 'format-message' ],
rules: {
'format-message/literal-locale': 1,
'format-message/literal-pattern': 1,
'format-message/no-identical-translation': 1,
'format-message/no-invalid-pattern': 2,
'format-message/no-invalid-translation': 2,
'format-message/no-missing-params': [ 2, { 'allowNonLiteral': true } ],
'format-message/no-missing-translation': 1,
'format-message/translation-match-params': 2
},
settings: {
'format-message': {
translations: { en: { foo: 'bar' } }
}
}
}
}); Here is the API docs: http://eslint.org/docs/developer-guide/nodejs-api#cliengine |
\o/ That gets settings through! I could have sworn I tried that, but perhaps I had a typo in there 😕. Thanks! Now to figure out why I'm not seeing the lint errors I expect... |
Also got bitten by this issue - it's not really intuitive, maybe a |
I'm having trouble using the CLIEngine to create a cli tool for validating internationalization (via format-message).
I was able to create a plugin that works great when using the actual eslint cli, but cannot seem to getting
settings
to get through to the rules usingCLIEngine
. I have tried puttingsettings
on both the root options object, as well as inside abaseConfig
object, and either waycontext.settings
is always an empty object inside my rules. I have not tried usingconfigFile
(which likely works), because the settings are dynamic, and I'd rather avoid writing a temp file just to pass settings.Is there a way to pass the desired
settings
for use incli.executeOnText
?Here is roughly the code I am using:
The text was updated successfully, but these errors were encountered: