Open jeremymeng opened 2 months ago
diff --git a/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts b/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts
index cd792e49cb..7155073805 100644
--- a/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts
+++ b/common/tools/eslint-plugin-azure-sdk/src/configs/index.ts
@@ -54,6 +54,7 @@ function recommended(plugin: FlatConfig.Plugin, options: { typeChecked: boolean
export default (plugin: FlatConfig.Plugin) => ({
recommended: recommended(plugin, { typeChecked: false }),
recommendedTypeChecked: recommended(plugin, { typeChecked: true }),
+ recommendedMarkdown: markdownCustomized,
"recommended-legacy": {
plugins: ["@azure/azure-sdk"],
env: {
diff --git a/common/tools/eslint-plugin-azure-sdk/src/configs/markdown-customized.ts b/common/tools/eslint-plugin-azure-sdk/src/configs/markdown-customized.ts
index cc6b72478f..ebfb108048 100644
--- a/common/tools/eslint-plugin-azure-sdk/src/configs/markdown-customized.ts
+++ b/common/tools/eslint-plugin-azure-sdk/src/configs/markdown-customized.ts
@@ -20,6 +20,7 @@ const markdownConfigs: FlatConfig.ConfigArray = [
},
...typescriptEslint.configs.disableTypeChecked,
rules: {
+ ...typescriptEslint.configs.disableTypeChecked.rules,
"no-unused-vars": "off",
"no-undef": "off",
"no-console": "off",
@@ -49,6 +50,7 @@ const markdownConfigs: FlatConfig.ConfigArray = [
},
...typescriptEslint.configs.disableTypeChecked,
rules: {
+ ...typescriptEslint.configs.disableTypeChecked.rules,
"@typescript-eslint/no-unused-vars": "off",
},
},
Currently if we have the following eslint.config.mjs for a package,
Linting README.md would gives the following error.
This is because the
{ rules: { ... }}
config in the local eslint.config.mjs doesn't specify anyfiles
orignores
so it applies to all files with default extension (.ts/.js?). And since it comes as the last matching config it is used.One possible workaround is adding another config from our eslint-plugin
recommendedMarkdown
, then local config adds it the end to ensure markdown rules comes last.