Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional typechecking with prettier update #3774

Merged
merged 15 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
web-admin/build
web-local/build
web-local/build
**/svelte.config.js

# ignored vendored files from shoelace in web-common/src/components/modal
bcolloran marked this conversation as resolved.
Show resolved Hide resolved
web-common/src/components/modal/*.js
29 changes: 27 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
'plugin:svelte/recommended',
"plugin:@typescript-eslint/recommended-type-checked",
Copy link
Contributor Author

@bcolloran bcolloran Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added current recommended eslint typechecking rules, and then disabled failing rules below so that we can clean them up incrementally

"plugin:svelte/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
Expand All @@ -12,6 +13,8 @@ module.exports = {
sourceType: "module",
ecmaVersion: 2019,
extraFileExtensions: [".svelte"],
project: true,
tsconfigRootDir: __dirname,
},
env: {
browser: true,
Expand All @@ -23,7 +26,7 @@ module.exports = {
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
parser: '@typescript-eslint/parser',
}
}
],
Expand All @@ -32,6 +35,28 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-duplicate-enum-values": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/no-implied-eval": "warn",
"@typescript-eslint/no-base-to-string": "warn",
"svelte/no-at-html-tags": "warn",
},
};
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ proto/

.env
*.sql
*.bin
*.csv
*.csv.gz
*.tsv
Expand Down
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{ "files": "*.ts", "options": { "parser": "typescript" } },
{ "files": "*.svelte", "options": { "parser": "svelte" } }
]
}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"clsx": "^1.1.1",
"docusaurus-gtm-plugin": "^0.0.2",
"prism-react-renderer": "^1.3.3",
"react-dom": "^17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Copy link
Contributor Author

@bcolloran bcolloran Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automatic re-sorting of deps, no actual change in /docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to replicate this re-sorting behavior, but I see *.json is included in the .prettierignore file. How did these re-sort automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they actually re-sorted when I was npm installing stuff, not from prettier.

"redocusaurus": "^1.1.2",
"tailwindcss": "^3.0.23",
"typescript": "^4.6.4"
Expand Down
Loading
Loading