Closed
Description
Bug Report
Rules such as functional/type-declaration-immutability
don’t work when using the flat config with ESM modules.
test.ts
:
type Test = readonly string[]
eslint.config.js
:
import tseslint from 'typescript-eslint'
import functional from 'eslint-plugin-functional/flat'
export default tseslint.config(
{
files: ['**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
tseslint.configs.base,
functional.configs.strict,
{
rules: {
'functional/type-declaration-immutability': 'error',
},
},
)
Expected behavior
No errors.
Actual behavior
/path/to/file/test.ts
1:1 error This type is declare to have an immutability of at least "Immutable" (actual: "Unknown") functional/type-declaration-immutability
Steps to reproduce
- Install [email protected]
- Run
eslint test.ts
Proposed changes
typescript
can’t be imported in an ESM module as require
is not defined.