Skip to content

linter: typescript/promise-function-async - wrong fix with exported functions #20783

@marcalexiei

Description

@marcalexiei

What version of Oxlint are you using?

1.57.0

What command did you run?

oxlint

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

import { defineConfig } from 'oxlint';

export default defineConfig({
  env: {
    node: true,
  },
  options: {
    typeAware: true,
  },
  plugins: ['typescript'],
  rules: {
    'typescript/promise-function-async': 'error',
  },
});

What happened?

Consider the following code:

export function myPromise(): Promise<string> {
  return '1';
}

typescript/promise-function-async fix is adding async before the export:

 async export function myPromise(): Promise<string> {
  return '1';
}

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions