1
0
mirror of https://github.com/theoludwig/eslint-config-conventions.git synced 2026-02-20 03:08:59 +01:00
Files
eslint-config-conventions/.oxlintrc.json

280 lines
7.6 KiB
JSON

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"eslint",
"typescript",
"unicorn",
"react",
"oxc",
"import",
"promise"
],
"categories": {
"correctness": "error",
"suspicious": "error",
"pedantic": "error",
"perf": "error"
},
"env": {
"browser": true,
"node": true
},
"rules": {
"no-await-in-loop": "off",
"no-loop-func": "off",
"no-negated-condition": "off",
"no-inline-comments": "off",
"max-lines": "off",
"max-depth": "off",
"max-classes-per-file": "off",
"max-lines-per-function": "off",
"require-await": "off",
"no-lonely-if": "off",
"array-callback-return": "off",
"getter-return": "error",
"no-undef": "error",
"no-unreachable": "error",
"use-isnan": [
"error",
{
"enforceForSwitchCase": true,
"enforceForIndexOf": true
}
],
"valid-typeof": [
"error",
{
"requireStringLiterals": true
}
],
"default-param-last": "error",
"default-case-last": "error",
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"grouped-accessor-pairs": "error",
"new-cap": [
"error",
{
"newIsCap": true,
"capIsNew": false,
"properties": true
}
],
"no-implicit-coercion": "error",
"no-extra-boolean-cast": [
"error",
{
"enforceForInnerExpressions": true
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-multi-str": "error",
"no-new-func": "error",
"no-proto": "error",
"no-regex-spaces": "error",
"no-shadow": "off",
"no-throw-literal": "off",
"no-useless-computed-key": "error",
"no-else-return": [
"error",
{
"allowElseIf": false
}
],
"no-var": "error",
"no-void": [
"error",
{
"allowAsStatement": true
}
],
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"prefer-object-has-own": "error",
"yoda": "error",
"curly": "error",
"func-style": "error",
"arrow-body-style": ["error", "always"],
"promise/param-names": "error",
"promise/no-nesting": "error",
"unicorn/catch-error-name": "error",
"unicorn/consistent-date-clone": "error",
"unicorn/error-message": "error",
"unicorn/no-array-for-each": "error",
"unicorn/no-array-method-this-argument": "error",
"unicorn/no-document-cookie": "error",
"unicorn/no-zero-fractions": "error",
"unicorn/number-literal-case": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/throw-new-error": "error",
"unicorn/require-array-join-separator": "error",
"unicorn/prefer-number-properties": "error",
"unicorn/prefer-modern-math-apis": "error",
"unicorn/prefer-structured-clone": "error",
"unicorn/consistent-existence-index-check": "error",
"unicorn/no-array-reverse": "off",
"unicorn/no-array-sort": "off",
"unicorn/no-lonely-if": "off",
"unicorn/prefer-string-replace-all": "off",
"unicorn/prefer-at": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/prefer-string-slice": "off",
"unicorn/no-immediate-mutation": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/no-object-as-default-parameter": "off",
"react/no-array-index-key": "off",
"react/no-unknown-property": "off",
"react/react-in-jsx-scope": "off",
"react/iframe-missing-sandbox": "off",
"react/self-closing-comp": "error",
"react/jsx-boolean-value": "error",
"react/jsx-no-target-blank": "off",
"react/jsx-no-useless-fragment": "off",
"import/no-webpack-loader-syntax": "error",
"import/export": "error",
"import/no-duplicates": "error",
"import/no-named-default": "error",
"import/no-anonymous-default-export": "error",
"import/consistent-type-specifier-style": "error",
"import/no-unassigned-import": "off",
"import/no-named-as-default-member": "off",
"import/max-dependencies": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unnecessary-type-arguments": "off",
"@typescript-eslint/no-unsafe-type-assertion": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-misused-promises": "off",
"@typescript-eslint/return-await": ["error", "always"],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/switch-exhaustiveness-check": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-use-before-define": [
"error",
{
"functions": false,
"classes": false,
"enums": false,
"variables": false,
"typedefs": false
}
],
"no-redeclare": [
"error",
{
"builtinGlobals": false
}
],
"@typescript-eslint/only-throw-error": "off",
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
}
],
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowHigherOrderFunctions": true,
"allowTypedFunctionExpressions": true,
"allowDirectConstAssertionInArrowFunctions": true
}
],
"@typescript-eslint/no-extraneous-class": [
"error",
{
"allowWithDecorator": true
}
],
"@typescript-eslint/no-floating-promises": [
"error",
{
"allowForKnownSafeCalls": [
{
"from": "package",
"name": ["test", "it", "suite", "describe"],
"package": "node:test"
}
]
}
],
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-find": "error",
"@typescript-eslint/prefer-nullish-coalescing": [
"error",
{
"ignoreTernaryTests": true,
"ignoreConditionalTests": false,
"ignoreMixedLogicalExpressions": false
}
],
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-return-this-type": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": [
"error",
{
"skipCompoundAssignments": true
}
],
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowString": false,
"allowNumber": false,
"allowNullableObject": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false
}
]
}
}