medusa
/
.eslintrc.js
319 строк · 10.0 Кб
1module.exports = {2root: true,3parserOptions: {4requireConfigFile: false,5ecmaFeatures: {6experimentalDecorators: true,7},8},9plugins: ["prettier"],10extends: ["eslint:recommended", "google", "plugin:prettier/recommended"],11rules: {12curly: ["error", "all"],13"new-cap": "off",14"require-jsdoc": "off",15"no-unused-expressions": "off",16"no-unused-vars": "off",17camelcase: "off",18"no-invalid-this": "off",19"max-len": [20"error",21{22code: 80,23ignoreStrings: true,24ignoreRegExpLiterals: true,25ignoreComments: true,26ignoreTrailingComments: true,27ignoreUrls: true,28ignoreTemplateLiterals: true,29},30],31semi: ["error", "never"],32quotes: [33"error",34"double",35{36allowTemplateLiterals: true,37},38],39"comma-dangle": [40"error",41{42arrays: "always-multiline",43objects: "always-multiline",44imports: "always-multiline",45exports: "always-multiline",46functions: "never",47},48],49"object-curly-spacing": ["error", "always"],50"arrow-parens": ["error", "always"],51"linebreak-style": 0,52"no-confusing-arrow": [53"error",54{55allowParens: false,56},57],58"space-before-function-paren": [59"error",60{61anonymous: "always",62named: "never",63asyncArrow: "always",64},65],66"space-infix-ops": "error",67"eol-last": ["error", "always"],68},69env: {70es6: true,71node: true,72jest: true,73},74overrides: [75{76files: ["*.ts"],77plugins: ["@typescript-eslint/eslint-plugin"],78extends: ["plugin:@typescript-eslint/recommended"],79parser: "@typescript-eslint/parser",80parserOptions: {81project: [82"./packages/medusa/tsconfig.json",83
84"./packages/admin-next/dashboard/tsconfig.json",85"./packages/admin-next/admin-sdk/tsconfig.json",86"./packages/admin-next/admin-shared/tsconfig.json",87"./packages/admin-next/admin-vite-plugin/tsconfig.json",88
89"./packages/cli/create-medusa-app/tsconfig.json",90"./packages/cli/medusa-cli/tsconfig.spec.json",91"./packages/cli/medusa-dev-cli/tsconfig.spec.json",92"./packages/cli/oas/medusa-oas-cli/tsconfig.spec.json",93
94"./packages/core/orchestration/tsconfig.json",95"./packages/core/workflows-sdk/tsconfig.spec.json",96"./packages/core/modules-sdk/tsconfig.json",97"./packages/core/js-sdk/tsconfig.json",98"./packages/core/types/tsconfig.json",99"./packages/core/utils/tsconfig.spec.json",100"./packages/core/medusa-test-utils/tsconfig.json",101
102"./packages/modules/product/tsconfig.json",103"./packages/modules/event-bus-local/tsconfig.spec.json",104"./packages/modules/event-bus-redis/tsconfig.spec.json",105"./packages/modules/cache-redis/tsconfig.spec.json",106"./packages/modules/cache-inmemory/tsconfig.spec.json",107"./packages/modules/workflow-engine-redis/tsconfig.spec.json",108"./packages/modules/workflow-engine-inmemory/tsconfig.spec.json",109"./packages/modules/fulfillment/tsconfig.spec.json",110"./packages/modules/api-key/tsconfig.spec.json",111"./packages/modules/auth/tsconfig.spec.json",112"./packages/modules/cart/tsconfig.spec.json",113"./packages/modules/currency/tsconfig.spec.json",114"./packages/modules/customer/tsconfig.spec.json",115"./packages/modules/file/tsconfig.spec.json",116"./packages/modules/inventory-next/tsconfig.spec.json",117"./packages/modules/stock-location-next/tsconfig.spec.json",118"./packages/modules/order/tsconfig.spec.json",119"./packages/modules/payment/tsconfig.spec.json",120"./packages/modules/pricing/tsconfig.spec.json",121"./packages/modules/promotion/tsconfig.spec.json",122"./packages/modules/region/tsconfig.spec.json",123"./packages/modules/sales-channel/tsconfig.spec.json",124"./packages/modules/store/tsconfig.spec.json",125"./packages/modules/tax/tsconfig.spec.json",126"./packages/modules/workflow-engine-inmemory/tsconfig.spec.json",127"./packages/modules/workflow-engine-redis/tsconfig.spec.json",128"./packages/modules/link-modules/tsconfig.spec.json",129"./packages/modules/user/tsconfig.spec.json",130
131"./packages/modules/providers/file-local/tsconfig.spec.json",132"./packages/modules/providers/file-s3/tsconfig.spec.json",133"./packages/modules/providers/fulfillment-manual/tsconfig.spec.json",134"./packages/modules/providers/payment-stripe/tsconfig.spec.json",135
136"./packages/framework/framework/tsconfig.json",137],138},139rules: {140"valid-jsdoc": "off",141"@typescript-eslint/no-non-null-assertion": "off",142"@typescript-eslint/no-floating-promises": "error",143"@typescript-eslint/await-thenable": "error",144"@typescript-eslint/promise-function-async": "error",145"@typescript-eslint/keyword-spacing": "error",146"@typescript-eslint/space-before-function-paren": [147"error",148{149anonymous: "always",150named: "never",151asyncArrow: "always",152},153],154"@typescript-eslint/space-infix-ops": "error",155
156// --- Rules to be fixed157"@typescript-eslint/ban-ts-comment": "off",158"@typescript-eslint/no-unused-vars": "off",159"@typescript-eslint/no-explicit-any": "off",160"@typescript-eslint/explicit-function-return-type": "off",161"@typescript-eslint/ban-types": "off",162"@typescript-eslint/no-var-requires": "off",163},164},165{166files: ["packages/design-system/ui/**/*.{ts,tsx}"],167extends: [168"plugin:react/recommended",169"plugin:storybook/recommended",170"plugin:react-hooks/recommended",171"plugin:@typescript-eslint/recommended",172],173plugins: ["@typescript-eslint"],174rules: {175"react/no-children-prop": "off",176"react-hooks/exhaustive-deps": "warn",177"react/prop-types": "off",178"@typescript-eslint/no-explicit-any": "off",179"@typescript-eslint/no-unused-vars": [180"error",181{ argsIgnorePattern: "^_" },182],183},184settings: {185react: {186version: "detect",187},188},189parser: "@typescript-eslint/parser",190parserOptions: {191project: "./packages/design-system/ui/tsconfig.json",192},193},194{195files: ["packages/design-system/icons/**/*.{ts,tsx}"],196extends: [197"plugin:react/recommended",198"plugin:@typescript-eslint/recommended",199],200plugins: ["@typescript-eslint"],201rules: {202"react/no-children-prop": "off",203"react/prop-types": "off",204"@typescript-eslint/no-explicit-any": "off",205"@typescript-eslint/no-unused-vars": [206"error",207{ argsIgnorePattern: "^_" },208],209},210settings: {211react: {212version: "detect",213},214},215parser: "@typescript-eslint/parser",216parserOptions: {217project: "./packages/design-system/icons/tsconfig.json",218},219},220{221files: [222"packages/admin-next/dashboard/**/*.ts",223"packages/admin-next/dashboard/**/*.tsx",224],225plugins: ["unused-imports", "react-refresh"],226extends: [227"plugin:react/recommended",228"plugin:react/jsx-runtime",229"plugin:react-hooks/recommended",230],231parser: "@typescript-eslint/parser",232parserOptions: {233ecmaFeatures: {234jsx: true,235},236ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features237sourceType: "module", // Allows for the use of imports238project: "./packages/admin-next/dashboard/tsconfig.json",239},240globals: {241__BASE__: "readonly",242},243env: {244browser: true,245},246rules: {247"prettier/prettier": "error",248"react/prop-types": "off",249"new-cap": "off",250"require-jsdoc": "off",251"valid-jsdoc": "off",252"react-refresh/only-export-components": [253"warn",254{ allowConstantExport: true },255],256"no-unused-expressions": "off",257"unused-imports/no-unused-imports": "error",258"unused-imports/no-unused-vars": [259"warn",260{261vars: "all",262varsIgnorePattern: "^_",263args: "after-used",264argsIgnorePattern: "^_",265},266],267},268},269{270files: [271"packages/admin-next/app/**/*.ts",272"packages/admin-next/app/**/*.tsx",273],274plugins: ["unused-imports", "react-refresh"],275extends: [276"plugin:react/recommended",277"plugin:react/jsx-runtime",278"plugin:react-hooks/recommended",279],280parser: "@typescript-eslint/parser",281parserOptions: {282ecmaFeatures: {283jsx: true,284},285ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features286sourceType: "module", // Allows for the use of imports287project: "./packages/admin-next/app/tsconfig.json",288},289globals: {290__BASE__: "readonly",291},292env: {293browser: true,294},295rules: {296"prettier/prettier": "error",297"react/prop-types": "off",298"new-cap": "off",299"require-jsdoc": "off",300"valid-jsdoc": "off",301"react-refresh/only-export-components": [302"warn",303{ allowConstantExport: true },304],305"no-unused-expressions": "off",306"unused-imports/no-unused-imports": "error",307"unused-imports/no-unused-vars": [308"warn",309{310vars: "all",311varsIgnorePattern: "^_",312args: "after-used",313argsIgnorePattern: "^_",314},315],316},317},318],319}
320