Skip to content

Commit 5c07370

Browse files
committed
javascript linter
Signed-off-by: BluThaitanium <[email protected]>
1 parent 0f83c55 commit 5c07370

File tree

4 files changed

+8341
-2171
lines changed

4 files changed

+8341
-2171
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ lint_python: venv ## Check Python code style compliance
4242
@which flake8 > /dev/null || pip install flake8 || pip3 install flake8
4343
@flake8 . --show-source --statistics \
4444
--select=E9,E2,E3,E5,F63,F7,F82,F4,F841,W291,W292 \
45-
--per-file-ignores sdk/python/tests/compiler/testdata/*:F841,F821 \
45+
--per-file-ignores ./*:F841,F821 \
4646
--exclude .git,__pycache__,docs/source/conf.py,old,build,dist,venv \
4747
--max-line-length=140
4848
@echo "$@: OK"
49+
50+
.PHONY: lint_javascript
51+
lint_javascript: ## Check Javascript code style compliance
52+
@cd dashboard/origin-mlx && npm run lint -- --fix
53+
@echo "$@: OK"

dashboard/origin-mlx/.eslintrc.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
env:
2+
browser: true
3+
es2021: true
4+
extends:
5+
- plugin:react/recommended
6+
- plugin:react/jsx-runtime
7+
- airbnb
8+
- airbnb-typescript
9+
parser: '@typescript-eslint/parser'
10+
parserOptions:
11+
project: './tsconfig.json'
12+
ecmaFeatures:
13+
jsx: true
14+
ecmaVersion: latest
15+
sourceType: module
16+
plugins:
17+
- react
18+
- '@typescript-eslint'
19+
rules:
20+
#===
21+
# Disabled, based on docs
22+
# https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
23+
react/jsx-uses-react: 'off'
24+
react/react-in-jsx-scope: 'off'
25+
#===
26+
# Allow only char '_' for unused-variable convention
27+
no-unused-vars: 'off'
28+
'@typescript-eslint/no-unused-vars':
29+
- warn
30+
- argsIgnorePattern: '^_'
31+
varsIgnorePattern: '^_'
32+
caughtErrorsIgnorePattern: '^_'
33+
#===

0 commit comments

Comments
 (0)