-
Notifications
You must be signed in to change notification settings - Fork 38
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
Internal: Add prettier and simplify eslint config #530
Changes from 6 commits
bbabec7
788b133
e0d0d91
3d22c95
5cd1c4f
5c686a0
7f3f987
175bc17
acec43f
5d7e6c4
e8d8479
c9747fe
5cc54dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,34 @@ | ||
{ | ||
"root": true, | ||
"extends": ["standard"], | ||
"rules": { | ||
"indent": ["error", 4] | ||
} | ||
} | ||
"root": true, | ||
"extends": ["standard", "plugin:prettier/recommended"], | ||
"plugins": ["prettier"], | ||
"rules": { | ||
"indent": ["error", 4], | ||
"prettier/prettier": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/frontend/**/*.js"], | ||
"env": { | ||
"browser": true, | ||
"es2020": true | ||
} | ||
}, | ||
{ | ||
"files": ["src/backend/**/*.js"], | ||
"env": { | ||
"node": true, | ||
"es2020": true | ||
} | ||
}, | ||
{ | ||
"files": ["tests/**/*.js"], | ||
"env": { | ||
"es2020": true, | ||
"node": true, | ||
"jest": true, | ||
"jasmine": true | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# See https://prettier.io/docs/en/options. most are set to default | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Config for prettier - per comment: most are set to default. We can change this to JSON TOML or plain js if anyone has an aversion to yaml |
||
trailingComma: "es5" | ||
tabWidth: 4 | ||
semi: false | ||
singleQuote: true | ||
bracketSpacing: true | ||
bracketSameLine: false | ||
arrowParens: always | ||
htmlWhitespaceSensitivity: strict | ||
singleAttributePerLine: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,11 @@ | |
"css-loader": "^6.8.1", | ||
"dart-sass": "^1.25.0", | ||
"eslint": "^8.54.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add prettier, the plugin to socket it in, and the config that prevents conflicts with eslint. Essentially we keep eslint as a way to find and prevent bugs, while prettier is soley focused on code styling per: |
||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-n": "^16.3.1", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"grunt": "1.6.1", | ||
"grunt-concurrent": "3.0.0", | ||
|
@@ -51,6 +53,7 @@ | |
"load-grunt-tasks": "5.1.0", | ||
"nock": "^13.3.8", | ||
"octokit": "^3.1.2", | ||
"prettier": "3.1.1", | ||
"style-loader": "^3.3.3", | ||
"supertest": "^6.3.3", | ||
"typescript": "^5.3.2", | ||
beckpaul marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add prettier as a plugin for eslint - it gets run now when
yarn lint
is ran and--fix
will also fix prettier issuesNot sure why there were 4 different
.eslintrc
files in different places but i've removed them and compressed the rules into one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the same with .gitignore, there are multiple ways to configure things, globally or per directory.
i think we can work with overrides for now