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

no-unknown-property: allowedTags.indexOf is not a function #2879

Closed
AriPerkkio opened this issue Dec 17, 2020 · 0 comments
Closed

no-unknown-property: allowedTags.indexOf is not a function #2879

AriPerkkio opened this issue Dec 17, 2020 · 0 comments

Comments

@AriPerkkio
Copy link
Contributor

Hello, no-unknown-property rule seems to crash in certain cases. This issue was spotted by automated CI run - it is not blocking my development or anything. https://github.com/AriPerkkio/eslint-remote-tester/runs/1568977821?check_suite_focus=true

This was the only (new) rule crashing in this plugin's weekly test. 👍

"eslint-plugin-react": "^7.21.5",
  "rules": {
    "react/no-unknown-property": "error"
  }

Minimal repro:

<div hasOwnProperty="should not be allowed tag" />
TypeError: allowedTags.indexOf is not a function
Occurred while linting <text>:187
    at JSXAttribute (/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js:262:87)```
Crash reports from real projects

Rule: no-unknown-property

  • Message: allowedTags.indexOf is not a function Occurred while linting <text>:187
  • Path: yzw7489757/react-code-learn/packages/react-dom/src/__tests__/ReactServerRendering-test.js
  • Link
      let html;
      expect(
        () =>
          (html = ReactDOMServer.renderToString(
            <div hasOwnProperty="poison">
              <span unknown="test" />
            </div>,
          )),
      ).toWarnDev(['React does not recognize the `hasOwnProperty` prop']);
      expect(html).toContain('<span unknown="test">');
TypeError: allowedTags.indexOf is not a function
Occurred while linting <text>:187
    at JSXAttribute (/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js:262:87)
    at /home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit(/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector(/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors(/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode(/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (/home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:711:23)
    at /home/<removed>/eslint-remote-tester/ci/node_modules/eslint-remote-tester/node_modules/eslint/lib/linter/linter.js:952:32
    at Array.forEach (<anonymous>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant