aws / aws/aws-durable-execution-sdk-js

[Feature]: ESLint plugin flat config support

Open
#468 0 comments 1 reaction 1 assignee Claimed by @ParidelPooya View on GitHub
enhancement
Dominant language
TypeScript
Stars
84
Forks
28
Avg merge
1d 17h
Merged PRs (30d)
43

Description

### What would you like?

The `@aws/durable-execution-sdk-js-eslint-plugin` only supports legacy ESLint config format. The `configs.recommended` preset uses a string-based `plugins` array, which is incompatible with ESLint flat config (`eslint.config.mjs`).

Flat config has been the default since ESLint v9 and legacy `.eslintrc` is deprecated. Projects using flat config must manually wire up the plugin:

```js
import durableFunctions from '@aws/durable-execution-sdk-js-eslint-plugin';

export default [
{
plugins: { '@aws/durable-functions': durableFunctions },
rules: {
'@aws/durable-functions/no-nested-durable-operations': 'error',
'@aws/durable-functions/no-non-deterministic-outside-step': 'error',
'@aws/durable-functions/no-closure-in-durable-operations': 'error',
},
},
];
```

A flat config-compatible preset would let users simply spread it instead:

```js
import durableFunctions from '@aws/durable-execution-sdk-js-eslint-plugin';

export default [durableFunctions.configs.recommended];
```

### Possible Implementation

Export a flat config-compatible `configs.recommended` that uses the object-based `plugins` format:

```ts
const recommended = {
plugins: {
'@aws/durable-functions': plugin, // plugin object, not a string
},
rules: {
'@aws/durable-functions/no-nested-durable-operations': 'error',
'@aws/durable-functions/no-non-deterministic-outside-step': 'error',
'@aws/durable-functions/no-closure-in-durable-operations': 'error',
},
};
```

For reference, [typescript-eslint](https://typescript-eslint.io/packages/typescript-eslint#flat-config-extends) is a good example of a plugin exporting flat config-compatible presets.

### Is this a breaking change?

No

### Does this require an RFC?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.