-
-
Notifications
You must be signed in to change notification settings - Fork 199
Description
Webpack encore adds built in support for a coupld of "wide spread" front end libraries. Being ReactJs, jQuery and SASS.
There is however one that is even more widespread: eslint. Having an .enableEslint() (or even enabling it by default in non production mode) would be a plus.
However, if we go along the "default should be good enough" path. This means taking a side in the many different code-styles that exist in the JavaScript world.
A small list:
- https://www.drupal.org/docs/develop/standards/javascript/javascript-coding-standards
- https://google.github.io/styleguide/jsguide.html
- https://github.com/airbnb/javascript
- https://github.com/rwaldron/idiomatic.js/
- https://github.com/standard/standard
Instead of choosing a side, symfony could use the default eslint, with the possibility to change the "extends" property.
.enableEslint({
extends: "airbnb"
})
Combining this with .autoProvidejQuery() and .enableReactPreset() would basically resort to something like
.addLoader({
test: /\.(js|jsx)$/,
loader: 'eslint-loader',
exclude: [/node_modules/],
enforce: "pre",
options: {
"extends": "airbnb",
"parser": "babel-eslint",
"settings": {
"import/resolver": {
"webpack": {
"config": "webpack.config.js"
}
}
},
"globals": {
"$": false
}
emitWarning: true
}
})
Is this something webpack encore is willing to add? If so, what path do we take?