From b356f1fb7098c5344f3e18caeda3e1c722dcb487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20Przoda=C5=82a?= Date: Tue, 5 May 2020 08:34:19 +0200 Subject: [PATCH] update dependencies --- .babelrc | 14 ++++++++- .eslintrc.json | 12 +++++++- package.json | 49 +++++++++++++++--------------- src/components/ErrorsContainer.jsx | 2 +- webpack-prod.config.js | 17 ++++++++--- webpack.config.js | 19 ++++++++---- 6 files changed, 75 insertions(+), 38 deletions(-) diff --git a/.babelrc b/.babelrc index ec9f214..352e7b4 100644 --- a/.babelrc +++ b/.babelrc @@ -1 +1,13 @@ -{ "presets": ["es2015", "es2017", "react", "stage-0"] } \ No newline at end of file +{ + "presets": ["@babel/preset-env", "@babel/preset-react"], + "plugins": [ + ["@babel/plugin-proposal-decorators", { "legacy": true }], + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-object-rest-spread", + "@babel/transform-runtime", + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions" + ] +} diff --git a/.eslintrc.json b/.eslintrc.json index 8a2cd07..f457ab2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,8 +1,17 @@ { "env": { + "browser": true, + "es6": true, "jest": true }, + "plugins": ["react", "import"], "parser": "babel-eslint", + "parserOptions": { + "ecmaFeatures": { + "experimentalDecorators": true, + "jsx": true + } + }, "extends": ["airbnb"], "rules": { "indent": [2, 4], @@ -14,7 +23,8 @@ "classes": false, "variables": false }], - "import/no-named-as-default": 0 + "import/no-named-as-default": 0, + "jsx-a11y/heading-has-content": 0 }, "globals": { "document": true diff --git a/package.json b/package.json index 0be30c0..3220cd3 100644 --- a/package.json +++ b/package.json @@ -44,41 +44,42 @@ "react-dom": "^15.5.4 || ^16.0.0" }, "devDependencies": { - "babel-core": "^6.21.0", - "babel-eslint": "^7.2.3", - "babel-jest": "^21.2.0", - "babel-loader": "^6.2.10", - "babel-polyfill": "^6.20.0", - "babel-preset-es2015": "^6.18.0", - "babel-preset-es2017": "^6.22.0", - "babel-preset-react": "^6.16.0", - "babel-preset-stage-0": "^6.22.0", - "babel-traverse": "^6.26.0", - "coveralls": "^2.13.1", - "css-loader": "^0.26.1", + "@babel/cli": "^7.7.0", + "@babel/core": "^7.7.0", + "@babel/polyfill": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.2.1", + "@babel/plugin-proposal-decorators": "^7.1.2", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.1.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.4.3", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.6.2", + "@babel/preset-env": "^7.7.1", + "babel-loader": "^8.0.6", + "@babel/preset-react": "^7.0.0", + "@babel/runtime": "^7.6.3", + "@babel/traverse": "^7.7.0", + "babel-eslint": "^10.0.1", + "coveralls": "^3.1.0", + "css-loader": "^3.5.3", "enzyme": "^3.4.4", "enzyme-adapter-react-16": "^1.2.0", "eslint": "^4.4.1", "eslint-config-airbnb": "^15.1.0", - "eslint-plugin-babel": "^4.1.2", - "eslint-plugin-import": "^2.14.0", + "eslint-plugin-import": "^2.6.1", "eslint-plugin-jsx-a11y": "^5.1.1", - "eslint-plugin-react": "^7.11.1", - "extract-text-webpack-plugin": "^1.0.1", - "jest": "^21.2.1", - "jsdom": "^9.11.0", + "eslint-plugin-react": "7.13.0", + "jest": "^24.9.0", "pre-commit": "^1.2.2", - "raf": "^3.4.0", - "react-addons-test-utils": "^15.6.2", "react-proptypes": "^1.0.0", - "react-test-renderer": "^15.4.1", "style-loader": "^0.13.1", - "webpack": "^2.2.1", - "webpack-dev-server": "^2.11.3" + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10", + "webpack-dev-server": "3.9.0" }, "jest": { "setupFiles": [ - "raf/polyfill", "./tests/enzymeConfig.js" ], "verbose": true, diff --git a/src/components/ErrorsContainer.jsx b/src/components/ErrorsContainer.jsx index a7dbe2a..564d77c 100644 --- a/src/components/ErrorsContainer.jsx +++ b/src/components/ErrorsContainer.jsx @@ -33,7 +33,7 @@ const parseErrors = (data) => { }; -class ErrorsContainer extends Component { +export class ErrorsContainer extends Component { getErrors() { const { getAllValidationErrors } = this.context; return parseErrors(getAllValidationErrors()); diff --git a/webpack-prod.config.js b/webpack-prod.config.js index 3bf2c2f..363db00 100644 --- a/webpack-prod.config.js +++ b/webpack-prod.config.js @@ -18,18 +18,25 @@ module.exports = { extensions: ['.js', '.jsx'] }, module: { - loaders: [ + rules: [ { test: /\.css$/, - loader: 'style-loader!css-loader?modules=true&localIdentName=[name]__[local]___[hash:base64:5]' + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + modules: { + localIdentName: '[name]__[hash:base64:5]' + } + } + } + ], }, { test: /.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, - query: { - presets: ['es2015', 'stage-0', 'es2017', 'react'] - } } ] }, diff --git a/webpack.config.js b/webpack.config.js index d06aaf1..b27b2eb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ var webpack = require('webpack'); module.exports = { - entry: ['babel-polyfill', "./src/demo/index.jsx"], + entry: ['@babel/polyfill', "./src/demo/index.jsx"], output: { path: '/dist/', filename: "demo.js" @@ -10,18 +10,25 @@ module.exports = { extensions: ['.js', '.jsx'] }, module: { - loaders: [ + rules: [ { test: /\.css$/, - loader: 'style-loader!css-loader?modules=true&localIdentName=[name]__[local]___[hash:base64:5]' + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + modules: { + localIdentName: '[name]__[hash:base64:5]' + } + } + } + ], }, { test: /.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, - query: { - presets: ['es2015', 'stage-0', 'es2017', 'react'] - } } ] },