From cbd1797948ee953756f5dafb5947e32c53a2c5a0 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 21 Sep 2024 15:36:10 +0700 Subject: [PATCH] refactor: split expected rules by plugin --- src/test/_expected-exported-value.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/test/_expected-exported-value.ts b/src/test/_expected-exported-value.ts index 39451a34..158e7aaf 100644 --- a/src/test/_expected-exported-value.ts +++ b/src/test/_expected-exported-value.ts @@ -4,7 +4,7 @@ import * as importPlugin from 'eslint-plugin-import' import * as nPlugin from 'eslint-plugin-n' import * as promisePlugin from 'eslint-plugin-promise' -const rules: Record = { +const eslintRules: Record = { 'no-magic-numbers': ['off'], 'no-var': ['error'], 'object-shorthand': ['warn', 'properties'], @@ -133,7 +133,9 @@ const rules: Record = { ], 'valid-typeof': ['error', { requireStringLiterals: true }], yoda: ['error', 'never'], +} +const importRules: Record = { 'import/export': ['error'], 'import/first': ['error'], 'import/no-absolute-path': [ @@ -143,7 +145,9 @@ const rules: Record = { 'import/no-duplicates': ['error'], 'import/no-named-default': ['error'], 'import/no-webpack-loader-syntax': ['error'], +} +const nRules: Record = { 'n/handle-callback-err': ['error', '^(err|error)$'], 'n/no-callback-literal': ['error'], 'n/no-deprecated-api': ['error'], @@ -151,8 +155,13 @@ const rules: Record = { 'n/no-new-require': ['error'], 'n/no-path-concat': ['error'], 'n/process-exit-as-throw': ['error'], +} +const promiseRules: Record = { 'promise/param-names': ['error'], +} + +const tseslintRules: Record = { '@typescript-eslint/adjacent-overload-signatures': ['error'], '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], '@typescript-eslint/await-thenable': ['error'], @@ -418,5 +427,11 @@ export const expectedExportedValue: TSESLint.FlatConfig.Config = { n: nPlugin, promise: promisePlugin, }, - rules, + rules: { + ...eslintRules, + ...importRules, + ...nRules, + ...promiseRules, + ...tseslintRules, + }, }