Hi! I have a strange error
TypeError: moduleDecl.body.body.forEach is not a function
Occurred while linting ~/services/admin-website/src/views/Products/Products/AddProductDialog/PhotoInput/index.tsx:1
at ~/node_modules/eslint-plugin-import/lib/ExportMap.js:565:32
at Array.forEach (<anonymous>)
at ~/node_modules/eslint-plugin-import/lib/ExportMap.js:563:19
at Array.forEach (<anonymous>)
at Function.ExportMap.parse (~/node_modules/eslint-plugin-import/lib/ExportMap.js:477:12)
at Function.ExportMap.for (~/node_modules/eslint-plugin-import/lib/ExportMap.js:361:25)
at resolveImport (~/node_modules/eslint-plugin-import/lib/ExportMap.js:415:25)
at Object.<anonymous> (~/node_modules/eslint-plugin-import/lib/ExportMap.js:422:14)
at processBodyStatement (~/node_modules/eslint-plugin-import/lib/rules/namespace.js:89:38)
at Array.forEach (<anonymous>)
the first line is
import React, { Fragment, FC, useState, ReactElement } from 'react'
so this is something else
eslintrc
{
"extends": [
"@trejgun/eslint-config/presets/tsx",
"@trejgun/eslint-config/rules/jest"
],
"parserOptions": {
"project": "./tsconfig.test.json"
},
"root": true,
"rules": {
"object-curly-spacing": [
"error",
"always"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}
tsconfig
{
"compilerOptions": {
"allowJs": true,
"alwaysStrict": true,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": false,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": false,
"target": "es2017",
"allowSyntheticDefaultImports": true
},
"exclude": ["node_modules", "build"],
"include": ["src"]
}
package.json
{
"react": "16.13.0",
"react-beautiful-dnd": "11.0.5",
"react-dom": "16.13.0",
"@trejgun/eslint-config": "0.0.7",
"@types/jest": "24.9.0",
"@types/react": "16.9.23",
"@types/react-dom": "16.0.11",
"@types/react-router-dom": "4.3.5",
"@typescript-eslint/eslint-plugin": "2.21.0",
"@typescript-eslint/parser": "2.21.0",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.0",
"eslint-config-standard": "14.1.0",
"eslint-import-resolver-ts": "0.4.2",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.0",
"eslint-plugin-mocha": "6.2.2",
"eslint-plugin-node": "11.0.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-react": "7.18.3",
"eslint-plugin-react-hooks": "2.4.0",
"eslint-plugin-standard": "4.0.1",
"firebase": "7.9.3",
"firebase-tools": "7.11.0",
"typescript": "3.8.2"
}
I personally think the problem comes from another. file
import * as firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/firestore'
import 'firebase/storage'
import config from './production.config'
if (!firebase.apps.length) {
firebase.initializeApp({
...config,
timestampsInSnapshots: true,
})
}
export default firebase
please gimme some directions i will try to debug
moduleDecl.body.body at that point is not an array
{
"type": "TSModuleBlock",
"body": [
{
"type": "TSInterfaceDeclaration",
"body": {
"type": "TSInterfaceBody",
"body": [
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "auth",
"range": [
47682,
47686
],
"loc": {
"start": {
"line": 1168,
"column": 4
},
"end": {
"line": 1168,
"column": 8
}
}
},
"params": [],
"range": [
47682,
47709
],
"loc": {
"start": {
"line": 1168,
"column": 4
},
"end": {
"line": 1168,
"column": 31
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1168,
"column": 10
},
"end": {
"line": 1168,
"column": 30
}
},
"range": [
47688,
47708
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
47690,
47698
],
"loc": {
"start": {
"line": 1168,
"column": 12
},
"end": {
"line": 1168,
"column": 20
}
}
},
"right": {
"type": "Identifier",
"name": "auth",
"range": [
47699,
47703
],
"loc": {
"start": {
"line": 1168,
"column": 21
},
"end": {
"line": 1168,
"column": 25
}
}
},
"range": [
47690,
47703
],
"loc": {
"start": {
"line": 1168,
"column": 12
},
"end": {
"line": 1168,
"column": 25
}
}
},
"right": {
"type": "Identifier",
"name": "Auth",
"range": [
47704,
47708
],
"loc": {
"start": {
"line": 1168,
"column": 26
},
"end": {
"line": 1168,
"column": 30
}
}
},
"range": [
47690,
47708
],
"loc": {
"start": {
"line": 1168,
"column": 12
},
"end": {
"line": 1168,
"column": 30
}
}
},
"range": [
47690,
47708
],
"loc": {
"start": {
"line": 1168,
"column": 12
},
"end": {
"line": 1168,
"column": 30
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "database",
"range": [
48008,
48016
],
"loc": {
"start": {
"line": 1180,
"column": 4
},
"end": {
"line": 1180,
"column": 12
}
}
},
"params": [
{
"type": "Identifier",
"name": "url",
"range": [
48017,
48029
],
"loc": {
"start": {
"line": 1180,
"column": 13
},
"end": {
"line": 1180,
"column": 25
}
},
"typeAnnotation": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1180,
"column": 17
},
"end": {
"line": 1180,
"column": 25
}
},
"range": [
48021,
48029
],
"typeAnnotation": {
"type": "TSStringKeyword",
"range": [
48023,
48029
],
"loc": {
"start": {
"line": 1180,
"column": 19
},
"end": {
"line": 1180,
"column": 25
}
}
}
},
"optional": true
}
],
"range": [
48008,
48059
],
"loc": {
"start": {
"line": 1180,
"column": 4
},
"end": {
"line": 1180,
"column": 55
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1180,
"column": 26
},
"end": {
"line": 1180,
"column": 54
}
},
"range": [
48030,
48058
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
48032,
48040
],
"loc": {
"start": {
"line": 1180,
"column": 28
},
"end": {
"line": 1180,
"column": 36
}
}
},
"right": {
"type": "Identifier",
"name": "database",
"range": [
48041,
48049
],
"loc": {
"start": {
"line": 1180,
"column": 37
},
"end": {
"line": 1180,
"column": 45
}
}
},
"range": [
48032,
48049
],
"loc": {
"start": {
"line": 1180,
"column": 28
},
"end": {
"line": 1180,
"column": 45
}
}
},
"right": {
"type": "Identifier",
"name": "Database",
"range": [
48050,
48058
],
"loc": {
"start": {
"line": 1180,
"column": 46
},
"end": {
"line": 1180,
"column": 54
}
}
},
"range": [
48032,
48058
],
"loc": {
"start": {
"line": 1180,
"column": 28
},
"end": {
"line": 1180,
"column": 54
}
}
},
"range": [
48032,
48058
],
"loc": {
"start": {
"line": 1180,
"column": 28
},
"end": {
"line": 1180,
"column": 54
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "delete",
"range": [
48440,
48446
],
"loc": {
"start": {
"line": 1196,
"column": 4
},
"end": {
"line": 1196,
"column": 10
}
}
},
"params": [],
"range": [
48440,
48463
],
"loc": {
"start": {
"line": 1196,
"column": 4
},
"end": {
"line": 1196,
"column": 27
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1196,
"column": 12
},
"end": {
"line": 1196,
"column": 26
}
},
"range": [
48448,
48462
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "Identifier",
"name": "Promise",
"range": [
48450,
48457
],
"loc": {
"start": {
"line": 1196,
"column": 14
},
"end": {
"line": 1196,
"column": 21
}
}
},
"typeParameters": {
"type": "TSTypeParameterInstantiation",
"range": [
48457,
48462
],
"params": [
{
"type": "TSAnyKeyword",
"range": [
48458,
48461
],
"loc": {
"start": {
"line": 1196,
"column": 22
},
"end": {
"line": 1196,
"column": 25
}
}
}
],
"loc": {
"start": {
"line": 1196,
"column": 21
},
"end": {
"line": 1196,
"column": 26
}
}
},
"range": [
48450,
48462
],
"loc": {
"start": {
"line": 1196,
"column": 14
},
"end": {
"line": 1196,
"column": 26
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "installations",
"range": [
48824,
48837
],
"loc": {
"start": {
"line": 1210,
"column": 4
},
"end": {
"line": 1210,
"column": 17
}
}
},
"params": [],
"range": [
48824,
48878
],
"loc": {
"start": {
"line": 1210,
"column": 4
},
"end": {
"line": 1210,
"column": 58
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1210,
"column": 19
},
"end": {
"line": 1210,
"column": 57
}
},
"range": [
48839,
48877
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
48841,
48849
],
"loc": {
"start": {
"line": 1210,
"column": 21
},
"end": {
"line": 1210,
"column": 29
}
}
},
"right": {
"type": "Identifier",
"name": "installations",
"range": [
48850,
48863
],
"loc": {
"start": {
"line": 1210,
"column": 30
},
"end": {
"line": 1210,
"column": 43
}
}
},
"range": [
48841,
48863
],
"loc": {
"start": {
"line": 1210,
"column": 21
},
"end": {
"line": 1210,
"column": 43
}
}
},
"right": {
"type": "Identifier",
"name": "Installations",
"range": [
48864,
48877
],
"loc": {
"start": {
"line": 1210,
"column": 44
},
"end": {
"line": 1210,
"column": 57
}
}
},
"range": [
48841,
48877
],
"loc": {
"start": {
"line": 1210,
"column": 21
},
"end": {
"line": 1210,
"column": 57
}
}
},
"range": [
48841,
48877
],
"loc": {
"start": {
"line": 1210,
"column": 21
},
"end": {
"line": 1210,
"column": 57
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "messaging",
"range": [
49207,
49216
],
"loc": {
"start": {
"line": 1224,
"column": 4
},
"end": {
"line": 1224,
"column": 13
}
}
},
"params": [],
"range": [
49207,
49249
],
"loc": {
"start": {
"line": 1224,
"column": 4
},
"end": {
"line": 1224,
"column": 46
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1224,
"column": 15
},
"end": {
"line": 1224,
"column": 45
}
},
"range": [
49218,
49248
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
49220,
49228
],
"loc": {
"start": {
"line": 1224,
"column": 17
},
"end": {
"line": 1224,
"column": 25
}
}
},
"right": {
"type": "Identifier",
"name": "messaging",
"range": [
49229,
49238
],
"loc": {
"start": {
"line": 1224,
"column": 26
},
"end": {
"line": 1224,
"column": 35
}
}
},
"range": [
49220,
49238
],
"loc": {
"start": {
"line": 1224,
"column": 17
},
"end": {
"line": 1224,
"column": 35
}
}
},
"right": {
"type": "Identifier",
"name": "Messaging",
"range": [
49239,
49248
],
"loc": {
"start": {
"line": 1224,
"column": 36
},
"end": {
"line": 1224,
"column": 45
}
}
},
"range": [
49220,
49248
],
"loc": {
"start": {
"line": 1224,
"column": 17
},
"end": {
"line": 1224,
"column": 45
}
}
},
"range": [
49220,
49248
],
"loc": {
"start": {
"line": 1224,
"column": 17
},
"end": {
"line": 1224,
"column": 45
}
}
}
}
},
{
"type": "TSPropertySignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "name",
"range": [
49817,
49821
],
"loc": {
"start": {
"line": 1244,
"column": 4
},
"end": {
"line": 1244,
"column": 8
}
}
},
"typeAnnotation": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1244,
"column": 8
},
"end": {
"line": 1244,
"column": 16
}
},
"range": [
49821,
49829
],
"typeAnnotation": {
"type": "TSStringKeyword",
"range": [
49823,
49829
],
"loc": {
"start": {
"line": 1244,
"column": 10
},
"end": {
"line": 1244,
"column": 16
}
}
}
},
"range": [
49817,
49830
],
"loc": {
"start": {
"line": 1244,
"column": 4
},
"end": {
"line": 1244,
"column": 17
}
}
},
{
"type": "TSPropertySignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "options",
"range": [
50207,
50214
],
"loc": {
"start": {
"line": 1256,
"column": 4
},
"end": {
"line": 1256,
"column": 11
}
}
},
"typeAnnotation": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1256,
"column": 11
},
"end": {
"line": 1256,
"column": 19
}
},
"range": [
50214,
50222
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "Identifier",
"name": "Object",
"range": [
50216,
50222
],
"loc": {
"start": {
"line": 1256,
"column": 13
},
"end": {
"line": 1256,
"column": 19
}
}
},
"range": [
50216,
50222
],
"loc": {
"start": {
"line": 1256,
"column": 13
},
"end": {
"line": 1256,
"column": 19
}
}
}
},
"range": [
50207,
50223
],
"loc": {
"start": {
"line": 1256,
"column": 4
},
"end": {
"line": 1256,
"column": 20
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "storage",
"range": [
50846,
50853
],
"loc": {
"start": {
"line": 1278,
"column": 4
},
"end": {
"line": 1278,
"column": 11
}
}
},
"params": [
{
"type": "Identifier",
"name": "url",
"range": [
50854,
50866
],
"loc": {
"start": {
"line": 1278,
"column": 12
},
"end": {
"line": 1278,
"column": 24
}
},
"typeAnnotation": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1278,
"column": 16
},
"end": {
"line": 1278,
"column": 24
}
},
"range": [
50858,
50866
],
"typeAnnotation": {
"type": "TSStringKeyword",
"range": [
50860,
50866
],
"loc": {
"start": {
"line": 1278,
"column": 18
},
"end": {
"line": 1278,
"column": 24
}
}
}
},
"optional": true
}
],
"range": [
50846,
50894
],
"loc": {
"start": {
"line": 1278,
"column": 4
},
"end": {
"line": 1278,
"column": 52
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1278,
"column": 25
},
"end": {
"line": 1278,
"column": 51
}
},
"range": [
50867,
50893
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
50869,
50877
],
"loc": {
"start": {
"line": 1278,
"column": 27
},
"end": {
"line": 1278,
"column": 35
}
}
},
"right": {
"type": "Identifier",
"name": "storage",
"range": [
50878,
50885
],
"loc": {
"start": {
"line": 1278,
"column": 36
},
"end": {
"line": 1278,
"column": 43
}
}
},
"range": [
50869,
50885
],
"loc": {
"start": {
"line": 1278,
"column": 27
},
"end": {
"line": 1278,
"column": 43
}
}
},
"right": {
"type": "Identifier",
"name": "Storage",
"range": [
50886,
50893
],
"loc": {
"start": {
"line": 1278,
"column": 44
},
"end": {
"line": 1278,
"column": 51
}
}
},
"range": [
50869,
50893
],
"loc": {
"start": {
"line": 1278,
"column": 27
},
"end": {
"line": 1278,
"column": 51
}
}
},
"range": [
50869,
50893
],
"loc": {
"start": {
"line": 1278,
"column": 27
},
"end": {
"line": 1278,
"column": 51
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "firestore",
"range": [
50899,
50908
],
"loc": {
"start": {
"line": 1279,
"column": 4
},
"end": {
"line": 1279,
"column": 13
}
}
},
"params": [],
"range": [
50899,
50941
],
"loc": {
"start": {
"line": 1279,
"column": 4
},
"end": {
"line": 1279,
"column": 46
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1279,
"column": 15
},
"end": {
"line": 1279,
"column": 45
}
},
"range": [
50910,
50940
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
50912,
50920
],
"loc": {
"start": {
"line": 1279,
"column": 17
},
"end": {
"line": 1279,
"column": 25
}
}
},
"right": {
"type": "Identifier",
"name": "firestore",
"range": [
50921,
50930
],
"loc": {
"start": {
"line": 1279,
"column": 26
},
"end": {
"line": 1279,
"column": 35
}
}
},
"range": [
50912,
50930
],
"loc": {
"start": {
"line": 1279,
"column": 17
},
"end": {
"line": 1279,
"column": 35
}
}
},
"right": {
"type": "Identifier",
"name": "Firestore",
"range": [
50931,
50940
],
"loc": {
"start": {
"line": 1279,
"column": 36
},
"end": {
"line": 1279,
"column": 45
}
}
},
"range": [
50912,
50940
],
"loc": {
"start": {
"line": 1279,
"column": 17
},
"end": {
"line": 1279,
"column": 45
}
}
},
"range": [
50912,
50940
],
"loc": {
"start": {
"line": 1279,
"column": 17
},
"end": {
"line": 1279,
"column": 45
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "functions",
"range": [
50946,
50955
],
"loc": {
"start": {
"line": 1280,
"column": 4
},
"end": {
"line": 1280,
"column": 13
}
}
},
"params": [
{
"type": "Identifier",
"name": "region",
"range": [
50956,
50971
],
"loc": {
"start": {
"line": 1280,
"column": 14
},
"end": {
"line": 1280,
"column": 29
}
},
"typeAnnotation": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1280,
"column": 21
},
"end": {
"line": 1280,
"column": 29
}
},
"range": [
50963,
50971
],
"typeAnnotation": {
"type": "TSStringKeyword",
"range": [
50965,
50971
],
"loc": {
"start": {
"line": 1280,
"column": 23
},
"end": {
"line": 1280,
"column": 29
}
}
}
},
"optional": true
}
],
"range": [
50946,
51003
],
"loc": {
"start": {
"line": 1280,
"column": 4
},
"end": {
"line": 1280,
"column": 61
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1280,
"column": 30
},
"end": {
"line": 1280,
"column": 60
}
},
"range": [
50972,
51002
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
50974,
50982
],
"loc": {
"start": {
"line": 1280,
"column": 32
},
"end": {
"line": 1280,
"column": 40
}
}
},
"right": {
"type": "Identifier",
"name": "functions",
"range": [
50983,
50992
],
"loc": {
"start": {
"line": 1280,
"column": 41
},
"end": {
"line": 1280,
"column": 50
}
}
},
"range": [
50974,
50992
],
"loc": {
"start": {
"line": 1280,
"column": 32
},
"end": {
"line": 1280,
"column": 50
}
}
},
"right": {
"type": "Identifier",
"name": "Functions",
"range": [
50993,
51002
],
"loc": {
"start": {
"line": 1280,
"column": 51
},
"end": {
"line": 1280,
"column": 60
}
}
},
"range": [
50974,
51002
],
"loc": {
"start": {
"line": 1280,
"column": 32
},
"end": {
"line": 1280,
"column": 60
}
}
},
"range": [
50974,
51002
],
"loc": {
"start": {
"line": 1280,
"column": 32
},
"end": {
"line": 1280,
"column": 60
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "performance",
"range": [
51396,
51407
],
"loc": {
"start": {
"line": 1294,
"column": 4
},
"end": {
"line": 1294,
"column": 15
}
}
},
"params": [],
"range": [
51396,
51444
],
"loc": {
"start": {
"line": 1294,
"column": 4
},
"end": {
"line": 1294,
"column": 52
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1294,
"column": 17
},
"end": {
"line": 1294,
"column": 51
}
},
"range": [
51409,
51443
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
51411,
51419
],
"loc": {
"start": {
"line": 1294,
"column": 19
},
"end": {
"line": 1294,
"column": 27
}
}
},
"right": {
"type": "Identifier",
"name": "performance",
"range": [
51420,
51431
],
"loc": {
"start": {
"line": 1294,
"column": 28
},
"end": {
"line": 1294,
"column": 39
}
}
},
"range": [
51411,
51431
],
"loc": {
"start": {
"line": 1294,
"column": 19
},
"end": {
"line": 1294,
"column": 39
}
}
},
"right": {
"type": "Identifier",
"name": "Performance",
"range": [
51432,
51443
],
"loc": {
"start": {
"line": 1294,
"column": 40
},
"end": {
"line": 1294,
"column": 51
}
}
},
"range": [
51411,
51443
],
"loc": {
"start": {
"line": 1294,
"column": 19
},
"end": {
"line": 1294,
"column": 51
}
}
},
"range": [
51411,
51443
],
"loc": {
"start": {
"line": 1294,
"column": 19
},
"end": {
"line": 1294,
"column": 51
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "remoteConfig",
"range": [
51752,
51764
],
"loc": {
"start": {
"line": 1307,
"column": 4
},
"end": {
"line": 1307,
"column": 16
}
}
},
"params": [],
"range": [
51752,
51803
],
"loc": {
"start": {
"line": 1307,
"column": 4
},
"end": {
"line": 1307,
"column": 55
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1307,
"column": 18
},
"end": {
"line": 1307,
"column": 54
}
},
"range": [
51766,
51802
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
51768,
51776
],
"loc": {
"start": {
"line": 1307,
"column": 20
},
"end": {
"line": 1307,
"column": 28
}
}
},
"right": {
"type": "Identifier",
"name": "remoteConfig",
"range": [
51777,
51789
],
"loc": {
"start": {
"line": 1307,
"column": 29
},
"end": {
"line": 1307,
"column": 41
}
}
},
"range": [
51768,
51789
],
"loc": {
"start": {
"line": 1307,
"column": 20
},
"end": {
"line": 1307,
"column": 41
}
}
},
"right": {
"type": "Identifier",
"name": "RemoteConfig",
"range": [
51790,
51802
],
"loc": {
"start": {
"line": 1307,
"column": 42
},
"end": {
"line": 1307,
"column": 54
}
}
},
"range": [
51768,
51802
],
"loc": {
"start": {
"line": 1307,
"column": 20
},
"end": {
"line": 1307,
"column": 54
}
}
},
"range": [
51768,
51802
],
"loc": {
"start": {
"line": 1307,
"column": 20
},
"end": {
"line": 1307,
"column": 54
}
}
}
}
},
{
"type": "TSMethodSignature",
"computed": false,
"key": {
"type": "Identifier",
"name": "analytics",
"range": [
52196,
52205
],
"loc": {
"start": {
"line": 1321,
"column": 4
},
"end": {
"line": 1321,
"column": 13
}
}
},
"params": [],
"range": [
52196,
52238
],
"loc": {
"start": {
"line": 1321,
"column": 4
},
"end": {
"line": 1321,
"column": 46
}
},
"returnType": {
"type": "TSTypeAnnotation",
"loc": {
"start": {
"line": 1321,
"column": 15
},
"end": {
"line": 1321,
"column": 45
}
},
"range": [
52207,
52237
],
"typeAnnotation": {
"type": "TSTypeReference",
"typeName": {
"type": "TSQualifiedName",
"left": {
"type": "TSQualifiedName",
"left": {
"type": "Identifier",
"name": "firebase",
"range": [
52209,
52217
],
"loc": {
"start": {
"line": 1321,
"column": 17
},
"end": {
"line": 1321,
"column": 25
}
}
},
"right": {
"type": "Identifier",
"name": "analytics",
"range": [
52218,
52227
],
"loc": {
"start": {
"line": 1321,
"column": 26
},
"end": {
"line": 1321,
"column": 35
}
}
},
"range": [
52209,
52227
],
"loc": {
"start": {
"line": 1321,
"column": 17
},
"end": {
"line": 1321,
"column": 35
}
}
},
"right": {
"type": "Identifier",
"name": "Analytics",
"range": [
52228,
52237
],
"loc": {
"start": {
"line": 1321,
"column": 36
},
"end": {
"line": 1321,
"column": 45
}
}
},
"range": [
52209,
52237
],
"loc": {
"start": {
"line": 1321,
"column": 17
},
"end": {
"line": 1321,
"column": 45
}
}
},
"range": [
52209,
52237
],
"loc": {
"start": {
"line": 1321,
"column": 17
},
"end": {
"line": 1321,
"column": 45
}
}
}
}
}
],
"range": [
47417,
52242
],
"loc": {
"start": {
"line": 1157,
"column": 16
},
"end": {
"line": 1322,
"column": 3
}
}
},
"id": {
"type": "Identifier",
"name": "App",
"range": [
47413,
47416
],
"loc": {
"start": {
"line": 1157,
"column": 12
},
"end": {
"line": 1157,
"column": 15
}
}
},
"range": [
47403,
52242
],
"loc": {
"start": {
"line": 1157,
"column": 2
},
"end": {
"line": 1322,
"column": 3
}
}
}
],
"range": [
47147,
52244
],
"loc": {
"start": {
"line": 1148,
"column": 31
},
"end": {
"line": 1323,
"column": 1
}
}
}
Looks like maybe the TS eslint parser isn't passing the kind of node we expect. a PR with failing test cases (or better, also a fix!) would be appreciated.
Hey! I have the same problem and it comes from eslint-plugin-import.
Firebase is using namespace inside another namespace.
declare namespace admin {
interface SomeInterface {
foo: string;
}
}
declare namespace admin.auth {
interface SomeOtherInterface {
bar: string;
}
}
This is converted by the parser as two TSModuleDeclaration, the first one with a TSModuleBlock and another one with another TSModuleDeclaration inside, which seems to be valid (see: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/src/ts-estree/ts-estree.ts#L1474).
But this plugin always assumes that a TSModuleDeclaration contains a TSModuleBlock and does not handle any recursive TSModuleDeclaration. (see: https://github.com/benmosher/eslint-plugin-import/blob/master/src/ExportMap.js#L554)
The workaround could be to disable ESLint on files importing this kind of modules like Firebase, and the fix would be to handle recursive TSModuleDeclaration.
@julien1619 thanks, a PR with the proper fix (and tests) would be most appreciated!
Done in #1763
@julien1619
thanks man!
guys, can we have this merged?
This should be fixed by #1763; after it's released, if it's still happening, I'll reopen this.
Most helpful comment
guys, can we have this merged?