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

Add prettier formatter #1736

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
  •  
  •  
  •  
109 changes: 69 additions & 40 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@
"radix": "warn",

// modify rules from base configurations
"no-unused-vars": ["error", {
"args": "none",
"vars": "all"
}],
"no-empty": ["error", {
"allowEmptyCatch": true
}],
"no-unused-vars": [
"error",
{
"args": "none",
"vars": "all"
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],

// disable rules from base configurations
"no-control-regex": "off",
Expand All @@ -47,49 +53,72 @@
"block-spacing": "error",
"array-bracket-spacing": "error",
"comma-spacing": "error",
"spaced-comment": ["error", "always", { "exceptions": ["/"] } ],
"spaced-comment": ["error", "always", { "exceptions": ["/"] }],
"comma-style": "error",
"computed-property-spacing": "error",
"no-trailing-spaces": "warn",
"eol-last": "error",
"func-call-spacing": "error",
"key-spacing": ["warn", {
"mode": "minimum"
}],
"indent": ["error", 4, {
"ignoreComments": true,
"ArrayExpression": "first",
"SwitchCase": 1
}],
"key-spacing": [
"warn",
{
"mode": "minimum"
}
],
"indent": [
"error",
4,
{
"ignoreComments": true,
"ArrayExpression": "first",
"SwitchCase": 1
}
],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double", {
"avoidEscape": true,
"allowTemplateLiterals": true
}],
"camelcase": ["error", {
"properties": "always"
}],
"quotes": [
"error",
"double",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"camelcase": [
"error",
{
"properties": "always"
}
],
"semi": ["error", "always"],
"unicode-bom": "error",
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true
"require-jsdoc": [
"error",
{
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": true,
"ArrowFunctionExpression": true
}
}
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
"no-multiple-empty-lines": [
"warn",
{
"max": 2,
"maxEOF": 1,
"maxBOF": 0
}
}],
"keyword-spacing": ["error", {
"before": true,
"after": true
}],
"no-multiple-empty-lines": ["warn", {
"max": 2,
"maxEOF": 1,
"maxBOF": 0
}],
],
"no-whitespace-before-property": "error",
"operator-linebreak": ["error", "after"],
"operator-linebreak": ["error", "before"],
Copy link
Author

Choose a reason for hiding this comment

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

Changed operator-linebreak to before to go along with prettier formatting

"space-in-parens": "error",
"no-var": "error",
"prefer-const": "error"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
npm run setheapsize

- name: Lint
run: npx grunt lint
run: npm run style && npx grunt lint && git diff --exit-code

- name: Unit Tests
run: |
Expand Down
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.github
.devcontainer
node_modules
**/*.md
.dockerignore
.gitignore
.editorconfig
.gitattributes
.npmignore
package-lock.json
package.json
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 4,
"useTabs": false,
"printWidth": 120,
"proseWrap": "always",
"semi": true,
"singleQuote": false,
"bracketSpacing": true,
"trailingComma": "none",
"quoteProps": "preserve"
}
Loading
Loading