Skip to content

Commit

Permalink
Add configs for prettier, adjust eslint rules
Browse files Browse the repository at this point in the history
For prettier, there are some config changes between v2 and v3.  The
new default for tailing commas changed causing a lot of breaks.  Use
the v2 default of "es5" for now.

A few eslint rules changed to warnings since there are a lot of them
and we don't want to fix those now.

Signed-off-by: Scott J Dickerson <[email protected]>
  • Loading branch information
sjd78 committed Aug 21, 2023
1 parent 794ac0b commit e791084
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root=true

[*]
# standard prettier behaviors
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

# Configurable prettier behaviors
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Library, IDE and build locations
**/node_modules/
**/coverage/
**/dist/
.vscode/
.idea/
.eslintcache/

#
# NOTE: Could ignore anything that eslint will look at since eslint also applies
# prettier.
#
14 changes: 14 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import("prettier").Config} */
const config = {
trailingComma: "es5", // es5 was the default in prettier v2
semi: true,
singleQuote: false,

// Values used from .editorconfig:
// - printWidth == max_line_length
// - tabWidth == indent_size
// - useTabs == indent_style
// - endOfLine == end_of_line
};

export default config;
2 changes: 2 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module.exports = {
rules: {
"prettier/prettier": ["error"],
"unused-imports/no-unused-imports": ["warn"],
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"react-hooks/rules-of-hooks": "warn",
"react-hooks/exhaustive-deps": "warn",
},
Expand Down
3 changes: 0 additions & 3 deletions client/types/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// <reference types="react" />
/// <reference types="react-dom" />

declare module "*.avif" {
const src: string;
export default src;
Expand Down

0 comments on commit e791084

Please sign in to comment.