Skip to content

Commit

Permalink
Update to ESLint (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Aug 25, 2018
1 parent f5e2a15 commit 9a90ac3
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 65 deletions.
3 changes: 1 addition & 2 deletions packages/generator-feathers-plugin/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ module.exports = generators.Base.extend({
'babel-cli@^6.0.0',
'babel-preset-es2015@^6.0.0',
'babel-plugin-add-module-exports',
'jshint@^2.0.0',
'eslint@^3.7.0',
'mocha@^2.0.0',
'chai@^3.5.0',
'feathers@^2.0.0',
'feathers-hooks@^1.5.0',
'feathers-rest@^1.2.2',
'body-parser@^1.9.0',
'nsp@^2.2.0',
'rimraf@^2.5.0'
], { saveDev: true});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-feathers-plugin/app/templates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Feathers
Copyright (c) 2016 Feathers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions packages/generator-feathers-plugin/app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"changelog": "github_changelog_generator && git add CHANGELOG.md && git commit -am \"Updating changelog\"",
"compile": "rimraf lib/ && babel -d lib/ src/",
"watch": "babel --watch -d lib/ src/",
"jshint": "jshint src/. test/. --config",
"lint": "eslint src/. test/.",
"mocha": "mocha --recursive test/ --compilers js:babel-core/register",
"test": "npm run compile && npm run jshint && npm run mocha",
"test": "npm run compile && npm run lint && npm run mocha",
"start": "npm run compile && node example/app"
},
"directories": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
30 changes: 0 additions & 30 deletions packages/generator-feathers-plugin/app/templates/static/.jshintrc

This file was deleted.

59 changes: 29 additions & 30 deletions packages/generator-feathers-plugin/test/test-creation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@ var fs = require('fs');
var exec = require('child_process').exec;
var helpers = require('yeoman-test');

describe('feathers-plugin generator', function () {
it('created a plugin with passing tests', function (done) {
var tmpDir;
describe('feathers-plugin generator', function() {
it('created a plugin with passing tests', function(done) {
var tmpDir;

helpers.run(path.join(__dirname, '../app'))
.inTmpDir(function (dir) {
tmpDir = dir;
})
.withOptions({
skipInstall: false
})
.withPrompts({
name: 'feathers-tmp',
repository: 'feathersjs/feathers-tmp',
description: 'Plugin description here'
})
.on('end', function () {
assert.ok(fs.existsSync(path.join(tmpDir, '.jshintrc')));
assert.ok(fs.existsSync(path.join(tmpDir, '.npmignore')));
assert.ok(fs.existsSync(path.join(tmpDir, '.travis.yml')));
assert.ok(fs.existsSync(path.join(tmpDir, '.editorconfig')));
assert.ok(fs.existsSync(path.join(tmpDir, '.babelrc')));
helpers.run(path.join(__dirname, '../app'))
.inTmpDir(function(dir) {
tmpDir = dir;
})
.withOptions({
skipInstall: false
})
.withPrompts({
name: 'feathers-tmp',
repository: 'feathersjs/feathers-tmp',
description: 'Plugin description here'
})
.on('end', function() {
assert.ok(fs.existsSync(path.join(tmpDir, '.npmignore')));
assert.ok(fs.existsSync(path.join(tmpDir, '.travis.yml')));
assert.ok(fs.existsSync(path.join(tmpDir, '.editorconfig')));
assert.ok(fs.existsSync(path.join(tmpDir, '.babelrc')));

var child = exec('npm test', {
cwd: tmpDir
});
var child = exec('npm test', {
cwd: tmpDir
});

child.on('exit', function (status) {
assert.equal(status, 0, 'Got correct exist status');
done();
});
});
});
child.on('exit', function(status) {
assert.equal(status, 0, 'Got correct exist status');
done();
});
});
});
});

0 comments on commit 9a90ac3

Please sign in to comment.