UNPKG

@effective/eslint-cfg

Version:

A library for generating ESLint Flat Configs with React and TypeScript support.

519 lines (518 loc) 20.1 kB
import { createRequire } from "module"; const require = createRequire(import.meta.url); export default [ { linterOptions: { reportUnusedDisableDirectives: "off", reportUnusedInlineConfigs: "off", }, rules: { "array-bracket-newline": "off", "array-bracket-spacing": "off", "array-element-newline": "off", "arrow-parens": "off", "arrow-spacing": "off", "block-spacing": "off", "brace-style": "off", "comma-dangle": "off", "comma-spacing": "off", "comma-style": "off", "computed-property-spacing": "off", "constructor-super": "off", curly: "off", "default-case": "off", "default-case-last": "off", "dot-location": "off", "dot-notation": "off", "eol-last": "off", eqeqeq: "off", "for-direction": "off", "func-call-spacing": "off", "function-call-argument-newline": "off", "function-paren-newline": "off", "generator-star": "off", "generator-star-spacing": "off", "getter-return": "off", "guard-for-in": "off", "implicit-arrow-linebreak": "off", indent: "off", "indent-legacy": "off", "jsx-quotes": "off", "key-spacing": "off", "keyword-spacing": "off", "linebreak-style": "off", "lines-around-comment": "off", "max-len": "off", "max-statements-per-line": "off", "multiline-ternary": "off", "new-parens": "off", "newline-per-chained-call": "off", "no-array-constructor": "off", "no-arrow-condition": "off", "no-async-promise-executor": "off", "no-case-declarations": "off", "no-class-assign": "off", "no-comma-dangle": "off", "no-compare-neg-zero": "off", "no-confusing-arrow": "off", "no-console": "off", "no-const-assign": "off", "no-constant-condition": "off", "no-constructor-return": "off", "no-control-regex": "off", "no-debugger": "off", "no-dupe-args": "off", "no-dupe-class-members": "off", "no-dupe-else-if": "off", "no-dupe-keys": "off", "no-duplicate-case": "off", "no-empty-character-class": "off", "no-empty-function": "off", "no-empty-pattern": "off", "no-eval": "off", "no-ex-assign": "off", "no-extra-boolean-cast": "off", "no-extra-label": "off", "no-extra-parens": "off", "no-extra-semi": "off", "no-fallthrough": "off", "no-floating-decimal": "off", "no-func-assign": "off", "no-global-assign": "off", "no-implied-eval": "off", "no-import-assign": "off", "no-inner-declarations": "off", "no-invalid-regexp": "off", "no-irregular-whitespace": "off", "no-label-var": "off", "no-lone-blocks": "off", "no-lonely-if": "off", "no-misleading-character-class": "off", "no-mixed-operators": "off", "no-mixed-spaces-and-tabs": "off", "no-multi-spaces": "off", "no-multiple-empty-lines": "off", "no-negated-condition": "off", "no-nested-ternary": "off", "no-new-native-nonconstructor": "off", "no-new-symbol": "off", "no-new-wrappers": "off", "no-nonoctal-decimal-escape": "off", "no-obj-calls": "off", "no-octal-escape": "off", "no-param-reassign": "off", "no-prototype-builtins": "off", "no-redeclare": "off", "no-regex-spaces": "off", "no-reserved-keys": "off", "no-restricted-globals": "off", "no-return-await": "off", "no-self-assign": "off", "no-self-compare": "off", "no-sequences": "off", "no-setter-return": "off", "no-shadow-restricted-names": "off", "no-space-before-semi": "off", "no-spaced-func": "off", "no-sparse-arrays": "off", "no-tabs": "off", "no-template-curly-in-string": "off", "no-this-before-super": "off", "no-throw-literal": "off", "no-trailing-spaces": "off", "no-undef": "off", "no-undef-init": "off", "no-unexpected-multiline": "off", "no-unneeded-ternary": "off", "no-unreachable": "off", "no-unsafe-finally": "off", "no-unsafe-negation": "off", "no-unsafe-optional-chaining": "off", "no-unused-expressions": "off", "no-unused-labels": "off", "no-unused-private-class-members": "off", "no-unused-vars": "off", "no-useless-backreference": "off", "no-useless-catch": "off", "no-useless-concat": "off", "no-useless-constructor": "off", "no-useless-escape": "off", "no-useless-rename": "off", "no-var": "off", "no-void": "off", "no-whitespace-before-property": "off", "no-with": "off", "no-wrap-func": "off", "nonblock-statement-body-position": "off", "object-curly-newline": "off", "object-curly-spacing": "off", "object-property-newline": "off", "one-var": "off", "one-var-declaration-per-line": "off", "operator-assignment": "off", "operator-linebreak": "off", "padded-blocks": "off", "prefer-const": "off", "prefer-exponentiation-operator": "off", "prefer-numeric-literals": "off", "prefer-promise-reject-errors": "off", "prefer-regex-literals": "off", "prefer-rest-params": "off", "prefer-template": "off", "quote-props": "off", quotes: "off", "require-await": "off", "require-yield": "off", "rest-spread-spacing": "off", semi: "off", "semi-spacing": "off", "semi-style": "off", "space-after-function-name": "off", "space-after-keywords": "off", "space-before-blocks": "off", "space-before-function-paren": "off", "space-before-function-parentheses": "off", "space-before-keywords": "off", "space-in-brackets": "off", "space-in-parens": "off", "space-infix-ops": "off", "space-return-throw-case": "off", "space-unary-ops": "off", "space-unary-word-ops": "off", "switch-colon-spacing": "off", "template-curly-spacing": "off", "template-tag-spacing": "off", "use-isnan": "off", "valid-typeof": "off", "wrap-iife": "off", "wrap-regex": "off", "yield-star-spacing": "off", yoda: "off", "@typescript-eslint/adjacent-overload-signatures": "off", "@typescript-eslint/array-type": "off", "@typescript-eslint/await-thenable": "off", "@typescript-eslint/ban-types": "off", "@typescript-eslint/block-spacing": "off", "@typescript-eslint/brace-style": "off", "@typescript-eslint/comma-dangle": "off", "@typescript-eslint/comma-spacing": "off", "@typescript-eslint/consistent-return": "off", "@typescript-eslint/consistent-type-exports": "off", "@typescript-eslint/default-param-last": "off", "@typescript-eslint/dot-notation": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-member-accessibility": "off", "@typescript-eslint/func-call-spacing": "off", "@typescript-eslint/indent": "off", "@typescript-eslint/key-spacing": "off", "@typescript-eslint/keyword-spacing": "off", "@typescript-eslint/lines-around-comment": "off", "@typescript-eslint/member-delimiter-style": "off", "@typescript-eslint/naming-convention": "off", "@typescript-eslint/no-array-delete": "off", "@typescript-eslint/no-base-to-string": "off", "@typescript-eslint/no-confusing-void-expression": "off", "@typescript-eslint/no-deprecated": "off", "@typescript-eslint/no-dupe-class-members": "off", "@typescript-eslint/no-duplicate-type-constituents": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-extra-non-null-assertion": "off", "@typescript-eslint/no-extra-parens": "off", "@typescript-eslint/no-extra-semi": "off", "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-for-in-array": "off", "@typescript-eslint/no-implied-eval": "off", "@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-invalid-void-type": "off", "@typescript-eslint/no-loss-of-precision": "off", "@typescript-eslint/no-meaningless-void-operator": "off", "@typescript-eslint/no-misused-new": "off", "@typescript-eslint/no-misused-promises": "off", "@typescript-eslint/no-misused-spread": "off", "@typescript-eslint/no-mixed-enums": "off", "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-redeclare": "off", "@typescript-eslint/no-redundant-type-constituents": "off", "@typescript-eslint/no-restricted-imports": "off", "@typescript-eslint/no-restricted-types": "off", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off", "@typescript-eslint/no-unnecessary-condition": "off", "@typescript-eslint/no-unnecessary-qualifier": "off", "@typescript-eslint/no-unnecessary-template-expression": "off", "@typescript-eslint/no-unnecessary-type-arguments": "off", "@typescript-eslint/no-unnecessary-type-assertion": "off", "@typescript-eslint/no-unnecessary-type-constraint": "off", "@typescript-eslint/no-unnecessary-type-conversion": "off", "@typescript-eslint/no-unnecessary-type-parameters": "off", "@typescript-eslint/no-unsafe-argument": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-declaration-merging": "off", "@typescript-eslint/no-unsafe-enum-comparison": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/no-unsafe-type-assertion": "off", "@typescript-eslint/no-unsafe-unary-minus": "off", "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-useless-constructor": "off", "@typescript-eslint/no-useless-empty-export": "off", "@typescript-eslint/non-nullable-type-assertion-style": "off", "@typescript-eslint/object-curly-spacing": "off", "@typescript-eslint/only-throw-error": "off", "@typescript-eslint/prefer-as-const": "off", "@typescript-eslint/prefer-destructuring": "off", "@typescript-eslint/prefer-enum-initializers": "off", "@typescript-eslint/prefer-find": "off", "@typescript-eslint/prefer-function-type": "off", "@typescript-eslint/prefer-includes": "off", "@typescript-eslint/prefer-literal-enum-member": "off", "@typescript-eslint/prefer-namespace-keyword": "off", "@typescript-eslint/prefer-nullish-coalescing": "off", "@typescript-eslint/prefer-optional-chain": "off", "@typescript-eslint/prefer-promise-reject-errors": "off", "@typescript-eslint/prefer-readonly": "off", "@typescript-eslint/prefer-readonly-parameter-types": "off", "@typescript-eslint/prefer-reduce-type-parameter": "off", "@typescript-eslint/prefer-regexp-exec": "off", "@typescript-eslint/prefer-return-this-type": "off", "@typescript-eslint/prefer-string-starts-ends-with": "off", "@typescript-eslint/promise-function-async": "off", "@typescript-eslint/quotes": "off", "@typescript-eslint/related-getter-setter-pairs": "off", "@typescript-eslint/require-array-sort-compare": "off", "@typescript-eslint/require-await": "off", "@typescript-eslint/restrict-plus-operands": "off", "@typescript-eslint/restrict-template-expressions": "off", "@typescript-eslint/return-await": "off", "@typescript-eslint/semi": "off", "@typescript-eslint/space-before-blocks": "off", "@typescript-eslint/space-before-function-paren": "off", "@typescript-eslint/space-infix-ops": "off", "@typescript-eslint/strict-boolean-expressions": "off", "@typescript-eslint/switch-exhaustiveness-check": "off", "@typescript-eslint/type-annotation-spacing": "off", "@typescript-eslint/unbound-method": "off", "@typescript-eslint/use-unknown-in-catch-callback-variable": "off", "import/no-commonjs": "off", "import/no-default-export": "off", "import/no-nodejs-modules": "off", "jest/max-nested-describe": "off", "jest/no-done-callback": "off", "jsx-a11y/alt-text": "off", "jsx-a11y/anchor-has-content": "off", "jsx-a11y/anchor-is-valid": "off", "jsx-a11y/aria-activedescendant-has-tabindex": "off", "jsx-a11y/aria-props": "off", "jsx-a11y/aria-proptypes": "off", "jsx-a11y/aria-role": "off", "jsx-a11y/aria-unsupported-elements": "off", "jsx-a11y/autocomplete-valid": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/heading-has-content": "off", "jsx-a11y/html-has-lang": "off", "jsx-a11y/iframe-has-title": "off", "jsx-a11y/img-redundant-alt": "off", "jsx-a11y/interactive-supports-focus": "off", "jsx-a11y/label-has-associated-control": "off", "jsx-a11y/lang": "off", "jsx-a11y/media-has-caption": "off", "jsx-a11y/mouse-events-have-key-events": "off", "jsx-a11y/no-access-key": "off", "jsx-a11y/no-aria-hidden-on-focusable": "off", "jsx-a11y/no-autofocus": "off", "jsx-a11y/no-distracting-elements": "off", "jsx-a11y/no-interactive-element-to-noninteractive-role": "off", "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", "jsx-a11y/no-noninteractive-tabindex": "off", "jsx-a11y/no-redundant-roles": "off", "jsx-a11y/no-static-element-interactions": "off", "jsx-a11y/prefer-tag-over-role": "off", "jsx-a11y/role-has-required-aria-props": "off", "jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/scope": "off", "jsx-a11y/tabindex-no-positive": "off", "n/no-process-env": "off", "no-barrel-files/avoid-namespace-import": "off", "no-barrel-files/avoid-re-export-all": "off", "react-hooks/exhaustive-deps": "off", "react-hooks/rules-of-hooks": "off", "react/button-has-type": "off", "react/jsx-child-element-spacing": "off", "react/jsx-closing-bracket-location": "off", "react/jsx-closing-tag-location": "off", "react/jsx-curly-newline": "off", "react/jsx-curly-spacing": "off", "react/jsx-equals-spacing": "off", "react/jsx-first-prop-new-line": "off", "react/jsx-fragments": "off", "react/jsx-indent": "off", "react/jsx-indent-props": "off", "react/jsx-key": "off", "react/jsx-max-props-per-line": "off", "react/jsx-newline": "off", "react/jsx-no-comment-textnodes": "off", "react/jsx-no-duplicate-props": "off", "react/jsx-no-target-blank": "off", "react/jsx-no-useless-fragment": "off", "react/jsx-one-expression-per-line": "off", "react/jsx-props-no-multi-spaces": "off", "react/jsx-space-before-closing": "off", "react/jsx-tag-spacing": "off", "react/jsx-wrap-multilines": "off", "react/no-array-index-key": "off", "react/no-children-prop": "off", "react/no-danger": "off", "react/no-danger-with-children": "off", "react/prop-types": "off", "react/void-dom-elements-no-children": "off", "sonarjs/cognitive-complexity": "off", "sonarjs/prefer-while": "off", "standard/array-bracket-even-spacing": "off", "standard/computed-property-even-spacing": "off", "standard/object-curly-even-spacing": "off", "unicorn/empty-brace-spaces": "off", "unicorn/error-message": "off", "unicorn/explicit-length-check": "off", "unicorn/no-array-for-each": "off", "unicorn/no-document-cookie": "off", "unicorn/no-for-loop": "off", "unicorn/no-instanceof-array": "off", "unicorn/no-lonely-if": "off", "unicorn/no-nested-ternary": "off", "unicorn/no-static-only-class": "off", "unicorn/no-thenable": "off", "unicorn/no-useless-switch-case": "off", "unicorn/number-literal-case": "off", "unicorn/prefer-array-flat-map": "off", "unicorn/prefer-date-now": "off", "unicorn/prefer-node-protocol": "off", "unicorn/prefer-number-properties": "off", "unicorn/prefer-string-slice": "off", "unicorn/prefer-string-trim-start-end": "off", "unicorn/require-number-to-fixed-digits-argument": "off", "unicorn/template-indent": "off", "unicorn/throw-new-error": "off", "unused-imports/no-unused-imports": "off", "unused-imports/no-unused-vars": "off", }, plugins: { "@typescript-eslint": require("@typescript-eslint/eslint-plugin"), "simple-import-sort": require("eslint-plugin-simple-import-sort"), jsdoc: require("eslint-plugin-jsdoc"), regexp: require("eslint-plugin-regexp"), }, languageOptions: { sourceType: "module", ecmaVersion: 2025, parser: require("@typescript-eslint/parser"), parserOptions: { program: null, project: false, projectService: false, ecmaVersion: "latest", ecmaFeatures: { jsx: false, }, }, }, name: "effective/base", }, { languageOptions: { globals: { afterAll: false, afterEach: false, beforeAll: false, beforeEach: false, describe: false, expect: false, fit: false, it: false, jest: false, test: false, xdescribe: false, xit: false, xtest: false, }, }, plugins: { jest: require("eslint-plugin-jest"), "testing-library": require("eslint-plugin-testing-library"), }, files: ["**/*.test.{ts,tsx}"], name: "effective/test", }, { languageOptions: { globals: { AbortController: false, AbortSignal: false, atob: false, Blob: false, BroadcastChannel: false, btoa: false, ByteLengthQueuingStrategy: false, clearInterval: false, clearTimeout: false, CompressionStream: false, console: false, CountQueuingStrategy: false, crypto: false, Crypto: false, CryptoKey: false, CustomEvent: false, DecompressionStream: false, DOMException: false, Event: false, EventTarget: false, fetch: false, File: false, FormData: false, Headers: false, Intl: false, MessageChannel: false, MessageEvent: false, MessagePort: false, performance: false, PerformanceEntry: false, PerformanceMark: false, PerformanceMeasure: false, PerformanceObserver: false, PerformanceObserverEntryList: false, PerformanceResourceTiming: false, queueMicrotask: false, ReadableByteStreamController: false, ReadableStream: false, ReadableStreamBYOBReader: false, ReadableStreamBYOBRequest: false, ReadableStreamDefaultController: false, ReadableStreamDefaultReader: false, Request: false, Response: false, setInterval: false, setTimeout: false, structuredClone: false, SubtleCrypto: false, TextDecoder: false, TextDecoderStream: false, TextEncoder: false, TextEncoderStream: false, TransformStream: false, TransformStreamDefaultController: false, URL: false, URLSearchParams: false, WebAssembly: false, WritableStream: false, WritableStreamDefaultController: false, WritableStreamDefaultWriter: false, }, }, plugins: { playwright: require("eslint-plugin-playwright"), }, files: ["**/*.spec.{ts}"], name: "effective/e2e", }, ];