From ba872f45c1fb211beeb2bc5ea0e33d0326657fa2 Mon Sep 17 00:00:00 2001 From: Yeoh Joer Date: Tue, 17 Feb 2026 00:22:25 +0800 Subject: [PATCH 1/2] style: keep union types unsorted --- examples/tanstack/start/src/external-stores/Redux.tsx | 1 - packages/config/eslint.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tanstack/start/src/external-stores/Redux.tsx b/examples/tanstack/start/src/external-stores/Redux.tsx index d7e70f8..96b5317 100644 --- a/examples/tanstack/start/src/external-stores/Redux.tsx +++ b/examples/tanstack/start/src/external-stores/Redux.tsx @@ -1,5 +1,4 @@ /* eslint-disable perfectionist/sort-switch-case */ -/* eslint-disable perfectionist/sort-union-types */ import * as stylex from '@stylexjs/stylex'; import { createFileRoute } from '@tanstack/react-router'; import { useState } from 'react'; diff --git a/packages/config/eslint.js b/packages/config/eslint.js index 8e83dc9..a09026e 100755 --- a/packages/config/eslint.js +++ b/packages/config/eslint.js @@ -309,6 +309,7 @@ function perfectionist() { 'perfectionist/sort-sets': 'warn', 'perfectionist/sort-switch-case': 'warn', 'perfectionist/sort-union-types': ['warn', { + type: 'unsorted', groups: ['unknown', 'named', 'nullish'], }], }, From a2f088d17a30e11f1fd0c808dba3a9405c94e9bc Mon Sep 17 00:00:00 2001 From: Yeoh Joer Date: Tue, 17 Feb 2026 00:41:28 +0800 Subject: [PATCH 2/2] refactor: merge the rules instead of overriding them later --- packages/config/eslint.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/config/eslint.js b/packages/config/eslint.js index a09026e..302fa0f 100755 --- a/packages/config/eslint.js +++ b/packages/config/eslint.js @@ -234,16 +234,19 @@ function unicorn() { } function stylistic() { + const config = stylistic_plugin.configs.customize({ + indent: 2, + quotes: 'single', + semi: true, + jsx: true, + braceStyle: '1tbs', + }); + return [ - stylistic_plugin.configs.customize({ - indent: 2, - quotes: 'single', - semi: true, - jsx: true, - braceStyle: '1tbs', - }), { + plugins: { '@stylistic': stylistic_plugin }, rules: { + ...config.rules, '@stylistic/indent': ['error', 2, { ignoredNodes: ['TSUnionType', 'TSIntersectionType'], SwitchCase: 1,