Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sort-objects): add custom-ignore to enable customizable ignore rule
Browse files Browse the repository at this point in the history
KID-joker authored and azat-io committed Jul 16, 2024
1 parent cf2d580 commit 2256ce2
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions rules/sort-objects.ts
Original file line number Diff line number Diff line change
@@ -96,9 +96,6 @@ export default createEslintRule<Options, MESSAGE_ID>({
},
type: 'array',
},
'ignore-function': {
type: 'object',
},
groups: {
type: 'array',
},
@@ -137,6 +134,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
} as const)

let shouldIgnore = false
let ignoreFunctions = Object.values(options.customIgnore)

if (
ignoreFunctions.length &&
4 changes: 2 additions & 2 deletions test/sort-objects.test.ts
Original file line number Diff line number Diff line change
@@ -2880,7 +2880,7 @@ describe(RULE_NAME, () => {
`,
options: [
{
'ignore-function': {
customIgnore: {
ignoreButtonStyles: (node: TSESTree.ObjectExpression) => {
if (
node.parent.type === 'VariableDeclarator' &&
@@ -2969,7 +2969,7 @@ describe(RULE_NAME, () => {
`,
options: [
{
'ignore-function': {
customIgnore: {
ignoreButtonStyles: () => false,
},
},

0 comments on commit 2256ce2

Please sign in to comment.