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

import-style: Cannot read property 'type' of undefined #902

Closed
AriPerkkio opened this issue Nov 22, 2020 · 0 comments · Fixed by #904
Closed

import-style: Cannot read property 'type' of undefined #902

AriPerkkio opened this issue Nov 22, 2020 · 0 comments · Fixed by #904
Assignees
Labels

Comments

@AriPerkkio
Copy link
Contributor

Hello, I'm testing stability of well known community ESlint plugins with eslint-remote-tester. This eslint plugin seems to contain a rule which causes linter to crash. ESlint rules should not crash in any condition since this makes all valid linting problems disappear. If this is a false flag please let me know.

Crashing rule:

import-style

Minimal repro:

const { a, ...b } = require('./c');

This causes ESlint to dispaly an error:

TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-plugin-unicorn/rules/import-style.js:84:21)

Real-world examples:

eslint-remote-tester-results/reakit_reakit.md

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-playground/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-system/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-system-bootstrap/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-system-palette/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-test-utils/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-utils/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/reakit-warning/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)

Rule: import-style

  • Message: Cannot read property 'type' of undefined Occurred while linting <text>:2
  • Path: reakit/reakit/packages/website/jest.config.js
  • Link
const { join } = require("path");
const { projects, ...baseConfig } = require("../../jest.config");
const pkg = require("./package.json");

module.exports = {
  ...baseConfig,
  displayName: pkg.name,
TypeError: Cannot read property 'type' of undefined
Occurred while linting <text>:2
    at getActualAssignmentTargetImportStyles (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:84:21)
    at gensyme54126958cf62 (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-plugin-unicorn/rules/import-style.js:300:32)
    at TemplateManager._matchTemplate (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:128:11)
    at newValue (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:290:17)
    at /<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:33
    at Array.forEach (<anonymous>)
    at newVisitor.<computed> (/<root-path-removed>/eslint-remote-tester/configs/node_modules/eslint-template-visitor/lib/index.js:300:14)
    at /<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:49:25
    at Array.forEach (<anonymous>)
    at Object.emit (/<root-path-removed>/eslint-remote-tester/node_modules/eslint/lib/linter/safe-emitter.js:47:38)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants