-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support languages json/markdown #151
base: main
Are you sure you want to change the base?
Conversation
lib/config-generator.js
Outdated
importContent += "import pluginReact from \"eslint-plugin-react\";\n"; | ||
exportContent += " pluginReact.configs.flat.recommended,\n"; | ||
// the default is commonmark | ||
exportContent += " {files: [\"**/*.md\"], language: \"markdown/gfm\"},\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better UX if it could export a predefined config for gfm?
] | ||
} | ||
]; | ||
Object.assign(this.answers, await enquirer.prompt(langQuestions)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't use skip
- as there is a known issue when using multi-selection: enquirer/enquirer#298
I think this part described in #148 isn't implemented:
|
Co-authored-by: Milos Djermanovic <[email protected]>
@@ -12,6 +12,7 @@ const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: plug | |||
|
|||
/** @type {import('eslint').Linter.Config[]} */ | |||
export default [ | |||
{ignores: ["**/*.js", "**/*.cjs", "**/*.mjs"]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests should be updated to pass languages: ["javascript"]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Milos Djermanovic <[email protected]>
A problem is that most plugin configs (including For example:
Generated config file: import pluginJs from "@eslint/js";
import json from "@eslint/json";
/** @type {import('eslint').Linter.Config[]} */
export default [
pluginJs.configs.recommended,
{files: ["**/*.json"], language: "json/json", ...json.configs.recommended},
];
|
Yes, I was able to repro! Is it the expected behavior? My understanding is that it should only be applied to and I'm getting the same error even if I added import pluginJs from "@eslint/js";
import json from "@eslint/json";
/** @type {import('eslint').Linter.Config[]} */
export default [
{files: ["**/*.{js,mjs,cjs}"]},
pluginJs.configs.recommended,
{files: ["**/*.json"], language: "json/json", ...json.configs.recommended},
]; |
fixes #148