Skip to content

Commit

Permalink
Fix Stylelint initialization (#941)
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer authored Feb 22, 2024
1 parent 7e9700c commit 9a2ef74
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-chefs-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sumup/foundry": patch
---

Fixed initializing the Stylelint config files.
2 changes: 1 addition & 1 deletion src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function getToolsForPresets(selectedPresets: Preset[]): ToolOptions[] {
flatten,
uniq,
map((tool: Tool) => tools[tool]),
)(selectedPresets) as ToolOptions[];
)(selectedPresets);
}

function getFilesForTools(
Expand Down
4 changes: 3 additions & 1 deletion src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import * as eslint from './eslint';
import * as husky from './husky';
import * as lintStaged from './lint-staged';
import * as prettier from './prettier';
import * as stylelint from './stylelint';

export const tools: { [key in Tool]?: ToolOptions } = {
export const tools: Record<Tool, ToolOptions> = {
[Tool.ESLINT]: eslint,
[Tool.HUSKY]: husky,
[Tool.LINT_STAGED]: lintStaged,
[Tool.PRETTIER]: prettier,
[Tool.STYLELINT]: stylelint,
};
2 changes: 1 addition & 1 deletion src/presets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ function formatName(name: string, description: string): string {
return [`${chalk.bold(name)}:`, description].join(' ');
}

export const presets = { lint };
export const presets: Record<Preset, PresetConfig> = { lint };

0 comments on commit 9a2ef74

Please sign in to comment.