Add environment specific ESLint Configs #1260
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Some lint rules like
no-debugger
are set to error by the extended plugins and this causes the usage debugger points to fail the development build. And during development we can supress the errors but it'll lead to these debug points to be pushed to vcs by mistake since the build will not catch them due to the supression.Goals
This PR introduces the ability to have environment specific lint rules.
Approach
Added a new ESLint config for production that is extended from the base config and can be used to override any rule that should be applied only in production.
TODO
eslint-loader
was deprecated in favor ofeslint-webpack-plugin
. Tried to migrate but faced some issues due to the plugin being unstable. Migration has to be only done when the issues are solved by the developers of the plugin.Tracker - wso2/product-is#10009