UNPKG

@jimmy.codes/eslint-config

Version:

A simple, modern ESLint config that covers most use cases.

1,247 lines (1,228 loc) 690 kB
import * as eslint from 'eslint'; import { Linter } from 'eslint'; import * as eslint_plugin_astro from 'eslint-plugin-astro'; import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint'; import * as astro_eslint_parser from 'astro-eslint-parser'; import * as _tanstack_eslint_plugin_query from '@tanstack/eslint-plugin-query'; import * as _stylistic_eslint_plugin from '@stylistic/eslint-plugin'; import * as eslint_plugin_regexp from 'eslint-plugin-regexp'; import * as eslint_plugin_n from 'eslint-plugin-n'; declare function nextjsConfig(): Promise<{ files: string[]; name: string; plugins: { "@next/next": { configs: { "core-web-vitals": eslint.Linter.Config<eslint.Linter.RulesRecord>; recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>; }; }; }; rules: { [k: string]: 0 | 1 | 2 | "off" | "error" | [eslint.Linter.RuleSeverity, ...any[]] | undefined; }; }[]>; declare namespace __configs_nextjs { export { nextjsConfig as default }; } declare function storybookConfig(): Promise<({ name: string; plugins: { readonly storybook: any; } | undefined; files?: undefined; rules?: undefined; } | { files: string[] | undefined; name: string; rules: { "import-x/no-anonymous-default-export": "off"; "storybook/meta-satisfies-type": "error"; "unicorn/no-anonymous-default-export": "off"; }; plugins?: undefined; } | { files: string[] | undefined; name: string; rules: {}; plugins?: undefined; })[]>; declare namespace __configs_storybook { export { storybookConfig as default }; } declare function playwrightConfig(): Promise<{ files: string[]; name: string; rules: { "playwright/expect-expect": "error"; "playwright/max-nested-describe": "error"; "playwright/no-conditional-expect": "error"; "playwright/no-conditional-in-test": "error"; "playwright/no-element-handle": "error"; "playwright/no-eval": "error"; "playwright/no-force-option": "error"; "playwright/no-nested-step": "error"; "playwright/no-page-pause": "error"; "playwright/no-skipped-test": "error"; "playwright/no-slowed-test": "error"; "playwright/no-useless-await": "error"; "playwright/no-useless-not": "error"; "playwright/no-wait-for-selector": "error"; "playwright/no-wait-for-timeout": "error"; "playwright/valid-title": "off"; }; ignores?: string[]; language?: string; languageOptions?: eslint.Linter.LanguageOptions; linterOptions?: eslint.Linter.LinterOptions; processor?: string | eslint.Linter.Processor; plugins?: Record<string, eslint.ESLint.Plugin>; settings?: Record<string, unknown>; }[]>; declare namespace __configs_playwright { export { playwrightConfig as default }; } declare function testingLibraryConfig(): Promise<{ files: string[]; ignores: string[]; name: string; plugins: { "jest-dom": { default: { meta: { name: string; version: string; }; configs: { all: eslint.Linter.LegacyConfig; recommended: eslint.Linter.LegacyConfig; "flat/all": eslint.Linter.FlatConfig; "flat/recommended": eslint.Linter.FlatConfig; }; rules: { [key: string]: eslint.Rule.RuleModule; }; }; meta: { name: string; version: string; }; configs: { all: eslint.Linter.LegacyConfig; recommended: eslint.Linter.LegacyConfig; "flat/all": eslint.Linter.FlatConfig; "flat/recommended": eslint.Linter.FlatConfig; }; rules: { [key: string]: eslint.Rule.RuleModule; }; }; "testing-library": { meta: { name: string; version: string; }; configs: { angular: eslint.Linter.LegacyConfig; dom: eslint.Linter.LegacyConfig; marko: eslint.Linter.LegacyConfig; react: eslint.Linter.LegacyConfig; svelte: eslint.Linter.LegacyConfig; vue: eslint.Linter.LegacyConfig; "flat/angular": eslint.Linter.FlatConfig; "flat/dom": eslint.Linter.FlatConfig; "flat/marko": eslint.Linter.FlatConfig; "flat/react": eslint.Linter.FlatConfig; "flat/svelte": eslint.Linter.FlatConfig; "flat/vue": eslint.Linter.FlatConfig; }; rules: { [key: string]: eslint.Rule.RuleModule; }; }; }; rules: { "testing-library/no-test-id-queries": "error"; }; }[]>; declare namespace __configs_testing_library { export { testingLibraryConfig as default }; } declare function vitestConfig(): Promise<{ name: string; rules: { "vitest/consistent-test-it": ["error", { fn: "test"; withinDescribe: "it"; }]; "vitest/consistent-vitest-vi": "error"; "vitest/no-alias-methods": "error"; "vitest/no-commented-out-tests": "error"; "vitest/no-conditional-in-test": "error"; "vitest/no-disabled-tests": "warn"; "vitest/no-duplicate-hooks": "error"; "vitest/no-focused-tests": "error"; "vitest/no-hooks": "off"; "vitest/no-identical-title": "error"; "vitest/no-interpolation-in-snapshots": "error"; "vitest/no-large-snapshots": "off"; "vitest/no-mocks-import": "error"; "vitest/no-restricted-matchers": "off"; "vitest/no-restricted-vi-methods": "off"; "vitest/no-standalone-expect": "error"; "vitest/no-test-prefixes": "error"; "vitest/no-test-return-statement": "error"; "vitest/prefer-called-with": "error"; "vitest/prefer-comparison-matcher": "error"; "vitest/prefer-each": "error"; "vitest/prefer-equality-matcher": "error"; "vitest/prefer-expect-assertions": "off"; "vitest/prefer-expect-resolves": "error"; "vitest/prefer-hooks-in-order": "error"; "vitest/prefer-hooks-on-top": "error"; "vitest/prefer-lowercase-title": "off"; "vitest/prefer-mock-promise-shorthand": "error"; "vitest/prefer-snapshot-hint": "error"; "vitest/prefer-spy-on": "off"; "vitest/prefer-strict-boolean-matchers": "error"; "vitest/prefer-strict-equal": "error"; "vitest/prefer-to-be": "error"; "vitest/prefer-to-contain": "error"; "vitest/prefer-to-have-length": "error"; "vitest/prefer-todo": "warn"; "vitest/require-hook": "error"; "vitest/require-to-throw-message": "error"; "vitest/require-top-level-describe": "off"; "vitest/valid-expect": "error"; "vitest/valid-expect-in-promise": "error"; "vitest/valid-title": ["error", { mustMatch: { it: string; }; }]; "vitest/expect-expect": "error"; "vitest/valid-describe-callback": "error"; "vitest/require-local-test-context-for-concurrent-snapshots": "error"; "vitest/no-import-node-test": "error"; }; plugins: { readonly vitest: eslint.ESLint.Plugin; }; files: string[]; ignores: string[]; }[]>; declare namespace __configs_vitest { export { vitestConfig as default }; } declare function jestConfig(): Promise<{ name: string; rules: { "jest/consistent-test-it": ["error", { fn: "test"; withinDescribe: "it"; }]; "jest/expect-expect": "error"; "jest/no-alias-methods": "error"; "jest/no-commented-out-tests": "error"; "jest/no-conditional-in-test": "error"; "jest/no-confusing-set-timeout": "error"; "jest/no-duplicate-hooks": "error"; "jest/no-hooks": "off"; "jest/no-large-snapshots": "off"; "jest/no-restricted-jest-methods": "off"; "jest/no-restricted-matchers": "off"; "jest/no-test-return-statement": "error"; "jest/no-untyped-mock-factory": "off"; "jest/prefer-called-with": "error"; "jest/prefer-comparison-matcher": "error"; "jest/prefer-each": "error"; "jest/prefer-equality-matcher": "error"; "jest/prefer-expect-assertions": "off"; "jest/prefer-expect-resolves": "error"; "jest/prefer-hooks-in-order": "error"; "jest/prefer-hooks-on-top": "error"; "jest/prefer-lowercase-title": "off"; "jest/prefer-mock-promise-shorthand": "error"; "jest/prefer-snapshot-hint": "error"; "jest/prefer-spy-on": "off"; "jest/prefer-strict-equal": "error"; "jest/prefer-todo": "warn"; "jest/require-hook": "error"; "jest/require-to-throw-message": "error"; "jest/require-top-level-describe": "off"; "jest/unbound-method": "off"; "jest/valid-title": ["error", { mustMatch: { it: string; }; }]; }; files: Array<string | string[]>; ignores: string[]; language?: string; languageOptions?: eslint.Linter.LanguageOptions; linterOptions?: eslint.Linter.LinterOptions; processor?: string | eslint.Linter.Processor; plugins?: Record<string, eslint.ESLint.Plugin>; settings?: Record<string, unknown>; }[]>; declare namespace __configs_jest { export { jestConfig as default }; } declare function astroConfig(): Promise<({ files: string[]; languageOptions: { globals: { Astro: false; Fragment: false; __dirname: false; __filename: false; AbortController: false; AbortSignal: false; AsyncDisposableStack: false; atob: false; Blob: false; BroadcastChannel: false; btoa: false; Buffer: false; ByteLengthQueuingStrategy: false; clearImmediate: false; clearInterval: false; clearTimeout: false; CloseEvent: false; CompressionStream: false; console: false; CountQueuingStrategy: false; crypto: false; Crypto: false; CryptoKey: false; CustomEvent: false; DecompressionStream: false; DisposableStack: false; DOMException: false; Event: false; EventTarget: false; exports: true; fetch: false; File: false; FormData: false; global: false; Headers: false; MessageChannel: false; MessageEvent: false; MessagePort: false; module: false; navigator: false; Navigator: false; performance: false; Performance: false; PerformanceEntry: false; PerformanceMark: false; PerformanceMeasure: false; PerformanceObserver: false; PerformanceObserverEntryList: false; PerformanceResourceTiming: false; process: false; queueMicrotask: false; ReadableByteStreamController: false; ReadableStream: false; ReadableStreamBYOBReader: false; ReadableStreamBYOBRequest: false; ReadableStreamDefaultController: false; ReadableStreamDefaultReader: false; Request: false; require: false; Response: false; setImmediate: false; setInterval: false; setTimeout: false; structuredClone: false; SubtleCrypto: false; SuppressedError: false; TextDecoder: false; TextDecoderStream: false; TextEncoder: false; TextEncoderStream: false; TransformStream: false; TransformStreamDefaultController: false; URL: false; URLPattern: false; URLSearchParams: false; WebAssembly: false; WebSocket: false; WritableStream: false; WritableStreamDefaultController: false; WritableStreamDefaultWriter: false; }; parser: { default: typeof astro_eslint_parser; ParseError: typeof astro_eslint_parser.ParseError; VisitorKeys: eslint.SourceCode.VisitorKeys; meta: typeof astro_eslint_parser.meta; name: string; parseForESLint: typeof astro_eslint_parser.parseForESLint; parseTemplate: typeof astro_eslint_parser.parseTemplate; traverseNodes: typeof astro_eslint_parser.traverseNodes; }; parserOptions: { extraFileExtensions: string[]; parser: _typescript_eslint_utils_ts_eslint.Parser.LooseParserModule; }; sourceType: "module"; }; name: string; plugins: { astro: typeof eslint_plugin_astro; "jsx-a11y": { configs: { recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>; }; }; }; processor: string; rules: { "astro/missing-client-only-directive-value": "error"; "astro/no-conflict-set-directives": "error"; "astro/no-deprecated-astro-canonicalurl": "error"; "astro/no-deprecated-astro-fetchcontent": "error"; "astro/no-deprecated-astro-resolve": "error"; "astro/no-deprecated-getentrybyslug": "error"; "astro/no-exports-from-components": "off"; "astro/no-unused-define-vars-in-style": "error"; "astro/valid-compile": "error"; }; settings?: undefined; } | { files: string[]; languageOptions: { parserOptions: _typescript_eslint_utils_ts_eslint.ParserOptions | undefined; globals?: undefined; parser?: undefined; sourceType?: undefined; }; name: string; rules: Partial<Record<string, _typescript_eslint_utils_ts_eslint.SharedConfig.RuleEntry>> | undefined; plugins?: undefined; processor?: undefined; settings?: undefined; } | { name: string; settings: { "import-x/core-modules": string[]; }; files?: undefined; languageOptions?: undefined; plugins?: undefined; processor?: undefined; rules?: undefined; })[]>; declare namespace __configs_astro { export { astroConfig as default }; } declare function tanstackQueryConfig(): Promise<{ files: string[]; name: string; plugins: { "@tanstack/query": _tanstack_eslint_plugin_query.Plugin; }; rules: { "@tanstack/query/exhaustive-deps": "error"; "@tanstack/query/infinite-query-property-order": "error"; "@tanstack/query/no-rest-destructuring": "error"; "@tanstack/query/no-unstable-deps": "error"; "@tanstack/query/no-void-query-fn": "error"; "@tanstack/query/stable-query-client": "error"; }; }[]>; declare namespace __configs_tanstack_query { export { tanstackQueryConfig as default }; } /* eslint-disable */ /* prettier-ignore */ interface RuleOptions { /** * require a `eslint-enable` comment for every `eslint-disable` comment * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/disable-enable-pair.html */ '@eslint-community/eslint-comments/disable-enable-pair'?: Linter.RuleEntry<EslintCommunityEslintCommentsDisableEnablePair> /** * disallow a `eslint-enable` comment for multiple `eslint-disable` comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-aggregating-enable.html */ '@eslint-community/eslint-comments/no-aggregating-enable'?: Linter.RuleEntry<[]> /** * disallow duplicate `eslint-disable` comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-duplicate-disable.html */ '@eslint-community/eslint-comments/no-duplicate-disable'?: Linter.RuleEntry<[]> /** * disallow `eslint-disable` comments about specific rules * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-restricted-disable.html */ '@eslint-community/eslint-comments/no-restricted-disable'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoRestrictedDisable> /** * disallow `eslint-disable` comments without rule names * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unlimited-disable.html */ '@eslint-community/eslint-comments/no-unlimited-disable'?: Linter.RuleEntry<[]> /** * disallow unused `eslint-disable` comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-disable.html */ '@eslint-community/eslint-comments/no-unused-disable'?: Linter.RuleEntry<[]> /** * disallow unused `eslint-enable` comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-unused-enable.html */ '@eslint-community/eslint-comments/no-unused-enable'?: Linter.RuleEntry<[]> /** * disallow ESLint directive-comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/no-use.html */ '@eslint-community/eslint-comments/no-use'?: Linter.RuleEntry<EslintCommunityEslintCommentsNoUse> /** * require include descriptions in ESLint directive-comments * @see https://eslint-community.github.io/eslint-plugin-eslint-comments/rules/require-description.html */ '@eslint-community/eslint-comments/require-description'?: Linter.RuleEntry<EslintCommunityEslintCommentsRequireDescription> /** * Enforces explicit boolean values for boolean attributes. * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-boolean */ '@eslint-react/avoid-shorthand-boolean'?: Linter.RuleEntry<[]> /** * Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax. * @see https://eslint-react.xyz/docs/rules/avoid-shorthand-fragment */ '@eslint-react/avoid-shorthand-fragment'?: Linter.RuleEntry<[]> /** * Disallow `children` in void DOM elements. * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children */ '@eslint-react/dom/no-children-in-void-dom-elements'?: Linter.RuleEntry<[]> /** * Disallow `dangerouslySetInnerHTML`. * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml */ '@eslint-react/dom/no-dangerously-set-innerhtml'?: Linter.RuleEntry<[]> /** * Disallow `dangerouslySetInnerHTML` and `children` at the same time. * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children */ '@eslint-react/dom/no-dangerously-set-innerhtml-with-children'?: Linter.RuleEntry<[]> /** * Disallow `findDOMNode`. * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node */ '@eslint-react/dom/no-find-dom-node'?: Linter.RuleEntry<[]> /** * Disallow `flushSync`. * @see https://eslint-react.xyz/docs/rules/dom-no-flush-sync */ '@eslint-react/dom/no-flush-sync'?: Linter.RuleEntry<[]> /** * Replaces usages of `ReactDom.hydrate()` with `hydrateRoot()`. * @see https://eslint-react.xyz/docs/rules/dom-no-hydrate */ '@eslint-react/dom/no-hydrate'?: Linter.RuleEntry<[]> /** * Enforces explicit `type` attribute for `button` elements. * @see https://eslint-react.xyz/docs/rules/dom-no-missing-button-type */ '@eslint-react/dom/no-missing-button-type'?: Linter.RuleEntry<[]> /** * Enforces explicit `sandbox` attribute for `iframe` elements. * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox */ '@eslint-react/dom/no-missing-iframe-sandbox'?: Linter.RuleEntry<[]> /** * Enforces the absence of a `namespace` in React elements. * @see https://eslint-react.xyz/docs/rules/dom-no-namespace */ '@eslint-react/dom/no-namespace'?: Linter.RuleEntry<[]> /** * Replaces usages of `ReactDom.render()` with `createRoot(node).render()`. * @see https://eslint-react.xyz/docs/rules/dom-no-render */ '@eslint-react/dom/no-render'?: Linter.RuleEntry<[]> /** * Disallow the return value of `ReactDOM.render`. * @see https://eslint-react.xyz/docs/rules/dom-no-render-return-value */ '@eslint-react/dom/no-render-return-value'?: Linter.RuleEntry<[]> /** * Disallow `javascript:` URLs as attribute values. * @see https://eslint-react.xyz/docs/rules/dom-no-script-url */ '@eslint-react/dom/no-script-url'?: Linter.RuleEntry<[]> /** * Disallow unknown `DOM` property. * @see https://eslint-react.xyz/docs/rules/dom-no-unknown-property */ '@eslint-react/dom/no-unknown-property'?: Linter.RuleEntry<EslintReactDomNoUnknownProperty> /** * Enforces `sandbox` attribute for `iframe` elements is not set to unsafe combinations. * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox */ '@eslint-react/dom/no-unsafe-iframe-sandbox'?: Linter.RuleEntry<[]> /** * Disallow `target="_blank"` without `rel="noreferrer noopener"`. * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank */ '@eslint-react/dom/no-unsafe-target-blank'?: Linter.RuleEntry<[]> /** * Replaces usages of `useFormState` with `useActionState`. * @see https://eslint-react.xyz/docs/rules/dom-no-use-form-state */ '@eslint-react/dom/no-use-form-state'?: Linter.RuleEntry<[]> /** * Disallow `children` in void DOM elements. * @see https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children */ '@eslint-react/dom/no-void-elements-with-children'?: Linter.RuleEntry<[]> /** * Disallow useless `forwardRef` calls on components that don't use `ref`s. * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref */ '@eslint-react/ensure-forward-ref-using-ref'?: Linter.RuleEntry<[]> /** * Enforces that a function with the `use` prefix should use at least one Hook inside of it. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix */ '@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks'?: Linter.RuleEntry<[]> /** * Disallow unnecessary usage of `useCallback`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback */ '@eslint-react/hooks-extra/ensure-use-callback-has-non-empty-deps'?: Linter.RuleEntry<[]> /** * Disallow unnecessary usage of `useMemo`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo */ '@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps'?: Linter.RuleEntry<[]> /** * Disallow direct calls to the `set` function of `useState` in `useEffect`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-effect */ '@eslint-react/hooks-extra/no-direct-set-state-in-use-effect'?: Linter.RuleEntry<[]> /** * Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-direct-set-state-in-use-layout-effect */ '@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect'?: Linter.RuleEntry<[]> /** * Enforces that a function with the `use` prefix should use at least one Hook inside of it. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix */ '@eslint-react/hooks-extra/no-redundant-custom-hook'?: Linter.RuleEntry<[]> /** * Disallow unnecessary usage of `useCallback`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-callback */ '@eslint-react/hooks-extra/no-unnecessary-use-callback'?: Linter.RuleEntry<[]> /** * Disallow unnecessary usage of `useMemo`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-memo */ '@eslint-react/hooks-extra/no-unnecessary-use-memo'?: Linter.RuleEntry<[]> /** * Enforces that a function with the `use` prefix should use at least one Hook inside of it. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix */ '@eslint-react/hooks-extra/no-unnecessary-use-prefix'?: Linter.RuleEntry<[]> /** * Enforces that a function with the `use` prefix should use at least one Hook inside of it. * @see https://eslint-react.xyz/docs/rules/hooks-extra-no-unnecessary-use-prefix */ '@eslint-react/hooks-extra/no-useless-custom-hooks'?: Linter.RuleEntry<[]> /** * Enforces function calls made inside `useState` to be wrapped in an `initializer function`. * @see https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization */ '@eslint-react/hooks-extra/prefer-use-state-lazy-initialization'?: Linter.RuleEntry<[]> /** * Enforces that the 'key' attribute is placed before the spread attribute in JSX elements. * @see https://eslint-react.xyz/docs/rules/jsx-key-before-spread */ '@eslint-react/jsx-key-before-spread'?: Linter.RuleEntry<[]> /** * Disallow duplicate props in JSX elements. * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props */ '@eslint-react/jsx-no-duplicate-props'?: Linter.RuleEntry<[]> /** * Disallows 'IIFE' in JSX elements. * @see https://eslint-react.xyz/docs/rules/jsx-no-iife */ '@eslint-react/jsx-no-iife'?: Linter.RuleEntry<[]> /** * Disallow undefined variables in JSX. * @see https://eslint-react.xyz/docs/rules/jsx-no-undef */ '@eslint-react/jsx-no-undef'?: Linter.RuleEntry<[]> /** * Marks React variables as used when JSX is used. * @see https://eslint-react.xyz/docs/rules/jsx-uses-react */ '@eslint-react/jsx-uses-react'?: Linter.RuleEntry<[]> /** * Marks variables used in JSX elements as used. * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars */ '@eslint-react/jsx-uses-vars'?: Linter.RuleEntry<[]> /** * Enforces naming conventions for components. * @see https://eslint-react.xyz/docs/rules/naming-convention-component-name */ '@eslint-react/naming-convention/component-name'?: Linter.RuleEntry<EslintReactNamingConventionComponentName> /** * Enforces context name to be a valid component name with the suffix `Context`. * @see https://eslint-react.xyz/docs/rules/naming-convention-context-name */ '@eslint-react/naming-convention/context-name'?: Linter.RuleEntry<[]> /** * Enforces consistent file naming conventions. * @see https://eslint-react.xyz/docs/rules/naming-convention-filename */ '@eslint-react/naming-convention/filename'?: Linter.RuleEntry<EslintReactNamingConventionFilename> /** * Enforces consistent file naming conventions. * @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension */ '@eslint-react/naming-convention/filename-extension'?: Linter.RuleEntry<EslintReactNamingConventionFilenameExtension> /** * Enforces destructuring and symmetric naming of `useState` hook value and setter. * @see https://eslint-react.xyz/docs/rules/naming-convention-use-state */ '@eslint-react/naming-convention/use-state'?: Linter.RuleEntry<[]> /** * Disallow accessing `this.state` inside `setState` calls. * @see https://eslint-react.xyz/docs/rules/no-access-state-in-setstate */ '@eslint-react/no-access-state-in-setstate'?: Linter.RuleEntry<[]> /** * Disallow an item's index in the array as its key. * @see https://eslint-react.xyz/docs/rules/no-array-index-key */ '@eslint-react/no-array-index-key'?: Linter.RuleEntry<[]> /** * Disallow `Children.count`. * @see https://eslint-react.xyz/docs/rules/no-children-count */ '@eslint-react/no-children-count'?: Linter.RuleEntry<[]> /** * Disallow 'Children.forEach'. * @see https://eslint-react.xyz/docs/rules/no-children-for-each */ '@eslint-react/no-children-for-each'?: Linter.RuleEntry<[]> /** * Disallow `Children.map`. * @see https://eslint-react.xyz/docs/rules/no-children-map */ '@eslint-react/no-children-map'?: Linter.RuleEntry<[]> /** * Disallow `Children.only`. * @see https://eslint-react.xyz/docs/rules/no-children-only */ '@eslint-react/no-children-only'?: Linter.RuleEntry<[]> /** * Disallow passing `children` as a prop. * @see https://eslint-react.xyz/docs/rules/no-children-prop */ '@eslint-react/no-children-prop'?: Linter.RuleEntry<[]> /** * Disallow `Children.toArray`. * @see https://eslint-react.xyz/docs/rules/no-children-to-array */ '@eslint-react/no-children-to-array'?: Linter.RuleEntry<[]> /** * Disallow class components except for error boundaries. * @see https://eslint-react.xyz/docs/rules/no-class-component */ '@eslint-react/no-class-component'?: Linter.RuleEntry<[]> /** * Disallow `cloneElement`. * @see https://eslint-react.xyz/docs/rules/no-clone-element */ '@eslint-react/no-clone-element'?: Linter.RuleEntry<[]> /** * Prevents comments from being inserted as text nodes. * @see https://eslint-react.xyz/docs/rules/no-comment-textnodes */ '@eslint-react/no-comment-textnodes'?: Linter.RuleEntry<[]> /** * Disallow complex conditional rendering in JSX expressions. * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering */ '@eslint-react/no-complex-conditional-rendering'?: Linter.RuleEntry<[]> /** * Disallow complex conditional rendering in JSX expressions. * @see https://eslint-react.xyz/docs/rules/no-complex-conditional-rendering */ '@eslint-react/no-complicated-conditional-rendering'?: Linter.RuleEntry<[]> /** * Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`. * @see https://eslint-react.xyz/docs/rules/no-component-will-mount */ '@eslint-react/no-component-will-mount'?: Linter.RuleEntry<[]> /** * Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`. * @see https://eslint-react.xyz/docs/rules/no-component-will-receive-props */ '@eslint-react/no-component-will-receive-props'?: Linter.RuleEntry<[]> /** * Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`. * @see https://eslint-react.xyz/docs/rules/no-component-will-update */ '@eslint-react/no-component-will-update'?: Linter.RuleEntry<[]> /** * Replace usages of `<Context.Provider>` with `<Context>`. * @see https://eslint-react.xyz/docs/rules/no-context-provider */ '@eslint-react/no-context-provider'?: Linter.RuleEntry<[]> /** * Disallow `createRef` in function components. * @see https://eslint-react.xyz/docs/rules/no-create-ref */ '@eslint-react/no-create-ref'?: Linter.RuleEntry<[]> /** * Disallow `defaultProps` property in favor of ES6 default parameters. * @see https://eslint-react.xyz/docs/rules/no-default-props */ '@eslint-react/no-default-props'?: Linter.RuleEntry<[]> /** * Disallow direct mutation of `this.state`. * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state */ '@eslint-react/no-direct-mutation-state'?: Linter.RuleEntry<[]> /** * Disallow duplicate props in JSX elements. * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props */ '@eslint-react/no-duplicate-jsx-props'?: Linter.RuleEntry<[]> /** * Disallow duplicate `key` on elements in the same array or a list of `children`. * @see https://eslint-react.xyz/docs/rules/no-duplicate-key */ '@eslint-react/no-duplicate-key'?: Linter.RuleEntry<[]> /** * Replaces usages of `forwardRef` with passing `ref` as a prop. * @see https://eslint-react.xyz/docs/rules/no-forward-ref */ '@eslint-react/no-forward-ref'?: Linter.RuleEntry<[]> /** * Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects). * @see https://eslint-react.xyz/docs/rules/no-implicit-key */ '@eslint-react/no-implicit-key'?: Linter.RuleEntry<[]> /** * Prevents problematic leaked values from being rendered. * @see https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering */ '@eslint-react/no-leaked-conditional-rendering'?: Linter.RuleEntry<[]> /** * Enforces that all components have a `displayName` which can be used in devtools. * @see https://eslint-react.xyz/docs/rules/no-missing-component-display-name */ '@eslint-react/no-missing-component-display-name'?: Linter.RuleEntry<[]> /** * Enforces that all contexts have a `displayName` which can be used in devtools. * @see https://eslint-react.xyz/docs/rules/no-missing-context-display-name */ '@eslint-react/no-missing-context-display-name'?: Linter.RuleEntry<[]> /** * Disallow missing `key` on items in list rendering. * @see https://eslint-react.xyz/docs/rules/no-missing-key */ '@eslint-react/no-missing-key'?: Linter.RuleEntry<[]> /** * Prevents incorrect usage of `captureOwnerStack`. * @see https://eslint-react.xyz/docs/rules/no-misused-capture-owner-stack */ '@eslint-react/no-misused-capture-owner-stack'?: Linter.RuleEntry<[]> /** * Disallow nesting component definitions inside other components. * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions */ '@eslint-react/no-nested-component-definitions'?: Linter.RuleEntry<[]> /** * Disallow nesting component definitions inside other components. * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions */ '@eslint-react/no-nested-components'?: Linter.RuleEntry<[]> /** * Disallow nesting lazy component declarations inside other components. * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions */ '@eslint-react/no-nested-lazy-component-declarations'?: Linter.RuleEntry<[]> /** * Disallow `propTypes` in favor of TypeScript or another type-checking solution. * @see https://eslint-react.xyz/docs/rules/no-prop-types */ '@eslint-react/no-prop-types'?: Linter.RuleEntry<[]> /** * Disallow `shouldComponentUpdate` when extending `React.PureComponent`. * @see https://eslint-react.xyz/docs/rules/no-redundant-should-component-update */ '@eslint-react/no-redundant-should-component-update'?: Linter.RuleEntry<[]> /** * Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks. * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount */ '@eslint-react/no-set-state-in-component-did-mount'?: Linter.RuleEntry<[]> /** * Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks. * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-update */ '@eslint-react/no-set-state-in-component-did-update'?: Linter.RuleEntry<[]> /** * Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks. * @see https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update */ '@eslint-react/no-set-state-in-component-will-update'?: Linter.RuleEntry<[]> /** * Replaces string refs with callback refs. * @see https://eslint-react.xyz/docs/rules/no-string-refs */ '@eslint-react/no-string-refs'?: Linter.RuleEntry<[]> /** * Warns the usage of `UNSAFE_componentWillMount` in class components. * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-mount */ '@eslint-react/no-unsafe-component-will-mount'?: Linter.RuleEntry<[]> /** * Warns the usage of `UNSAFE_componentWillReceiveProps` in class components. * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-receive-props */ '@eslint-react/no-unsafe-component-will-receive-props'?: Linter.RuleEntry<[]> /** * Warns the usage of `UNSAFE_componentWillUpdate` in class components. * @see https://eslint-react.xyz/docs/rules/no-unsafe-component-will-update */ '@eslint-react/no-unsafe-component-will-update'?: Linter.RuleEntry<[]> /** * Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`. * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value */ '@eslint-react/no-unstable-context-value'?: Linter.RuleEntry<[]> /** * Prevents using referential-type values as default props in object destructuring. * @see https://eslint-react.xyz/docs/rules/no-unstable-default-props */ '@eslint-react/no-unstable-default-props'?: Linter.RuleEntry<[]> /** * Warns unused class component methods and properties. * @see https://eslint-react.xyz/docs/rules/no-unused-class-component-members */ '@eslint-react/no-unused-class-component-members'?: Linter.RuleEntry<[]> /** * Warns unused class component state. * @see https://eslint-react.xyz/docs/rules/no-unused-state */ '@eslint-react/no-unused-state'?: Linter.RuleEntry<[]> /** * Replaces usages of `useContext` with `use`. * @see https://eslint-react.xyz/docs/rules/no-use-context */ '@eslint-react/no-use-context'?: Linter.RuleEntry<[]> /** * Disallow useless `forwardRef` calls on components that don't use `ref`s. * @see https://eslint-react.xyz/docs/rules/no-useless-forward-ref */ '@eslint-react/no-useless-forward-ref'?: Linter.RuleEntry<[]> /** * Disallow useless fragment elements. * @see https://eslint-react.xyz/docs/rules/no-useless-fragment */ '@eslint-react/no-useless-fragment'?: Linter.RuleEntry<EslintReactNoUselessFragment> /** * Enforces destructuring assignment for component props and context. * @see https://eslint-react.xyz/docs/rules/prefer-destructuring-assignment */ '@eslint-react/prefer-destructuring-assignment'?: Linter.RuleEntry<[]> /** * Enforces React is imported via a namespace import. * @see https://eslint-react.xyz/docs/rules/prefer-react-namespace-import */ '@eslint-react/prefer-react-namespace-import'?: Linter.RuleEntry<[]> /** * Enforces read-only props in components. * @see https://eslint-react.xyz/docs/rules/prefer-read-only-props */ '@eslint-react/prefer-read-only-props'?: Linter.RuleEntry<[]> /** * Enforces shorthand syntax for boolean attributes. * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-boolean */ '@eslint-react/prefer-shorthand-boolean'?: Linter.RuleEntry<[]> /** * Enforces shorthand syntax for fragments. * @see https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment */ '@eslint-react/prefer-shorthand-fragment'?: Linter.RuleEntry<[]> /** * Marks variables used in JSX elements as used. * @see https://eslint-react.xyz/docs/rules/jsx-uses-vars */ '@eslint-react/use-jsx-vars'?: Linter.RuleEntry<[]> /** * Prevents leaked `addEventListener` in a component or custom Hook. * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener */ '@eslint-react/web-api/no-leaked-event-listener'?: Linter.RuleEntry<[]> /** * Prevents leaked `setInterval` in a component or custom Hook. * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval */ '@eslint-react/web-api/no-leaked-interval'?: Linter.RuleEntry<[]> /** * Prevents leaked `ResizeObserver` in a component or custom Hook. * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer */ '@eslint-react/web-api/no-leaked-resize-observer'?: Linter.RuleEntry<[]> /** * Prevents leaked `setTimeout` in a component or custom Hook. * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout */ '@eslint-react/web-api/no-leaked-timeout'?: Linter.RuleEntry<[]> /** * Enforce font-display behavior with Google Fonts. * @see https://nextjs.org/docs/messages/google-font-display */ '@next/next/google-font-display'?: Linter.RuleEntry<[]> /** * Ensure `preconnect` is used with Google Fonts. * @see https://nextjs.org/docs/messages/google-font-preconnect */ '@next/next/google-font-preconnect'?: Linter.RuleEntry<[]> /** * Enforce `id` attribute on `next/script` components with inline content. * @see https://nextjs.org/docs/messages/inline-script-id */ '@next/next/inline-script-id'?: Linter.RuleEntry<[]> /** * Prefer `next/script` component when using the inline script for Google Analytics. * @see https://nextjs.org/docs/messages/next-script-for-ga */ '@next/next/next-script-for-ga'?: Linter.RuleEntry<[]> /** * Prevent assignment to the `module` variable. * @see https://nextjs.org/docs/messages/no-assign-module-variable */ '@next/next/no-assign-module-variable'?: Linter.RuleEntry<[]> /** * Prevent client components from being async functions. * @see https://nextjs.org/docs/messages/no-async-client-component */ '@next/next/no-async-client-component'?: Linter.RuleEntry<[]> /** * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document */ '@next/next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]> /** * Prevent manual stylesheet tags. * @see https://nextjs.org/docs/messages/no-css-tags */ '@next/next/no-css-tags'?: Linter.RuleEntry<[]> /** * Prevent importing `next/document` outside of `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-document-import-in-page */ '@next/next/no-document-import-in-page'?: Linter.RuleEntry<[]> /** * Prevent duplicate usage of `<Head>` in `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-duplicate-head */ '@next/next/no-duplicate-head'?: Linter.RuleEntry<[]> /** * Prevent usage of `<head>` element. * @see https://nextjs.org/docs/messages/no-head-element */ '@next/next/no-head-element'?: Linter.RuleEntry<[]> /** * Prevent usage of `next/head` in `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-head-import-in-document */ '@next/next/no-head-import-in-document'?: Linter.RuleEntry<[]> /** * Prevent usage of `<a>` elements to navigate to internal Next.js pages. * @see https://nextjs.org/docs/messages/no-html-link-for-pages */ '@next/next/no-html-link-for-pages'?: Linter.RuleEntry<NextNextNoHtmlLinkForPages> /** * Prevent usage of `<img>` element due to slower LCP and higher bandwidth. * @see https://nextjs.org/docs/messages/no-img-element */ '@next/next/no-img-element'?: Linter.RuleEntry<[]> /** * Prevent page-only custom fonts. * @see https://nextjs.org/docs/messages/no-page-custom-font */ '@next/next/no-page-custom-font'?: Linter.RuleEntry<[]> /** * Prevent usage of `next/script` in `next/head` component. * @see https://nextjs.org/docs/messages/no-script-component-in-head */ '@next/next/no-script-component-in-head'?: Linter.RuleEntry<[]> /** * Prevent usage of `styled-jsx` in `pages/_document.js`. * @see https://nextjs.org/docs/messages/no-styled-jsx-in-document */ '@next/next/no-styled-jsx-in-document'?: Linter.RuleEntry<[]> /** * Prevent synchronous scripts. * @see https://nextjs.org/docs/messages/no-sync-scripts */ '@next/next/no-sync-scripts'?: Linter.RuleEntry<[]> /** * Prevent usage of `<title>` with `Head` component from `next/document`. * @see https://nextjs.org/docs/messages/no-title-in-document-head */ '@next/next/no-title-in-document-head'?: Linter.RuleEntry<[]> /** * Prevent common typos in Next.js data fetching functions. */ '@next/next/no-typos'?: Linter.RuleEntry<[]> /** * Prevent duplicate polyfills from Polyfill.io. * @see https://nextjs.org/docs/messages/no-unwanted-polyfillio */ '@next/next/no-unwanted-polyfillio'?: Linter.RuleEntry<[]> /** * Enforce linebreaks after opening and before closing array brackets * @see https://eslint.style/rules/js/array-bracket-newline */ '@stylistic/array-bracket-newline'?: Linter.RuleEntry<StylisticArrayBracketNewline> /** * Enforce consistent spacing inside array brackets * @see https://eslint.style/rules/js/array-bracket-spacing */ '@stylistic/array-bracket-spacing'?: Linter.RuleEntry<StylisticArrayBracketSpacing> /** * Enforce line breaks after each array element * @see https://eslint.style/rules/js/array-element-newline */ '@stylistic/array-element-newline'?: Linter.RuleEntry<StylisticArrayElementNewline> /** * Require parentheses around arrow function arguments * @see https://eslint.style/rules/js/arrow-parens */ '@stylistic/arrow-parens'?: Linter.RuleEntry<StylisticArrowParens> /** * Enforce consistent spacing before and after the arrow in arrow functions * @see https://eslint.style/rules/js/arrow-spacing */ '@stylistic/arrow-spacing'?: Linter.RuleEntry<StylisticArrowSpacing> /** * Disallow or enforce spaces inside of blocks after opening block and before closing block * @see https://eslint.style/rules/ts/block-spacing */ '@stylistic/block-spacing'?: Linter.RuleEntry<StylisticBlockSpacing> /** * Enforce consistent brace style for blocks * @see https://eslint.style/rules/ts/brace-style */ '@stylistic/brace-style'?: Linter.RuleEntry<StylisticBraceStyle> /** * Require or disallow trailing commas * @see https://eslint.style/rules/ts/comma-dangle */ '@stylistic/comma-dangle'?: Linter.RuleEntry<StylisticCommaDangle> /** * Enforce consistent spacing before and after commas * @see https://eslint.style/rules/ts/comma-spacing */ '@stylistic/comma-spacing'?: Linter.RuleEntry<StylisticCommaSpacing> /** * Enforce consistent comma style * @see https://eslint.style/rules/js/comma-style */ '@stylistic/comma-style'?: Linter.RuleEntry<StylisticCommaStyle> /** * Enforce consistent spacing inside computed property brackets * @see https://eslint.style/rules/js/computed-property-spacing */ '@stylistic/computed-property-spacing'?: Linter.RuleEntry<StylisticComputedPropertySpacing> /** * Enforce consistent line breaks after opening and before closing braces * @see https://eslint.style/rules/plus/curly-newline */ '@stylistic/curly-newline'?: Linter.RuleEntry<StylisticCurlyNewline> /** * Enforce consistent newlines before and after dots * @see https://eslint.style/rules/js/dot-location */ '@stylistic/dot-location'?: Linter.RuleEntry<StylisticDotLocation> /** * Require or disallow newline at the end of files * @see https://eslint.style/rules/js/eol-last */ '@stylistic/eol-last'?: Linter.RuleEntry<StylisticEolLast> /** * Require or disallow spacing between function identifiers and their invocations * @see https://eslint.style/rules/ts/function-call-spacing */ '@stylistic/func-call-spacing'?: Linter.RuleEntry<StylisticFuncCallSpacing> /** * Enforce line breaks between arguments of a function call * @see https://eslint.style/rules/js/function-call-argument-newline */ '@stylistic/function-call-argument-newline'?: Linter.RuleEntry<StylisticFunctionCallArgumentNewline> /** * Require or disallow spacing between function identifiers and their invocations * @see https://eslint.style/rules/ts/function-call-spacing */ '@stylistic/function-call-spacing'?: Linter.RuleEntry<StylisticFunctionCallSpacing> /** * Enforce consistent line breaks inside function parentheses * @see https://eslint.style/rules/js/function-paren-newline */ '@stylistic/function-paren-newline'?: Linter.RuleEntry<StylisticFunctionParenNewline> /** * Enforce consistent spacing around `*` operators in generator functions * @see https://eslint.style/rules/js/generator-star-spacing */ '@stylistic/generator-star-spacing'?: Linter.RuleEntry<StylisticGeneratorStarSpacing> /** * Enforce the location of arrow function bodies * @see https://eslint.style/rules/js/implicit-arrow-linebreak */ '@stylistic/implicit-arrow-linebreak'?: Linter.RuleEntry<StylisticImplicitArrowLinebreak> /** * Enforce consistent indentation * @see https://eslint.style/rules/ts/indent */ '@stylistic/indent'?: Linter.RuleEntry<StylisticIndent> /** * Indentation for binary operators * @see https://eslint.style/rules/plus/indent-binary-ops */ '@stylistic/indent-binary-ops'?: Linter.RuleEntry<StylisticIndentBinaryOps> /** * Enforce or disallow spaces inside of curly braces in JSX attributes and expressions * @see https://eslint.style/rules/jsx/jsx-child-element-spacing */ '@stylistic/jsx-child-element-spacing'?: Linter.RuleEntry<[]> /** * Enforce closing bracket location in JSX * @see https://eslint.style/rules/jsx/jsx-closing-bracket-location */ '@stylistic/jsx-closing-bracket-location'?: Linter.RuleEntry<StylisticJsxClosingBracketLocation> /** * Enforce closing tag location for multiline JSX * @see https://eslint.style/rules/jsx/jsx-closing-tag-location */ '@stylistic/jsx-closing-tag-location'?: Linter.RuleEntry<StylisticJsxClosingTagLocation> /** * Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes * @see https://eslint.style/rules/jsx/jsx-curly-brace-presence */ '@stylistic/jsx-curly-brace-presence'?: Linter.RuleEntry<StylisticJsxCurlyBracePresence> /** * Enforce consistent linebreaks in curly braces in JSX attributes and expressions * @see https://eslint.style/rules/jsx/jsx-curly-newline */ '@stylistic/jsx-curly-newline'?: Linter.RuleEntry<StylisticJsxCurlyNewline> /** * Enforce or disallow spaces inside of curly braces in JSX attributes and