-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
29 lines (28 loc) · 961 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const loaderMerge = require("@neutrinojs/loader-merge")
const merge = require("deepmerge")
module.exports = (neutrino, options) => {
neutrino.config.module
.rule("lint")
.use("eslint")
.tap(options =>
Object.assign({}, options, {
rules: merge(options.rules, {
"flowtype-errors/show-errors": "error"
}),
plugins: options.plugins.concat([
"flowtype",
"flowtype-errors"
]),
baseConfig: {
extends: options.baseConfig.extends
? options.baseConfig.extends.concat([
"plugin:flowtype/recommended"
])
: ["plugin:flowtype/recommended"]
}
})
)
neutrino.use(loaderMerge("compile", "babel"), {
presets: ["flow"]
})
}