Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition for rule 'jsx-a11y/img-has-alt' was not found #642

Closed
kennethslee613 opened this issue Oct 14, 2019 · 2 comments
Closed

Definition for rule 'jsx-a11y/img-has-alt' was not found #642

kennethslee613 opened this issue Oct 14, 2019 · 2 comments

Comments

@kennethslee613
Copy link

I have tried following the solutions in https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/232, but the list that I get from running npm ls is the following:

npm ERR! peer dep missing: babel-eslint@^7.0.0, required by eslint-config-react-app@0.6.2
npm ERR! peer dep missing: eslint@^3.16.1, required by eslint-config-react-app@0.6.2
npm ERR! peer dep missing: eslint@>=1.6.0 <4.0.0, required by eslint-loader@1.6.0
npm ERR! peer dep missing: eslint-plugin-jsx-a11y@^2.0.0 || ^3.0.0 || ^4.0.0, required by eslint-config-react-app@0.6.2
npm ERR! peer dep missing: eslint-plugin-react@^6.4.1, required by eslint-config-react-app@0.6.2

but updating the versions of the requirements just lead to contradicting requirements by other packages.

I tried removing all packages, and starting with just installing eslint, babel-eslint, and eslint-config-airbnb, and then ran npm info "eslint-config-airbnb@latest" peerDependencies to install dependencies, but I still seem to be having this issue.

The following is my dev dependencies:

"babel-eslint": "^10.0.3",
    "eslint": "^5.16.0",
    "eslint-config-airbnb": "^18.0.1",
    "eslint-plugin-import": "^2.18.2",
    "eslint-plugin-jsx-a11y": "^6.2.3",
    "eslint-plugin-react": "^7.16.0",
    "eslint-plugin-react-hooks": "^1.7.0"

and this is what my eslintrc file looks like

module.exports = {
  env: {
    browser: true,
    es6: true,
  },
  extends: [
    'airbnb',
  ],
  globals: {
    Atomics: 'readonly',
    SharedArrayBuffer: 'readonly',
  },
  parser: "babel-eslint",
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
  },
};

Any help would be appreciated, thank you.

@ljharb
Copy link
Member

ljharb commented Oct 15, 2019

If npm ls can not be made to pass, then the configuration of deps you’re trying to use is impossible.

Specifically, CRA often imposes very specific peer dep requirements on its users. You’re also using an ancient CRA version that requires an ancient eslint - v3, when it’s on v6. eslint-loader also is requiring up to eslint 4, which is also years obsolete.

@jessebeach
Copy link
Collaborator

Closing until further information is provided. There's nothing we can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants