package
1.5.3
Repository: https://github.com/mazeyqian/go-gin-gee.git
Documentation: pkg.go.dev

# README

Using Scripts to Consolidate Designated Files/Folders and Execute Customized ESLint Commands

Background

Recently, I faced a large project where I only needed to modify a specific module. It was too cumbersome to manually input commands every time, so I thought about writing a script to assist in handling these tasks.

Solution

Customized one-click ESLint, download the executable file at:

https://github.com/mazeyqian/go-gin-gee/releases/tag/v1.4.0

Assets

Basic Usage

The following examples use MacOS as an example, please replace the corresponding files for other systems.

Example 1: Specify files file1.js and file2.js with the default configuration.

#!/bin/bash
./eslint-files-mac-darwin-amd64 -files="file1.js,file2.js"

Example 2: Specify folders src/views and src/components.

#!/bin/bash
./eslint-files-mac-darwin-amd64 -folders="/root/app/src/views,/root/app/src/components"

Specify folders using the root directory root:

#!/bin/bash
./eslint-files-mac-darwin-amd64 \
  -folders="src/views,src/components" \
  -root="/root/app/"

Example 3: Specify ESLint configuration file custom.eslintrc.js and command --fix.

#!/bin/bash
./eslint-files-mac-darwin-amd64 \
  -folders="/root/app/src/views" \
  -esConf="custom.eslintrc.js" \
  -esCom="--fix"

Complex Scenarios

  1. Specify ESLint configuration file custom.eslintrc.js;
  2. Specify accompanying command --fix;
  3. Specify files and folders;
  4. Specify file suffix;
  5. Add prefix and postfix execution commands.
#!/bin/bash
./eslint-files-mac-darwin-amd64 \
  -files="file1.js,file2.js" \
  -folders="src/views,src/components" \
  -root="/root/app/" \
  -esConf="custom.eslintrc.js" \
  -esCom="--fix" \
  -ext=".js,.ts,.jsx,.vue,.tsx" \
  -befCom="echo 'Starting format';" \
  -aftCom="echo 'Format completed';"

Parameter Description

ParameterDescriptionDefaultExampleRequired
filesSpecify files, multiple files are separated by ,.-file1.js,file2.jsOptional
foldersSpecify folders, multiple folders are separated by ,.-src/views,src/componentsOptional
esConfSpecify ESLint configuration file.-custom.eslintrc.jsOptional
esComSpecify accompanying command.---fixOptional
rootSpecify root directory, used with folders.-/root/app/Optional
extSpecify file suffix..js.js,.ts,.jsx,.vueOptional
befComSpecify prefix execution command.-echo 'Starting format';Optional
aftComSpecify postfix execution command.-echo 'Format completed';Optional
filesRangSpecify the range of files, count the processed and unprocessed files.-/root/app/Optional