From bb040cbeeea1b9fda1f505bf534cb8cad08addee Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 30 Aug 2021 22:28:08 +0800 Subject: [PATCH] chore: enforce default export name on React files (#101) --- packages/core/package.json | 4 +- packages/phrases/package.json | 4 +- packages/schemas/package.json | 4 +- packages/ui/package.json | 8 +- packages/ui/src/App.tsx | 2 +- .../ui/src/{init/i18n.ts => i18n/init.ts} | 0 pnpm-lock.yaml | 99 ++++++++++++------- 7 files changed, 74 insertions(+), 47 deletions(-) rename packages/ui/src/{init/i18n.ts => i18n/init.ts} (100%) diff --git a/packages/core/package.json b/packages/core/package.json index 0cffff7f3..0a29cd21b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -42,8 +42,8 @@ "zod": "^3.8.1" }, "devDependencies": { - "@logto/eslint-config": "^0.1.0-rc.24", - "@logto/ts-config": "^0.1.0-rc.24", + "@logto/eslint-config": "^0.1.0-rc.26", + "@logto/ts-config": "^0.1.0-rc.26", "@types/jest": "^27.0.1", "@types/koa": "^2.13.3", "@types/koa-logger": "^3.1.1", diff --git a/packages/phrases/package.json b/packages/phrases/package.json index 704666145..b2ae8fa7b 100644 --- a/packages/phrases/package.json +++ b/packages/phrases/package.json @@ -25,8 +25,8 @@ "url": "https://github.com/logto-io/logto/issues" }, "devDependencies": { - "@logto/eslint-config": "^0.1.0-rc.24", - "@logto/ts-config": "^0.1.0-rc.24", + "@logto/eslint-config": "^0.1.0-rc.26", + "@logto/ts-config": "^0.1.0-rc.26", "eslint": "^7.31.0", "lint-staged": "^11.1.1", "prettier": "^2.3.2", diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 55984ea50..ec2b64e07 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -21,9 +21,9 @@ "node": ">=14.15.0" }, "devDependencies": { - "@logto/eslint-config": "^0.1.0-rc.24", + "@logto/eslint-config": "^0.1.0-rc.26", "@logto/essentials": "^1.1.0-rc.2", - "@logto/ts-config": "^0.1.0-rc.24", + "@logto/ts-config": "^0.1.0-rc.26", "@types/lodash.uniq": "^4.5.6", "@types/node": "14", "@types/pluralize": "^0.0.29", diff --git a/packages/ui/package.json b/packages/ui/package.json index 3820d83f3..53205770e 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -31,10 +31,10 @@ "devDependencies": { "@babel/core": "^7.14.6", "@jest/types": "^27.0.6", - "@logto/eslint-config": "^0.1.0-rc.24", - "@logto/eslint-config-react": "^0.1.0-rc.24", - "@logto/ts-config": "^0.1.0-rc.24", - "@logto/ts-config-react": "^0.1.0-rc.24", + "@logto/eslint-config": "^0.1.0-rc.26", + "@logto/eslint-config-react": "^0.1.0-rc.26", + "@logto/ts-config": "^0.1.0-rc.26", + "@logto/ts-config-react": "^0.1.0-rc.26", "@testing-library/react": "^12.0.0", "@types/jest": "^26.0.24", "@types/react": "^17.0.14", diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index ff7b431ab..30b682b54 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -3,7 +3,7 @@ import { Route, Switch } from 'react-router-dom'; import AppContent from './components/AppContent'; import useTheme from './hooks/use-theme'; -import initI18n from './init/i18n'; +import initI18n from './i18n/init'; import Consent from './pages/Consent'; import Register from './pages/Register'; import SignIn from './pages/SignIn'; diff --git a/packages/ui/src/init/i18n.ts b/packages/ui/src/i18n/init.ts similarity index 100% rename from packages/ui/src/init/i18n.ts rename to packages/ui/src/i18n/init.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8cf25cdec..25a5f7adb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,11 +20,11 @@ importers: packages/core: specifiers: - '@logto/eslint-config': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 '@logto/essentials': ^1.1.0-rc.2 '@logto/phrases': ^0.1.0 '@logto/schemas': ^0.1.0 - '@logto/ts-config': ^0.1.0-rc.24 + '@logto/ts-config': ^0.1.0-rc.26 '@types/jest': ^27.0.1 '@types/koa': ^2.13.3 '@types/koa-logger': ^3.1.1 @@ -89,8 +89,8 @@ importers: slonik-interceptor-preset: 1.2.10 zod: 3.8.1 devDependencies: - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab - '@logto/ts-config': 0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/ts-config': 0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370 '@types/jest': 27.0.1 '@types/koa': 2.13.4 '@types/koa-logger': 3.1.1 @@ -111,15 +111,15 @@ importers: packages/phrases: specifiers: - '@logto/eslint-config': ^0.1.0-rc.24 - '@logto/ts-config': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 + '@logto/ts-config': ^0.1.0-rc.26 eslint: ^7.31.0 lint-staged: ^11.1.1 prettier: ^2.3.2 typescript: ^4.3.5 devDependencies: - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab - '@logto/ts-config': 0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/ts-config': 0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370 eslint: 7.31.0 lint-staged: 11.1.1 prettier: 2.3.2 @@ -127,10 +127,10 @@ importers: packages/schemas: specifiers: - '@logto/eslint-config': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 '@logto/essentials': ^1.1.0-rc.2 '@logto/phrases': ^0.1.0 - '@logto/ts-config': ^0.1.0-rc.24 + '@logto/ts-config': ^0.1.0-rc.26 '@types/lodash.uniq': ^4.5.6 '@types/node': '14' '@types/pluralize': ^0.0.29 @@ -146,9 +146,9 @@ importers: dependencies: '@logto/phrases': link:../phrases devDependencies: - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab '@logto/essentials': 1.1.0-rc.2 - '@logto/ts-config': 0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c + '@logto/ts-config': 0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370 '@types/lodash.uniq': 4.5.6 '@types/node': 14.17.6 '@types/pluralize': 0.0.29 @@ -166,12 +166,12 @@ importers: specifiers: '@babel/core': ^7.14.6 '@jest/types': ^27.0.6 - '@logto/eslint-config': ^0.1.0-rc.24 - '@logto/eslint-config-react': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 + '@logto/eslint-config-react': ^0.1.0-rc.26 '@logto/phrases': ^0.1.0 '@logto/schemas': ^0.1.0 - '@logto/ts-config': ^0.1.0-rc.24 - '@logto/ts-config-react': ^0.1.0-rc.24 + '@logto/ts-config': ^0.1.0-rc.26 + '@logto/ts-config-react': ^0.1.0-rc.26 '@testing-library/react': ^12.0.0 '@types/jest': ^26.0.24 '@types/react': ^17.0.14 @@ -216,10 +216,10 @@ importers: devDependencies: '@babel/core': 7.14.8 '@jest/types': 27.0.6 - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab - '@logto/eslint-config-react': 0.1.0-rc.24_3d86d47bd84fdbb75de6533b28633e70 - '@logto/ts-config': 0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c - '@logto/ts-config-react': 0.1.0-rc.24_56e7b91bb27f2374270546bf6b655d4d + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/eslint-config-react': 0.1.0-rc.26_a3ddc8d99e81f5584d80cc4b67ab4c8a + '@logto/ts-config': 0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370 + '@logto/ts-config-react': 0.1.0-rc.26_6ee48860da0e38c770ff936c56519999 '@testing-library/react': 12.0.0_react-dom@17.0.2+react@17.0.2 '@types/jest': 26.0.24 '@types/react': 17.0.15 @@ -2790,13 +2790,13 @@ packages: write-file-atomic: 3.0.3 dev: true - /@logto/eslint-config-react/0.1.0-rc.24_3d86d47bd84fdbb75de6533b28633e70: - resolution: {integrity: sha512-0telwVjuHOpfbTMFJ6xwRPwhDgpEFPOThM/pvKhh9Yy8sqS76ITC7S+0N3jyQjnRUId/ut0q9EYiTqtKrJ/W+g==} + /@logto/eslint-config-react/0.1.0-rc.26_a3ddc8d99e81f5584d80cc4b67ab4c8a: + resolution: {integrity: sha512-8tye/S3d/kVugPZfFA2RzYSoPCkIJkREG2SMMGBCW4oeWdY9nu+EXi7z8WaijE3ZHvfUCndcOyrWHyOr8oYc4g==} peerDependencies: - '@logto/eslint-config': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 stylelint: ^13.13.1 dependencies: - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab eslint-config-xo-react: 0.25.0_5f704e3662965de4cfb2bcc40a24fdc0 eslint-plugin-react: 7.25.0_eslint@7.31.0 eslint-plugin-react-hooks: 4.2.0_eslint@7.31.0 @@ -2806,8 +2806,8 @@ packages: - eslint dev: true - /@logto/eslint-config/0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab: - resolution: {integrity: sha512-dmIg0AwhFczqhq54OikElhNlcyS3iXnTIpPxdhkZfql8LpydDYizpDwE5gl/tcEGiI152ZfwWw+8lYcyQatfUA==} + /@logto/eslint-config/0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab: + resolution: {integrity: sha512-QSy1EAQ9elaLSQ5B7EzdPjonuP5aW0i5R6V/C12Rlkb6+EqOtB6HKkT/xeXYBmkuqCTQHvVZ8AfebLZzphEuZQ==} engines: {node: '>=14.15.0'} peerDependencies: eslint: ^7.30.0 @@ -2821,6 +2821,7 @@ packages: eslint-config-xo: 0.37.0_eslint@7.31.0 eslint-config-xo-typescript: 0.43.0_5e94fa9d17795ac650ba73b69f3de816 eslint-import-resolver-typescript: 2.4.0_ad16af91e8fab94a7e22e925abb31583 + eslint-plugin-consistent-default-export-name: 0.0.7 eslint-plugin-eslint-comments: 3.2.0_eslint@7.31.0 eslint-plugin-import: 2.24.2_eslint@7.31.0 eslint-plugin-no-use-extend-native: 0.5.0 @@ -2841,27 +2842,27 @@ packages: lodash.orderby: 4.6.0 lodash.pick: 4.4.0 - /@logto/ts-config-react/0.1.0-rc.24_56e7b91bb27f2374270546bf6b655d4d: - resolution: {integrity: sha512-nwbNoI3XXARR7qg3qCYmeLU3yD4V4BSogXAk6Ge6CIIb0aPoj/27wCknq1edjwaInxPR3J6ZXmicQqHokdZ30g==} + /@logto/ts-config-react/0.1.0-rc.26_6ee48860da0e38c770ff936c56519999: + resolution: {integrity: sha512-H9+yiU8VtQzL7YHq30lyPl7L/S//gmUYN9zq3Ro10cNRL7p2Y6lx1tCpEcn/zG/Y7yzLk45D6MQ8fOf4PA8a8Q==} engines: {node: '>=14.15.0'} peerDependencies: - '@logto/eslint-config-react': ^0.1.0-rc.24 - '@logto/ts-config': ^0.1.0-rc.24 + '@logto/eslint-config-react': ^0.1.0-rc.26 + '@logto/ts-config': ^0.1.0-rc.26 typescript: ^4.3.5 dependencies: - '@logto/eslint-config-react': 0.1.0-rc.24_3d86d47bd84fdbb75de6533b28633e70 - '@logto/ts-config': 0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c + '@logto/eslint-config-react': 0.1.0-rc.26_a3ddc8d99e81f5584d80cc4b67ab4c8a + '@logto/ts-config': 0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370 typescript: 4.3.5 dev: true - /@logto/ts-config/0.1.0-rc.24_43787dd55a198a22e6c455f148105a9c: - resolution: {integrity: sha512-cjL0oStG1BYJzbT80MgR/XECaoUUyQ44IJavRNETZ8ngmg375HRoM2DQlmlNXwIlGmlbWR21VIohIhd89FANDQ==} + /@logto/ts-config/0.1.0-rc.26_71f6e48bcb7d8cc850d476cd072a5370: + resolution: {integrity: sha512-EJDAlEBjZB17Yzgv3F28yG15K9ZnDdReKX5Ra0dEv2WyfXSGxM11fktNIIjgFiuOwk8w2De1HnXJ+9NTpJOZYQ==} engines: {node: '>=14.15.0'} peerDependencies: - '@logto/eslint-config': ^0.1.0-rc.24 + '@logto/eslint-config': ^0.1.0-rc.26 typescript: ^4.3.5 dependencies: - '@logto/eslint-config': 0.1.0-rc.24_2055f56ab8dafa07df5c7ad406c8a4ab + '@logto/eslint-config': 0.1.0-rc.26_2055f56ab8dafa07df5c7ad406c8a4ab typescript: 4.3.5 dev: true @@ -6757,6 +6758,16 @@ packages: pkg-dir: 2.0.0 dev: true + /eslint-plugin-consistent-default-export-name/0.0.7: + resolution: {integrity: sha512-5gQqnXniMBCzB4TTai/XX28CLgfSk2/bb9GYD5DiuIKlEUSklLdB068nq9zwG3808pjPFlYTm0dLyRk/qDolaQ==} + engines: {node: '>=0.10.0'} + dependencies: + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + lodash.snakecase: 4.1.1 + lodash.upperfirst: 4.3.1 + dev: true + /eslint-plugin-es/3.0.1_eslint@7.31.0: resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} engines: {node: '>=8.10.0'} @@ -10617,6 +10628,10 @@ packages: resolution: {integrity: sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=} dev: true + /lodash.camelcase/4.3.0: + resolution: {integrity: sha1-soqmKIorn8ZRA1x3EfZathkDMaY=} + dev: true + /lodash.clonedeep/4.5.0: resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=} dev: true @@ -10629,6 +10644,10 @@ packages: resolution: {integrity: sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=} dev: true + /lodash.kebabcase/4.1.1: + resolution: {integrity: sha1-hImxyw0p/4gZXM7KRI/21swpXDY=} + dev: true + /lodash.memoize/4.1.2: resolution: {integrity: sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=} dev: true @@ -10643,6 +10662,10 @@ packages: /lodash.pick/4.4.0: resolution: {integrity: sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=} + /lodash.snakecase/4.1.1: + resolution: {integrity: sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=} + dev: true + /lodash.sortby/4.7.0: resolution: {integrity: sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=} dev: false @@ -10668,6 +10691,10 @@ packages: resolution: {integrity: sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=} dev: true + /lodash.upperfirst/4.3.1: + resolution: {integrity: sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=} + dev: true + /lodash/4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}