Skip to content
This repository was archived by the owner on Sep 13, 2021. It is now read-only.
Open
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If it is your first time using `mintbean-cli`, first connect to GitHub with conf
```shell
mint new <my-project>
cd <my-project>
mint repo
mint repo
mint deploy
```

Expand Down Expand Up @@ -78,6 +78,12 @@ View your config settings anytime with `mint config -v`.

Starts a local development server to display your code's output (look for `localhost` link). Changes to your code automatically updates when you save.

### Check for styling errors (linting)

`mint mint` or `mint l`

Lints the project files to flag any programming errors, bugs, or stylistic errors in your JavaScript code.

### Deployment

If you haven't yet, create a remote repo: `mint repo -cp`
Expand Down
18 changes: 18 additions & 0 deletions commands/lint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import chalk from 'chalk';
import cp from 'child_process';

export const lint = (lintSources = 'src/') => {
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.

Is there a reason to allow a user to input his own lint sources

const path = __dirname + '/../node_modules/eslint/bin/eslint.js';

const eslint = cp.spawn(path, [lintSources], {
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.

Can you add some inline above line 7? cp.spawn isn't very clear to those who haven't used it, makes it more accessible to new contributors.

stdio: ['inherit', 'inherit', 'pipe']
});

eslint.on('error', (error) => {
if (error.errno === -2) {
console.log(chalk.red(`error: ${error.message}`));
}
});
};


6,050 changes: 0 additions & 6,050 deletions package-lock.json

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"configstore": "5.0.1",
"dotpref": "1.0.0",
"ejs": "3.1.3",
"eslint": "^7.11.0",
"esm": "3.2.25",
"execa": "4.0.3",
"figlet": "1.4.0",
Expand Down
10 changes: 10 additions & 0 deletions program.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Command } from "commander";

import { lint } from "./commands/lint";
import { config } from "./commands/config";
import { newProject } from "./commands/new";
import { repo } from "./commands/repo";
Expand All @@ -18,6 +20,14 @@ export const createProgram = (args) => {
newProject(project);
});

program
.command("lint [lintSources]")
.alias("l")
.description("Lint the code of the project")
.action(function (lintSources) {
lint(lintSources);
});

program
.command("deploy")
.alias("d")
Expand Down
13 changes: 13 additions & 0 deletions templates/phaser/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"semi": "error"
},
}
15 changes: 15 additions & 0 deletions templates/react/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
},
}
13 changes: 13 additions & 0 deletions templates/svelte/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"semi": "error"
},
}
13 changes: 13 additions & 0 deletions templates/vanilla-js/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"semi": "error"
},
}
12 changes: 12 additions & 0 deletions templates/vue/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"browser": true,
"es2021": true
},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
},
}