Skip to content

Commit

Permalink
fix: pass in the correct name for each padding rule
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Apr 24, 2024
1 parent 6f796d2 commit a82b143
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/rules/padding-around-after-all-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-after-each-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config as paddingAroundExpectGroupsConfig } from './padding-around-expe
import { config as paddingAroundTestBlocksConfig } from './padding-around-test-blocks';
import { createPaddingRule } from './utils/padding';

export default createPaddingRule([
export default createPaddingRule(__filename, [
...paddingAroundAfterAllBlocksConfig,
...paddingAroundAfterEachBlocksConfig,
...paddingAroundBeforeAllBlocksConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/padding-around-before-all-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-before-each-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-describe-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-expect-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
2 changes: 1 addition & 1 deletion src/rules/padding-around-test-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export const config = [
},
];

export default createPaddingRule(config);
export default createPaddingRule(__filename, config);
8 changes: 6 additions & 2 deletions src/rules/utils/padding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,13 @@ const verifyNode = (node: Node, paddingContext: PaddingContext): void => {
*
* See src/index.ts for examples of Config usage.
*/
export const createPaddingRule = (configs: Config[], deprecated = false) => {
export const createPaddingRule = (
name: string,
configs: Config[],
deprecated = false,
) => {
return createRule({
name: __filename,
name,
meta: {
docs: {
description: 'Enforce assertion to be made in a test body',
Expand Down

0 comments on commit a82b143

Please sign in to comment.