javascript icon indicating copy to clipboard operation
javascript copied to clipboard

TypeError: Failed to load plugin 'jsx-a11y' declared

Open srghma opened this issue 1 year ago • 1 comments

$ eslint --ignore-path .eslintignore --fix .

Oops! Something went wrong! :(

ESLint: 8.57.0

TypeError: Failed to load plugin 'jsx-a11y' declared in '.eslintrc.js » eslint-config-airbnb » /app/node_modules/eslint-config-airbnb/rules/react-a11y.js': `[[GeneratorState]]` is not present on `O`
    at Object.assert (/app/node_modules/es-iterator-helpers/node_modules/internal-slot/index.js:18:10)
    at GeneratorStart (/app/node_modules/es-iterator-helpers/aos/GeneratorStart.js:12:7)
    at CreateIteratorFromClosure (/app/node_modules/es-iterator-helpers/aos/CreateIteratorFromClosure.js:42:2)
    at Array Iterator.filter (/app/node_modules/es-iterator-helpers/Iterator.prototype.filter/implementation.js:75:15)
    at Object.<anonymous> (/app/node_modules/eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js:65:70)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
    at Module.load (node:internal/modules/cjs/loader:1212:32)
    at Module._load (node:internal/modules/cjs/loader:1028:12)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

const stylistic = require("@stylistic/eslint-plugin")

const customized = stylistic.configs.customize({
  // the following options are the default values
  indent: 2,
  quotes: "double",
  semi: false,
  jsx: true,
  // ...
})

module.exports = {
  plugins: ["@stylistic"],
  rules: {
    ...customized.rules,
  },
  extends: [
    "eslint:recommended",
    "airbnb",
    // "airbnb/hooks",
    "plugin:@stylistic/all-extends",
    // "plugin:import/recommended",
    // "plugin:jest/recommended",
    // "plugin:jsdoc/recommended"
  ],
  env: {
    browser: true,
    es2023: true,
    node: true,
  },
  parserOptions: {
    sourceType: "module",
    ecmaVersion: 2023,
    ecmaFeatures: {
      jsx: true,
      // globalReturn: true,
    },
  },
}

package-lock.json package.json

srghma avatar Mar 02 '24 08:03 srghma