Closed pmcelhaney closed 7 years ago
It's listed as a devDependency: https://github.com/eslint/generator-eslint/blob/master/package.json#L38
Did you have problems running npm test
?
Weird. I'm not getting that when I install from Yeoman.
~/code/temp-yo-test
$ yo eslint:plugin
? What is your name? pm
? What is the plugin ID? issue-32
? Type a short description of this plugin: testing issue 32
? Does this plugin contain custom ESLint rules? Yes
? Does this plugin contain one or more processors? No
create lib/index.js
create package.json
create README.md
~/code/temp-yo-test
$ cat package.json
{
"name": "eslint-plugin-issue-32",
"version": "0.0.0",
"description": "testing issue 32",
"keywords": [
"eslint",
"eslintplugin",
"eslint-plugin"
],
"author": "pm",
"main": "lib/index.js",
"scripts": {
"test": "mocha"
},
"dependencies": {
"requireindex": "~1.1.0"
},
"devDependencies": {
"eslint": "~1.2.0"
},
"engines": {
"node": ">=0.10.0"
},
"license": "ISC"
}
Oh. You pointed to the package.json of this repo. It actually needs to be added to the template.
https://github.com/eslint/generator-eslint/blob/master/plugin/templates/_package.json#L19
Yeah, sorry, I thought you were talking about this package, not the generated output. You are right we should add mocha as a devDependency. But since it is run from npm test
I don't think there will be a problem referencing the mocha
command directly.
I wasn't able to get the tests to run until I installed mocha-cli globally and mocha locally.
Maybe I'm missing something, but shouldn't mocha be included as a dev dependency? And can we avoid depending on the presence of the mocha command by referencing
./node_modules/mocha/bin/mocha
directly?