Giter VIP home page Giter VIP logo

Comments (4)

egamma avatar egamma commented on August 16, 2024

VSCode only supports JSX syntax on files with .jsx extension,

Not anymore ::-): if you enable Salsa, please see the release notes https://code.visualstudio.com/Updates#_javascript-salsa-preview

You can still use eslint for linting. The vscode-eslint extension supports linting of .jsx files. You need to do is to enable the rule in the .eslintrc

{
    "ecmaFeatures": {
        "jsx": true,
        ...
    }
    ...
}

from vscode-eslint.

everystone avatar everystone commented on August 16, 2024

Here is my .eslintrc

{
  "extends": "airbnb",

  "rules": {
    "prefer-template": 0
  },
  "plugins": ["react"],

  "ecmaFeatures": {
    "jsx": true
  }
}

I still don't get any linting on jsx files, and the documentation for the js-is-jsx extension states that

Notice when you install this extension you will
loose all the existing language support provided for .js 

Which is not really what I am after, I guess it's not possible at the moment

from vscode-eslint.

egamma avatar egamma commented on August 16, 2024

Notice when you install this extension you will loose all the existing language support provided for .js

This is no longer the case when you enable Salsa. Salsa understands jsx constructs in the .js files as described in the release notes (not sure how I can make this more clear than it is written now). When you enable Salsa all the js-is-jsx extension does is to enable the jsx coloring for js files. I will update the description of js-is-jsx. Thanks for pointing this out.

I will verify the eslint later, but in the implementation of vscode-eslint the javascriptReact language mode is enabled.

from vscode-eslint.

everystone avatar everystone commented on August 16, 2024

Ah I see, thank you for explaining. I will try out Salsa.

from vscode-eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.