UNPKG

@effective/eslint-cfg

Version:

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

307 lines (306 loc) 10.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", "dot-location": "off", "dot-notation": "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-empty-function": "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-return-await": "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-useless-constructor": "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/block-spacing": "off", "@typescript-eslint/brace-style": "off", "@typescript-eslint/comma-dangle": "off", "@typescript-eslint/comma-spacing": "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/no-extra-parens": "off", "@typescript-eslint/no-extra-semi": "off", "@typescript-eslint/object-curly-spacing": "off", "@typescript-eslint/quotes": "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/type-annotation-spacing": "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"), "simple-import-sort": require("eslint-plugin-simple-import-sort"), 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, }, ecmaVersion: "latest", projectService: true, }, }, 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", }, ];