Skip to content
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

Protect config files from declaring invalid keys #772

Closed
kumar303 opened this issue Jan 23, 2017 · 1 comment
Closed

Protect config files from declaring invalid keys #772

kumar303 opened this issue Jan 23, 2017 · 1 comment
Assignees

Comments

@kumar303
Copy link
Contributor

This is part of implementing #176

Let's say you have a config with a typo in it:

module.exports = {
  sourceDirectory: './src',
};

This should raise an error like "sourceDirectory is not a valid config key."

This would also naturally raise an error for non-camel cased options, like:

module.exports = {
  'source-dir': './src',
};

-> "source-dir is not a valid config key."

@shubheksha
Copy link
Contributor

@kumar303, for this patch, I think we discussed the approach a little while back. We'll have to keep track of all the options and see if we can find the key in the config in, say, an array. Does that sound right? I think I suggested hard coding the options into the array but that'll become chaotic quickly as and when we add new options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants