UNPKG

eslint-config-hardcore

Version:
256 lines (220 loc) 6.34 kB
{ "$schema": "https://json.schemastore.org/eslintrc.json", "rules": { "import/no-unused-modules": "off" }, "overrides": [ { "files": [ "*.ts", ".*.ts", "*.tsx", "*.mts", ".*.mts", "*.cts", ".*.cts", "*.vue" ], "extends": [ "plugin:import/typescript", "plugin:@typescript-eslint/all", "./ts-for-js.json", "./prettier.json" ], "plugins": [ "import", "eslint-plugin-no-explicit-type-exports", "etc", "total-functions", "sonarjs" ], "rules": { "@typescript-eslint/no-magic-numbers": [ "error", { "ignore": [0, 1], "enforceConst": true, "ignoreDefaultValues": true, "ignoreClassFieldInitialValues": true, "ignoreEnums": true, "ignoreNumericLiteralTypes": true, "ignoreReadonlyClassProperties": true, "ignoreTypeIndexes": true } ], "@typescript-eslint/no-unused-expressions": [ "error", { "enforceForJSX": true } ], "@typescript-eslint/no-shadow": [ "error", { "builtinGlobals": true, "allow": [ "defaultStatus", "event", "find", "length", "name", "status" ] } ], "@typescript-eslint/prefer-readonly-parameter-types": [ "error", { "ignoreInferredTypes": true } ], "@typescript-eslint/no-use-before-define": [ "error", { "ignoreTypeReferences": false } ], "@typescript-eslint/no-meaningless-void-operator": [ "error", { "checkNever": true } ], "@typescript-eslint/consistent-indexed-object-style": [ "error", "index-signature" ], "@typescript-eslint/consistent-type-assertions": [ "error", { "assertionStyle": "never" } ], "@typescript-eslint/switch-exhaustiveness-check": [ "error", { "requireDefaultForNonUnion": true } ], "prefer-destructuring": "off", "@typescript-eslint/prefer-destructuring": [ "error", { "array": true, "object": true }, { "enforceForRenamedProperties": true, "enforceForDeclarationWithTypeAnnotation": true } ], "@shopify/typescript/prefer-singular-enums": "error", "import/extensions": ["error", "never", { "checkTypeImports": true }], "import/no-unused-modules": [ "error", { "missingExports": false, "unusedExports": true } ], "import/max-dependencies": ["error", { "ignoreTypeImports": true }], "no-explicit-type-exports/no-explicit-type-exports": "error", "etc/no-const-enum": "error", "etc/no-enum": "error", "etc/no-implicit-any-catch": "error", "etc/no-misused-generics": "error", "etc/no-t": "error", "etc/prefer-interface": ["error", { "allowIntersection": false }], "total-functions/no-unsafe-readonly-mutable-assignment": "error", "total-functions/require-strict-mode": "error", "total-functions/no-partial-url-constructor": "error", "total-functions/no-partial-division": "error", "total-functions/no-partial-string-normalize": "error", "total-functions/no-premature-fp-ts-effects": "error", "total-functions/no-partial-array-reduce": "error", "total-functions/no-nested-fp-ts-effects": "error", "sonarjs/public-static-readonly": "error", "@typescript-eslint/member-ordering": "off", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-restricted-imports": "off", "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/adjacent-overload-signatures": "off", "@typescript-eslint/class-methods-use-this": "off", "@typescript-eslint/no-array-delete": "off", "@typescript-eslint/prefer-find": "off" }, "settings": { "import/parsers": { "@typescript-eslint/parser": [".ts", ".tsx"] }, "import/resolver": { "typescript": { "alwaysTryTypes": true } }, "node": { "tryExtensions": [ ".mjs", ".cjs", ".js", ".json", ".node", ".mts", ".cts", ".ts", ".d.ts" ] } } }, { "files": ["*.cts", ".*.cts"], "parserOptions": { "sourceType": "script" }, "env": { "commonjs": true }, "rules": { "import/order": [ "error", { "named": true, "groups": [ "builtin", "external", "internal", "unknown", "parent", "sibling", "index" ], "newlines-between": "always", "alphabetize": { "order": "asc", "orderImportKind": "asc", "caseInsensitive": true } } ], "unicorn/prefer-module": "off", "import/no-commonjs": "off", "import/unambiguous": "off" } }, { "files": [ "**/test/**", "**/tests/**", "**/spec/**", "**/__tests__/**", "*.test.*", "*.spec.*", "*.e2e.*", "*.e2e-spec.*" ], "rules": { "@typescript-eslint/no-shadow": [ "error", { "builtinGlobals": true, "allow": [ "defaultStatus", "event", "find", "length", "name", "status", "screen" ] } ], "@typescript-eslint/no-magic-numbers": "off" } } ], "ignorePatterns": ["*.d.ts"] }