UNPKG

@effective/eslint-cfg

Version:

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

363 lines (362 loc) 13.4 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", "dot-location": "off", "eol-last": "off", "func-call-spacing": "off", "function-call-argument-newline": "off", "function-paren-newline": "off", "generator-star": "off", "generator-star-spacing": "off", "getter-return": "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-class-assign": "off", "no-comma-dangle": "off", "no-confusing-arrow": "off", "no-const-assign": "off", "no-dupe-args": "off", "no-dupe-class-members": "off", "no-dupe-keys": "off", "no-empty-character-class": "off", "no-extra-parens": "off", "no-extra-semi": "off", "no-floating-decimal": "off", "no-func-assign": "off", "no-implied-eval": "off", "no-import-assign": "off", "no-invalid-regexp": "off", "no-mixed-operators": "off", "no-mixed-spaces-and-tabs": "off", "no-multi-spaces": "off", "no-multiple-empty-lines": "off", "no-new-native-nonconstructor": "off", "no-new-symbol": "off", "no-obj-calls": "off", "no-redeclare": "off", "no-reserved-keys": "off", "no-setter-return": "off", "no-space-before-semi": "off", "no-spaced-func": "off", "no-tabs": "off", "no-this-before-super": "off", "no-throw-literal": "off", "no-trailing-spaces": "off", "no-undef": "off", "no-unexpected-multiline": "off", "no-unreachable": "off", "no-unsafe-negation": "off", "no-unused-expressions": "off", "no-unused-vars": "off", "no-useless-backreference": "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-declaration-per-line": "off", "operator-linebreak": "off", "padded-blocks": "off", "prefer-promise-reject-errors": "off", "quote-props": "off", quotes: "off", "require-await": "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", "wrap-iife": "off", "wrap-regex": "off", "yield-star-spacing": "off", "@typescript-eslint/await-thenable": "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/dot-notation": "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-duplicate-type-constituents": "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-meaningless-void-operator": "off", "@typescript-eslint/no-misused-promises": "off", "@typescript-eslint/no-misused-spread": "off", "@typescript-eslint/no-mixed-enums": "off", "@typescript-eslint/no-redundant-type-constituents": "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-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-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/non-nullable-type-assertion-style": "off", "@typescript-eslint/object-curly-spacing": "off", "@typescript-eslint/only-throw-error": "off", "@typescript-eslint/prefer-destructuring": "off", "@typescript-eslint/prefer-find": "off", "@typescript-eslint/prefer-includes": "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", "jsx-a11y/anchor-ambiguous-text": "off", "jsx-a11y/control-has-associated-label": "off", "jsx-a11y/label-has-for": "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-indent": "off", "react/jsx-indent-props": "off", "react/jsx-max-props-per-line": "off", "react/jsx-newline": "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-uses-react": "off", "react/jsx-wrap-multilines": "off", "react/no-unsafe": "off", "react/prop-types": "off", "react/react-in-jsx-scope": "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/no-nested-ternary": "off", "unicorn/number-literal-case": "off", "unicorn/template-indent": "off", }, plugins: { "@typescript-eslint": require("@typescript-eslint/eslint-plugin"), react: require("eslint-plugin-react"), "react-hooks": require("eslint-plugin-react-hooks"), "react-compiler": require("eslint-plugin-react-compiler"), storybook: require("eslint-plugin-storybook"), "jsx-a11y": require("eslint-plugin-jsx-a11y"), jsdoc: require("eslint-plugin-jsdoc"), regexp: require("eslint-plugin-regexp"), }, languageOptions: { sourceType: "module", ecmaVersion: 2025, parser: require("@typescript-eslint/parser"), parserOptions: { ecmaFeatures: { jsx: true, }, program: null, project: false, projectService: false, ecmaVersion: "latest", }, }, 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", }, { rules: { "no-empty-pattern": "off", }, 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", }, { rules: { "import/no-anonymous-default-export": "off", "react-hooks/rules-of-hooks": "off", }, files: ["**/*.stories.tsx"], name: "effective/storybook", }, ];