Skip to content

Commit

Permalink
chore: update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 13, 2021
1 parent bc79565 commit 5b44367
Show file tree
Hide file tree
Showing 32 changed files with 6,947 additions and 10,539 deletions.
13 changes: 10 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
module.exports = {
extends: [
'plugin:react/recommended',
'eslint:recommended',
'airbnb',
'airbnb/hooks',
],
plugins: [
'react',
'jsx-a11y',
],
rules: {
"react/jsx-props-no-spreading": 0,
"react/destructuring-assignment": 0
'import/no-extraneous-dependencies': 0,
'react/jsx-props-no-spreading': 0,
'react/destructuring-assignment': 0,
},
parser: 'babel-eslint',
env: {
browser: true,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }],
[
"@babel/plugin-transform-runtime", {
Expand Down
96 changes: 19 additions & 77 deletions example/router-redux-rematch/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,24 @@
const eslintrc = {
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"browser": true,
"node": true,
"es6": true,
"mocha": true,
"jest": true,
"jasmine": true
env: {
browser: true,
jest: true,
es6: true,
},
"plugins": [
"react",
"import"
],
"parserOptions": {
parser: 'babel-eslint',
plugins: ['import'],
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
"rules": {
"linebreak-style": 0,
"func-names": 0,
"sort-imports": 0,
"arrow-body-style": 0,
"prefer-destructuring": 0,
"max-len": 0,
"consistent-return": 0,
"comma-dangle": [
"error",
"always-multiline"
],
"function-paren-newline": 0,
"class-methods-use-this": 0,
"react/sort-comp": 0,
"react/prop-types": 0,
"react/jsx-first-prop-new-line": 0,
"react/require-extension": 0,
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
],
"import/extensions": 0,
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/anchor-has-content": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"react/no-danger": 0,
"react/jsx-no-bind": 0,
"react/forbid-prop-types": 0,
"react/prefer-stateless-function": 0,
"react/require-default-props": 0,
"react/no-did-mount-set-state": 0,
"react/no-array-index-key": 0,
"react/no-find-dom-node": 0,
"react/no-unused-state": 0,
"react/no-unused-prop-types": 0,
"react/default-props-match-prop-types": 0,
"react/jsx-curly-spacing": 0,
"react/no-render-return-value": 0,
"object-curly-newline": 0,
"no-param-reassign": 0,
"no-return-assign": 0,
"no-redeclare": 0,
"no-restricted-globals": 0,
"no-restricted-syntax": 0,
"no-underscore-dangle": 0,
"no-unused-expressions": 0
}
}
rules: {
'no-console': 'warn',
'no-eval': 'error',
'import/first': 'error',
'react/prop-types': 0,
'import/prefer-default-export': 0,
'jsx-a11y/label-has-associated-control': 0,
},
};

if (process.env.NODE_ENV === 'development') {
Object.assign(eslintrc.rules,
Expand All @@ -86,4 +28,4 @@ if (process.env.NODE_ENV === 'development') {
});
}

module.exports = eslintrc
module.exports = eslintrc;
84 changes: 44 additions & 40 deletions example/router-redux-rematch/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "npmp-web",
"name": "@example/router-redux-rematch",
"version": "1.0.0",
"description": "Use Redux(@rematch), React Router example.",
"private": true,
Expand All @@ -20,50 +20,54 @@
"author": "kenny wong",
"license": "ISC",
"dependencies": {
"@rematch/core": "1.1.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"@rematch/core": "2.0.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-dynamic-loadable": "2.0.5",
"react-redux": "7.1.0",
"react-router-dom": "5.0.1"
"react-redux": "7.2.4",
"react-router-dom": "5.2.0"
},
"devDependencies": {
"@babel/cli": "7.12.10",
"@babel/core": "7.12.10",
"@babel/node": "7.12.10",
"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-object-rest-spread": "7.12.1",
"@babel/cli": "7.14.5",
"@babel/core": "7.14.5",
"@babel/node": "7.14.5",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/plugin-proposal-object-rest-spread": "7.14.5",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-transform-async-to-generator": "7.12.1",
"@babel/plugin-transform-runtime": "7.12.10",
"@babel/preset-env": "7.12.11",
"@babel/preset-react": "7.12.10",
"@babel/runtime": "7.12.5",
"@nuxtjs/friendly-errors-webpack-plugin": "2.1.0",
"autoprefixer": "9.6.1",
"babel-eslint": "8.2.6",
"@babel/plugin-transform-modules-commonjs": "7.14.5",
"@babel/plugin-transform-async-to-generator": "7.14.5",
"@babel/plugin-transform-runtime": "7.14.5",
"@babel/preset-env": "7.14.5",
"@babel/preset-react": "7.14.5",
"@babel/runtime": "^7.14.5",
"@babel/eslint-parser": "7.14.5",
"@babel/eslint-plugin": "7.14.5",
"@soda/friendly-errors-webpack-plugin": "1.8.0",
"autoprefixer": "10.2.6",
"babel-loader": "8.2.2",
"colors-cli": "1.0.23",
"css-loader": "3.2.0",
"eslint": "4.19.1",
"eslint-config-airbnb": "16.1.0",
"eslint-loader": "2.2.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.14.3",
"file-loader": "1.1.11",
"html-webpack-plugin": "3.2.0",
"less": "3.13.1",
"less-loader": "4.1.0",
"loading-cli": "1.0.8",
"mocker-api": "2.7.5",
"postcss-flexbugs-fixes": "3.3.1",
"postcss-loader": "2.1.6",
"style-loader": "0.21.0",
"colors-cli": "1.0.27",
"css-loader": "5.2.6",
"eslint": "7.28.0",
"eslint-config-airbnb": "18.2.1",
"eslint-loader": "4.0.2",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.24.0",
"eslint-webpack-plugin": "2.5.4",
"file-loader": "6.2.0",
"html-webpack-plugin": "5.3.1",
"less": "4.1.1",
"less-loader": "9.1.0",
"loading-cli": "1.1.0",
"mocker-api": "2.9.0",
"postcss": "8.3.2",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-loader": "6.1.0",
"style-loader": "2.0.0",
"transform-runtime": "0.0.0",
"url-loader": "1.1.2",
"webpack": "4.39.2",
"webpack-cli": "3.3.6",
"webpack-dev-server": "3.8.0"
"url-loader": "4.1.1",
"webpack": "5.38.1",
"webpack-cli": "4.7.2",
"webpack-dev-server": "3.11.2"
}
}
1 change: 1 addition & 0 deletions example/router-redux-rematch/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ compiler.run((err, stats) => {
// 官方输出参数
// https://webpack.js.org/configuration/stats/
// https://github.com/webpack/webpack/issues/538#issuecomment-59586196
// eslint-disable-next-line no-console
console.log(stats.toString({
colors: true,
children: false,
Expand Down
8 changes: 3 additions & 5 deletions example/router-redux-rematch/scripts/conf/path.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@


const path = require('path');
const fs = require('fs');

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

module.exports = {
appBuildDist: resolveApp('dist'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveApp('src/index.js'),
appIndexJs: resolveApp('src/index.jsx'),
// appFavicon: resolveApp('public/favicon.png'),
appFavicon: resolveApp('public/favicon.ico'),
appSrc: resolveApp('src'),
}
};
69 changes: 13 additions & 56 deletions example/router-redux-rematch/scripts/conf/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,20 @@
import webpack from 'webpack';
import autoprefixer from 'autoprefixer';
import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import FriendlyErrorsWebpackPlugin from '@nuxtjs/friendly-errors-webpack-plugin';
import ESLintPlugin from 'eslint-webpack-plugin';
// import FriendlyErrorsWebpackPlugin from '@soda/friendly-errors-webpack-plugin';
import paths from './path';
import pkg from '../../package.json';
// import pkg from '../../package.json';

export default {
mode: 'development',
entry: {
app: [
paths.appIndexJs,
],
vendors: Object.keys(pkg.dependencies || {}),
},
entry: paths.appIndexJs,
target: 'web',
output: {
publicPath: '/',
filename: '[name].js',
},
module: {
strictExportPresence: true,
rules: [
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
// 首先运行linter。
// 在Babel处理js之前做这一点很重要。
options: {
// formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
configFile: require.resolve('../../.eslintrc.js'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
oneOf: [
{
Expand All @@ -60,41 +37,15 @@ export default {
importLoaders: 1,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
// Necessary for external CSS imports to work
// https://github.com/facebookincubator/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
postcssFlexbugsFixes(),
// require('postcss-flexbugs-fixes'),
autoprefixer({
// overrideBrowserslist: [
// '>1%',
// 'last 4 versions',
// 'Firefox ESR',
// 'not ie < 9', // React doesn't support IE8 anyway
// ],
flexbox: 'no-2009',
}),
],
},
},
require.resolve('less-loader'),
],
},
// Process JS with Babel.
{
test: /\.(js|jsx|mjs)$/,
include: paths.appSrc,
exclude: /node_modules/,
loader: require.resolve('babel-loader'),
options: {
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
},
},
// “file-loader”确保这些资源由WebpackDevServer服务。
// 当您导入资源时,您将获得(虚拟)文件名。
Expand All @@ -113,13 +64,19 @@ export default {
},
],
},
resolve: {
extensions: ['*', '.js', '.jsx'],
},
plugins: [
new HtmlWebpackPlugin({
favicon: paths.appFavicon,
inject: true,
template: paths.appHtml,
}),
new webpack.HotModuleReplacementPlugin(),
new FriendlyErrorsWebpackPlugin(),
new ESLintPlugin({
eslintPath: require.resolve('eslint'),
overrideConfigFile: require.resolve('../../.eslintrc.js'),
}),
],
};
Loading

0 comments on commit 5b44367

Please sign in to comment.