Parse Error: Illegal import declaration. React Native project
See original GitHub issueTell us about your environment
- ESLint Version: v3.19.0
- Node Version: v7.9.0
- npm Version: 4.2.0 What parser (default, Babel-ESLint, etc.) are you using? babel-eslint Please show your full configuration:
"extends" : "airbnb",
"parser" : "babel-eslint",
"parserOptions" : {
"ecmaVersion" : 6,
"sourceType" : "module",
},
"ecmaFeatures" : {
"jsx": true,
"modules": true,
},
"env": {
"browser" : true,
"node" : true,
"jquery" : true,
},
"settings":{
"react":{
"pragma":"React",
"version":"15.1.0"
},
"ecmascript":6,
"jsx":true
},
"plugins": [
"react",
"react-native"
],
"rules": {
"strict": 0,
"quotes": 0,
"no-unused-vars": 1,
"camelcase": 1,
"no-underscore-dangle": 1,
"comma-dangle":[1,"never"],
"indent":["error",4],
"react/jsx-indent":0,
"react/jsx-equals-spacing": [2, "always"],
"no-console":0,
"max-len":1,
"no-param-reassign":1,
"key-spacing": [
2,
{
"align": "colon",
"beforeColon": true,
"afterColon": true
}
],
"no-multi-spaces": [
2,
{
"exceptions":{
"VariableDeclarator":true,
"ImportDeclaration":true,
"JSXAttribute":true,
"AssignmentExpression":true
}
}
]
}
}
What did you do? Please include the actual source code causing the issue.
import React, { Component } from 'react'
What did you expect to happen? I want to make no mistake
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Parse Error: Line 1: Illegal import declaration - Stack Overflow
I looked online and it appears that the import statement is not recognised unless I use Babel. However, from what I understand, with...
Read more >[Solved]-Parse Error: Line 1: Illegal import declaration-babel.js
Create React App uses both Webpack and Babel under the hood. As the current browsers don't support the import statement, you have to...
Read more >React.js JSX files import - Google Groups
I am using sbt-reactjs to compile JSX files used by react.js framework. ... error[Parse Error: Line 1: Illegal import declaration].
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >Top 6 Ways To Fix Illegal Start Of Expression Error In Java
Recheck the syntax as well. Always look for the root cause of the error and always recompile every time you fix a bug...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Working! https://medium.com/usevim/in-editor-linting-with-syntastic-6814122bdbec
@gHashTag Might be worth running
./node_modules/bin/eslint.js --print-config path/to/file.js
so that you can see if a different configuration file is interfering.