Skip to content

Commit

Permalink
Merge pull request #311 from uhh-lt/fix-prettier-config
Browse files Browse the repository at this point in the history
Configure prettier pre-commit hook to run on .json files
  • Loading branch information
bigabig authored Dec 18, 2023
2 parents 19939bb + 8317640 commit 12df3bf
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ repos:
rev: "v3.1.0"
hooks:
- id: prettier
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
files: \.([jt]sx?|json)$ # *.js, *.jsx, *.ts, *.tsx, *.json
args: [--print-width, "120"]
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"python.envFile": "${workspaceFolder}/backend/.env",
"python.analysis.extraPaths": ["./backend/src"],
"python.autoComplete.extraPaths": ["./backend/src"]
"python.envFile": "${workspaceFolder}/backend/.env",
"python.analysis.extraPaths": ["./backend/src"],
"python.autoComplete.extraPaths": ["./backend/src"]
}
2 changes: 1 addition & 1 deletion frontend/generateAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ console.log(openapiOutput.toString("utf-8"));

// 3. prettify file
console.log(`Prettify generated code at ${openapiFolderPath}`);
const prettierOutput = execSync(`prettier -w ${openapiFolderPath}`);
const prettierOutput = execSync(`npx prettier --write ${openapiFolderPath}`);
console.log(prettierOutput.toString("utf-8"));
10 changes: 2 additions & 8 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -20,7 +16,5 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
"include": ["src"]
}
2 changes: 1 addition & 1 deletion frontend/updateAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ http

// 5. prettify file
console.log("Prettify openapi.json");
exec(`prettier -w ${openapiFilePath}`, (err, stdout, stderr) => {
exec(`npx prettier --write ${openapiFilePath}`, (err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
console.error("An error occured when trying to run prettier :(");
Expand Down
24 changes: 12 additions & 12 deletions tools/readability/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"dependencies": {
"@mozilla/readability": "^0.4.2",
"express": "^4.18.2",
"jsdom": "^16.7.0",
"minimist": "^1.2.7"
"dependencies": {
"@mozilla/readability": "^0.4.2",
"express": "^4.18.2",
"jsdom": "^16.7.0",
"minimist": "^1.2.7"
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": "latest"
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"es6": true
}
"env": {
"es6": true
}
}
}

0 comments on commit 12df3bf

Please sign in to comment.