diff --git a/.eslintrc.js b/.eslintrc.js index 90fbcae..8c6fde2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,6 +30,12 @@ module.exports = { 'templateStrings': true, }, }, + "settings": { + "react": { + "version": "16.3", + }, + "propWrapperFunctions": ["forbidExtraProps"] + }, 'plugins': ['react', 'class-property', 'babel', 'prettier'], 'rules': { 'arrow-body-style': 'off', @@ -58,7 +64,7 @@ module.exports = { 'max-depth': ['warn', 4], 'max-len': ['error', 120], 'max-nested-callbacks': ['warn', 2], - 'max-params': ['warn', 4], + 'max-params': ['warn', 5], 'max-statements': ['off', 10], 'new-cap': 'error', 'new-parens': 'error', diff --git a/CHANGELOG.md b/CHANGELOG.md index 199aa58..759f939 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,17 @@ This changelog references the relevant changes done between versions. To get the diff for a specific change, go to https://github.com/FriendsOfECMAScript/ReactI18nRouting/commit/XXX where XXX is the change hash -To get the diff between two versions, go to https://github.com/FriendsOfECMAScript/ReactI18nRouting/compare/v0.4.0...v0.5.0 +To get the diff between two versions, go to https://github.com/FriendsOfECMAScript/ReactI18nRouting/compare/v0.7.0...v0.8.0 +- 0.9.0 (future release) + - Upgraded all dependencies removing alpha and beta versions. - 0.8.0 - - React new Context API is now used to manage state - - Decoupled from `react-intl` and `react-redux` - - Added React component testing using `react-testing-library` + - React new Context API is now used to manage state. + - Decoupled from `react-intl` and `react-redux`. - [BC BREAK] Removed bridges for redux, browser, in-memory and local storage. - - [BC BREAK] Removed support for React and ReactDOM < 16.3 (Context API is not supported in those versions) + - [BC BREAK] Removed support for React and ReactDOM < 16.3 (Context API is not supported in those versions). + - Added React component testing using `react-testing-library`. + - Increased test code coverage. - 0.7.0 - Added support for using an string-array as the path property as `react-router` does. - 0.6.0 diff --git a/package.json b/package.json index 48d10af..0f4db2b 100644 --- a/package.json +++ b/package.json @@ -99,29 +99,29 @@ } }, "dependencies": { - "@babel/preset-env": "^7.0.0-beta.49", - "@babel/preset-react": "^7.0.0-beta.49", - "babel-preset-minify": "^0.5.0-alpha.a28b6b00" + "@babel/preset-env": "^7.2.3", + "@babel/preset-react": "^7.0.0", + "babel-preset-minify": "^0.5.0" }, "devDependencies": { - "@babel/cli": "^7.0.0-beta.49", - "@babel/core": "^7.0.0-beta.51", - "@babel/plugin-proposal-class-properties": "^7.0.0-beta.49", - "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.49", - "@babel/plugin-transform-modules-commonjs": "^7.0.0-beta.49", + "@babel/cli": "^7.2.3", + "@babel/core": "^7.2.2", + "@babel/plugin-proposal-class-properties": "^7.2.3", + "@babel/plugin-proposal-object-rest-spread": "^7.2.0", + "@babel/plugin-transform-modules-commonjs": "^7.2.0", "babel-core": "^7.0.0-0", - "babel-eslint": "^8.2.3", - "babel-jest": "^23.0.1", - "eslint": "^4.19.1", - "eslint-plugin-babel": "^5.1.0", + "babel-eslint": "^8.2.6", + "babel-jest": "^23.6.0", + "eslint": "^5.11.1", + "eslint-plugin-babel": "^5.3.0", "eslint-plugin-class-property": "^1.1.0", - "eslint-plugin-prettier": "^3.0.0", - "eslint-plugin-react": "^7.9.1", - "jest": "^23.1.0", + "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-react": "^7.12.0", + "jest": "^23.6.0", "mkdirp": "^0.5.1", "npm-install-peers": "^1.2.1", - "prettier": "^1.10.2", - "react-testing-library": "^5.3.2", + "prettier": "^1.15.3", + "react-testing-library": "^5.4.2", "regenerator-runtime": "^0.11.1", "rimraf": "^2.6.2" }, diff --git a/src/renderTranslatedRoutes.js b/src/renderTranslatedRoutes.js index fcb3033..1fcd6eb 100644 --- a/src/renderTranslatedRoutes.js +++ b/src/renderTranslatedRoutes.js @@ -9,7 +9,6 @@ import flatMap from 'lodash.flatmap'; -// eslint-disable-next-line max-params const getRouteConfig = (configRoute, locale, currentLocale, pathFromRouteForPathsAndLocale) => { const {paths, ...configRouteRest} = configRoute; @@ -21,7 +20,7 @@ const getRouteConfig = (configRoute, locale, currentLocale, pathFromRouteForPath getRouteConfigForLocale = (configRoute, currentLocale, pathFromRouteForPathsAndLocale) => locale => getRouteConfig(configRoute, locale, currentLocale, pathFromRouteForPathsAndLocale); -// eslint-disable-next-line max-params +/* eslint-disable max-params */ const renderTranslatedRoutesForLocales = ( configRoute, routes, @@ -45,7 +44,6 @@ const renderTranslatedRoutesForLocales = ( ); }), ), - // eslint-disable-next-line max-params renderTranslatedRoutesForConfig = ( configRoute, routes, @@ -61,8 +59,8 @@ const renderTranslatedRoutesForLocales = ( pathFromRouteForPathsAndLocale, getRouteConfigForCurrentLocale, ); +/* eslint-enable max-params */ -// eslint-disable-next-line max-params const renderTranslatedRoutes = (locales, routes, pathFromRouteForPathsAndLocale) => currentLocale => ( config, iterationLocale,