diff --git a/.github/workflows/js-css.yml b/.github/workflows/js-css.yml index 932cb90d..c2f7e71f 100644 --- a/.github/workflows/js-css.yml +++ b/.github/workflows/js-css.yml @@ -1,19 +1,14 @@ -name: JS and CSS Linting -on: [push, pull_request] +name: pre-commit + +on: + pull_request: + push: + branches: [main] + jobs: - linting: - name: JS and CSS Linting + pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Linters - run: | - npm install eslint@8.10.0 - npm install eslint-config-airbnb-base@15.0.0 - npm install eslint-plugin-import@2.25.4 - npm install stylelint@14.8.3 - npm install stylelint-config-standard@25.0.0 - - name: Run ESLint - run: npx eslint . - - name: Run Stylelint - run: npx stylelint "**/*.css" + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 394e20d8..25f68fb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: ruff # Javascript - repo: https://github.com/pre-commit/mirrors-eslint - rev: "v8.24.0" + rev: "v8.51.0" hooks: - id: eslint - additional_dependencies: ['eslint@8.24.0', 'eslint-plugin-import@2.26.0', 'eslint-config-airbnb-base@15.0.0'] + additional_dependencies: ['eslint@8.51.0', 'eslint-plugin-import@2.28.1', 'eslint-config-airbnb-base@15.0.0'] diff --git a/package.json b/package.json index 2014def9..a1cbe08c 100644 --- a/package.json +++ b/package.json @@ -1,53 +1,53 @@ { - "name": "sketch-map-tool", - "version": "1.0.0", - "description": "", - "nodemonConfig": { - "watch": [ - "client-src", - "sketch_map_tool/templates", - "esbuild.js" - ], - "ext": "js,css,html", - "exec": "npm run build" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "lint-css": "stylelint '**/*.css'", - "lint-js": "eslint .", - "lint": "npm run lint-css && npm run lint-js", - "lint-css:fix": "npm run lint-css -- --fix", - "lint-js:fix": "npm run lint-js -- --fix", - "lint:fix": "npm run lint-css:fix && npm run lint-js:fix", - "clean": "rimraf ./sketch_map_tool/static/bundles", - "build": "npm run clean && node esbuild.js", - "watch": "nodemon" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/GIScience/sketch-map-tool.git" - }, - "author": "HeiGIT ", - "license": "AGPL-3.0", - "bugs": { - "url": "https://github.com/GIScience/sketch-map-tool/issues" - }, - "homepage": "https://github.com/GIScience/sketch-map-tool#readme", - "devDependencies": { - "esbuild": "^0.19.4", - "eslint": "8.10.0", - "eslint-config-airbnb-base": "15.0.0", - "eslint-plugin-import": "2.25.4", - "nodemon": "^3.0.1", - "rimraf": "^5.0.5", - "stylelint": "14.8.3", - "stylelint-config-standard": "25.0.0" - }, - "dependencies": { - "@giscience/ol-print-layout-control": "^1.0.2", - "@picocss/pico": "^1.5.10", - "filebokz": "^0.1.3", - "ol": "^8.1.0", - "ol-geocoder": "^4.3.1" - } + "name": "sketch-map-tool", + "version": "1.0.0", + "description": "", + "nodemonConfig": { + "watch": [ + "client-src", + "sketch_map_tool/templates", + "esbuild.js" + ], + "ext": "js,css,html", + "exec": "npm run build" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "lint-css": "stylelint '**/*.css'", + "lint-js": "eslint .", + "lint": "npm run lint-css && npm run lint-js", + "lint-css:fix": "npm run lint-css -- --fix", + "lint-js:fix": "npm run lint-js -- --fix", + "lint:fix": "npm run lint-css:fix && npm run lint-js:fix", + "clean": "rimraf ./sketch_map_tool/static/bundles", + "build": "npm run clean && node esbuild.js", + "watch": "nodemon" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GIScience/sketch-map-tool.git" + }, + "author": "HeiGIT ", + "license": "AGPL-3.0", + "bugs": { + "url": "https://github.com/GIScience/sketch-map-tool/issues" + }, + "homepage": "https://github.com/GIScience/sketch-map-tool#readme", + "devDependencies": { + "esbuild": "^0.19.4", + "eslint": "8.51.0", + "eslint-config-airbnb-base": "15.0.0", + "eslint-plugin-import": "2.28.1", + "nodemon": "^3.0.1", + "rimraf": "^5.0.5", + "stylelint": "15.10.3", + "stylelint-config-standard": "34.0.0" + }, + "dependencies": { + "@giscience/ol-print-layout-control": "^1.0.2", + "@picocss/pico": "^1.5.10", + "filebokz": "^0.1.3", + "ol": "^8.1.0", + "ol-geocoder": "^4.3.1" + } }