Skip to content

Commit

Permalink
feat(sage-monorepo): update the HTML formatter and linter (ARCH-290) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter authored Sep 25, 2024
1 parent 9e0228c commit 9779db6
Show file tree
Hide file tree
Showing 22 changed files with 106 additions and 2,413 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
"stkb.rewrap",
"vmware.vscode-boot-dev-pack",
"vscjava.vscode-gradle",
"vscjava.vscode-java-pack",
"webhint.vscode-webhint"
"vscjava.vscode-java-pack"
],
"settings": {
"workbench.startupEditor": "readme"
Expand Down
4 changes: 0 additions & 4 deletions .hintrc

This file was deleted.

5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
},
"editor.rulers": [100],
"editor.inlayHints.enabled": "off",
"eslint.enable": true,
"eslint.workingDirectories": ["."],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "html"],
// We need to explicitly set Prettier as the format for JSON formats, otherwise the formatter
// provided with VS Code will set itself as the default one, despite us specifying that Prettier
// is the default formatter (editor.defaultFormatter).
Expand All @@ -29,6 +31,9 @@
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.tsdk": "node_modules/typescript/lib",
// Python settings
"python.analysis.autoImportCompletions": true,
Expand Down
2 changes: 1 addition & 1 deletion apps/sandbox/angular-app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<app-nx-welcome></app-nx-welcome>
<sandbox-angular-lib></sandbox-angular-lib>
<router-outlet></router-outlet>
<router-outlet></router-outlet>
4 changes: 0 additions & 4 deletions dev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ function workspace-lint {
nx run-many --target=lint
}

function workspace-lint-html {
nx run-many --target=lint-html
}

function workspace-build {
nx run-many --target=build
}
Expand Down
13 changes: 1 addition & 12 deletions docs/_archive/linters-and-formatters.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,12 @@
| File type | File extension | Linter |
| ---------- | -------------- | ---------------- |
| Dockerfile | `Dockerfile` | [hadolint] |
| HTML | `*.html` | [Webhint] |
| HTML | `*.html` | ESLint |
| Java | `*.java` | [Checkstyle] |
| SCSS | `*.scss` | [VS Code (SCSS)] |
| TypeScript | `*.ts` | [ESLint] |
| XML | `*.xml` | - |

### Webhint

Linter:

- Webhint - VS Code extension

Linter configuration:

- `.hintrc`

## Formatters

| File type | File extension | Formatter | Package type |
Expand Down Expand Up @@ -84,7 +74,6 @@ Notes:

<!-- Links -->

[webhint]: https://marketplace.visualstudio.com/items?itemName=webhint.vscode-webhint
[prettier]: https://prettier.io
[eslint]: https://eslint.org
[checkstyle]: https://checkstyle.sourceforge.io/
Expand Down
3 changes: 0 additions & 3 deletions libs/agora/about/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/about/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"options": {
"fix": true
}
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/agora/about",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:agora", "language:typescript"],
Expand Down
3 changes: 0 additions & 3 deletions libs/agora/news/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/news/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"options": {
"fix": true
}
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/agora/news",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:agora", "language:typescript"],
Expand Down
14 changes: 8 additions & 6 deletions libs/agora/not-found/src/lib/not-found.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<div class="err-message">
<em class="err-code">404b</em>
<h1>Page Not Found</h1>
<p>Oops! The page you are looking for does not exist. It might have been
moved or deleted.</p>
<p>Oops! The page you are looking for does not exist. It might have been moved or deleted.</p>
</div>
<div *ngIf="dataversion$ | async as dataVersion">
<h3>Data Release Info</h3>
Expand All @@ -23,10 +22,13 @@ <h4>Wiki page fetched with Synapse API Client for Angular</h4>
</div>
<div class="btn-group">
<a mat-raised-button class="home-btn" href="/home">Home</a>
<a mat-raised-button color="basic"
href="https://github.com/Sage-Bionetworks/sage-monorepo/issues/new/choose">Contact
Us</a>
<a
mat-raised-button
color="basic"
href="https://github.com/Sage-Bionetworks/sage-monorepo/issues/new/choose"
>Contact Us</a
>
</div>
</main>

<agora-footer [appVersion]="appVersion" [apiDocsUrl]="apiDocsUrl" />
<agora-footer [appVersion]="appVersion" [apiDocsUrl]="apiDocsUrl" />
3 changes: 0 additions & 3 deletions libs/agora/teams/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/teams/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
},
"lint": {
"executor": "@nx/eslint:lint"
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/agora/teams",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:agora", "language:typescript"],
Expand Down
3 changes: 0 additions & 3 deletions libs/agora/testing/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/testing/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"options": {
"fix": true
}
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/agora/testing",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:agora", "language:typescript"],
Expand Down
3 changes: 0 additions & 3 deletions libs/agora/wiki/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/agora/wiki/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
},
"lint": {
"executor": "@nx/eslint:lint"
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/agora/wiki",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:agora", "language:typescript"],
Expand Down
3 changes: 0 additions & 3 deletions libs/openchallenges/about/.hintrc

This file was deleted.

8 changes: 0 additions & 8 deletions libs/openchallenges/about/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"options": {
"fix": true
}
},
"lint-html": {
"executor": "nx:run-commands",
"options": {
"commands": ["hint src/**/*.html"],
"cwd": "libs/openchallenges/about",
"parallel": false
}
}
},
"tags": ["type:feature", "scope:openchallenges", "language:typescript"],
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
`nx affected --target=lint --files=${filenames.join(',')}`,
],

'**/*.{json,md,yaml,yml}': (filenames) => [
'**/*.{json,md,yaml,yml,html}': (filenames) => [
// Format files with Prettier
`prettier --write ${filenames.join(' ')}`,
],
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
"@angular/compiler-cli": "18.2.5",
"@angular/language-service": "18.2.5",
"@chromatic-com/storybook": "2.0.2",
"@hint/configuration-web-recommended": "8.2.16",
"@hint/formatter-codeframe": "3.1.33",
"@nrwl/js": "19.8.0",
"@nx-tools/container-metadata": "5.0.3",
"@nx-tools/nx-container": "5.0.3",
Expand Down Expand Up @@ -146,7 +144,6 @@
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"hint": "7.1.3",
"husky": "9.1.5",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
Expand Down
Loading

0 comments on commit 9779db6

Please sign in to comment.