Skip to content

Commit

Permalink
fix: af-webpack
Browse files Browse the repository at this point in the history
should resolve eslintrc according to APP_ROOT
  • Loading branch information
paranoidjk committed Jun 19, 2018
1 parent 8030218 commit 55ca5cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/af-webpack/src/getConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,18 @@ export default function getConfig(opts = {}) {
}

// 读用户的 eslintrc
if (existsSync(resolve('.eslintrc'))) {
const userEslintRulePath = resolve(opts.cwd, '.eslintrc');
if (existsSync(userEslintRulePath)) {
try {
const userRc = readRc(resolve('.eslintrc'));
const userRc = readRc(userEslintRulePath);
debug(`userRc: ${JSON.stringify(userRc)}`);
if (userRc.extends) {
debug(`use user's .eslintrc: ${resolve('.eslintrc')}`);
debug(`use user's .eslintrc: ${userEslintRulePath}`);
eslintOptions.useEslintrc = true;
eslintOptions.baseConfig = false;
eslintOptions.ignore = true;
} else {
debug(`extend with user's .eslintrc: ${resolve('.eslintrc')}`);
debug(`extend with user's .eslintrc: ${userEslintRulePath}`);
eslintOptions.baseConfig = {
...eslintOptions.baseConfig,
...userRc,
Expand Down

0 comments on commit 55ca5cb

Please sign in to comment.