From c97cae27e1767ecf1f13d321e2d7498c19b9d36c Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Wed, 25 Jan 2023 10:21:57 +0530 Subject: [PATCH] feat(tools): add warnings for filename-convention --- .eslintrc.json | 11 +++++++++-- package.json | 1 + pnpm-lock.yaml | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c1349259d4c..5af8e120e89 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,7 +17,7 @@ "plugin:jsx-a11y/recommended", "prettier" ], - "plugins": ["no-only-tests"], + "plugins": ["no-only-tests", "filenames-simple"], "globals": { "Promise": true, "window": true, @@ -47,7 +47,8 @@ "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" } - ] + ], + "filenames-simple/naming-convention": ["warn"] }, "overrides": [ { @@ -150,6 +151,12 @@ { "files": ["web/**/*.tsx"], "extends": ["plugin:react/jsx-runtime"] + }, + { + "files": ["**/api-server/**/*", "**/404.*"], + "rules": { + "filenames-simple/naming-convention": "off" + } } ] } diff --git a/package.json b/package.json index ac189a53b38..37a66021825 100644 --- a/package.json +++ b/package.json @@ -127,6 +127,7 @@ "docsify-cli": "4.4.4", "eslint": "7.32.0", "eslint-config-prettier": "8.7.0", + "eslint-plugin-filenames-simple": "0.8.0", "eslint-plugin-import": "2.27.5", "eslint-plugin-jest-dom": "3.9.4", "eslint-plugin-jsx-a11y": "6.7.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca9c551ab46..58e5ff23e2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,6 +28,7 @@ importers: dotenv: 16.0.3 eslint: 7.32.0 eslint-config-prettier: 8.7.0 + eslint-plugin-filenames-simple: 0.8.0 eslint-plugin-import: 2.27.5 eslint-plugin-jest-dom: 3.9.4 eslint-plugin-jsx-a11y: 6.7.1 @@ -84,6 +85,7 @@ importers: docsify-cli: 4.4.4 eslint: 7.32.0 eslint-config-prettier: 8.7.0_eslint@7.32.0 + eslint-plugin-filenames-simple: 0.8.0_eslint@7.32.0 eslint-plugin-import: 2.27.5_eslint@7.32.0 eslint-plugin-jest-dom: 3.9.4_eslint@7.32.0 eslint-plugin-jsx-a11y: 6.7.1_eslint@7.32.0 @@ -14796,6 +14798,16 @@ packages: - supports-color dev: true + /eslint-plugin-filenames-simple/0.8.0_eslint@7.32.0: + resolution: {integrity: sha512-8+uBzNBE5gSUMQv7bmMBiOD26eKzD4/5flPtD5Vl3dzZLXotSwXK3W7ZZqKQfU0Qyoborh+LqbN76EfmbBcU8A==} + engines: {node: ^14.17.0 || ^16.0.0 || ^18.0.0} + peerDependencies: + eslint: '>=7.0.0 <9.0.0' + dependencies: + eslint: 7.32.0 + pluralize: 8.0.0 + dev: true + /eslint-plugin-flowtype/5.10.0_eslint@7.32.0: resolution: {integrity: sha512-vcz32f+7TP+kvTUyMXZmCnNujBQZDNmcqPImw8b9PZ+16w1Qdm6ryRuYZYVaG9xRqqmAPr2Cs9FAX5gN+x/bjw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -24227,6 +24239,11 @@ packages: /platform/1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} + /pluralize/8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + dev: true + /pm2-axon-rpc/0.7.1: resolution: {integrity: sha512-FbLvW60w+vEyvMjP/xom2UPhUN/2bVpdtLfKJeYM3gwzYhoTEEChCOICfFzxkxuoEleOlnpjie+n1nue91bDQw==} engines: {node: '>=5'}