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

CHORE: Format js file and check js code style #727

Merged
merged 1 commit into from
Dec 5, 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
11 changes: 11 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ jobs:
run: pip install mypy && mypy --install-types --non-interactive xinference
- name: codespell
run: pip install codespell && codespell xinference
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16
# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: cd xinference/web/ui && npm ci
- name: ESLint Check
run: cd xinference/web/ui && npx eslint .
- name: Prettier Check
run: cd xinference/web/ui && ./node_modules/.bin/prettier --check .

build_test_job:
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 5 additions & 0 deletions xinference/web/ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.github
node_modules
build
public
30 changes: 30 additions & 0 deletions xinference/web/ui/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
env:
browser: true
es2021: true
node: true
extends:
- 'eslint:recommended'
- 'plugin:react/recommended'
- 'prettier'
parserOptions:
parser: '@babel/eslint-parser'
requireConfigFile: false
ecmaFeatures:
jsx: true
ecmaVersion: 12
sourceType: module
plugins:
- react
- simple-import-sort
rules:
new-cap: 'error'
no-var: 'error'
simple-import-sort/imports: 'error'
simple-import-sort/exports: 'error'
quote-props: ['error', 'consistent']
'react/react-in-jsx-scope': 'off'
'react/prop-types': 'off'
'react/jsx-key': 'off'
settings:
react:
version: 'detect'
5 changes: 5 additions & 0 deletions xinference/web/ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.github
node_modules
build
public
9 changes: 9 additions & 0 deletions xinference/web/ui/.prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
trailingComma: 'es5'
tabWidth: 2
semi: false
singleQuote: true
printWidth: 80
bracketSpacing: true
bracketSameLine: false
arrowParens: 'always'
quoteProps: 'consistent'
Loading
Loading