Currently eslint use yaml.safeLoad()
without options which disabling executing JavaScript. I think using DEFAULT_FULL_SCHEMA
may be better.
Use case:
I'm using eslint-import-resolver-webpack
with a generated webpack config file so I have to manually embed webpack resolving rules. Unfortunately, absolute path are required for resolvers to work correctly. With raw yaml files, it is just impossible because the absolute path should be generated from the current path of the project. To workaround this, I have to change eslintrc format entirely from YAML to JavaScript.
Hi, thanks for the proposal.
Hmm, I'm unsure about this -- it seems like the point of using a yaml config file would be to make it static.
To workaround this, I have to change eslintrc format entirely from YAML to JavaScript.
Is this a problem? Using a JavaScript config file is the recommended course of action if you want to execute JavaScript in your config file.
I was thinking about reducing the capability gap between different config formats so that they only differs in "formats" :P
:-1: Interesting idea, but I don't think we want to do this. We added the JS config file format for users who need dynamic calculation of values. I don't think there's much benefit to allow JS in Yaml files. If we did, it would be severely limited so as to not be very useful. I don't think there's any user expectation around Yaml being used this way in our config files, nor do I think it provides much of an advantage if implemented.
Most helpful comment
Hi, thanks for the proposal.
Hmm, I'm unsure about this -- it seems like the point of using a yaml config file would be to make it static.
Is this a problem? Using a JavaScript config file is the recommended course of action if you want to execute JavaScript in your config file.