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

"Cannot read property 'value' of null" while linting #13394

Closed
noftaly opened this issue Jun 5, 2020 · 2 comments
Closed

"Cannot read property 'value' of null" while linting #13394

noftaly opened this issue Jun 5, 2020 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon

Comments

@noftaly
Copy link

noftaly commented Jun 5, 2020

Tell us about your environment

Environment Info:

Node version: v14.3.0
npm version: v6.14.5
Local ESLint version: vundefined (Currently used)
Global ESLint version: v7.1.0

It does not recognize my local version but in my package.json I have v7.1.0
I have the same error with nodejs v12.17.0

What parser (default, Babel-ESLint, etc.) are you using?
I use babel-eslint 10.1.0 (with @babel/core 7.10.2, @babel/node 7.10.1, @babel/preset-env 7.10.2)

Please show your full configuration:

Configuration
module.exports = {
  parser: 'babel-eslint',
  extends: 'airbnb-base',
  rules: {
    'arrow-parens': [
      'error',
      'as-needed',
      { requireForBlockBody: true },
    ],
    'no-console': 'off',
    'no-plusplus': 'off',
    'no-continue': 'off',
    'no-await-in-loop': 'off',
    'no-loop-func': 'off',
    'no-underscore-dangle': 'off',
    'consistent-return': 'off',
    'class-methods-use-this': 'off',
    'max-len': 'off',
    'no-restricted-syntax': 'off',
    'no-restricted-globals': 'off',
    'no-unused-vars': [
      'error',
      { argsIgnorePattern: '^_' },
    ],
    'object-curly-newline': [
      'error',
      { ImportDeclaration: 'never' },
    ],
  },
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

My file is pretty long so I'll link you to the file on the repo (on the right line): https://github.com/Skript-MC/Swan/blob/dev/src/SwanClient.js#L74

eslint .

What did you expect to happen?
No error to occur, just lint ^^

What actually happened? Please include the actual, raw output from ESLint.

➜  Swan-dev: npm run lint           

> swan@1.7.0 lint /Bot/Swan-dev
> eslint .


Oops! Something went wrong! :(

ESLint: 7.1.0

TypeError: Cannot read property 'value' of null
Occurred while linting /Bot/Swan-dev/src/SwanClient.js:74
    at checkSpacingBefore (/Bot/Swan-dev/node_modules/eslint/lib/rules/template-curly-spacing.js:52:24)
    at TemplateElement (/Bot/Swan-dev/node_modules/eslint/lib/rules/template-curly-spacing.js:136:17)
    at /Bot/Swan-dev/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Bot/Swan-dev/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Bot/Swan-dev/node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (/Bot/Swan-dev/node_modules/eslint/lib/linter/node-event-generator.js:283:22)
    at NodeEventGenerator.enterNode (/Bot/Swan-dev/node_modules/eslint/lib/linter/node-event-generator.js:297:14)
    at CodePathAnalyzer.enterNode (/Bot/Swan-dev/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:635:23)
    at /Bot/Swan-dev/node_modules/eslint/lib/linter/linter.js:949:32

Are you willing to submit a pull request to fix this bug?
No :(

Additional Infos:
For me and the other person I work on this project with, we don't have any error and the linting can finish without any problems. But we discovered this error through a GitHub action (same error as above). We then tested by downloading the repo and putting it into a brand new directory, installing deps (npm i) and running npm run lint (= eslint .) and the error occurs...
Excuse my English

@noftaly noftaly added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Jun 5, 2020
@yeonjuan
Copy link
Member

yeonjuan commented Jun 5, 2020

Hi :) @noftaly
It seems a bug in babel-eslint. - babel/babel#10904

@noftaly
Copy link
Author

noftaly commented Jun 5, 2020

Thanks very much for that fast response ! Indeed this is related to the issue you mentionned. I'll close this one as it is not related to ESLint then ! :)

@noftaly noftaly closed this as completed Jun 5, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 3, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

2 participants