Использование eslint v5.16.0
Я пытаюсь использовать адаптированный сторонний плагин, чтобы позволить мне шаблонизировать javascript, используя язык шаблонов django.
Чтобы воспроизвести мою ситуацию, вы можете сделать следующее (это по сути клонируетrepo [который я изменяю], затем связывает его в npm, показывает изменения, сделанные в настройках eslint config и vscode):
cd ~/projects
git clone https://github.com/alexkuz/eslint-plugin-jinja
cd eslint-plugin-jinja
sudo npm link
cd ~/projects/myproj
npm link eslint-plugin-jinja
npm ls -g --depth=0 --link=true
/usr/local/lib
├── babel-core@6.26.3
├── clever-tools@1.4.2
├── UNMET PEER DEPENDENCY eslint@5.16.0
├── eslint-config-standard@13.0.1
├── eslint-plugin-import@2.18.1
├── eslint-plugin-jinja@0.1.0 -> /opt/stuff/projects/eslint-plugin-jinja
nano ~/projects/myproj/.vscode/settings.json
...
"eslint.autoFixOnSave": true,
"eslint.enable": true,
"eslint.options": {
"configFile": "/opt/digglerz/projects/kapsule/.eslintrc.json",
"useEslintrc": true
},
"eslint.run": "onSave",
"eslint.validate": [
"javascript",
"html"
],
...
nano ~/projects/myproj/.eslintrc.json
...
"plugins": [
"jinja"
]
...
eslint --debug ~/projects/myproj/some-js.js
eslint:cli-engine Processing /opt/digglerz/projects/kapsule/kapsule/static/kapsule/js/preview/simple/simple-preview.js +0ms
eslint:cli-engine Linting /opt/digglerz/projects/kapsule/kapsule/static/kapsule/js/preview/simple/simple-preview.js +1ms
eslint:config Constructing config file hierarchy for /opt/digglerz/projects/kapsule/kapsule/static/kapsule/js/preview/simple +0ms
eslint:config Using .eslintrc and package.json files +0ms
eslint:config Loading /opt/digglerz/projects/kapsule/.eslintrc.json +2ms
eslint:config-file Loading JSON config file: /opt/digglerz/projects/kapsule/.eslintrc.json +0ms
eslint:plugins Failed to load plugin eslint-plugin-jinja. +0ms
Oops! Something went wrong! :(
ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-jinja". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jinja is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm i eslint-plugin-jinja@latest --save-dev
Path to ESLint package: /usr/local/lib/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
Мне кажется, что я правильно настроил ссылку, настройку eslint и .vscode / settings.json, почему я вижу эту ошибку?