Skip to content

Commit 5b44367

Browse files
committed
chore: update dependencies.
1 parent bc79565 commit 5b44367

32 files changed

+6947
-10539
lines changed

.eslintrc.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
module.exports = {
22
extends: [
3-
'plugin:react/recommended',
3+
'eslint:recommended',
44
'airbnb',
5+
'airbnb/hooks',
56
],
67
plugins: [
78
'react',
9+
'jsx-a11y',
810
],
911
rules: {
10-
"react/jsx-props-no-spreading": 0,
11-
"react/destructuring-assignment": 0
12+
'import/no-extraneous-dependencies': 0,
13+
'react/jsx-props-no-spreading': 0,
14+
'react/destructuring-assignment': 0,
15+
},
16+
parser: 'babel-eslint',
17+
env: {
18+
browser: true,
1219
},
1320
};

example/router-redux-rematch/.babelrc renamed to example/router-redux-rematch/.babelrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@babel/plugin-syntax-dynamic-import",
1414
"@babel/plugin-proposal-class-properties",
1515
"@babel/plugin-transform-async-to-generator",
16+
"@babel/plugin-transform-modules-commonjs",
1617
["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }],
1718
[
1819
"@babel/plugin-transform-runtime", {
Lines changed: 19 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,24 @@
11
const eslintrc = {
2-
"parser": "babel-eslint",
3-
"extends": "airbnb",
4-
"env": {
5-
"browser": true,
6-
"node": true,
7-
"es6": true,
8-
"mocha": true,
9-
"jest": true,
10-
"jasmine": true
2+
env: {
3+
browser: true,
4+
jest: true,
5+
es6: true,
116
},
12-
"plugins": [
13-
"react",
14-
"import"
15-
],
16-
"parserOptions": {
17-
parser: 'babel-eslint',
7+
plugins: ['import'],
8+
extends: 'eslint:recommended',
9+
parserOptions: {
10+
ecmaVersion: 2020,
11+
sourceType: 'module',
1812
},
19-
"rules": {
20-
"linebreak-style": 0,
21-
"func-names": 0,
22-
"sort-imports": 0,
23-
"arrow-body-style": 0,
24-
"prefer-destructuring": 0,
25-
"max-len": 0,
26-
"consistent-return": 0,
27-
"comma-dangle": [
28-
"error",
29-
"always-multiline"
30-
],
31-
"function-paren-newline": 0,
32-
"class-methods-use-this": 0,
33-
"react/sort-comp": 0,
34-
"react/prop-types": 0,
35-
"react/jsx-first-prop-new-line": 0,
36-
"react/require-extension": 0,
37-
"react/jsx-filename-extension": [
38-
1,
39-
{
40-
"extensions": [
41-
".js",
42-
".jsx"
43-
]
44-
}
45-
],
46-
"import/extensions": 0,
47-
"import/no-unresolved": 0,
48-
"import/no-extraneous-dependencies": 0,
49-
"import/prefer-default-export": 0,
50-
"jsx-a11y/no-static-element-interactions": 0,
51-
"jsx-a11y/anchor-has-content": 0,
52-
"jsx-a11y/click-events-have-key-events": 0,
53-
"jsx-a11y/anchor-is-valid": 0,
54-
"jsx-a11y/label-has-for": 0,
55-
"jsx-a11y/no-noninteractive-element-interactions": 0,
56-
"jsx-a11y/mouse-events-have-key-events": 0,
57-
"react/no-danger": 0,
58-
"react/jsx-no-bind": 0,
59-
"react/forbid-prop-types": 0,
60-
"react/prefer-stateless-function": 0,
61-
"react/require-default-props": 0,
62-
"react/no-did-mount-set-state": 0,
63-
"react/no-array-index-key": 0,
64-
"react/no-find-dom-node": 0,
65-
"react/no-unused-state": 0,
66-
"react/no-unused-prop-types": 0,
67-
"react/default-props-match-prop-types": 0,
68-
"react/jsx-curly-spacing": 0,
69-
"react/no-render-return-value": 0,
70-
"object-curly-newline": 0,
71-
"no-param-reassign": 0,
72-
"no-return-assign": 0,
73-
"no-redeclare": 0,
74-
"no-restricted-globals": 0,
75-
"no-restricted-syntax": 0,
76-
"no-underscore-dangle": 0,
77-
"no-unused-expressions": 0
78-
}
79-
}
13+
rules: {
14+
'no-console': 'warn',
15+
'no-eval': 'error',
16+
'import/first': 'error',
17+
'react/prop-types': 0,
18+
'import/prefer-default-export': 0,
19+
'jsx-a11y/label-has-associated-control': 0,
20+
},
21+
};
8022

8123
if (process.env.NODE_ENV === 'development') {
8224
Object.assign(eslintrc.rules,
@@ -86,4 +28,4 @@ if (process.env.NODE_ENV === 'development') {
8628
});
8729
}
8830

89-
module.exports = eslintrc
31+
module.exports = eslintrc;
Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "npmp-web",
2+
"name": "@example/router-redux-rematch",
33
"version": "1.0.0",
44
"description": "Use Redux(@rematch), React Router example.",
55
"private": true,
@@ -20,50 +20,54 @@
2020
"author": "kenny wong",
2121
"license": "ISC",
2222
"dependencies": {
23-
"@rematch/core": "1.1.0",
24-
"react": "17.0.1",
25-
"react-dom": "17.0.1",
23+
"@rematch/core": "2.0.1",
24+
"react": "17.0.2",
25+
"react-dom": "17.0.2",
2626
"react-dynamic-loadable": "2.0.5",
27-
"react-redux": "7.1.0",
28-
"react-router-dom": "5.0.1"
27+
"react-redux": "7.2.4",
28+
"react-router-dom": "5.2.0"
2929
},
3030
"devDependencies": {
31-
"@babel/cli": "7.12.10",
32-
"@babel/core": "7.12.10",
33-
"@babel/node": "7.12.10",
34-
"@babel/plugin-proposal-class-properties": "7.12.1",
35-
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
31+
"@babel/cli": "7.14.5",
32+
"@babel/core": "7.14.5",
33+
"@babel/node": "7.14.5",
34+
"@babel/plugin-proposal-class-properties": "7.14.5",
35+
"@babel/plugin-proposal-object-rest-spread": "7.14.5",
3636
"@babel/plugin-syntax-dynamic-import": "7.8.3",
37-
"@babel/plugin-transform-async-to-generator": "7.12.1",
38-
"@babel/plugin-transform-runtime": "7.12.10",
39-
"@babel/preset-env": "7.12.11",
40-
"@babel/preset-react": "7.12.10",
41-
"@babel/runtime": "7.12.5",
42-
"@nuxtjs/friendly-errors-webpack-plugin": "2.1.0",
43-
"autoprefixer": "9.6.1",
44-
"babel-eslint": "8.2.6",
37+
"@babel/plugin-transform-modules-commonjs": "7.14.5",
38+
"@babel/plugin-transform-async-to-generator": "7.14.5",
39+
"@babel/plugin-transform-runtime": "7.14.5",
40+
"@babel/preset-env": "7.14.5",
41+
"@babel/preset-react": "7.14.5",
42+
"@babel/runtime": "^7.14.5",
43+
"@babel/eslint-parser": "7.14.5",
44+
"@babel/eslint-plugin": "7.14.5",
45+
"@soda/friendly-errors-webpack-plugin": "1.8.0",
46+
"autoprefixer": "10.2.6",
4547
"babel-loader": "8.2.2",
46-
"colors-cli": "1.0.23",
47-
"css-loader": "3.2.0",
48-
"eslint": "4.19.1",
49-
"eslint-config-airbnb": "16.1.0",
50-
"eslint-loader": "2.2.1",
51-
"eslint-plugin-import": "2.18.2",
52-
"eslint-plugin-jsx-a11y": "6.2.3",
53-
"eslint-plugin-react": "7.14.3",
54-
"file-loader": "1.1.11",
55-
"html-webpack-plugin": "3.2.0",
56-
"less": "3.13.1",
57-
"less-loader": "4.1.0",
58-
"loading-cli": "1.0.8",
59-
"mocker-api": "2.7.5",
60-
"postcss-flexbugs-fixes": "3.3.1",
61-
"postcss-loader": "2.1.6",
62-
"style-loader": "0.21.0",
48+
"colors-cli": "1.0.27",
49+
"css-loader": "5.2.6",
50+
"eslint": "7.28.0",
51+
"eslint-config-airbnb": "18.2.1",
52+
"eslint-loader": "4.0.2",
53+
"eslint-plugin-import": "2.23.4",
54+
"eslint-plugin-jsx-a11y": "6.4.1",
55+
"eslint-plugin-react": "7.24.0",
56+
"eslint-webpack-plugin": "2.5.4",
57+
"file-loader": "6.2.0",
58+
"html-webpack-plugin": "5.3.1",
59+
"less": "4.1.1",
60+
"less-loader": "9.1.0",
61+
"loading-cli": "1.1.0",
62+
"mocker-api": "2.9.0",
63+
"postcss": "8.3.2",
64+
"postcss-flexbugs-fixes": "5.0.2",
65+
"postcss-loader": "6.1.0",
66+
"style-loader": "2.0.0",
6367
"transform-runtime": "0.0.0",
64-
"url-loader": "1.1.2",
65-
"webpack": "4.39.2",
66-
"webpack-cli": "3.3.6",
67-
"webpack-dev-server": "3.8.0"
68+
"url-loader": "4.1.1",
69+
"webpack": "5.38.1",
70+
"webpack-cli": "4.7.2",
71+
"webpack-dev-server": "3.11.2"
6872
}
6973
}

example/router-redux-rematch/scripts/build.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ compiler.run((err, stats) => {
1212
// 官方输出参数
1313
// https://webpack.js.org/configuration/stats/
1414
// https://github.com/webpack/webpack/issues/538#issuecomment-59586196
15+
// eslint-disable-next-line no-console
1516
console.log(stats.toString({
1617
colors: true,
1718
children: false,
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
2-
31
const path = require('path');
42
const fs = require('fs');
53

64
// Make sure any symlinks in the project folder are resolved:
75
// https://github.com/facebookincubator/create-react-app/issues/637
86
const appDirectory = fs.realpathSync(process.cwd());
9-
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
7+
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
108

119
module.exports = {
1210
appBuildDist: resolveApp('dist'),
1311
appHtml: resolveApp('public/index.html'),
14-
appIndexJs: resolveApp('src/index.js'),
12+
appIndexJs: resolveApp('src/index.jsx'),
1513
// appFavicon: resolveApp('public/favicon.png'),
1614
appFavicon: resolveApp('public/favicon.ico'),
1715
appSrc: resolveApp('src'),
18-
}
16+
};
Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,20 @@
11
import webpack from 'webpack';
2-
import autoprefixer from 'autoprefixer';
3-
import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
42
import HtmlWebpackPlugin from 'html-webpack-plugin';
5-
import FriendlyErrorsWebpackPlugin from '@nuxtjs/friendly-errors-webpack-plugin';
3+
import ESLintPlugin from 'eslint-webpack-plugin';
4+
// import FriendlyErrorsWebpackPlugin from '@soda/friendly-errors-webpack-plugin';
65
import paths from './path';
7-
import pkg from '../../package.json';
6+
// import pkg from '../../package.json';
87

98
export default {
109
mode: 'development',
11-
entry: {
12-
app: [
13-
paths.appIndexJs,
14-
],
15-
vendors: Object.keys(pkg.dependencies || {}),
16-
},
10+
entry: paths.appIndexJs,
11+
target: 'web',
1712
output: {
1813
publicPath: '/',
1914
filename: '[name].js',
2015
},
2116
module: {
22-
strictExportPresence: true,
2317
rules: [
24-
{
25-
test: /\.(js|jsx|mjs)$/,
26-
enforce: 'pre',
27-
use: [
28-
{
29-
// 首先运行linter。
30-
// 在Babel处理js之前做这一点很重要。
31-
options: {
32-
// formatter: eslintFormatter,
33-
eslintPath: require.resolve('eslint'),
34-
configFile: require.resolve('../../.eslintrc.js'),
35-
},
36-
loader: require.resolve('eslint-loader'),
37-
},
38-
],
39-
include: paths.appSrc,
40-
},
4118
{
4219
oneOf: [
4320
{
@@ -60,41 +37,15 @@ export default {
6037
importLoaders: 1,
6138
},
6239
},
63-
{
64-
loader: require.resolve('postcss-loader'),
65-
options: {
66-
// Necessary for external CSS imports to work
67-
// https://github.com/facebookincubator/create-react-app/issues/2677
68-
ident: 'postcss',
69-
plugins: () => [
70-
postcssFlexbugsFixes(),
71-
// require('postcss-flexbugs-fixes'),
72-
autoprefixer({
73-
// overrideBrowserslist: [
74-
// '>1%',
75-
// 'last 4 versions',
76-
// 'Firefox ESR',
77-
// 'not ie < 9', // React doesn't support IE8 anyway
78-
// ],
79-
flexbox: 'no-2009',
80-
}),
81-
],
82-
},
83-
},
8440
require.resolve('less-loader'),
8541
],
8642
},
8743
// Process JS with Babel.
8844
{
8945
test: /\.(js|jsx|mjs)$/,
9046
include: paths.appSrc,
47+
exclude: /node_modules/,
9148
loader: require.resolve('babel-loader'),
92-
options: {
93-
// This is a feature of `babel-loader` for webpack (not Babel itself).
94-
// It enables caching results in ./node_modules/.cache/babel-loader/
95-
// directory for faster rebuilds.
96-
cacheDirectory: true,
97-
},
9849
},
9950
// “file-loader”确保这些资源由WebpackDevServer服务。
10051
// 当您导入资源时,您将获得(虚拟)文件名。
@@ -113,13 +64,19 @@ export default {
11364
},
11465
],
11566
},
67+
resolve: {
68+
extensions: ['*', '.js', '.jsx'],
69+
},
11670
plugins: [
11771
new HtmlWebpackPlugin({
11872
favicon: paths.appFavicon,
11973
inject: true,
12074
template: paths.appHtml,
12175
}),
12276
new webpack.HotModuleReplacementPlugin(),
123-
new FriendlyErrorsWebpackPlugin(),
77+
new ESLintPlugin({
78+
eslintPath: require.resolve('eslint'),
79+
overrideConfigFile: require.resolve('../../.eslintrc.js'),
80+
}),
12481
],
12582
};

0 commit comments

Comments
 (0)