Closed evliu closed 6 years ago
got it to work by adding @neutrinojs/eslint
and changing the index.js to
const loaderMerge = require('@neutrinojs/loader-merge');
const merge = require('deepmerge');
module.exports = (neutrino, options) => {
neutrino.config.module
.rule('lint')
.use('eslint')
.tap(({ rules, plugins, baseConfig, ...rest }) => ({
...rest,
rules: merge(rules, { 'flowtype-errors/show-errors': 'error' }),
plugins: [...plugins, 'flowtype', 'flowtype-errors'],
baseConfig: { extends: [...baseConfig.extends || [], 'plugin:flowtype/recommended'] }
}));
neutrino.use(loaderMerge('compile', 'babel'), {
presets: ['flow']
});
};
Yes you are right, I just tested it and it seems that eslint
is also a dependency, I didn't realise that. I'll update the readme. Thanks :)
The other issue I found is that baseConfig is an empty object which is why I used the || operator
You shouldn't need to do that because the flow plugin injects plugin:flowtype/recommended
for you. See here https://github.com/nwaywood/neutrino-preset-flow/blob/master/index.js#L17-L19
The issue is actually that baseConfig is empty so there is no extends
property, thus it tries to concat on undefined
Ah I understand now. Thanks.
I never run into this issue myself because I am using neutrino-preset-prettier-eslint
which creates the extends field for prettier.
I just pushed v0.0.4 which should fix your issue https://www.npmjs.com/package/neutrino-preset-flow
Please let me know if that doesn't work
Thanks! It works now except I get a new issue, which I'll make issue #3
This happens when I launch the project:
thoughts? thanks!