Skip to content

Commit 49bd4bf

Browse files
committed
moving eslint options into webpack
1 parent 47d665f commit 49bd4bf

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

Diff for: packages/react-scripts/config/webpack.config.dev.js

+43-11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,48 @@ const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
2020
const getClientEnvironment = require('./env');
2121
const paths = require('./paths');
2222

23+
// AUTOMATA
24+
// Our customized eslint options
25+
const eslintOptions = {
26+
formatter: eslintFormatter,
27+
eslintPath: require.resolve('eslint'),
28+
baseConfig: {
29+
extends: [require.resolve('eslint-config-airbnb')],
30+
env: {
31+
browser: true
32+
},
33+
},
34+
rules: {
35+
complexity: [
36+
'warn',
37+
11
38+
],
39+
'no-case-declarations': 'warn',
40+
'no-console': 'warn',
41+
'react/jsx-filename-extension': [
42+
'error',
43+
{
44+
'extensions': [
45+
'.js',
46+
'.jsx'
47+
]
48+
}
49+
],
50+
'react/jsx-no-bind': 'warn',
51+
'react/no-array-index-key': 'warn',
52+
'react/prefer-stateless-function': 'warn',
53+
'react/prop-types': [
54+
'error',
55+
{
56+
'skipUndeclared': true
57+
}
58+
]
59+
},
60+
ignore: false,
61+
useEslintrc: true,
62+
};
63+
64+
2365
// Webpack uses `publicPath` to determine where the app is being served from.
2466
// In development, we always serve from the root. This makes config easier.
2567
const publicPath = '/';
@@ -128,17 +170,7 @@ module.exports = {
128170
enforce: 'pre',
129171
use: [
130172
{
131-
options: {
132-
formatter: eslintFormatter,
133-
eslintPath: require.resolve('eslint'),
134-
// @remove-on-eject-begin
135-
baseConfig: {
136-
extends: [require.resolve('eslint-config-airbnb')],
137-
},
138-
ignore: false,
139-
// useEslintrc: false,
140-
// @remove-on-eject-end
141-
},
173+
options: eslintOptions,
142174
loader: require.resolve('eslint-loader'),
143175
},
144176
],

0 commit comments

Comments
 (0)