Skip to content

Commit 55bf891

Browse files
authored
fix: eslint's react version warning and babel-eslint dep lost (#2627)
1 parent ebb4cbc commit 55bf891

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

packages/af-webpack/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"address": "1.1.0",
1717
"assert": "1.4.1",
1818
"autoprefixer": "9.6.0",
19+
"babel-eslint": "10.0.2",
1920
"babel-loader": "8.0.6",
2021
"babel-plugin-dynamic-import-node": "2.2.0",
2122
"babel-plugin-named-asset-import": "0.3.2",

packages/af-webpack/yarn.lock

+22-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
esutils "^2.0.2"
222222
js-tokens "^4.0.0"
223223

224-
"@babel/parser@^7.4.4", "@babel/parser@^7.4.5":
224+
"@babel/parser@^7.0.0", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5":
225225
version "7.4.5"
226226
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872"
227227
integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==
@@ -702,7 +702,7 @@
702702
"@babel/parser" "^7.4.4"
703703
"@babel/types" "^7.4.4"
704704

705-
"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5":
705+
"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5":
706706
version "7.4.5"
707707
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216"
708708
integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==
@@ -1302,6 +1302,18 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
13021302
esutils "^2.0.2"
13031303
js-tokens "^3.0.2"
13041304

1305+
babel-eslint@10.0.2:
1306+
version "10.0.2"
1307+
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456"
1308+
integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q==
1309+
dependencies:
1310+
"@babel/code-frame" "^7.0.0"
1311+
"@babel/parser" "^7.0.0"
1312+
"@babel/traverse" "^7.0.0"
1313+
"@babel/types" "^7.0.0"
1314+
eslint-scope "3.7.1"
1315+
eslint-visitor-keys "^1.0.0"
1316+
13051317
babel-loader@8.0.6:
13061318
version "8.0.6"
13071319
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb"
@@ -2974,6 +2986,14 @@ eslint-plugin-react@7.13.0:
29742986
prop-types "^15.7.2"
29752987
resolve "^1.10.1"
29762988

2989+
eslint-scope@3.7.1:
2990+
version "3.7.1"
2991+
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
2992+
integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=
2993+
dependencies:
2994+
esrecurse "^4.1.0"
2995+
estraverse "^4.1.1"
2996+
29772997
eslint-scope@^4.0.0, eslint-scope@^4.0.3:
29782998
version "4.0.3"
29792999
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"

packages/eslint-config-umi/src/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ export default {
1010
'react/react-in-jsx-scope': [0],
1111
'no-useless-escape': [0],
1212
},
13+
settings: {
14+
react: {
15+
version: '16.8',
16+
},
17+
},
1318
};

packages/umi-core/src/error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function printUmiError(e, opts = {}) {
3131
if (!code) {
3232
for (const c of Object.keys(errorCodeMap)) {
3333
const { test } = errorCodeMap[c];
34-
if (test({ error: e, context })) {
34+
if (test && test({ error: e, context })) {
3535
code = c;
3636
}
3737
}

scripts/startDevServers.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ const DEV_SCRIPT = join(__dirname, '../packages/umi/bin/umi.js');
66
function startDevServer(opts = {}) {
77
const { port, cwd } = opts;
88
return new Promise(resolve => {
9+
console.log(`Start dev server for ${cwd}`);
910
const child = fork(DEV_SCRIPT, ['dev', '--port', port, '--cwd', cwd], {
1011
env: {
1112
...process.env,
12-
CLEAR_CONSOLE: 'none',
1313
BROWSER: 'none',
14+
PROGRESS: 'none',
1415
UMI_DIR: dirname(require.resolve('../packages/umi/package')),
1516
},
1617
});

0 commit comments

Comments
 (0)