Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ESLint: Cannot read property 'loc' of undefined. Please see the 'ESLint' output channel for details. #441

Closed
Labels
bugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: parserIssues related to @typescript-eslint/parser
@WDever

Description

@WDever

What code were you trying to parse?

import*asReactfrom'react';importstyledfrom'styled-components';constTestStyledComponent=styled.div`  // css`;classExampleextendsReact.Component<ExampleProps,ExampleState>{publicrender(){return(<TestStyledComponent/>);};}exportdefaultExample;

What did you expect to happen?
No Error
What actually happened?
ESLint: Cannot read property 'loc' of undefined. Please see the 'ESLint' output channel for details.

[Error - 1:08:08 PM] ESLint stack trace:[Error - 1:08:08 PM] TypeError: Cannot read property 'loc' of undefined    at Object.VariableDeclaration [as listener] (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/rules/indent.js:1361:69)    at Program:exit.listenerCallQueue.filter.forEach.nodeInfo (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/rules/indent.js:1537:55)    at Array.forEach (<anonymous>)    at Program:exit (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/rules/indent.js:1537:26)    at listeners.(anonymous function).forEach.listener (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/util/safe-emitter.js:45:58)    at Array.forEach (<anonymous>)    at Object.emit (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/util/safe-emitter.js:45:38)    at NodeEventGenerator.applySelector (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/util/node-event-generator.js:251:26)    at NodeEventGenerator.applySelectors (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/util/node-event-generator.js:280:22)    at NodeEventGenerator.leaveNode (/Users/wdever/Documents/Projects/hanlight-frontend-web/node_modules/eslint/lib/util/node-event-generator.js:303:14)

when I write const in tsx, ESlint send an errror.

my eslint.js:

module.exports = {  parser: '@typescript-eslint/parser',  extends: [    'plugin:@typescript-eslint/recommended',    'react-app',    'plugin:prettier/recommended',    'prettier',  ],  plugins: ['@typescript-eslint', 'react'],  rules: {    '@typescript-eslint/indent': ['error', 2],    // "@typescript-eslint/explicit-function-return-type": ["false"],    '@typescript-eslint/explicit-function-return-type': 0,    // "prettier/prettier": ["error", {    //   "singleQuote": true,    //   "parser": "flow"    // }],    // "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],    'no-unused-vars': 0,    '@typescript-eslint/no-empty-interface': 0,    'prettier/prettier': 0,    '@typescript-eslint/no-parameter-properties': 0,    // "@typescript-eslint/no-unused-vars": 0,    // "@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],  },};

Versions

packageversion
@typescript-eslint/parser1.6.0
TypeScript3.3.3333
ESLintcreate-react-app default
node11.10.0
npm6.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: parserIssues related to @typescript-eslint/parser

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp