-
Notifications
You must be signed in to change notification settings - Fork 8
/
.neutrinorc.js
61 lines (61 loc) · 1.95 KB
/
.neutrinorc.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
module.exports = {
use: [
['@neutrinojs/airbnb-base', {
eslint: {
fix: true,
emitWarning: process.env.NODE_ENV === 'development',
baseConfig: {
extends: ['eslint-config-prettier'],
},
plugins: ['eslint-plugin-prettier'],
rules: {
'class-methods-use-this': 'off',
'prettier/prettier': [
'error',
{
singleQuote: true,
bracketSpacing: true,
jsxBracketSameLine: true,
trailingComma: 'es5',
},
{ usePrettierrc: false },
],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'never', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
{ blankLine: 'always', prev: 'multiline-block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: ['if', 'do', 'for', 'switch', 'try', 'while'] },
{ blankLine: 'always', prev: '*', next: 'return' },
],
'no-console': process.env.NODE_ENV === 'development' ? 'off' : 'error',
'no-nested-ternary': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
}
}
}],
['@neutrinojs/node', {
hot: false,
babel: {
plugins: [
require.resolve('babel-plugin-transform-object-rest-spread'),
],
},
}],
(neutrino) => {
// replace start-server with restart-server
neutrino.config.when(neutrino.options.command === 'start', config => {
config.plugins.delete('start-server');
neutrino.use(['neutrino-middleware-restart-server', {
name: 'index.js',
}]);
});
neutrino.config.module
.rule('graphql')
.test(/\.graphql$/)
.use('raw')
.loader(require.resolve('raw-loader'));
}
],
};