From bd32dad1c5308b737b654c49340786506421d665 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 10 Jul 2023 22:01:53 +0200 Subject: [PATCH] chore: run prettier and eslint separately --- .eslintrc.cjs | 34 +++++----------------------------- .woodpecker/checks.yaml | 6 ++++++ .woodpecker/release.yaml | 1 + package.json | 12 +++++++----- pnpm-lock.yaml | 31 ------------------------------- system.json | 20 ++++---------------- 6 files changed, 23 insertions(+), 81 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 020ad601..92fcb685 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,36 +4,12 @@ module.exports = { parser: "@typescript-eslint/parser", - - parserOptions: { - ecmaVersion: 2020, - sourceType: "module", - }, - - env: { - browser: true, - }, - - extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"], - + parserOptions: { ecmaVersion: 2020, sourceType: "module" }, + env: { browser: true }, + extends: ["plugin:@typescript-eslint/recommended", "prettier"], plugins: ["@typescript-eslint"], - - rules: { - // Specify any specific ESLint rules. - }, - overrides: [ - { - files: ["./*.cjs", "./*.js"], - rules: { - "@typescript-eslint/no-var-requires": "off", - }, - }, - { - files: ["./spec/**/*"], - env: { - browser: false, - }, - }, + { files: ["./*.cjs"], rules: { "@typescript-eslint/no-var-requires": "off" } }, + { files: ["./spec/**/*"], env: { browser: false } }, ], }; diff --git a/.woodpecker/checks.yaml b/.woodpecker/checks.yaml index 823900f0..a46f3116 100644 --- a/.woodpecker/checks.yaml +++ b/.woodpecker/checks.yaml @@ -29,6 +29,12 @@ steps: commands: - <<: *enable_pnpm - pnpm lint + formatcheck: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm format:check typecheck: group: check image: *node_image diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index 1581e71f..598014d6 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -34,6 +34,7 @@ steps: - git config user.name woodpecker[bot] - git config user.email woodpecker[bot]@${CI_SYSTEM_HOST} - pnpm bump-version --release=${RELEASE_TYPE} + - pnpm exec prettier package.json system.json - export RELEASE_VERSION=$(jq -r '.version' < package.json) - git --no-pager diff - git add package.json system.json diff --git a/package.json b/package.json index 8504e592..a45c4ed8 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,12 @@ "clean": "run-p clean:files clean:link", "clean:files": "rimraf dist", "clean:link": "node ./tools/link-package.js --clean", - "lint": "eslint --ext .ts,.js,.cjs,.mjs .", - "lint:fix": "eslint --ext .ts,.js,.cjs,.mjs --fix .", - "format": "prettier --write \"./**/*.(ts|js|cjs|mjs|json|scss|yml)\"", + "lint": "pnpm eslint", + "lint:fix": "pnpm eslint --fix", + "eslint": "eslint --ext .ts,.js,.cjs,.mjs .", + "format": "pnpm prettier --write", + "format:check": "pnpm prettier --check", + "prettier": "prettier \"./**/*.(ts|js|cjs|mjs|json|scss|yml)\"", "test": "run-p test:vitest test:typecheck", "test:vitest": "vitest run", "test:typecheck": "tsc --noEmit --project spec/tsconfig.json", @@ -77,7 +80,6 @@ "conventional-changelog-conventionalcommits": "6.1.0", "eslint": "8.44.0", "eslint-config-prettier": "8.8.0", - "eslint-plugin-prettier": "4.2.1", "fs-extra": "11.1.1", "handlebars": "4.7.7", "npm-run-all": "4.1.5", @@ -93,5 +95,5 @@ "vitest": "0.33.0", "yargs": "17.7.2" }, - "packageManager": "pnpm@8.6.6" + "packageManager": "pnpm@8.6.7" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec1d4087..b10f6f7d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,9 +50,6 @@ devDependencies: eslint-config-prettier: specifier: 8.8.0 version: 8.8.0(eslint@8.44.0) - eslint-plugin-prettier: - specifier: 4.2.1 - version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.44.0)(prettier@2.8.8) fs-extra: specifier: 11.1.1 version: 11.1.1 @@ -2068,23 +2065,6 @@ packages: eslint: 8.44.0 dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.44.0)(prettier@2.8.8): - resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} - engines: {node: '>=12.0.0'} - peerDependencies: - eslint: '>=7.28.0' - eslint-config-prettier: '*' - prettier: '>=2.0.0' - peerDependenciesMeta: - eslint-config-prettier: - optional: true - dependencies: - eslint: 8.44.0 - eslint-config-prettier: 8.8.0(eslint@8.44.0) - prettier: 2.8.8 - prettier-linter-helpers: 1.0.0 - dev: true - /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -2224,10 +2204,6 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-diff@1.2.0: - resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} - dev: true - /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -3945,13 +3921,6 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-linter-helpers@1.0.0: - resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} - engines: {node: '>=6.0.0'} - dependencies: - fast-diff: 1.2.0 - dev: true - /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} diff --git a/system.json b/system.json index 7d61aa09..3fa7b978 100644 --- a/system.json +++ b/system.json @@ -36,28 +36,16 @@ "version": "1.20.0-0", "flags": { "hotReload": { - "extensions": [ - "css", - "hbs", - "json" - ], - "paths": [ - "templates", - "css", - "lang" - ] + "extensions": ["css", "hbs", "json"], + "paths": ["templates", "css", "lang"] } }, "compatibility": { "minimum": "11.305", "verified": "11" }, - "esmodules": [ - "ds4.js" - ], - "styles": [ - "css/ds4.css" - ], + "esmodules": ["ds4.js"], + "styles": ["css/ds4.css"], "languages": [ { "lang": "en", -- 2.45.2