Skip to content

Commit

Permalink
feat: improve sort intersections
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Oct 19, 2024
1 parent de1b62b commit f406d4b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
52 changes: 47 additions & 5 deletions src/modules/perfectionist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,59 @@ function perfectionist() {
'perfectionist/sort-exports': 'warn',
'perfectionist/sort-imports': ['warn', {}],
'perfectionist/sort-interfaces': 'off',
'perfectionist/sort-intersection-types': 'warn',
'perfectionist/sort-jsx-props': 'warn',
'perfectionist/sort-maps': 'warn',
'perfectionist/sort-intersection-types': [
'warn',
{
groups: [
'conditional',
'function',
'import',
'intersection',
'keyword',
'literal',
'named',
'object',
'operator',
'tuple',
'union',
'nullish',
],
},
],
'perfectionist/sort-jsx-props': [
'warn',
{
groups: ['shorthand', 'unknown', 'callback', 'multiline'],
customGroups: { callback: 'on*' },
},
],
'perfectionist/sort-maps': 'off',
'perfectionist/sort-named-exports': 'warn',
'perfectionist/sort-named-imports': 'warn',
'perfectionist/sort-object-types': 'off',
'perfectionist/sort-objects': 'off',
'perfectionist/sort-sets': 'warn',
'perfectionist/sort-svelte-attributes': 'warn',
'perfectionist/sort-switch-case': 'warn',
'perfectionist/sort-union-types': 'warn',
'perfectionist/sort-switch-case': 'off',
'perfectionist/sort-union-types': [
'warn',
{
groups: [
'conditional',
'function',
'import',
'intersection',
'keyword',
'literal',
'named',
'object',
'operator',
'tuple',
'union',
'nullish',
],
},
],
'perfectionist/sort-variable-declarations': 'warn',
'perfectionist/sort-vue-attributes': 'warn',
},
Expand Down
2 changes: 1 addition & 1 deletion src/modules/react.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function react() {
},
rules: {
'@eslint-react/dom/no-children-in-void-dom-elements': 'warn',
'@eslint-react/dom/no-dangerously-set-innerhtml': 'warn',
'@eslint-react/dom/no-dangerously-set-innerhtml': 'off',
'@eslint-react/dom/no-dangerously-set-innerhtml-with-children': 'error',
'@eslint-react/dom/no-find-dom-node': 'error',
'@eslint-react/dom/no-missing-button-type': 'warn',
Expand Down
1 change: 1 addition & 0 deletions src/modules/typescript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ function typescript(options = {}) {
'react/jsx-no-useless-fragment': 'off', // Need useless-fragment for JSX return type

// Conflicts with @typescript-eslint
'default-case': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/default': 'off',
Expand Down

0 comments on commit f406d4b

Please sign in to comment.