fix(joyent-cp-frontend): patch react-scripts to use eslintrc
This commit is contained in:
parent
b22121cb93
commit
ce3f63eaae
2
.gitignore
vendored
2
.gitignore
vendored
@ -159,5 +159,3 @@ packages/*/dist
|
||||
packages/*/buid
|
||||
packages/ui-toolkit/styleguide/
|
||||
packages/*/package-lock.json
|
||||
|
||||
/packages/ui-toolkit/styleguide/index.html
|
||||
|
@ -2,6 +2,8 @@
|
||||
"extends": "joyent-portal",
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"new-cap": 0
|
||||
"new-cap": 0,
|
||||
// temp
|
||||
"no-undef": 1
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,29 @@ module.exports = config => {
|
||||
|
||||
config.module.rules = config.module.rules
|
||||
.reduce((loaders, loader, index) => {
|
||||
if (Array.isArray(loader.use)) {
|
||||
return loaders.concat([
|
||||
Object.assign(loader, {
|
||||
use: loader.use.map(l => {
|
||||
if (isString(l) || !isString(l.loader)) {
|
||||
return l;
|
||||
}
|
||||
|
||||
if (!l.loader.match(/eslint-loader/)) {
|
||||
return l;
|
||||
}
|
||||
|
||||
return Object.assign(l, {
|
||||
options: Object.assign(l.options, {
|
||||
baseConfig: null,
|
||||
useEslintrc: true
|
||||
})
|
||||
});
|
||||
})
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
if (!isString(loader.loader)) {
|
||||
return loaders.concat([loader]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user