Community
    • Login

    JavaScript ES6 for NPP 64-bit.

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    10 Posts 4 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H.R. 30H
      H.R. 30
      last edited by

      I found notes about JSLint to extend NotePad++ for using Javascript with ECMAScript 6 (ES6), but it’s a 32-bit plugin, hence not suitable for NotePad++ 64-bit 7.8.9. Is JSLintNPP or something similar available as 64-bit Version? Or is it possible to load 32-bit extensions into NPP.

      It seems that NPP doesn’t yet include ES6, as arrow functions, default function parameters and perhaps other ES6 extensions aren’t supported there. I mean the last version of JSLintNPP 0.8.3 is from 2015.

      1 Reply Last reply Reply Quote 0
      • webketjeW
        webketje
        last edited by webketje

        This setup is quite easy to do and will work with any version of NPP/ ESlint (it does require NodeJS):

        1. Install eslint with npm (npm i -g eslint or npm i --save-dev eslint)
        2. Make sure you have a valid .eslintrc in the project directory
        3. In Notepad++, open the run Dialog and save 1 of these commands:
          1. ESlint current file cmd /k eslint --fix-dry-run $(FULL_CURRENT_PATH)
          2. ESlint project cmd /k eslint --fix-dry-run $(CURRENT_DIRECTORY) (this will only work if NPP is opened on a file in the project root, or if “Follow current document” is not checked in NPP Preferences > Default directory.

        This will open a terminal with the results of the ESlint check.
        If you’d like ESLint to fix the problems too instead of reporting them only, substitute --fix-dry-run with --fix in the commands above.

        H.R. 30H 1 Reply Last reply Reply Quote 3
        • chcgC
          chcg
          last edited by

          https://github.com/deadem/notepad-pp-linter available also from PluginAdmin might be of interest.

          H.R. 30H 1 Reply Last reply Reply Quote 3
          • H.R. 30H
            H.R. 30 @chcg
            last edited by

            @chcg It doesn’t work and I don’t know why. I replaced “deadem” with my user designation in the config file. It seems that the cmd-files (eslint.cmd …) as listed in the config shall be in the folders listed there, but (of course) there is none.
            From where shall I get them? What is the content of this files?
            What shall I put in for replacement of “Path with spaces\somelint.cmd”?

            1 Reply Last reply Reply Quote 0
            • H.R. 30H
              H.R. 30 @webketje
              last edited by

              @webketje Sorry, it doesn’t work. I installed with npm i --save-dev eslint.
              What is the .eslintrc? I suppose it’s a file, but it’s not installed with eslint. Where shall I get this and what shall be its content?
              Starting cmd /k eslint --fix-dry-run $(FULL_CURRENT_PATH) from the project directory, where the file is located, does’nt find eslint.

              1 Reply Last reply Reply Quote 0
              • H.R. 30H
                H.R. 30
                last edited by

                Half solutions shown here. NPP stays unable to work with ES6/ECMA2015.

                EkopalypseE 1 Reply Last reply Reply Quote 0
                • EkopalypseE
                  Ekopalypse @H.R. 30
                  last edited by

                  @H-R-30
                  and which other half is missing?

                  H.R. 30H 1 Reply Last reply Reply Quote 0
                  • H.R. 30H
                    H.R. 30 @Ekopalypse
                    last edited by

                    @Ekopalypse The other half which make ES6 work withNPP

                    EkopalypseE 1 Reply Last reply Reply Quote 0
                    • EkopalypseE
                      Ekopalypse @H.R. 30
                      last edited by

                      @H-R-30

                      I see - thanks for letting me know.

                      1 Reply Last reply Reply Quote 0
                      • webketjeW
                        webketje
                        last edited by

                        @H-R-30 Sorry I forgot to follow up on this topic, but the conclusion is incorrect. I’ve used the solution I proposed extensively, it is tested and working and certainly not half. .eslintrc is the ESlint configuration file, which a Google Search would have given you as a first result. Here is an example. Naturally, if you don’t define any options, eslint won’t know what to look for.

                        If eslint is not recognized, it means you haven’t told Windows to look in node_modules\.bin to find executables. So change the command to cmd /k node_modules\.bin\eslint --fix-dry-run $(FULL_CURRENT_PATH). Or edit the Windows PATH variable and add node_modules\.bin\eslint to it if it is not there. For globally installed npm executables add %AppData%\npm\node_modules\.bin too. Restart Notepad++ to be sure the changes are in effect.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors