diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index ef5f87a..4419cdd 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -7,7 +7,7 @@ on: branches: [main] jobs: - run-eslint: + format: name: Format runs-on: ubuntu-latest @@ -25,4 +25,4 @@ jobs: run: npm ci - name: Code Format Check - run: npm run format:check \ No newline at end of file + run: npm run format:check:all \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b25583e..141c4d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ on: branches: [main] jobs: - run-eslint: + lint: name: Lint runs-on: ubuntu-latest @@ -25,4 +25,4 @@ jobs: run: npm ci - name: Code Linting Check - run: npm run lint:check \ No newline at end of file + run: npm run lint:check:all \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index e375fe8..5e089b8 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,5 +2,5 @@ . "$(dirname -- "$0")/_/husky.sh" echo 'Pre-commit checks' -npm run format:check -npm run lint:check +npm run format:check:all +npm run lint:check:all diff --git a/README.md b/README.md index df5582d..bfcf0d6 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,13 @@ npm test {featurePath} {generatorPath} Two scripts are available to help you find linting errors: ``` -npm run eslint:check +npm run eslint:check:all ``` This runs eslint in check mode which will raise errors found but not try and fix them. This is also ran on a PR and a push to main. It will fail if any errors were found. ``` -npm run eslint:write +npm run eslint:write:all ``` This runs eslint in write mode which will raise errors found and try to fix them. diff --git a/package-lock.json b/package-lock.json index e017d16..49f8b78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "openapi-forge-typescript", "version": "0.1.0", "license": "MIT", + "dependencies": { + "prettier": "^2.7.1" + }, "devDependencies": { "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.1.0", @@ -7237,8 +7240,8 @@ }, "node_modules/prettier": { "version": "2.7.1", - "dev": true, - "license": "MIT", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "bin": { "prettier": "bin-prettier.js" }, @@ -13983,7 +13986,8 @@ }, "prettier": { "version": "2.7.1", - "dev": true + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" }, "process-nextick-args": { "version": "2.0.1", diff --git a/package.json b/package.json index ffc2d1b..f1f7d34 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,11 @@ "prepare": "husky install", "test": "\"./node_modules/.bin/cucumber-js\" -p default", "test:defaultPath": "\"./node_modules/.bin/cucumber-js\" -p default \"node_modules/openapi-forge/features/*.feature\" \"openapi-forge/src/generate\"", - "format:check": "prettier --check .", - "format:write": "prettier --write .", - "lint:check": "eslint .", - "lint:write": "eslint --fix ." + "format:check:all": "prettier --check .", + "format:write:all": "prettier --write .", + "format:write": "prettier --write", + "lint:check:all": "eslint .", + "lint:write:all": "eslint --fix ." }, "license": "MIT", "devDependencies": { @@ -29,11 +30,13 @@ "eslint": "^8.24.0", "husky": "^8.0.1", "openapi-forge": "github:ColinEberhardt/openapi-forge#1cd7b107fca832e286c40f9e8ec1e483e368b624", - "prettier": "^2.7.1", "semantic-release": "^19.0.5", "ts-node": "^8.0.3", "typescript": "^4.7.4" }, + "dependencies": { + "prettier": "^2.7.1" + }, "engines": { "node": ">=16.0.0" }