oxc-project/oxc

Documented errors, page 7 of 12. Back to oxc-project/oxc

Code / MessageTypeSeverityTags
All imports in the declaration are only used as types. Use…
validation warning typescript, lint, imports, type-import, tree-shaking, oxlint
Capture group should be named.
validation warning oxlint, eslint, regex, es2018, modernization
Nested block is redundant.
validation warning lint, javascript, blocks, dead-code, nesting, style
Prefer String#endsWith over a regex with a dollar sign.
validation warning oxlint, unicorn, string, regex, endswith, deprecated-rule
Prevent usage of `next/script` in `next/head` component.
validation warning nextjs, next-script, next-head, lint
Template placeholders will not interpolate in regular…
validation warning eslint, oxlint, no-template-curly-in-string, template-literals, strings, interpolation
The generic type arguments should be specified as part of…
validation warning typescript, oxlint, lint, generics, constructor, type-annotation, style
Variable declarations should be sorted
validation info eslint, oxlint, sorting, variables, style, lint
File has too many lines
validation warning eslint, oxlint, style, file-size, maintainability
`jest.setTimeout` should be placed before any other jest…
console warning lint, jest, testing, timers, ordering, oxlint
Prefer `toHaveBeenCalled()` over `toHaveBeenCalledTimes(0)`
validation warning lint, jest, testing, matchers, style, oxlint
Do not use `void` as a type argument for
validation warning typescript, lint, void, generics
Iterator supplied too few elements
panic error
Duplicate conditions in if-else-if chain
validation warning javascript, eslint, lint, logic, dead-code
Enforce using the separator argument with Array#join()
validation warning oxlint, unicorn, array, join, explicit-arguments
Prefer destructuring from `defineProps` directly.
validation info vue, oxlint, lint, script-setup, defineprops, destructuring, style
Prefer `next/script` component when using the inline script…
validation warning nextjs, google-analytics, next-script, lint
Prefer using `dataset` over `hasAttribute`.
validation error
Split initialized ' ' declarations into multiple statements.
validation warning oxlint, eslint, style, variables, declaration
This label ' ' is unnecessary
validation error eslint, oxlint, lint, labels, dead-code
Unexpected `any`. Specify a different type.
validation warning typescript, lint, any, type-safety
Unexpected `!` in ` `.
console warning lint, webpack, loader, import, oxlint, bundler
Use spread operators instead of `.apply()`.
validation warning eslint, oxlint, es6, spread, lint
Avoid destructuring from `defineProps`.
validation warning vue, oxlint, lint, script-setup, defineprops, destructuring, reactivity
Disabled test suite
validation warning jest, vitest, oxlint, testing, skipped-test, describe
Found a comment that would permit fallthrough, but case…
validation warning eslint, oxlint, lint, switch, comments
Missing parameters.
validation warning eslint, oxlint, parseint, radix, correctness, lint
Prevent client components from being async functions.
validation warning nextjs, react-server-components, async, lint
Use runtime declaration instead of type-based declaration
validation info vue, oxlint, lint, script-setup, defineprops, style
Do not assign to the variable `module`.
validation warning nextjs, webpack, naming, lint
Prefer `Math.hypot(…)` over alternatives
validation error
Imports are only used as type.
validation warning typescript, lint, imports, type-import, oxlint
Prefer using `Response.json(…)` over `JSON.stringify()`.
validation warning oxlint, unicorn, fetch-api, style, response
Right-hand side of `&&` operator has no effect.
validation error oxlint, oxc, conditions, logic-bug, javascript, static-analysis
Unexpected `if` as the only statement in an `else` block
validation warning lint, javascript, if-else, style, readability
All signatures should be adjacent.
validation warning typescript, oxlint, overloads, code-organization, adjacent-overload-signatures
`aria-hidden` must not be true on focusable elements.
validation warning jsx-a11y, react, accessibility, aria, screen-reader, lint
Both sides of the logical operator are equivalent
validation warning oxlint, oxc, conditions, equality, javascript, static-analysis
' ' is already defined as a built-in global variable.
validation warning lint, eslint, no-redeclare, globals, shadowing, configuration
Prefer `Node#append()` over `Node#appendChild()` for DOM…
validation error
Unexpected use of `undefined`
validation info eslint, oxlint, no-undefined, style, undefined, null-check
Use `Set#size` instead of converting a `Set` to an array…
validation warning oxlint, unicorn, set, style, refactor
All 'var' declarations must be at the top of the function…
validation warning lint, oxlint, eslint, style, var, hoisting, scoping
Expected "import" statement instead of "require" call
validation warning typescript, lint, commonjs, imports, esm
Missing accessible content when using `a` elements.
validation warning jsx-a11y, accessibility, link-text, screen-reader, react, lint, oxlint
Do not include multiple instances of `<Head/>`
validation warning nextjs, pages-router, seo, lint
Prefer String#slice() over String#
validation warning oxlint, unicorn, string, legacy-api, slice
Unexpected function expression.
validation warning oxlint, eslint, style, arrow-functions, callbacks, es6
Using target=`_blank` without rel=`noreferrer` (which…
validation warning react, security, tabnabbing, noopener, oxlint, lint
Disabled test
validation warning jest, vitest, oxlint, testing, skipped-test
Function name ` ` should not match property name ` `.
validation warning eslint, oxlint, naming, function-expression, redundant-name
`@yields` tag is required when using `@generator` tag.
validation warning jsdoc, generator, documentation, lint, oxlint, config
Do not assign to the exception parameter.
validation warning javascript, eslint, lint, error-handling, catch
Prefer `.textContent` over `.innerText`.
validation error
Require test cases and hooks to be inside a `describe` block
validation warning jest, vitest, oxlint, describe, test-structure
A font-display parameter is missing (adding…
validation warning nextjs, performance, fonts, core-web-vitals, lint
Barrel file detected
validation warning oxlint, barrel-file, performance, bundling, module-graph
Expect in a promise chain must be awaited or returned
validation warning jest, vitest, oxlint, testing, promise-chain, floating-promise, async, valid-expect-in-promise
Name " " is reserved in Vue.js 3.x.
validation warning vue, naming, lint, vue3, reserved-names, components
Use `toBeNaN` instead.
validation warning jest, vitest, oxlint, matcher, nan
Do not use `< >` elements as they can create visual…
validation warning jsx-a11y, react, accessibility, deprecated-html, css, lint
Invalid `alt` value.
validation error jsx-a11y, accessibility, alt-text, react, lint, oxlint
Prefer omitting the catch binding parameter if it is unused
validation error
Promises which return async assertions must be awaited.
validation warning jest, vitest, oxlint, testing, async, promise-chain, floating-promise, valid-expect
Spread works on iterables, `.toArray()` is unnecessary.
validation warning lint, oxlint, unicorn, spread, iterator-helpers, performance, nursery
TS5058
The specified path does not exist
validation error
Describe block title is used multiple times in the same…
validation warning jest, vitest, oxlint, testing, titles, duplicates, describe
Member ' ' of the import declaration should be sorted…
validation info eslint, oxlint, imports, sorting, style, lint
Mock functions that return simple values should use…
validation warning jest, vitest, oxlint, testing, mocks, style, static-analysis
` .hasAssertions` expects no arguments.
validation warning jest, vitest, oxlint, testing, assertions, api-misuse, static-analysis
Split requires to be separated into a single block.
validation warning oxlint, eslint, style, commonjs, require, variables
Unnecessarily computed property
validation warning lint, eslint, oxlint, object-literal, computed-key
A record is preferred over an index signature.
validation warning typescript, oxlint, lint, record-type, index-signature, style
`toMatchSnapshot` takes at most two arguments.
validation warning jest, vitest, oxlint, testing, snapshots, api-misuse, static-analysis
Unexpected assignment to read-only global variable.
validation warning oxlint, lint, globals, readonly, assignment
Use a property signature instead of a method signature.
validation warning typescript, lint, interface, style, oxlint
Multiple consecutive spaces are hard to count.
validation warning lint, eslint, no-regex-spaces, regex, autofix
Require `for-in` loops to include an `if` statement
validation warning eslint, oxlint, correctness, for-in, prototype-chain, pedantic
Suggest using `toHaveLength()`.
validation warning jest, vitest, oxlint, matcher, length
The " " property should be a constructor.
validation error
The `scope` prop can only be used on
validation warning jsx-a11y, react, accessibility, html-table, lint
Variables should not be deleted
validation warning javascript, eslint, lint, memory, strict-mode
stream did not contain valid UTF-8
exception error
Title description can not have the same content as a…
validation error
Prefer top-level await over an async function call.
validation warning oxlint, unicorn, async, floating-promise, top-level-await
Split ' ' declarations into multiple statements.
validation warning oxlint, eslint, style, variables, declaration
Suggest using `test.todo`.
validation warning jest, vitest, oxlint, test-structure, todo
Expected method shorthand.
validation warning lint, eslint, oxlint, object-literal, method-shorthand, es6
' ' is already defined.
validation warning lint, eslint, no-redeclare, variables, scoping
` .assertions` expects a single argument of type number.
validation warning jest, vitest, oxlint, testing, assertions, api-misuse, static-analysis
Unexpected implicit coercion to string
validation warning eslint, oxlint, lint, coercion, string
Unexpected newline between numerator and division operator
validation error eslint, oxlint, no-unexpected-multiline, asi, semicolons, division, regex-literal
Duplicate class member
validation warning javascript, eslint, lint, classes, dead-code
Expected a `break` statement before `default`.
validation error eslint, oxlint, lint, switch, control-flow
Literals should be exposed using getters.
validation warning typescript, oxlint, lint, class, getter, readonly, style
Missing argument type on function
validation warning typescript, lint, annotations, parameters, implicit-any, oxlint
Duplicate case label
validation warning javascript, eslint, lint, switch, dead-code
`next/script` components with inline content must specify…
validation warning nextjs, next-script, jsx, lint
Prefer `find` over filtering and accessing the first result.
validation warning oxlint, unicorn, arrays, performance, refactor, autofix
Unexpected newline between template tag and template literal
validation error eslint, oxlint, no-unexpected-multiline, asi, semicolons, template-literals