Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
module.exports = {
"root": true,
"plugins": ["node", "prettier"],
"extends": ["eslint:recommended", "plugin:node/recommended"],
"env": {
"node": true,
"es6": true,
"jest": true
},
"parserOptions": { "ecmaVersion": 2017 },
"rules": {
"quote-props": ["error", "as-needed"],
"no-dupe-keys": "error",
"quotes": ["error", "double"],
"no-undef": "error",
"no-extra-semi": "error",
"semi": "error",
"no-template-curly-in-string": "error",
"no-caller": "error",
"yoda": "error",
"eqeqeq": "error",
"global-require": "off",
"brace-style": "error",
"key-spacing": "error",
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"indent": ["error", "tab", { "SwitchCase": 1 }],
"no-extra-bind": "warn",
"no-empty": "off",
"no-multiple-empty-lines": "error",
"no-multi-spaces": "error",
"no-process-exit": "off",
"no-trailing-spaces": "error",
"no-use-before-define": "off",
"no-unused-vars": ["error", { "args": "none" }],
"no-unsafe-negation": "error",
"no-loop-func": "warn",
"space-before-function-paren": ["error", "never"],
"space-before-blocks": "error",
"object-curly-spacing": ["error", "always"],
"keyword-spacing": ["error", {
"after": true,
"overrides": {
"const": { "after": true },
"try": { "after": true },
"catch": { "after": true },
"if": { "after": true },
"else": { "after": true },
"throw": { "after": true },
"case": { "after": true },
"return": { "after": true },
"finally": { "after": true },
"do": { "after": true }
}
}],
"no-console": "off",
"valid-jsdoc": "error",
"node/no-unsupported-features": ["error", { "version": 4 }],
"node/no-deprecated-api": "error",
"node/no-missing-import": "error",
"node/no-missing-require": [
"error",
{
"allowModules": [
"webpack"
]
}
],
"node/no-unpublished-bin": "error",
"node/no-unpublished-require": "error",
"eol-last": ["error", "always"],
"newline-per-chained-call": "off",
"node/process-exit-as-throw": "error",
"prettier/prettier": ["error", {
"useTabs": true,
"bracketSpacing": false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for not including it? I believe it's much more readable with spaces.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me double check, I was getting crazy errors of compatibility between eslint and prettify, did some tests, this might have squeezed in.

}]
}
};
55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

25 changes: 0 additions & 25 deletions .jsbeautifyrc

This file was deleted.

12 changes: 7 additions & 5 deletions __mocks__/creator/validate-options.mock.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const fs = require('fs');
const path = require('path');
"use strict";

const fs = require("fs");
const path = require("path");

function getPath(part) {
return path.join(process.cwd(), part);
}

function validateOptions(opts) {
return Object.keys(opts).forEach( (location) => {
return Object.keys(opts).forEach((location) => {
let part = getPath(opts[location]);
try {
fs.readFileSync(part);
} catch (err) {
throw new Error('Did not find the file');
} catch(err) {
throw new Error("Did not find the file");
}
});
}
Expand Down
18 changes: 10 additions & 8 deletions __mocks__/inquirer/resolve.mock.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
'use strict';
const path = require('path');
"use strict";

const path = require("path");

function mockPromise(value) {
return (value || {}).then ? value : {
then: function (callback) {
then: function(callback) {
return mockPromise(callback(value));
}
};
}

function spawnChild(pkg) {
return pkg;
}

function getLoc(option) {
let packageModule = [];
option.filter( (pkg) => {
mockPromise(spawnChild(pkg)).then( () => {
option.filter((pkg) => {
mockPromise(spawnChild(pkg)).then(() => {
try {
let loc = path.join('..', '..', 'node_modules', pkg);
let loc = path.join("..", "..", "node_modules", pkg);
packageModule.push(loc);
} catch(err) {
throw new Error('Package wasn\'t validated correctly..' +
'Submit an issue for', pkg, 'if this persists');
throw new Error("Package wasn't validated correctly.." +
"Submit an issue for", pkg, "if this persists");
}
});
return packageModule;
Expand Down
5 changes: 5 additions & 0 deletions bin/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"node/no-missing-require": 0
}
}
Loading