0

I'm having trouble getting my eslint atom package to work with jsx. My eslint package references a global .eslintrc in my home directory. Following the eslint docs I have my .eslintrc file set up as follows:

{
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "extends": [
  "eslint:recommended",
  "plugin:react/recommended"
  ],
  "rules": {
    "semi": 2,
    "strict": 0
  }
}

My package.json dependencies:

"devDependencies": {
"babel-core": "^6.2.1",
"babel-eslint": "^8.2.6",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.10.0",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
  "babel-preset-stage-1": "^6.1.18",
  "lodash": "^3.10.1",
  "react": "16.3.2",
  "react-dom": "16.3.2",
  "react-redux": "5.0.7",
  "redux": "4.0.0",
  "youtube-api-search": "0.0.5"
}

I have installed the babel parser and eslint-plugin-react but am still not able to read the jsx. I'd really appreciate any help with this, thanks in advance.

1 Answers1

0

What you mean by saying cant read jsx? If i get you right, i assume Atom is not showing any Error? If so, it would be great to show us the list of installed Atom packages. I guess you missed to include some packages e.g language-javascript-jsx

Max Günther
  • 27
  • 1
  • 2
  • 7
  • Hi Max, sorry to be unclear. The problem is that the eslinter shows an 'unexpected token' error in atom when I use jsx tags ie '<'. Here is a list of my packages: ├── Sublime-Style-Column-Selection@1.7.4 ├── atom-ternjs@0.18.3 ├── busy-signal@1.4.3 ├── file-icons@2.1.22 ├── intentions@1.1.5 ├── language-babel@2.85.0 ├── linter@2.2.0 ├── linter-erb@1.1.1 ├── linter-eslint@8.4.1 ├── linter-htmlhint@1.4.0 ├── linter-js-yaml@1.3.0 ├── linter-ruby@1.2.6 ├── linter-ui-default@1.7.1 ├── mac-classic@0.5.0 ├── open-in-browser@0.5.2 ├── pigments@0.40.2 └── ruby-block@0.3.6 – MikejdeGroot Jul 17 '18 at 13:44