diff --git a/.changeset/late-mirrors-drop.md b/.changeset/late-mirrors-drop.md new file mode 100644 index 000000000..f1092a71c --- /dev/null +++ b/.changeset/late-mirrors-drop.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-svelte": minor +--- + +feat: add rule types diff --git a/.eslintignore b/.eslintignore index 3de5191c2..522400a38 100644 --- a/.eslintignore +++ b/.eslintignore @@ -29,6 +29,7 @@ /docs-svelte-kit/src/routes/*.md /docs-svelte-kit/src/routes/**/*.md /docs-svelte-kit/src/app.html +/src/rule-types.ts # JSONSchema bug? /.devcontainer/devcontainer.json diff --git a/package.json b/package.json index 7c9baaf84..af8e9d923 100644 --- a/package.json +++ b/package.json @@ -141,6 +141,7 @@ "eslint-plugin-svelte": "^2.35.1", "eslint-plugin-yml": "^1.14.0", "eslint-scope": "^8.0.1", + "eslint-typegen": "^0.2.1", "eslint-visitor-keys": "^4.0.0", "espree": "^10.0.1", "estree-walker": "^3.0.3", diff --git a/src/index.ts b/src/index.ts index 8aed92235..826a7b8d2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ +import './rule-types'; import type { RuleModule } from './types'; import { rules as ruleList } from './utils/rules'; import base from './configs/base'; diff --git a/src/rule-types.ts b/src/rule-types.ts new file mode 100644 index 000000000..84d6aab40 --- /dev/null +++ b/src/rule-types.ts @@ -0,0 +1,477 @@ +// IMPORTANT! +// This file has been automatically generated, +// in order to update its content execute "pnpm run update" + +/* eslint-disable */ +/* prettier-ignore */ +import type { Linter } from 'eslint' + +declare module 'eslint' { + namespace Linter { + interface RulesRecord extends RuleOptions {} + } +} + +export interface RuleOptions { + /** + * disallow conditionals where the type is always truthy or always falsy + * @see https://sveltejs.github.io/eslint-plugin-svelte/rules/@typescript-eslint/no-unnecessary-condition/ + * @deprecated + */ + 'svelte/@typescript-eslint/no-unnecessary-condition'?: Linter.RuleEntry + /** + * disallows the use of languages other than those specified in the configuration for the lang attribute of `