这是indexloc提供的服务,不要输入任何密码
Skip to content

Update ESLint and Super-Linter settings #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2024
Merged
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
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
env:
jest: true
node: true
googleappsscript/googleappsscript: true

###############
# Parser vars #
Expand All @@ -29,6 +30,7 @@ extends:
- 'plugin:@typescript-eslint/recommended'
plugins:
- '@typescript-eslint'
- 'googleappsscript'
#########
# Rules #
#########
Expand Down
74 changes: 32 additions & 42 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,48 @@
---
###########################
###########################
## Linter GitHub Actions ##
###########################
###########################
name: Lint Code Base

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
on: # yamllint disable-line rule:truthy
push: null
pull_request: null

#############################
# Start the job on all push #
#############################
on:
push:
# branches-ignore: [main]
# Remove the line above to run when pushing to main
pull_request:
branches: [main]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
name: Lint
runs-on: ubuntu-latest

##################
# Load all steps #
##################
permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
- name: Checkout code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
# super-linter needs the full git history to get the
# list of files that changed across commits
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter/slim@v5 # uses: github/super-linter@v4 See https://github.com/github/super-linter#images
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Super-linter
uses: super-linter/super-linter/slim@v5 # x-release-please-version
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.yml
LINTER_RULES_PATH: /
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_ES: true
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.yml
DEFAULT_BRANCH: main
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-googleappsscript": "^1.0.5",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.4",
Expand Down