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):
- Install eslint with npm (
npm i -g eslint
ornpm i --save-dev eslint
) - Make sure you have a valid
.eslintrc
in the project directory - In Notepad++, open the run Dialog and save 1 of these commands:
- ESlint current file
cmd /k eslint --fix-dry-run $(FULL_CURRENT_PATH)
- 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.
- ESlint current file
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.
- Install eslint with npm (
-
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?
Startingcmd /k eslint --fix-dry-run $(FULL_CURRENT_PATH)
from the project directory, where the file is located, does’nt find eslint.
-
Half solutions shown here. NPP stays unable to work with ES6/ECMA2015.
-
@H-R-30
and which other half is missing?
-
@Ekopalypse The other half which make ES6 work withNPP
-
I see - thanks for letting me know.