This commit is contained in:
9
packages/oxlint-config/rules/consider.jsonc
Normal file
9
packages/oxlint-config/rules/consider.jsonc
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
"no-array-for-each": "off",
|
||||
"no-nested-ternary": "off",
|
||||
"no-array-sort": "off",
|
||||
"preserve-caught-error": "off",
|
||||
},
|
||||
}
|
||||
16
packages/oxlint-config/rules/disabled.jsonc
Normal file
16
packages/oxlint-config/rules/disabled.jsonc
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
"no-await-in-loop": "off",
|
||||
"consistent-function-scoping": "off",
|
||||
"prefer-add-event-listener": "off",
|
||||
"no-new": "off",
|
||||
"no-new-array": "off",
|
||||
"no-useless-spread": "off",
|
||||
"no-async-endpoint-handlers": "off",
|
||||
"no-this-alias": "off",
|
||||
"no-unassigned-import": "off",
|
||||
"no-array-reverse": "off", // disabled for compatibility
|
||||
"no-map-spread": "off",
|
||||
},
|
||||
}
|
||||
88
packages/oxlint-config/rules/enabled.jsonc
Normal file
88
packages/oxlint-config/rules/enabled.jsonc
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"argsIgnorePattern": "^(_|e|event)",
|
||||
"caughtErrorsIgnorePattern": "^(_|e|error)",
|
||||
"varsIgnorePattern": "^_",
|
||||
"fix": {
|
||||
"imports": "safe-fix",
|
||||
},
|
||||
},
|
||||
],
|
||||
"no-var": "error",
|
||||
"no-non-null-assertion": "error",
|
||||
"no-non-null-asserted-nullish-coalescing": "error",
|
||||
"no-explicit-any": "error",
|
||||
"no-empty-object-type": "error",
|
||||
"explicit-function-return-type": [
|
||||
"error",
|
||||
{
|
||||
"allowExpressions": true,
|
||||
},
|
||||
],
|
||||
"no-unused-expressions": [
|
||||
"error",
|
||||
{
|
||||
"allowTernary": true,
|
||||
},
|
||||
],
|
||||
"no-unsafe-function-type": "error",
|
||||
"prefer-for-of": "error",
|
||||
"consistent-type-definitions": ["error", "type"],
|
||||
"no-var-requires": "error",
|
||||
"no-named-as-default": "error",
|
||||
"no-named-as-default-member": "error",
|
||||
"no-array-constructor": "error",
|
||||
"no-dynamic-delete": "error",
|
||||
"no-extraneous-class": "error",
|
||||
"no-require-imports": "error",
|
||||
"no-empty-function": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-empty": [
|
||||
"error",
|
||||
{
|
||||
"allowEmptyCatch": true,
|
||||
},
|
||||
],
|
||||
"no-self-compare": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-constant-binary-expression": "error",
|
||||
"no-unnecessary-type-constraint": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"prefer-literal-enum-member": "error",
|
||||
"prefer-namespace-keyword": "error",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"no-duplicates": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-inner-declarations": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"typescript/no-namespace": "error",
|
||||
"eqeqeq": "error",
|
||||
"ban-ts-comment": "error",
|
||||
"no-unassigned-vars": "error",
|
||||
"max-depth": [
|
||||
"error",
|
||||
{
|
||||
"max": 5,
|
||||
},
|
||||
],
|
||||
"always-return": [
|
||||
"error",
|
||||
{
|
||||
"ignoreLastCallback": true,
|
||||
},
|
||||
],
|
||||
"unicorn/prefer-includes": "error",
|
||||
"unicorn/prefer-structured-clone": "error",
|
||||
"curly": ["error", "multi-line", "consistent"],
|
||||
"no-sequences": "error",
|
||||
"import/no-cycle": "error",
|
||||
},
|
||||
}
|
||||
44
packages/oxlint-config/rules/jsx.jsonc
Normal file
44
packages/oxlint-config/rules/jsx.jsonc
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"overrides": [
|
||||
{
|
||||
"plugins": [
|
||||
"typescript",
|
||||
"unicorn",
|
||||
"oxc",
|
||||
"import",
|
||||
"node",
|
||||
"promise",
|
||||
"react",
|
||||
],
|
||||
"files": ["src/**/*.tsx"],
|
||||
"rules": {
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/button-has-type": "error",
|
||||
"react/jsx-no-duplicate-props": "error",
|
||||
"react/jsx-no-undef": "error",
|
||||
"react/jsx-props-no-spread-multi": "error",
|
||||
"react/void-dom-elements-no-children": "error",
|
||||
"react/no-unknown-property": [
|
||||
"error",
|
||||
{
|
||||
"ignore": [
|
||||
"autocomplete",
|
||||
"class",
|
||||
"classList",
|
||||
"innerHTML",
|
||||
"onScrollEnd",
|
||||
"router-link",
|
||||
],
|
||||
},
|
||||
],
|
||||
"react/jsx-no-comment-textnodes": "error",
|
||||
"react/style-prop-object": "error",
|
||||
"react/checked-requires-onchange-or-readonly": "error",
|
||||
"react/jsx-no-useless-fragment": "error",
|
||||
"react/no-unescaped-entities": "error",
|
||||
"react/jsx-pascal-case": "error",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
21
packages/oxlint-config/rules/ts-consider.jsonc
Normal file
21
packages/oxlint-config/rules/ts-consider.jsonc
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
//936, no options on this one. super strict, it doesnt allow casting to a narrower type
|
||||
"typescript/no-unsafe-type-assertion": "off",
|
||||
//224 errors, very easy to fix.
|
||||
// adds unnecessary promise overhead and pushing the function to the microtask queue, creating a delay
|
||||
// all though performance impact probably minimal
|
||||
// anything that needs to be absolutely as fast as possible should not be async (if not using await)
|
||||
"typescript/require-await": "off",
|
||||
//388, when allowing numbers only 27, when also allowing arrays 12
|
||||
// could be nice to avoid some weird things showing up in templated strings
|
||||
"typescript/restrict-template-expressions": [
|
||||
"off",
|
||||
{
|
||||
"allowNumber": true,
|
||||
"allowArray": true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
13
packages/oxlint-config/rules/ts-disabled.jsonc
Normal file
13
packages/oxlint-config/rules/ts-disabled.jsonc
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
"typescript/non-nullable-type-assertion-style": "off",
|
||||
"typescript/switch-exhaustiveness-check": "off",
|
||||
"typescript/unbound-method": "off",
|
||||
"typescript/prefer-promise-reject-errors": "off",
|
||||
"typescript/no-redundant-type-constituents": "off",
|
||||
"typescript/require-array-sort-compare": "off",
|
||||
//unnecessary, might aswell keep template strings in case a string might be added in the future
|
||||
"typescript/no-unnecessary-template-expression": "off",
|
||||
},
|
||||
}
|
||||
64
packages/oxlint-config/rules/ts-enabled.jsonc
Normal file
64
packages/oxlint-config/rules/ts-enabled.jsonc
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
|
||||
"rules": {
|
||||
"typescript/strict-boolean-expressions": [
|
||||
"error",
|
||||
{ "allowNullableBoolean": true },
|
||||
],
|
||||
"typescript/only-throw-error": "error",
|
||||
"typescript/no-unsafe-member-access": "error",
|
||||
"typescript/no-unsafe-call": "error",
|
||||
"typescript/no-unsafe-argument": "error",
|
||||
"typescript/no-unsafe-assignment": "error",
|
||||
"typescript/no-unnecessary-type-assertion": "error",
|
||||
"typescript/no-confusing-void-expression": [
|
||||
"error",
|
||||
{ "ignoreArrowShorthand": true },
|
||||
],
|
||||
"typescript/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": false,
|
||||
},
|
||||
],
|
||||
"typescript/promise-function-async": "error",
|
||||
"typescript/no-floating-promises": "error",
|
||||
"typescript/no-array-delete": "error",
|
||||
"typescript/no-base-to-string": "error",
|
||||
"typescript/no-duplicate-type-constituents": "error",
|
||||
"typescript/no-for-in-array": "error",
|
||||
"typescript/no-implied-eval": "error",
|
||||
"typescript/no-meaningless-void-operator": "error",
|
||||
"typescript/no-mixed-enums": "error",
|
||||
"typescript/no-unnecessary-boolean-literal-compare": "error",
|
||||
"typescript/no-unsafe-enum-comparison": "error",
|
||||
"typescript/no-unsafe-return": "error",
|
||||
"typescript/no-unsafe-unary-minus": "error",
|
||||
"typescript/prefer-reduce-type-parameter": "error",
|
||||
"typescript/prefer-return-this-type": "error",
|
||||
"typescript/related-getter-setter-pairs": "error",
|
||||
//todo: consider "always" or "in-try-catch"
|
||||
"typescript/return-await": ["error", "error-handling-correctness-only"],
|
||||
"typescript/use-unknown-in-catch-callback-variable": "error",
|
||||
"typescript/await-thenable": "error",
|
||||
"typescript/no-unnecessary-type-arguments": "error",
|
||||
"typescript/restrict-plus-operands": [
|
||||
"error",
|
||||
{
|
||||
"allowNumberAndString": true,
|
||||
},
|
||||
],
|
||||
"typescript/no-deprecated": "error",
|
||||
"typescript/prefer-includes": "error",
|
||||
"typescript/prefer-nullish-coalescing": "error",
|
||||
"typescript/no-invalid-void-type": "error",
|
||||
"typescript/unified-signatures": "error",
|
||||
"typescript/parameter-properties": "error",
|
||||
"typescript/dot-notation": "error",
|
||||
"typescript/no-useless-default-assignment": "error",
|
||||
"typescript/prefer-string-starts-ends-with": "error",
|
||||
"typescript/prefer-regexp-exec": "error",
|
||||
"typescript/prefer-find": "error",
|
||||
"typescript/consistent-type-exports": "error",
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user