Skip to content

[Feature]: ESLint plugin flat config support #468

@blimmer

Description

@blimmer

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:

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:

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:

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 is a good example of a plugin exporting flat config-compatible presets.

Is this a breaking change?

No

Does this require an RFC?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions