From f5dc55da0a0c769765fd2d385e014d50b97dbfec Mon Sep 17 00:00:00 2001 From: Ashley Huo Date: Tue, 12 Dec 2023 12:27:36 -0500 Subject: [PATCH] predefine eslint cmd --- .github/workflows/lint.yml | 4 ++-- package.json | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a2efcf6..b687130 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,11 +32,11 @@ jobs: - name: Run linters without auto-fix (on master) if: github.ref == 'refs/heads/master' - run: ./node_modules/.bin/eslint --ext .js,.vue src + run: npm run eslint - name: Run linters with auto-fix (on non-master branches) if: github.ref != 'refs/heads/master' - run: ./node_modules/.bin/eslint --ext .js,.vue src --fix + run: npm run eslint-fix - name: Commit changes uses: EndBug/add-and-commit@v9 diff --git a/package.json b/package.json index ee29ae8..a3bcba1 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,9 @@ "fetch-datasets": "node src/server/utils/FetchDatasets.js", "generate-grammar-prod": "rm -rf src/utils/CypherParser/ && cp node_modules/kuzu/kuzu-source/src/antlr4/Cypher.g4 ./ && npx antlr4ng-cli -o src/utils/CypherParser -Dlanguage=TypeScript -no-visitor -no-listener Cypher.g4 && rm Cypher.g4 && cd src/utils/CypherParser && mv CypherParser.ts CypherParserOld.ts && grep -v \"notify\" CypherParserOld.ts > CypherParser.ts && rm CypherParserOld.ts", "generate-grammar": "rm -rf src/utils/CypherParser/ && cp kuzu/src/antlr4/Cypher.g4 ./ && npx antlr4ng-cli -o src/utils/CypherParser -Dlanguage=TypeScript -no-visitor -no-listener Cypher.g4 && rm Cypher.g4 && cd src/utils/CypherParser && mv CypherParser.ts CypherParserOld.ts && grep -v \"notify\" CypherParserOld.ts > CypherParser.ts && rm CypherParserOld.ts", - "clean": "rm -rf node_modules dist datasets src/utils/CypherParser && git submodule deinit --all" + "clean": "rm -rf node_modules dist datasets src/utils/CypherParser && git submodule deinit --all", + "eslint": "eslint --ext .js,.vue src", + "eslint-fix": "eslint --ext .js,.vue src --fix" }, "dependencies": { "@antv/g6": "^4.8.22",