{
"env": {
"browser": true
},
"categories": {
"correctness": "error"
},
"rules": {
"no-unused-vars": ["error", {"args": "none", "caughtErrors": "none"}],
"no-extra-boolean-cast": "off",
"no-useless-escape": "off",
"no-useless-catch": "off",
"no-constant-binary-expression": "off",
"no-caller": "off",
"no-await-in-promise-methods": "off",
"no-useless-fallback-in-spread": "off",
"no-useless-spread": "off",
"no-empty-file": "off",
"prefer-set-size": "off",
"no-new-array": "off",
"no-unnecessary-await": "off",
"prefer-string-starts-ends-with": "off",
"valid-typeof": ["error", {"requireStringLiterals": true}],
// Correctness
"named": "error",
"default": "error",
"namespace": "error",
// Restriction
"default-case": "error",
"no-alert": "error",
"no-console": "error",
"no-empty": "error",
"no-empty-object-type": "error",
"no-eval": "error",
"no-iterator": "error",
"no-namespace": "error",
"no-proto": "error",
"no-var": "error",
"no-void": ["error", {"allowAsStatement": true}],
"no-amd": "error",
"no-cycle": ["error", {"maxDepth": "∞"}],
"no-dynamic-require": "error",
"no-unnecessary-type-constraint": "error",
"no-webpack-loader-syntax": "error",
// Suspicious
"no-extend-native": "error",
"no-useless-constructor": "error",
"no-duplicates": "error",
"no-named-as-default": "error",
"no-named-as-default-member": "error",
"no-self-import": "error",
// Pedantic
"ban-ts-comment": "error",
"eqeqeq": ["error", "always"],
"no-array-constructor": "error",
"no-case-declarations": "error",
"no-constructor-return": "error",
"no-new-wrappers": "error",
"no-redeclare": "error",
"no-self-compare": "error",
"no-unsafe-function-type": "error",
"symbol-description": "error",
// Style
"array-type": ["error", {"default": "generic"}],
"default-case-last": "error",
"no-label-var": "error",
"no-new-func": "error",
"no-return-assign": ["error", "always"],
"no-script-url": "error",
"no-template-curly-in-string": "error",
"prefer-exponentiation-operator": "error",
"prefer-namespace-keyword": "error",
"prefer-numeric-literals": "error",
"import/first": "error",
"yoda": "error"
}
}
When writing a function that returns a promise resolving to an array, oxlint does not catch when the array is written in 'array' style when the config is set to convert to 'generic'.
What version of Oxlint are you using?
0.15.8
What command did you run?
npx oxlint
What does your
.oxlint.jsonconfig file look like?{ "env": { "browser": true }, "categories": { "correctness": "error" }, "rules": { "no-unused-vars": ["error", {"args": "none", "caughtErrors": "none"}], "no-extra-boolean-cast": "off", "no-useless-escape": "off", "no-useless-catch": "off", "no-constant-binary-expression": "off", "no-caller": "off", "no-await-in-promise-methods": "off", "no-useless-fallback-in-spread": "off", "no-useless-spread": "off", "no-empty-file": "off", "prefer-set-size": "off", "no-new-array": "off", "no-unnecessary-await": "off", "prefer-string-starts-ends-with": "off", "valid-typeof": ["error", {"requireStringLiterals": true}], // Correctness "named": "error", "default": "error", "namespace": "error", // Restriction "default-case": "error", "no-alert": "error", "no-console": "error", "no-empty": "error", "no-empty-object-type": "error", "no-eval": "error", "no-iterator": "error", "no-namespace": "error", "no-proto": "error", "no-var": "error", "no-void": ["error", {"allowAsStatement": true}], "no-amd": "error", "no-cycle": ["error", {"maxDepth": "∞"}], "no-dynamic-require": "error", "no-unnecessary-type-constraint": "error", "no-webpack-loader-syntax": "error", // Suspicious "no-extend-native": "error", "no-useless-constructor": "error", "no-duplicates": "error", "no-named-as-default": "error", "no-named-as-default-member": "error", "no-self-import": "error", // Pedantic "ban-ts-comment": "error", "eqeqeq": ["error", "always"], "no-array-constructor": "error", "no-case-declarations": "error", "no-constructor-return": "error", "no-new-wrappers": "error", "no-redeclare": "error", "no-self-compare": "error", "no-unsafe-function-type": "error", "symbol-description": "error", // Style "array-type": ["error", {"default": "generic"}], "default-case-last": "error", "no-label-var": "error", "no-new-func": "error", "no-return-assign": ["error", "always"], "no-script-url": "error", "no-template-curly-in-string": "error", "prefer-exponentiation-operator": "error", "prefer-namespace-keyword": "error", "prefer-numeric-literals": "error", "import/first": "error", "yoda": "error" } }What happened?
When writing a function that returns a promise resolving to an array, oxlint does not catch when the array is written in
'array'style when the config is set to convert to'generic'.The Rule:
Example code