-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.neutrinorc.js
More file actions
57 lines (53 loc) · 1.7 KB
/
.neutrinorc.js
File metadata and controls
57 lines (53 loc) · 1.7 KB
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
const { join } = require('path');
const reactLint = require('@mozilla-frontend-infra/react-lint');
const reactComponents = require('@neutrinojs/react-components');
const jest = require('@neutrinojs/jest');
require('babel-register')({
plugins: [
[require.resolve('babel-plugin-transform-es2015-modules-commonjs'), {
useBuiltIns: true
}],
require.resolve('babel-plugin-transform-object-rest-spread'),
],
cache: false,
});
const theme = require('./src/theme').default;
module.exports = {
use: [
reactLint({
rules: {
'react/jsx-filename-extension': 'off',
'react/jsx-props-no-spreading': 'off',
// We use @babel/plugin-proposal-class-properties to allow those
'react/static-property-placement': 'off',
// We use @babel/plugin-proposal-class-properties to allow those
'react/state-in-constructor': 'off',
},
}),
reactComponents(),
(neutrino) => {
neutrino.config.resolve.alias
.set('react-dom', '@hot-loader/react-dom');
neutrino.register('styleguide', () => ({
webpackConfig: neutrino.config.toConfig(),
components: join(
neutrino.options.source,
'components/**',
`*.{${neutrino.options.extensions.join(',')}}`
),
usageMode: 'expand',
showSidebar: false,
skipComponentsWithoutExample: true,
theme: theme.styleguide,
styles: {
StyleGuide: theme.styleguide.StyleGuide,
},
styleguideComponents: {
Wrapper: join(__dirname, 'src/styleguide/ThemeWrapper.jsx'),
StyleGuideRenderer: join(__dirname, 'src/styleguide/StyleGuideRenderer.jsx'),
},
}));
},
jest(),
],
};