Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
adenflorian committed Oct 7, 2020
1 parent aef756d commit 00bd5b2
Show file tree
Hide file tree
Showing 12 changed files with 2,861 additions and 2,835 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ indent_size = 4
indent_style = space
insert_final_newline = false
tab_width = 4

# YAML is usually 2 spaces
# Asobo indents json and css with 2 spaces
[*.{yml,json,css}]
indent_size = 2
tab_width = 2
138 changes: 63 additions & 75 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,64 @@
{
"env": {
"browser": true,
"es2021": true
},
// DO NOT CHANGE THIS FILE (unless you are an admin) (if admin, make sure you change the same file in the latest asobo branch as well)
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
// "linebreak-style": [
// "error",
// "unix"
// ],
"linebreak-style": "off",
// No quotes option is really fully consistent, so probably best to jsut not enforce either type
"quotes": "off",
"semi": [
"error",
"always"
],
"curly": [
"error",
"all"
],
"brace-style": [
"error",
"1tbs"
],
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"keyword-spacing": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
"semi-spacing": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
// There are too many vars that cant be autofixed
"no-var": "off",
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
// The vanilla code already has over 100 console.logs, but maybe we can enable this in master and delete them there
"no-console": "off",
"no-debugger": "error",
"eol-last": [
"error",
"never"
],
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxBOF": 0,
"maxEOF": 0
}
]
}
}
"env": {
"browser": true,
"es2021": true
},
// DO NOT CHANGE THIS FILE (unless you are an admin) (if admin, make sure you change the same file in the latest asobo branch as well)
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
// "linebreak-style": [
// "error",
// "unix"
// ],
"linebreak-style": "off",
// No quotes option is really fully consistent, so probably best to jsut not enforce either type
"quotes": "off",
"semi": ["error", "always"],
"curly": ["error", "all"],
"brace-style": ["error", "1tbs"],
"space-before-blocks": "error",
"space-before-function-paren": [
"error",
{
"anonymous": "always",
"named": "never",
"asyncArrow": "always"
}
],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"keyword-spacing": "error",
"no-irregular-whitespace": "error",
"no-trailing-spaces": "error",
"semi-spacing": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
// There are too many vars that cant be autofixed
"no-var": "off",
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
// The vanilla code already has over 100 console.logs, but maybe we can enable this in master and delete them there
"no-console": "off",
"no-debugger": "error",
"eol-last": ["error", "never"],
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxBOF": 0,
"maxEOF": 0
}
]
}
}
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ jobs:
with:
name: A32NX
path: ./A32NX/

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
!package-lock.json
!.editorconfig
!.eslintrc.json
!.prettierrc.json
!.prettierignore
.DS_Store
node_modules
/src/sound/.cache
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.DDS.json
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
41 changes: 32 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
{
"eslint.lintTask.enable": true,
"eslint.format.enable": true,
"eslint.quiet": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
"eslint.lintTask.enable": true,
"eslint.format.enable": true,
"eslint.quiet": true,
"editor.formatOnSave": false,
"editor.defaultFormatter": null,
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
4 changes: 2 additions & 2 deletions A32NX/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

if content_entries:
with open("layout.json", "w") as layout_file:
json.dump(layout_entries, layout_file, indent=4)
json.dump(layout_entries, layout_file, indent=2)
else:
print("Error: layout.json not updated", file=sys.stderr)

Expand All @@ -49,6 +49,6 @@

if manifest_entries:
with open("manifest.json", "w") as manifest_file:
json.dump(manifest_entries, manifest_file, indent=4)
json.dump(manifest_entries, manifest_file, indent=2)
else:
print("Error: manifest.json not updated", file=sys.stderr)
Loading

0 comments on commit 00bd5b2

Please sign in to comment.