Skip to content

Commit 4765dd5

Browse files
committedMay 3, 2024
fix(markdown): override default rules
1 parent 98d7b04 commit 4765dd5

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed
 

Diff for: ‎src/eslint.config.ts

+21-15
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ export default function unjsPreset(
5353
...(tseslint.configs.recommended as Linter.FlatConfig[]),
5454
// https://github.com/sindresorhus/eslint-plugin-unicorn
5555
eslintPluginUnicorn.configs["flat/recommended"] as Linter.FlatConfig,
56+
57+
// Preset overrides
58+
{ rules: rules as Linter.RulesRecord },
59+
{
60+
languageOptions: {
61+
globals: Object.fromEntries(
62+
Object.keys(globals).flatMap((group) =>
63+
Object.keys(globals[group as keyof typeof globals]).map((k) => [
64+
k,
65+
true,
66+
]),
67+
),
68+
),
69+
},
70+
},
71+
{ ignores: ["dist", "coverage", ...(config.ignores || [])] },
72+
73+
// Markdown
5674
// https://www.npmjs.com/package/eslint-plugin-markdown
5775
config.markdown !== false && { plugins: { markdown } },
5876
config.markdown !== false && {
@@ -68,24 +86,12 @@ export default function unjsPreset(
6886
"padded-blocks": 0,
6987
"@typescript-eslint/no-unused-vars": 0,
7088
"no-empty-pattern": 0,
89+
"no-redeclare": 0,
90+
"no-import-assign": 0,
7191
...config.markdown?.rules,
7292
}) as any,
7393
},
74-
// Preset overrides
75-
{ rules: rules as Linter.RulesRecord },
76-
{
77-
languageOptions: {
78-
globals: Object.fromEntries(
79-
Object.keys(globals).flatMap((group) =>
80-
Object.keys(globals[group as keyof typeof globals]).map((k) => [
81-
k,
82-
true,
83-
]),
84-
),
85-
),
86-
},
87-
},
88-
{ ignores: ["dist", "coverage", ...(config.ignores || [])] },
94+
8995
// User overrides
9096
...(userConfigs as Linter.FlatConfig[]),
9197
].filter(Boolean) as Linter.FlatConfig[];

0 commit comments

Comments
 (0)
Please sign in to comment.