Skip to content
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

Update README.md for lint rules and add predefined eslint script #63

Merged
merged 4 commits into from
Dec 13, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ npm run fetch-datasets
env KUZU_PATH=path/to/database npm run serve
```

### Check code style with ESLint

```
npm run eslint
```
Include `-fix` for automatic correction of fixable styles.
```
npm run eslint-fix
```

## Build and serve for production

### Run production server locally
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down