Skip to content

v1.4.0

Latest
Compare
Choose a tag to compare
@mazeyqian mazeyqian released this 31 Oct 12:02
· 15 commits to main since this release

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"

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

Parameter Description Default Example Required
files Specify files, multiple files are separated by ,. - file1.js,file2.js Optional
folders Specify folders, multiple folders are separated by ,. - src/views,src/components Optional
esConf Specify ESLint configuration file. - custom.eslintrc.js Optional
esCom Specify accompanying command. - --fix Optional
root Specify root directory, used with folders. - /root/app/ Optional
ext Specify file suffix. .js .js,.ts,.jsx,.vue Optional
befCom Specify prefix execution command. - echo 'Starting format'; Optional
aftCom Specify postfix execution command. - echo 'Format completed'; Optional
filesRang Specify the range of files, count the processed and unprocessed files. - /root/app/ Optional