uhyo / eslint-plugin-import-access

https://www.npmjs.com/package/eslint-plugin-import-access
MIT License
355 stars 9 forks source link

Flat Config Support #18

Closed uhyo closed 4 months ago

uhyo commented 5 months ago

We cannot use eslint-plugin-import-access with Flat Config. 😨 This is caused by providing TypeScript Language Server Plugin from the same module.

Config

import typescriptEslintParser from "@typescript-eslint/parser";
import importAccess from 'eslint-plugin-import-access';

export default [
  {
    languageOptions: {
      parser: typescriptEslintParser,
    },
    files: ['**/*.ts'],
    plugins: {
      'import-access': importAccess,
    },
    rules: {
      'import-access/jsdoc': 'error'
    }
  }
]

Error message

ESLint: 9.0.0

ConfigError: Config (unnamed): Key "plugins": Key "import-access": Expected an object.

Workaround

    plugins: {
      'import-access': { ...importAccess },
    },
uhyo commented 4 months ago

Final state

Both are breaking changes.

Intermediate state