1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-28 06:00:06 +02:00

fix(joyent-cp-frontend): patch react-scripts to use eslintrc

This commit is contained in:
Sérgio Ramos 2017-06-16 23:01:06 +01:00
parent b22121cb93
commit ce3f63eaae
3 changed files with 26 additions and 3 deletions

2
.gitignore vendored
View File

@ -159,5 +159,3 @@ packages/*/dist
packages/*/buid
packages/ui-toolkit/styleguide/
packages/*/package-lock.json
/packages/ui-toolkit/styleguide/index.html

View File

@ -2,6 +2,8 @@
"extends": "joyent-portal",
"rules": {
"no-console": 0,
"new-cap": 0
"new-cap": 0,
// temp
"no-undef": 1
}
}

View File

@ -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]);
}