mirror of https://github.com/alibaba/ice.git
refactor: rename eslintLoaderOptions to eslint (#290)
* refactor: rename eslintLoaderOptions to eslint * feat: support eslint boolean
This commit is contained in:
parent
909ecbbf44
commit
1e566c905a
|
|
@ -6,7 +6,7 @@
|
|||
"ignoreHtmlTemplate": false
|
||||
}
|
||||
},
|
||||
"eslintLoaderOptions": {
|
||||
"eslint": {
|
||||
"disable": false,
|
||||
"quiet": true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,5 @@ module.exports = {
|
|||
compileDependencies: [],
|
||||
babelPlugins: [],
|
||||
babelPresets: [],
|
||||
eslintLoaderOptions: {
|
||||
disable: false
|
||||
}
|
||||
eslint: true
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,5 +63,7 @@ module.exports = {
|
|||
compileDependencies: 'array',
|
||||
babelPlugins: 'array',
|
||||
babelPresets: 'array',
|
||||
eslintLoaderOptions: 'object'
|
||||
eslint: (val) => {
|
||||
return validation('eslint', val, 'boolean|object');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
const path = require('path');
|
||||
|
||||
module.exports = (config, eslintLoaderOptions, { rootDir }) => {
|
||||
const { disable, ...args } = eslintLoaderOptions;
|
||||
module.exports = (config, eslint, { rootDir }) => {
|
||||
if (typeof eslint === 'boolean' && eslint === false) {
|
||||
return config;
|
||||
}
|
||||
const { disable, ...args } = eslint;
|
||||
if (!disable) {
|
||||
const appSrc = path.join(rootDir, 'src');
|
||||
config.module
|
||||
Loading…
Reference in New Issue