mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
6e81ee9d97
Fixes merge conflict in: - .eslintrc.json due to 6167eda6b6e5566469ed88b8850aa04e427bd245 - lint.yml due to 5674f8e6758f4628c78389b4380ecbe233045146
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
push: {}
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- ready_for_review
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [16.x]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
cache: yarn
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Install Yarn
|
|
run: npm i yarn --global
|
|
|
|
- name: Install Packages
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
env:
|
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
|
|
|
- name: Run Linting
|
|
run: yarn lint
|
|
|
|
- name: Verify Docs
|
|
run: yarn docs:verify
|
|
|
|
- name: Check no `console.log()` in .jison files
|
|
# ESLint can't parse .jison files directly
|
|
# In the future, it might be worth making a `eslint-plugin-jison`, so
|
|
# that this will be built into the `yarn lint` command.
|
|
run: |
|
|
shopt -s globstar
|
|
mkdir -p tmp/
|
|
for jison_file in src/**/*.jison; do
|
|
outfile="tmp/$(basename -- "$jison_file" .jison)-jison.js"
|
|
echo "Converting $jison_file to $outfile"
|
|
# default module-type (CJS) always adds a console.log()
|
|
yarn jison "$jison_file" --outfile "$outfile" --module-type "amd"
|
|
done
|
|
yarn eslint --no-eslintrc --rule no-console:error --parser "@babel/eslint-parser" "./tmp/*-jison.js"
|