Skip to content
This repository was archived by the owner on Sep 13, 2021. It is now read-only.

Mint lint command#69

Open
nicofraisse wants to merge 7 commits intoFolkwise-io:masterfrom
nicofraisse:mint-lint-command
Open

Mint lint command#69
nicofraisse wants to merge 7 commits intoFolkwise-io:masterfrom
nicofraisse:mint-lint-command

Conversation

@nicofraisse
Copy link
Copy Markdown
Contributor

@nicofraisse nicofraisse commented Oct 21, 2020

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

See issue #60

This PR Adds the mint lint (alias mint l) command to the list of mint commands. It lints the code of the project using eslint behind the scenes. Each template now has a specific.eslintrc. For example, vanilla-js' eslint config file is set to check for semi columns, while react's eslint config file activates jsx as acceptable syntax.

Added to documentation?

  • readme
  • no documentation needed

Note

I made this PR to showcase this new functionality; feel free to let me know if anything should be improved and/or if there are better ways to approach this.

@nicofraisse nicofraisse requested a review from a team as a code owner October 21, 2020 16:33
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

Copy link
Copy Markdown
Contributor

@KmBarnett KmBarnett left a comment

Choose a reason for hiding this comment

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

I have left a few comments otherwise good just make sure there isn't any standard .eslintrc for each type of project

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants