Merge pull request #1568 from umap-project/eslint
lint: use eslint with a browserslist configuration
This commit is contained in:
commit
c3a849258d
7 changed files with 1759 additions and 68 deletions
11
.eslintrc.json
Normal file
11
.eslintrc.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"plugins": ["compat"],
|
||||||
|
"extends": ["plugin:compat/recommended"],
|
||||||
|
"env": {
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2020,
|
||||||
|
"sourceType": "module"
|
||||||
|
}
|
||||||
|
}
|
11
.github/workflows/test-docs.yml
vendored
11
.github/workflows/test-docs.yml
vendored
|
@ -2,9 +2,9 @@ name: Test & Docs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
|
@ -24,7 +24,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.8", "3.12"]
|
python-version: ['3.8', '3.12']
|
||||||
database: [postgresql]
|
database: [postgresql]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -53,10 +53,11 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: '3.11'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -e .[test,dev]
|
python3 -m pip install -e .[test,dev]
|
||||||
|
make installjs
|
||||||
|
|
||||||
- name: Run Lint
|
- name: Run Lint
|
||||||
run: make lint
|
run: make lint
|
||||||
|
@ -71,7 +72,7 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: '3.11'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -r docs/requirements.txt
|
python3 -m pip install -r docs/requirements.txt
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -20,6 +20,7 @@ format: ## Format the code and templates files
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: ## Lint the code and template files
|
lint: ## Lint the code and template files
|
||||||
|
npx eslint umap/static/umap/ &&\
|
||||||
djlint umap/templates --lint &&\
|
djlint umap/templates --lint &&\
|
||||||
isort --check --profile black umap/ &&\
|
isort --check --profile black umap/ &&\
|
||||||
ruff format --check --target-version=py38 umap/ &&\
|
ruff format --check --target-version=py38 umap/ &&\
|
||||||
|
|
1715
package-lock.json
generated
1715
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -7,6 +7,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^3.3.0",
|
"chai": "^3.3.0",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
|
"eslint-plugin-compat": "^4.2.0",
|
||||||
"happen": "~0.1.3",
|
"happen": "~0.1.3",
|
||||||
"lebab": "^3.2.1",
|
"lebab": "^3.2.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
|
@ -60,5 +62,8 @@
|
||||||
"simple-statistics": "^7.8.3",
|
"simple-statistics": "^7.8.3",
|
||||||
"togpx": "^0.5.4",
|
"togpx": "^0.5.4",
|
||||||
"tokml": "0.4.0"
|
"tokml": "0.4.0"
|
||||||
}
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 0.5%, last 2 versions, Firefox ESR, not dead, not op_mini all"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,6 +548,7 @@ L.U.Help = L.Class.extend({
|
||||||
label.title = label.textContent = L._('Close')
|
label.title = label.textContent = L._('Close')
|
||||||
this.content = L.DomUtil.create('div', 'umap-help-content', this.box)
|
this.content = L.DomUtil.create('div', 'umap-help-content', this.box)
|
||||||
this.isMacOS = /mac/i.test(
|
this.isMacOS = /mac/i.test(
|
||||||
|
// eslint-disable-next-line compat/compat -- Fallback available.
|
||||||
navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform
|
navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
"after": true,
|
"after": true,
|
||||||
"it": true,
|
"it": true,
|
||||||
"sinon": true,
|
"sinon": true,
|
||||||
"qs": true,
|
|
||||||
"enableEdit": true,
|
"enableEdit": true,
|
||||||
"disableEdit": true,
|
"disableEdit": true,
|
||||||
"changeInputValue": true,
|
"changeInputValue": true,
|
||||||
|
|
Loading…
Reference in a new issue