JavaScript ES6 for NPP 64-bit.



  • 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.



  • 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.



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



  • @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”?



  • @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.


Log in to reply