Skip to content
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

fix: generate builtin rules type correctly #639

Closed
wants to merge 1 commit into from

Conversation

KazariEX
Copy link

Description

N/A

Linked Issues

N/A

Additional context

I cannot run dev and typegen script on my end.

Copy link

netlify bot commented Nov 27, 2024

Deploy Preview for melodious-froyo-4871f8 failed.

Name Link
🔨 Latest commit b04b399
🔍 Latest deploy log https://app.netlify.com/sites/melodious-froyo-4871f8/deploys/674751ae6787b20008e7b368

@RayGuo-ergou
Copy link
Contributor

I am experiencing the opposite tho.

With rules: JS.configs.all.rules,

> esno scripts/typegen.ts

file:///home/raydev/work/eslint-config/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/eslint-typegen/dist/core.mjs:37
      if ("meta" in rule) {
                 ^

TypeError: Cannot use 'in' operator to search for 'meta' in error
    at pluginsToRulesDTS (file:///home/raydev/work/eslint-config/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/eslint-typegen/dist/core.mjs:37:18)
    at flatConfigsToRulesDTS (file:///home/raydev/work/eslint-config/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/eslint-typegen/dist/core.mjs:19:10)
    at async <anonymous> (/home/raydev/work/eslint-config/scripts/typegen.ts:62:11)

Node.js v20.18.0

@RayGuo-ergou
Copy link
Contributor

RayGuo-ergou commented Nov 28, 2024

But I found an issue related to it, that eslint rules are not in the typegen.d.ts

Details

❯ rg "'quotes'" ./src/typegen.d.ts

❯ rg "quotes" ./src/typegen.d.ts
1081: * require quotes around object literal property names
1086: * enforce use of double or single quotes
1087: * @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quotes.html
1089: 'jsonc/quotes'?: Linter.RuleEntry
2524: * Enforce the consistent use of either double or single quotes in JSX attributes
2525: * @see https://eslint.style/rules/js/jsx-quotes
2527: 'style/jsx-quotes'?: Linter.RuleEntry
2709: * Require quotes around object literal, type literal, interfaces and enums property names
2714: * Enforce the consistent use of either backticks, double, or single quotes
2715: * @see https://eslint.style/rules/ts/quotes
2717: 'style/quotes'?: Linter.RuleEntry
2865: * enforce quotes style of HTML attributes
2866: * @see https://sveltejs.github.io/eslint-plugin-svelte/rules/html-quotes/
2868: 'svelte/html-quotes'?: Linter.RuleEntry
3536: * require or disallow quotes around keys
5144: * enforce quotes style of HTML attributes
5145: * @see https://eslint.vuejs.org/rules/html-quotes.html
5147: 'vue/html-quotes'?: Linter.RuleEntry
5852: * Require quotes around object literal, type literal, interfaces and enums property names in <template>
6294: * enforce the consistent use of either double, or single quotes
6295: * @see https://ota-meshi.github.io/eslint-plugin-yml/rules/quotes.html
6297: 'yaml/quotes'?: Linter.RuleEntry
7270:// ----- jsonc/quotes -----
8735:// ----- style/jsx-quotes -----
9419:// ----- style/quotes -----
9562:// ----- svelte/html-quotes -----
11492:// ----- vue/html-quotes -----
12587:// ----- yaml/quotes -----

@antfu antfu closed this in d9b10e1 Nov 28, 2024
@KazariEX KazariEX deleted the fix/typegen-builtin branch November 28, 2024 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants